Creating your first "Hello World" Python project in PyCharm on Mac


  1. Create a new project
  2. Name it "Hello"
    1. Before hitting "Create" make sure the interpreter is Python 3.7
    2. Smash that Create button
  3. Under "Project" right click the "Hello"
    1. Click "New" --> "Python file"
    2. Name it "Hello" and press enter... you now have a Hello.py file
  4. Your ready to write some code!
    1. Write the following
      1. print("Hello world")
  5. 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

__________


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

Popular posts from this blog

Installing Microsoft ODBC Driver to connect to SQL from Python on Mac OS X

Connection to MSSQL with Pythonan and pyodbc (on Mac OS X)

Installing PyCharm on Mac