May-14-2024, 04:51 PM
I have recently decided to learn python and found a playlist by Corey Schafer. The problem is that with the very first task, I cannot get it to work. He says to create a script in IDLE and then once saved you can print it by calling it from the cmd terminal.
C:\Users\brett>python Intro.py
python: can't open file 'C:\\Users\\brett\\Intro.py': [Errno 2] No such file or directory
C:\Users\brett>python C:\Users\brett\AppData\Local\Programs\Python\Python312\Intro
python: can't open file 'C:\\Users\\brett\\AppData\\Local\\Programs\\Python\\Python312\\Intro': [Errno 2] No such file or directory
C:\Users\brett>python Users\brett\AppData\Local\Programs\Python\Python312\Intro
python: can't open file 'C:\\Users\\brett\\Users\\brett\\AppData\\Local\\Programs\\Python\\Python312\\Intro': [Errno 2] No such file or directory
C:\Users\brett>clear
'clear' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\brett>python Desktop/Intro.py
python: can't open file 'C:\\Users\\brett\\Desktop\\Intro.py': [Errno 2] No such file or directory
C:\Users\brett>python Desktop/Python Files/Intro.py
python: can't open file 'C:\\Users\\brett\\Desktop\\Python': [Errno 2] No such file or directory
C:\Users\brett>python Desktop/PythonFiles/Intro.py
python: can't open file 'C:\\Users\\brett\\Desktop\\PythonFiles\\Intro.py': [Errno 2] No such file or directory
C:\Users\brett>python Desktop/PythonFiles/Intro
python: can't open file 'C:\\Users\\brett\\Desktop\\PythonFiles\\Intro': [Errno 2] No such file or directory
C:\Users\brett>python Documents/PythonFiles/Intro
python: can't open file 'C:\\Users\\brett\\Documents\\PythonFiles\\Intro': [Errno 2] No such file or directory
C:\Users\brett>python C:\Users\brett\OneDrive\Documents\PythonFiles
C:\Users\brett\AppData\Local\Programs\Python\Python312\python.exe: can't find '__main__' module in 'C:\\Users\\brett\\OneDrive\\Documents\\PythonFiles'
I have tried many different ways of loading it but the cmd never finds it. I tried it on my desktop then in my documents folder. I tried copying the directory address (I think it's called). It seems like a very stupid error, mainly because Corey Schafer seems to be quite thorough in his explanations but he did not explain this at all.
I'm sorry if I have posted this in the wrong forum or I wrote it wrong. This is my first time posting and I tried following the rules that I read. At the moment I don't know what BBCode is but I will also try to learn what that is.
C:\Users\brett>python Intro.py
python: can't open file 'C:\\Users\\brett\\Intro.py': [Errno 2] No such file or directory
C:\Users\brett>python C:\Users\brett\AppData\Local\Programs\Python\Python312\Intro
python: can't open file 'C:\\Users\\brett\\AppData\\Local\\Programs\\Python\\Python312\\Intro': [Errno 2] No such file or directory
C:\Users\brett>python Users\brett\AppData\Local\Programs\Python\Python312\Intro
python: can't open file 'C:\\Users\\brett\\Users\\brett\\AppData\\Local\\Programs\\Python\\Python312\\Intro': [Errno 2] No such file or directory
C:\Users\brett>clear
'clear' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\brett>python Desktop/Intro.py
python: can't open file 'C:\\Users\\brett\\Desktop\\Intro.py': [Errno 2] No such file or directory
C:\Users\brett>python Desktop/Python Files/Intro.py
python: can't open file 'C:\\Users\\brett\\Desktop\\Python': [Errno 2] No such file or directory
C:\Users\brett>python Desktop/PythonFiles/Intro.py
python: can't open file 'C:\\Users\\brett\\Desktop\\PythonFiles\\Intro.py': [Errno 2] No such file or directory
C:\Users\brett>python Desktop/PythonFiles/Intro
python: can't open file 'C:\\Users\\brett\\Desktop\\PythonFiles\\Intro': [Errno 2] No such file or directory
C:\Users\brett>python Documents/PythonFiles/Intro
python: can't open file 'C:\\Users\\brett\\Documents\\PythonFiles\\Intro': [Errno 2] No such file or directory
C:\Users\brett>python C:\Users\brett\OneDrive\Documents\PythonFiles
C:\Users\brett\AppData\Local\Programs\Python\Python312\python.exe: can't find '__main__' module in 'C:\\Users\\brett\\OneDrive\\Documents\\PythonFiles'
I have tried many different ways of loading it but the cmd never finds it. I tried it on my desktop then in my documents folder. I tried copying the directory address (I think it's called). It seems like a very stupid error, mainly because Corey Schafer seems to be quite thorough in his explanations but he did not explain this at all.
I'm sorry if I have posted this in the wrong forum or I wrote it wrong. This is my first time posting and I tried following the rules that I read. At the moment I don't know what BBCode is but I will also try to learn what that is.