Difference between revisions of "Hello, World! Python program in JupyterLab Step-by-Step"

From PharmWiki
Jump to navigation Jump to search
(Created page with "1.")
 
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
1.
#
#Open Anaconda3
# Click [[File:Jyp006.png|frameless]] under [[File:Jyp007.png|frameless|114x114px]]''Click to enlarge''
##If you did it correctly, it should look like: [[File:Jyp008.png|frameless|100x100px]]''Click to enlarge''
#You can make a new folder for your Hello, World! program by clicking: [[File:Jyp009.png|frameless|44x44px]]and name the folder '''Hello World'''.
##If you did it correctly, it should look like: [[File:Jyp010.png|frameless|100x100px]]Click to enlarge
#Double Click on the Hello World folder to change the path.
##The left part of the window should look something like: [[File:Jyp011.png|frameless|180x180px]]''Click to enlarge''
#Make a new Jupyter notebook by clicking [[File:Jyp012.png|frameless|101x101px]]under [[File:Jyp013.png|frameless]].
##If you did it correctly, it should look like: [[File:Jyp014.png|frameless|100x100px]] ''Click to enlarge''
##Note that the ending of the Jupyter notebook file is .ipynb. It says Untitled.ipynb
##The light gray box is a cell: [[File:Jyp015.png|frameless]] ''Click to enlarge''
#Go to File ---> Save Notebook As... and save the file as ''HelloWorld.ipynb''
##The dialog will look like: [[File:Jyp016.png|frameless|100x100px]]''Click to enlarge''
#Click [[File:Jyp017.png|frameless]]
##If you did it correctly, it should look like: [[File:Jyp018.png|frameless|100x100px]]''Click to enlarge''
#To clean things up, on ''Untitled.ipynb'' alternate click Delete or click the Delete button on your keyboard.
##If you did it correctly, you will get the following dialog: [[File:Jyp019.png|frameless|100x100px]]''Click to enlarge''
#Click the [[File:Jyp020.png|frameless]]button.
##If you did it correctly, the JupyterLab window should look like: [[File:Jyp021.png|frameless|100x100px]]''Click to enlarge''
#Type the following text into the JupyterLab notebook.
#:<syntaxhighlight lang="python">
'''
 
This is a basic Hello, World! program
 
'''
 
print("Hello, World!")
 
</syntaxhighlight>
#:* If you did it correctly, it should look like:[[File:Jyp022.png|frameless|100x100px]]''Click to enlarge''
#Click File ⇒ Save Notebook
#To run click [[File:Jyp023.png|frameless]]
##If you did it correctly, it should look like:[[File:Jyp024.png|frameless|100x100px]]''Click to enlarge''
##If you get errors do not worry, carefully look at the script. Despite programming for over 40 years, I got an error the first time that I wrote this program, so do not worry.
#Click File ⇒ Save Notebook
#
#
#

Latest revision as of 12:29, 8 March 2022

  1. Open Anaconda3
  2. Click Jyp006.png under Jyp007.pngClick to enlarge
    1. If you did it correctly, it should look like: Jyp008.pngClick to enlarge
  3. You can make a new folder for your Hello, World! program by clicking: Jyp009.pngand name the folder Hello World.
    1. If you did it correctly, it should look like: Jyp010.pngClick to enlarge
  4. Double Click on the Hello World folder to change the path.
    1. The left part of the window should look something like: Jyp011.pngClick to enlarge
  5. Make a new Jupyter notebook by clicking Jyp012.pngunder Jyp013.png.
    1. If you did it correctly, it should look like: Jyp014.png Click to enlarge
    2. Note that the ending of the Jupyter notebook file is .ipynb. It says Untitled.ipynb
    3. The light gray box is a cell: Jyp015.png Click to enlarge
  6. Go to File ---> Save Notebook As... and save the file as HelloWorld.ipynb
    1. The dialog will look like: Jyp016.pngClick to enlarge
  7. Click Jyp017.png
    1. If you did it correctly, it should look like: Jyp018.pngClick to enlarge
  8. To clean things up, on Untitled.ipynb alternate click Delete or click the Delete button on your keyboard.
    1. If you did it correctly, you will get the following dialog: Jyp019.pngClick to enlarge
  9. Click the Jyp020.pngbutton.
    1. If you did it correctly, the JupyterLab window should look like: Jyp021.pngClick to enlarge
  10. Type the following text into the JupyterLab notebook.
    '''
    
     This is a basic Hello, World! program
    
    '''
    
    print("Hello, World!")
    
    • If you did it correctly, it should look like:Jyp022.pngClick to enlarge
  11. Click File ⇒ Save Notebook
  12. To run click Jyp023.png
    1. If you did it correctly, it should look like:Jyp024.pngClick to enlarge
    2. If you get errors do not worry, carefully look at the script. Despite programming for over 40 years, I got an error the first time that I wrote this program, so do not worry.
  13. Click File ⇒ Save Notebook