Difference between revisions of "Python Starting"

From Computer Science
Jump to: navigation, search
(Reading and Tutorials)
Line 19: Line 19:
 
=Reading and Tutorials=
 
=Reading and Tutorials=
 
The following are good sources to read when starting out with python. If you are taking a course at ISU that uses python, the course might use one or more of these as required reading material.
 
The following are good sources to read when starting out with python. If you are taking a course at ISU that uses python, the course might use one or more of these as required reading material.
 +
 +
* [https://www.w3schools.com/python/python_intro.asp w3schools Python] - interactive tutorial where you can try out code in the browser
 +
*  [https://www.learnpython.org/ Learn Python] - interactive tutorial where you can try out code in the browser
 +
* [https://automatetheboringstuff.com/ Automate the Boring Stuff with Python] - suitable for people with very limited programming experience, this is the text that is being followed for our CS 151 course (as of 2019)
 +
* [http://greenteapress.com/thinkpython2/html/index.html Think Python] - suitable for people with very limited programming experience, not very deep
 +
* [https://learnxinyminutes.com/docs/python3/ LearnXinYminutes] - quick review once you are familiar with the basics
 +
* [https://docs.python.org/3/tutorial/ Python.org tutorial] - good for those with programming experience already, or in a course where the instructor is guiding the class

Revision as of 17:04, 20 August 2022

Running Python Programs

To get started with Python programming, you need to be able to run the program. Here are some ways to get started...

Install Python

You can install python on your personal computer. You download from python.org/downloads, and it normally auto-detects your OS. Click the download button, install it, and open it open after it's installed.

Python Online

There are various websites that provide an online Python environment that you can use in your web browser. Most of these are fine to use to get started. One that we are familiar with that you could try is repl.it.

Connect to the CS Server

The CS server has python installed. If you have an account for the CS systems (see CS Accounts and CS Lab Computers) then you can use this account to login to the CS server and run Python in the terminal. See CS Server - Terminal for how to connect to the CS server. Once you are logged into the server, you can run python in interactive mode by simply running: python3

To run a python program that is in your account on the server, you would run: python3 filename.py where filename.py is the name of the file you want to run.

Note that the python might be running an older version of python (python2). You can tell by running this command: python --version

If this prints a version that is 2.something, you should use the command python3 to make sure you are using the current version of python (as above).

Reading and Tutorials

The following are good sources to read when starting out with python. If you are taking a course at ISU that uses python, the course might use one or more of these as required reading material.

  • w3schools Python - interactive tutorial where you can try out code in the browser
  • Learn Python - interactive tutorial where you can try out code in the browser
  • Automate the Boring Stuff with Python - suitable for people with very limited programming experience, this is the text that is being followed for our CS 151 course (as of 2019)
  • Think Python - suitable for people with very limited programming experience, not very deep
  • LearnXinYminutes - quick review once you are familiar with the basics
  • Python.org tutorial - good for those with programming experience already, or in a course where the instructor is guiding the class