r/PythonLearning • u/CurveStrange3084 • Jun 08 '25
Why cant i execute my codes in vscode
Why wont it work i got the latest version of python 3.13.4 im new to using pc on coding because i use my phone and i dont know how this works helpðŸ˜
1
u/asdfghjkl_047264 Jun 08 '25
Can you post your entire code?
2
u/CurveStrange3084 Jun 08 '25
It was just
print ("test")
5
u/grozno Jun 08 '25
So obviously the next step is to take a screenshot of your entire screen, but in particular if there is a dot in the tab at the top where you have app.py open, then you haven't saved the file. Press ctrl S and try running it again.
6
1
u/AlexDPG Jun 08 '25
Are you sure the file’s in that folder? Can you show the file contents?
1
u/CurveStrange3084 Jun 08 '25
1
u/idillogia Jun 08 '25
6
1
u/Ste4mPunk3r Jun 08 '25
It was app.py already (based on the icon) just without showing extension by Windows.
OP - if you want to learn anything It related, having OS to show extension should be one of first steps during the preparation :D
1
u/Background_Cut_9223 Jun 08 '25
Just write python in terminal and then type print('test') and give me the screenshot
1
u/More_Yard1919 Jun 08 '25
did you save app.py...? hit control+s in with vs window. If the file is empty then the python interpreter will do nothing and exit.
1
u/FoolsSeldom Jun 08 '25
Is the file with the code save with the file name app.py?
Also, there's a play icon (a triangle) near the top right on the VS code that will run the current code.
1
1
u/Ste4mPunk3r Jun 08 '25
Do you have python extension installed in VSCode? If you do - just run code using run button in top right.
Also - have you saved the file before running it?Â
1
u/enginma Jun 08 '25
My windows install, I have to type py app.py.
My Linux command is`python3 app.py.
1
u/Specific-Opinion-605 Jun 08 '25
Well most of the times our file does not save automatically, so it might be the issue.
And if it is the issue try to turn on the auto save option. Saves me alot of time and unnecessary strugle.
1
-7
u/VoldgalfTheWizard Jun 08 '25
Maybe try just app.py sometimes it works for me when I execute the python files.
2
u/JaleyHoelOsment Jun 08 '25
lol that doesn’t work magically… you have to setup a shebang at the top of the file
1
u/agfitzp Jun 08 '25
On Windows?
1
u/JaleyHoelOsment Jun 08 '25
not sure about windows development! it’s probably slightly different for no reason though
3
u/agfitzp Jun 08 '25
I swear I don’t drink enough for Reddit comments.
1
u/JaleyHoelOsment Jun 08 '25
you could probably fire up a VM or some shit like that. i’ve seen Windows devs do all kinds of craziness to do the most basic dev work
1
u/agfitzp Jun 08 '25
The python windows installer sets up the registry entries so that the py extension is associated with the python exe, the same way it works with any other file type for the past 30 years.
But if you're not a windows user you would not know that.
How you can be operating any computer in this century and not know how windows file associations works is beyond my understanding. It's kind of like not knowing cell phones and satellites exist while owning a cellphone using GPS.
1
u/JaleyHoelOsment Jun 08 '25
for me windows computers are machines that play video games.
im sorry im not as cool as you though 😂
1
u/agfitzp Jun 08 '25
If knowing the basics of the most commonly used operating system on the planet is cool, which I doubt, I plead guilty.
-1
1
1
Jun 08 '25
[removed] — view removed comment
1
u/CurveStrange3084 Jun 08 '25
I got it tysm didn't realize it was that simple ðŸ˜
1
u/ZEUS_IS_THE_TRUE_GOD Jun 08 '25
You should enable auto saving in the settings, will save you lots of headaches lol
1


4
u/Adrewmc Jun 08 '25
Does app.py do anything?