TIME NOW
World current time now,
CALENDAR
Calendar monthly, yearly
login CONVERT LENGTH
login CONVERT TEMPERATURE
login DICTIONARIES, LISTS
login SCIENCE EDUCATION RELIGION
login WORK CALCULATOR
login CALCULATE LIFE

Python 3 programming language, learn python, tutorial

Page bottomNext article  ALL TOPICS

Python 3 programming. Beginer. Getting started

 Python is a general-purpose computer programming language. Remember: python 3 differs from version 2. Here we will learn python 3.
Features:
  • Python is Interpreted
  • Python is Interactive
  • Python is Object-Oriented
  • Python is a Beginner's Language

2015 TIOBE rank is 6 - Tiobe index. It is very popular language in the world and lacks programmers, i think.

Run Python code on your machine

I prefer to run python examples on windows. Later it will be useful to do programming on Linux. Lets make  your firsts python file, which is empty:

hello.py

and run from windows command line:

c:\pathToPython\python c:\pathToYourFile\hello.py



Now lets use some editor and write into hello.py:
print ("Hello Python!")
print ("This is my first script.")



On linux it will be with path to python. File must be executable. Tu run it print on command line ./hello.py:
#!/usr/bin/env python
 
print ("Hello Python!")
print ("This is my first script.")

Or:
#!/usr/bin/python
print ("Hello, Python!")

How to run on linux. This is command, which makes the file as executable :
$ chmod +x hello.py    
$./test.py

If you use Python 2 syntax. Python3 and Python2 differ:
print "Hello Python!"
print "This is my first script."

You will get errors:


You can read the debugger messages and make right code.


-- 
Page topNext article  ALL TOPICS



 Use username: Guest, Anonymous, Programmer






QUOTES:
Great men are not always wise.
Biblical Proverb
Anyone who says he can see through women is missing a lot.
Groucho Marx
Christianity, above all, has given a clear-cut answer to the demands of the human soul.
Anonymous