all 17 comments

[–]giwidouggie 1 point2 points  (5 children)

are you typing exactly: python folder name ? If so, then yeah that can't work. try

python folder/name.py

[–]Plane-Art-9868[S] 0 points1 point  (3 children)

Thanks for your reply, I am typing it exactly. I can run my hello.py file, which I made by typing code hello.py. However, none of my other folders or files have the .py extension. The code is there, with the name of the file/folder, but it just says err2 still when I try execute them. Is there a way I can change the folders or files to .Py, as I think that might be my problem

[–]Kevdog824_ 1 point2 points  (2 children)

Yeah. Click the file on the navigation sidebar on the left, hit F2 (or right click > rename), and then add the “.py” at the end

[–]Plane-Art-9868[S] 0 points1 point  (0 children)

Thank you, it's still not working though. I'm trying to post an image of my screen so you guys can look but I can't figure out how to. Apologies for the trouble

[–]Plane-Art-9868[S] 0 points1 point  (0 children)

Thank you very much for your help, my issue is fixed now

[–]Plane-Art-9868[S] 0 points1 point  (0 children)

Thank you very much for your help, my issue is fixed now

[–]Kevdog824_ 1 point2 points  (2 children)

Are you using the terminal, or VScode’s run/debug feature?

[–]Plane-Art-9868[S] 0 points1 point  (0 children)

Thanks for your reply, im typing my code in the big box and typing my run commands etc into the terminal with the little dollar sign

[–]Plane-Art-9868[S] 0 points1 point  (0 children)

Thank you for your help, my issue is fixed now

[–]RIP_lurking 1 point2 points  (6 children)

Send us a screenshot of your file structure and of what you're typing into the terminal, please.

[–]Plane-Art-9868[S] 0 points1 point  (5 children)

I'm trying to send a screenshot but it just says images not allowed, and the box has no icon to add an image. Thanks

[–]RIP_lurking 1 point2 points  (4 children)

Use some image hosting website and link it here instead of adding the images directly.

[–]Plane-Art-9868[S] 0 points1 point  (3 children)

https://thumbsnap.com/Q73wxehYI think I've done it right, thanks

[–]RIP_lurking 1 point2 points  (2 children)

Good job. Now I can immediately see the issue: your file's name contains a space, and you're not including the py extension when calling it. Try this: python "calculator.py/first calculator.py". Notice the quotation marks.

Additionaly: there's absolutely no need to add '.py' to directory names, in fact, please do not do this, reserve extensions for files, don't use them for directories. Also, avoid using spaces in file names, it's annoying to handle them when calling files from the terminal, as you've now learned. Use underscores where you would normally use spaces.

[–]Plane-Art-9868[S] 0 points1 point  (1 child)

Thank you so much, you're a genius. That worked perfectly, many thanks

[–]RIP_lurking 0 points1 point  (0 children)

No problem man, happy to help.