falldog 发表于 2017-5-4 11:01:15

python -- 包含 类库、引用其他文件

  //hello.py
  


def PrintHello():
print 'hello, andylin\n';
#PrintHello();

   //pysys.py
  


import sys;
print 'the command line arguments are:';
for i in sys.argv:
print i;
print '\n\nThe PYTHONPATH is ', sys.path, '\n';
#import using_name;
#print 'file name:', __name___, '\n';
#as c include
import hello
hello.PrintHello();
from hello import PrintHello
PrintHello();
import sys;
dir(sys);
print 'end of test dir\n';

 
页: [1]
查看完整版本: python -- 包含 类库、引用其他文件