Sep-18-2022, 02:46 PM
(This post was last modified: Sep-18-2022, 03:14 PM by Yoriz.
Edit Reason: Added code tags, Formatting
)
I'm currently starting with Python, I use VsCode; Hadn't had any problems until yesterday.
Basically the problem is that I can execute individual lines of code (with "shift+Enter") and they work, but the moment I decide to execute all at once, I get an error
On the other hand, if I run all the code first, with the button that appears in the upper right corner of VsCode, the code runs fine; but if I try to execute individual lines of code (with "shift+Enter"), they work for me too, but when I re-execute all the code, I get the error
The sequence of how I do things goes like this:
Again, I insist that I would be infinitely grateful if you help me solve this problem that keeps my hands tied
Basically the problem is that I can execute individual lines of code (with "shift+Enter") and they work, but the moment I decide to execute all at once, I get an error
On the other hand, if I run all the code first, with the button that appears in the upper right corner of VsCode, the code runs fine; but if I try to execute individual lines of code (with "shift+Enter"), they work for me too, but when I re-execute all the code, I get the error
The sequence of how I do things goes like this:
- I open any file
- write something simple
sentence_1="three sad tigers swallowed wheat in a wheat field" print(sentence_1)
- I execute line by line with "Shift+Enter" and in the terminal it comes out as it should
"Shift+Enter" forsentence_1="three sad tigers swallowed wheat in a wheat field"
>>sentence_1="three sad tigers swallowed wheat in a wheat field"
"Shift+Enter" toprint(sentence_1)
>>three sad tigers swallowed wheat in a wheat field
- I try to Execute the complete code with the button that appears in the upper corner of VsCode, and in the terminal it appears
Error:& C:/Users/LEROLERO/AppData/Local/Programs/Python/Python310/python.exe c:/Users/LEROLERO/Desktop/Untitled-1.py File "", line 1 & C:/Users/LEROLERO/AppData /Local/Programs/Python/Python310/python.exe c:/Users/LEROLERO/Desktop/Untitled-1.py ^ SyntaxError: invalid syntax - In the problems tab Since I open the VsCode, I have this:
Output:Missing module docstring Module name "Untitled-1" doesn't conform to snake_case naming style Constant name "sentence_1" doesn't conform to UPPER_CASE naming style Final newline missing - The extensions I currently have installed are:
- Python
- Pylint
- Pylance
- Jupyter Keymap
- Jupyte
- Python
- my status bar, where it is evident that I use Python 3.10.6 of 64Bits
Again, I insist that I would be infinitely grateful if you help me solve this problem that keeps my hands tied