Creating your first "Hello World" Python project in PyCharm on Mac
- Create a new project
- Name it "Hello"
- Before hitting "Create" make sure the interpreter is Python 3.7
- Smash that Create button
- Under "Project" right click the "Hello"
- Click "New" --> "Python file"
- Name it "Hello" and press enter... you now have a Hello.py file
- Your ready to write some code!
- Write the following
print("Hello world")
- To execute the code, right-click and press "Run 'Hello'"
This is the output:
_________
/Users/imac/venv/bin/python /Users/imac/PycharmProjects/Hello/Hello.py
Hello world
Process finished with exit code 0
_________
/Users/imac/venv/bin/python /Users/imac/PycharmProjects/Hello/Hello.py
Hello world
Process finished with exit code 0
__________
To run the script copy the URL line (save the file first) and then paste /Users/imac/venv/bin/python /Users/imac/PycharmProjects/Hello/Hello.py to execute the script in terminal.
Output:
___________
Last login: Fri Oct 4 21:52:51 on ttys001
brian-air:~ imac$ /Users/imac/venv/bin/python /Users/imac/PycharmProjects/Hello/Hello.py
Hello world
brian-air:~ imac$
___________
Comments
Post a Comment