Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Python¿ìËÙÈëÃÅ

1. µÚÒ»Õ¡¡Python¿ìËÙÈëÃÅ
±¾ÕÂÊÇPythonµÄ¿ìËÙÈëÃÅ£¬ÔÚÕâÒ»Õ²¢²»Éæ¼°pythonµÄÌØÊâ¹æÔòºÍϸ½Ú£¬Ä¿±êÊÇͨ¹ýʾÀýʹÄã¿ìËÙÁ˽âPythonÓïÑÔµÄÌص㡣±¾Õ¼òÒª½éÉÜÁ˱äÁ¿,±í´ïʽ,¿ØÖÆÁ÷,º¯ÊýÒÔ¼°ÊäÈë/Êä³öµÄ»ù±¾¸ÅÄî,ÔÚÕâÒ»Õ²»Éæ¼°PythonÓïÑԵĸ߼¶ÌØÐÔ¡£¾¡¹ÜÈç´Ë£¬Óо­ÑéµÄ³ÌÐòÔ±»¹ÊÇÄܹ»Í¨¹ýÔĶÁ±¾ÕµIJÄÁÏ´´½¨¸ß¼¶³ÌÐò¡£ÎÒÃǹÄÀøÐÂÊÖͨ¹ýÔËÐÐʾÀý£¬Ç×ÉíÌåÑéÒ»°ÑPython¡£
 
1.1. ÔËÐÐPython
Python ³ÌÐòͨ¹ý½âÊÍÆ÷Ö´ÐС£Èç¹ûÄãµÄ»úÆ÷ÒѾ­×°ºÃÁËpython£¬¼òµ¥µÄÔÚÃüÁîÐмüÈëpython¼´¿ÉÔËÐÐpython½âÊÍÆ÷¡£ÔÚ½âÊÍÆ÷ÔËÐеÄʱ£¬»áÓÐÒ»¸öÃüÁîÌáʾ·û >>>£¬ÔÚÌáʾ·ûºó¼üÈëÄãµÄ³ÌÐòÓï¾ä£¬¼üÈëµÄÓï¾ä½«»áÁ¢¼´Ö´ÐС£ÔÚϱߵÄÀý×ÓÖУ¬ÎÒÃÇÔÚ>>>Ìáʾ·ûºó±ß¼üÈë×î³£¼ûµÄÏÔʾ"Hello World"µÄÃüÁî:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print "Hello World"
Hello World
>>>
³ÌÐòÒ²¿ÉÒÔÏñÏÂÃæÒ»Ñù·ÅÖÃÔÚÒ»¸öÎļþÖÐ
# helloworld.py
print "Hello World"
PythonÔ´´úÂëÎļþʹÓÃ.pyºó׺.'#'±íʾעÊÍ(µ½ÐÐÄ©½áÊø)
Ö´ÐÐÎļþhelloworld.py
% python helloworld.py
Hello World
%
ÔÚWindows Ï£¬Ö»ÐèË«»÷Ò»¸ö.pyÎļþ¾ÍÄÜÖ´ÐÐÕâ¸öpython³ÌÐò¡£windows»á×Ô¶¯µ÷ÓÃpython½âÊͳÌÐò£¬È»ºóÆô¶¯Ò»¸öÖն˴°¿Ú(ÀàDOS´°¿Ú)À´Ö´ÐÐËü¡£ÔÚÕâÖÖÇé¿öÏÂ,Öն˴°¿Ú»áÔÚ³ÌÐòÖ´ÐÐÍê±ÏºóÁ¢¼´¹Ø±Õ(¾­³£ÊÇÔÚÄã¿´µ½ËüµÄÊä³ö֮ǰ)¡£Îª±ÜÃâÕâ¸öÎÊÌâ,Äã¿ÉÒÔʹÓÃpython¼¯³É¿ª·¢»·¾³,ÀýÈçIDLE»òPythonwin¡£ÁíÒ»¸ö¿ÉÐеķ½·¨Êǽ¨Á¢Ò»¸ö batÎļþ,ÔÚÎļþдÈëÕâÑùÒ»ÐÐÓï¾ä£¬Èç python -i helloworld.py¡£ÔËÐÐÕâ¸öÅú´¦Àí£¬³ÌÐòÔÚÖ´ÐÐÍê³Éºó»á×Ô¶¯½øÈëpython½âÊÍÆ÷¡£
ÔÚ½âÊÍÆ÷ÖÐ,Ò²¿ÉÒÔͨ¹ýº¯Êýexecfile()À´ÔËÐÐÒ»¸ö±£´æÔÚ´ÅÅÌÉϵijÌÐò,ÈçÏÂÀý:
>>> execfile("helloworld.py")
Hello World
ÔÚUNIXÏÂ,Äã¿ÉÒÔÔÚ³ÌÐòµÄÊ×ÐÐдÈë #! ħ·¨×Ö·û´® À´×Ô¶¯µ÷ÓÃpython½âÊÍÆ÷Ö´ÐÐÄãµÄ½Å±¾¡£
print "Hello World"
½âÊÍÆ÷»áÒ»Ö±ÔËÐÐÖ±µ½Îļþ½áÊø¡£Èç¹ûÔÚ½»»¥Ä£Ê½ÏÂ,¼üÈë EOF×Ö·ûÍ˳ö½âÊÍÆ÷¡£ÔÚUNIXÏÂ,EOF×Ö·ûÊÇCtrl+ D;ÔÚWindowsÏÂ,EOF×Ö·ûÊÇCtrl+Z.Ò²¿ÉÒÔÔÚ³ÌÐòÖÐʹÓÃsys.exit()º¯Êý»òÕßͨ¹ýÒý·¢SystemExitÒì³£À´Í˳ö³ÌÐò:
>>> import sys
>>> sys.exit()
»òÕß
>>> raise SystemExit
 


