学习材料:
Python教程
python
Cpython
python xxx.py
print ‘Hello %d’ % 1+2
input=raw_input(‘please input the value:’)
1 2
|
#!/usr/bin/env python # -*- coding: utf-8 -*-
|
if name == main:
main()
list and tuple
条件判断和循环
while i < 1 :
if i < 1 :
else:
for i in range(min,max):
整型和字符串
int(str)
str(int)
module
1 2 3 4 5 6 7
|
import httplib conn = httplib.HTTPconnection(ip, port, timeout=20); conn.request("GET", "/index.html"); res = conn.getresponse(); print res.status print res.reason conn.close();
|
1 2 3 4 5 6 7 8 9 10 11 12
|
import threading class (threading.Thread): globalArg = 0; def __init__(self,arg1): threading.Thread(self); self.arg1 = arg1;
def run(): print "thred is running";
thread1 = myThread(arg1); thread1.start();
|
近期评论