python ÖеÄpackage ºÍmodule Ôõô×éÖ¯°¡£®
python ÖеÄpackage ºÍmodule Ôõô×éÖ¯°¡£®
/src
lsx
__init__.py
user.py
hello.py
===================================
-----------hello.py-------------
from lsx import user
if __name__ == '__main__':
u=user('dhz')
-----------------
Õâ¸ö˵ÊDz»¶Ô£¬¸ÄÔõô×éÖ¯ÄØ£¿»¹ÊÇÒªÉèÖÃʲô»·¾³±äÁ¿£®
Traceback (most recent call last):
File "F:\App\javaSpace\PyHello\src\hello.py", line 8, in <module>
u=user('dhz')
TypeError: 'module' object is not callable
лл°¡¡¡£®
Ïà¹ØÎÊ´ð£º
¸÷λ¸ßÊÖ£¬ÄÄλÄÜд¸ö¼òµ¥µÄͨѶ¼£¬Ö»±£´æÐÕÃûºÍÊÖ»úºÅ£¬Äܱ£´æµ½Ó²Å̲¢¿É¶Á»Ø£¬ÓÐÌí¼Ó£¬É¾³ý£¬Ð޸ģ¬²éѯ¹¦ÄÜ£¬ÃüÁîÐÐʽµÄ¾ÍÐÐ
ÕâÖÖ»îÄãµÃ×Ô¼º¸É£¬ÓÐÎÊÌâ¿ÉÒÔÎÊ£¬µ«²»»áÓÐÈË°ïÄã×öµÄ¡£
¸øÄãÔ´Âë
http://dow ......
֮ǰÎҵĵçÄÔÉÏ°²×°ÁËIronPython2.0,ºó°²×°ShareDevelop3.0,²ÉÓÃĬÈÏÉèÖÃ
ÎÒÔÚShareDevelopÖн¨Á¢ÁËÒ»¸öĬÈϵÄPythonµÄ¿ØÖÆ̨»ò´°ÌåÏîÄ¿,ÔËÐÐʱ±¨´íÈçÏÂ:
µ÷ÊÔÆ÷Å׳öÒì³£System.IO.FileNotFoundException: ......
Ïñ C µÄ scanf() ÄÇÑù
±ÈÈç¶ÁÈë 1 2 3 a b c
ÿ´Î¶ÁÈëÒ»¸ö
ÏÂÃæÕâ¸öÓ¦¸ÃÊÇÄãÏëÒªµÄ°É£º
Python code:
>>> k = raw_input()
0 0123 ds dsl sd
>>> k
'0 0123 ds dsl sd'
>>> ......
ÓźñµÄ¸å³ê£¬³ÏÕÐPython¼¼ÊõÈËÔ±²ÎÓë¸÷ÖÖ¼¼ÊõÊé¼®³ö°æ¡£
ͨ¹ý¸ÃÊé¼®£¬×÷Õß¿ÉÒԵõ½Èçϱ¨³ê£º
1¡¢·áºñµÄ¸å³ê¡£
2¡¢Êé¼®Öø×÷µÄÊðÃûȨ¡£
3¡¢¶Ô×÷ÕߺÍÊé½øÐÐÐû´«£¬Ìá¸ß×÷ÕßÔÚ¼¼ÊõȦ×ÓÀ ......
Ä¿Ç°pythonµÄ¹ÙÍøÉϺÃÏñÏÂÔز»Á˶«Î÷£¬ËùÒÔÅܵ½ÕâÉÏÃæÀ´ÎÊÎÊ£¬ÓÐûÓÐÈËÁôÓÐÏàÓ¦µÄ¼Òµ±£¬ÄÜ·ñ¸øСµÜ¹²ÏíÒ»·Ý,ʲôƽ̨ϵĶ¼¿ÉÒÔ£¬Ð»Ð»£¡
Ôõô¿ÉÄÜϲ»ÁË£¿
ÏÂÔØÒ³ÃæòËƱ»Ç½ÁË£¬ÉÏ´úÀí¾ÍÐÐ...
ÇëÎʶþÂ¥ÄÜ·ñ½² ......