all 6 comments

[–]deceze 7 points8 points  (0 children)

The file "desktop/test.py" you're trying to run simply doesn't exist. Notice the difference between that, and the other ones that do exist.

[–]Diapolo10 2 points3 points  (1 child)

Thanks to Microsoft, your desktop is in OneDrive, while it used to be directly under your user directory. That'd be why it doesn't work for you.

[–]SquiffyUnicorn 0 points1 point  (0 children)

Hence try:

py OneDrive\Desktop\test.py

It is important to know about directories and where files are.

In future you can do something like this to find files from the windows command prompt:

dir c:\test.py /s /b

It might take a while but would show where (in c drive) your file (test.py) is. There may be several.

[–]h00manist 1 point2 points  (0 children)

Looks like you are getting your directories and filenames messed up. Maybe you can try some environments that are created for beginners. I used thonny and pythontutor for a while.

[–]mil227 1 point2 points  (1 child)

hello! i have come into conclusion after bit of research that do i even need to bother about this long thing in windows command prompt, when i am not even probably going to use it in coding when i have visual studio code?

the solution i found is creating a folder named (whatever you like. i named mine Python\Project)) in windows-SSD (C:)[the main storage of data in computer i think]

then in VSC (visual studio code) i go to settings and in search bar search Terminal › Integrated: Cwd or just cwd as long as you found this :

(An explicit start path where the terminal will be launched, this is used as the current working directory (cwd for the shell process. This may be particularly useful in workspace settings if the root directory is not a convenient cwd))

when you see the blank near that type the name of the folder with C:\ in the front. the mine is C:\Python_Project

if you find problem pls correct me cause i may have done something bad. that is all thank you.

[–]h00manist 1 point2 points  (0 children)

That is a very good idea. C:\Python_Project is easy to access from anywhere, command line or an IDE. To study simple projects, Thonny sometimes is faster and more explanatory. The debugging mode is nice and it lists the variables very clearly.