Sunday 4 October 2020

HOW TO WRITE AND RUN PYTHON SCRIPTS

 WRITING PYTHON SCRIPTS

1) put on your system, and click START

2)     type Notepad into the command prompt

3)  write your python codes

4) save your codes AS

        a) file Name: whatever.py -save it with any name, but ensure the ".py" ending

        b)encoding: utf-8

note: some writers talk about creating a new folder for your python files. That does not necessarily matter as long as you could quote your location when running your codes. 

  Your python file is created successfully.

 

RUN YOUR PYTHON CODES

a) ensure that python is properly installed on your system

b) click on START once your PC is on

c) type COMMAND PROMPT, select it

     a dark command prompt would open with a cammand line C: \Users\PC>

Now, this is where you identify the Location of your file. Assuming your file is stored in a new folder called MYFOLDER at DESKTOP, this is how you declare your file location

d) type "cd desktop" Press enter

e) type "cd myfolder". Press enter

f) finally, type your file name: whatever.py. Press enter

  Congrats, your code output is successfully displayed. Happy coding.