Search

Friday, February 4, 2011

Python from zero

Personal log in learning python.
Environment : Linux Fedora 14, Python 2.7


Basic
comment single line : # some line
for block of comment lines read : http://mail.python.org/pipermail/tutor/2004-February/028432.html


Common Data Types
String : 'foo', "bar"
Lists : ['foo','bar']
Tuples : ('foo', 'bar')
Dictionaries : {'foo':'bar'}


Type
cast integer to string : string(22)


Output
print "hello world"


String
concatenate string : "hello " + " world"


Iteration
for i in range (1, 15) :
   print i


System
import os
os.system('php file_name.php');

No comments:

Post a Comment