PythonÈëÃŵÄ36¸öÀý×Ó Ö® 18
Àý1£º
# _018
# This is a module (if write Chinese in a module, there will be a error)
def func1():
print 'This is function 1.'
def func2():
print 'This is function 2.'
def func3():
print 'This is function 3.'
# 019
# ʹÓÓimport”Óï¾äµ÷ÓÃÄ£¿é£º
import _018_Module
_018_Module.func1()
_018_Module.func2()
_018_Module.func3()
output£º
This is function 1.
This is function 2.
This is function 3.
Àý2£º
# _018
# This is a module (if write Chinese in a module, there will be a error)
def func1():
print 'This is function 1.'
def func2():
print 'This is function 2.'
def func3():
print 'This is function 3.'
# 020
# ʹÓÓfrom ... import ...”Óï¾äµ÷ÓÃÄ£¿é
from _018_Module import func2
import _018_Module
_018_Module.func1()
func2()
_018_Module.func3()
output£º
This is function 1.
This is function 2.
This is function 3.
Àý3£º
# _018
# This is a module (if write Chinese in a module, there will be a error)
def func1():
print 'This is function 1.'
def func2():
print 'This is function 2.'
def func3():
print 'This is function 3.'
# 021
# ʹÓÓfrom ... import *”Óï¾äµ÷ÓÃÄ£¿é
from _018_Module import *
func1()
func2()
func3()
output£º
This is function 1.
This is function 2.
This is function 3.
Ïà¹ØÎĵµ£º
from: http://www.cnblogs.com/dahuzizyd/archive/2005/03/01/111006.html
pythonÖ§³ÖÃæÏò¶ÔÏóµÄ±à³Ì·ç¸ñ£¬ÕâÀïÖ÷Ҫ˵˵pythonÖеĶà¼Ì³Ð£º
ÏÂÃæµÄ´úÂëʹÓÃpython2.4£¬°²×°ºóʹÓÃidleµÄIDE¿ª·¢»·¾³£¨ËµÊÇIDE £¬±ÈÆðdelphi,VS.netµÈ¼òµ¥µÃÌ«¶àÁË)
´ÓFile-New²Ëµ¥½¨Á¢Ò»¸ö.pyÎļþ£¬Ð´ÏÂÃæµÄ´úÂ룺
class SuperCl ......
import time,thread
def test(a,b):
for i in range(a,b):
time.sleep(1)
print i
def start():
thread.start_new_thread(test,(1,1001))
thread.start_new_thread(test,(1000,2001))
if __name__=='__main__':
start()
......
E-mailÖ÷ÒªÓÉÓʼþÍ·ºÍÓʼþÌåÁ½²¿·Ö×é³É¡£
ÓʼþÍ·ÖеÄÄÚÈݺÍÎÒÃǼÄÐÅʱдÔÚÐÅ·âÉϵÄÄÚÈÝ´óͬСÒ⣬µ±È»ÕâÀïÒ²°üº¬Á˺ܶà·¹ýµÄ“Óʾ֔µÄÐÅÏ¢ÁË¡£
ÓʼþÌåÖеÄÄÚÈݾÍÊÇÎÒÃÇдµÄÐÅ»òÕß°ü¹ü¡£
python×ÔÉí°üº¬ÁËemailÄ£¿é´¦Àí¿ÉÒÔ¿ìËٵĴ¦ÀíE-mailÖеÄÐÅÏ¢
import email
#´ò¿ªÒ»¸öÎļþ
fp = open('email.eml', ' ......
djangoproject python 3 prog python code http://wiki.python.org/moin/WebBrowserProgramming http://wiki.woodpecker.org.cn/moin/ http://www.okpython.com/viewlist-fid-5.html http://zh.wikipedia.org/wiki/CPython django doc douban ibm python doc ibm python zope http://www.czug.org/ http://www.apolov ......
¡¡¡¡ÓÐʱºò£¬Òª°ÑÄÚ´æÖеÄÒ»¸ö¶ÔÏó³Ö¾Ã»¯±£´æµ½´ÅÅÌÉÏ£¬»òÕßÐòÁл¯³É¶þ½øÖÆÁ÷ͨ¹ýÍøÂç·¢Ë͵½Ô¶³ÌÖ÷»úÉÏ¡£PythonÖÐÓкܶàÄ£¿éÌṩÁËÐòÁл¯Óë·´ÐòÁл¯µÄ¹¦ÄÜ£¬È磺marshal, pickle, cPickleµÈµÈ¡£½ñÌì¾Í½²½²marshalÄ£¿é¡£
¡¡¡¡×¢Ò⣺
marshal²¢²»ÊÇÒ»¸öͨÓõÄÄ£¿é£¬ÔÚijЩʱºòËüÊÇÒ»¸ö²»±»ÍƼöʹÓõÄÄ£¿é£¬ÒòΪʹÓÃmarshalÐ ......