Hi All,
I just installed Python in my computer, and trying to do what’s suggested in the Codecademy page, as follows:
1. Open a Terminal (if on Mac) or Command Prompt (if on Windows) and browse to a directory of your choice.
2. Create a new file called mycode.py
and open it with your favorite text editor.
3. Copy and paste the following code and save the file.
print(“I’m running Python code on my own environment!”)
4. Finally, run the script by executing the following command from the Terminal/Command Prompt in the folder where the file was saved.
python mycode.py
5. Our console should print the following message
I’m running Python code on my own environment!.
6. That’s it! We just ran Python code on our own personal environment.
Now how do I create the mycode.py from the windows command prompt?
My questions are:
- Same as above, how do I create the mycode.py from Windows Command Prompt? I have already at the step where I saved the script in text editor (Notepad) and saved it in the same file as the mycode.py folder. In the instructions, it says :
“Finally, run the script by executing the following command from the Terminal/Command Prompt in the folder where the file was saved.”
How do we run Command Prompt in the folder where the file was saved? Right clicking in the folder doesn’t allow for option for Command Prompt…I tried choosing “Git Bash Here” but it doesn’t seem to be the way of doing it - Do we always need to do the scripts in Windows Command prompt (for WIndows) to run Python?
- When the instruction says : " 5. Our console should print the following message", does the “console” means in the Python program?
Thank you all for your help. I tried following the answer but I really cant figure it out…
- Vinaa