Ïà¹ØÎĵµ£º

PythonÔªÀà

±³ºóÓÐÒ»´óÌ×µÄÀíÂÛ £¡£¡¹ÜËüÄØ£¡£¿ÀíÂÛÄܵ±·¹³ÔÂð£¿
ÏÈÖªµÀÔõôÓÃÔÙ˵£¡
¼Çס£ºÔªÀà¾ÍÊÇÀàµÄÄ£°å——Ì«ÐÎÏóÁËÁËѽ£¬»ô»ô¡£
ÎÒÒªÒ»´óȺµÄÀ඼¾ßÓÐÒ»ÖÐÌص㣬ÎÒÔõô¸øËûÃǼÓÉÏÄØ£¿Ä£°åÄ£°åÂð£¬ÎÒ´ÓÕâ¸öÄ£°å´´½¨Ò»ÈºÀ಻¾ÍOKÁË£¿ÄǾÍÐèÒªÔªÀàÁË¡£»ô»ô¡·
¶¨ÒåÒ»¸öÔªÀࣨ¾ÍËùÒ»¸öÀàµÄÄ£°å£¡Äª¶àÏ룬»¹Òª¼ÇסÕâÊÇÀ ......

ÔÚLinuxϵͳÉÏʵÏÖÓÃPythonÔ¶³Ì·ÃÎÊOracleÊý¾Ý¿â

1¡¢ÏÂÔØoracleÈí¼þ
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
oracle-instantclient-basic-10.2.0.4-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
oracle-instantclient-devel-10.2.0.4-1.i386.rpm
2¡¢°²×°rpm°ü
rpm -ivh oracle-instantclient-basic-10.2.0.4 ......

Python¶àÏß³Ì ¼òÃ÷Àý×Ó

×ÛÊö
 
  ¶àÏß³ÌÊdzÌÐòÉè¼ÆÖеÄÒ»¸öÖØÒª·½Ã棬ÓÈÆäÊÇÔÚ·þÎñÆ÷Deamon³ÌÐò·½Ãæ¡£ÎÞÂÛºÎÖÖϵͳ£¬Ï̵߳÷¶ÈµÄ¿ªÏú¶¼±È´«Í³µÄ½ø³ÌÒª¿ìµÃ¶à¡£
 
Python¿ÉÒÔ·½±ãµØÖ§³Ö¶àÏ̡߳£¿ÉÒÔ¿ìËÙ´´½¨Ï̡߳¢»¥³âËø¡¢ÐźÅÁ¿µÈµÈÔªËØ£¬Ö§³ÖÏ̶߳Áдͬ²½»¥³â¡£ÃÀÖв»×ãµÄÊÇ£¬PythonµÄÔËÐÐÔÚPython
ÐéÄâ»úÉÏ£¬´´½¨µÄ¶àÏß³Ì¿É ......

PythonÐÔÄܲâÊÔº¯Êý

Python ÉçÇøÓоäË×Ó“Python ×Ô¼º´ø×ŵç³Ø¡£” ±ð×Ô¼ºÐ´¼Æʱ¿ò¼Ü¡£Python 2.3ÒÔºó ¡¢¾ß±¸Ò»¸ö½Ð×ö timeit µÄÍêÃÀ¼Æʱ¹¤¾ß¡£DiveIntoÖеÄÀý×Ó
>>> import timeit
>>> t = timeit.Timer("soundex.soundex('Pilgrim')",
... "import soundex")
>>> t.timeit() ......

arcgis python½Å±¾

Script Name: Spider_Create   
#Script Label: Create Spider Diagrams   
#   
#Description:  Custom python script developed to create spider diagrams from points contained   
#in one or two feature classes.  If using two fea ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