About 322,000 results
Open links in new tab
  1. How can I do a line break (line continuation) in Python (split up a ...

    The Python interpreter will join consecutive lines if the last character of the line is a backslash. This is helpful in some cases, but should usually be avoided because of its fragility: a white space added to the end of the line, after the backslash, will break the …

  2. How to get to a new line in Python Shell? - Stack Overflow

    Jan 16, 2024 · I want to write the following two lines on the console: x = 3 print x**5 But when I type x = 3, I press enter, it then executes the assignment.

  3. How to move a line of text file one line up in Python?

    Oct 11, 2018 · Question: I was thinking of using regex functions to find the green but still i dont know how to put it one line up. One of your mistakes are .match(line[0]). You match against the first character in line. This is not what you want, change to .match(line) This results in the following Output: header:Object1 header:Green empty: header:Object2 {}

  4. How do I move a file in Python? - Stack Overflow

    Jan 13, 2012 · Although os.rename() and shutil.move() will both rename files, the command that is closest to the Unix mv command is shutil.move(). The difference is that os.rename() doesn't work if the source and destination are on different disks, while shutil.move() is files disk agnostic.

  5. python - Is there go up line character? (Opposite of \n ... - Stack ...

    Oct 11, 2021 · \033[A: Move cursor one line up. \r: Move the cursor to the beginning of the line. xxx: The string to be printed. {xxx} if it is a variable; If you have some extra characters from the previous line after your string, overwrite them with white space, depending on the length of the previous line. Below I added 10 white spaces. print(f'\033[A\rxxx ...

  6. Are there keyboard shortcuts for duplicate current line, move line …

    Sep 12, 2021 · In Sublime (Windows), we can use some shortcuts likes, Ctrl + Shift + D: Duplicate line Ctrl + Shift + UP: Move line Up Ctrl + Shift + Down: Move line Down I want to know in Python IDLE, are there ...

  7. How to move the cursor to a specific line in python

    Jan 13, 2022 · This way you can call readline() as many times as you want to move your cursor down, then return the next line. Also, I don't recommend using line != '<end>\n' unless you're absolutely sure that there will be a newline after <end>. Instead, do something like not '<end>' in …

  8. How do I make text go on to the next line (enter/return effect)?

    Sep 17, 2016 · How can I do a line break (line continuation) in Python (split up a long line of source code)? Hot Network Questions What is the purpose of the new Add URL function in Engagement Split based on Clicks?

  9. python - How to move line (not cell) up/down in jupyter notebook …

    Sep 14, 2020 · You can select the line with mouse in jupyter notebook. Drag it up or down before the line where you want to move it. Press > button on keyboard while your text is still selected. This will bring the cursor to end of selected line, but before the text of …

  10. python - Pycharm Enter Key is not working - Stack Overflow

    My enter key is not causing a line break in pycharm. When I press enter at the end of a line, the cursor jumps to the front of the next line, without causing a line break. This suddenly happened, I have no idea why. I checked my keymap and have reset it, with enter key mapping to enter but this problem still persists. Does anyone have any solution?