參見英文答案 >How do you call a private module function from inside a class?????????????????????????????????????1個我用谷歌搜索了一堆,似乎無法弄清楚如何實際做到這一點:鑒于我有一個通用的實用方法,如下所示:def __square(n):python import函數。
模塊(module)也是為了同樣的目的。在Python中,一個.py文件就構成一個模塊。通過模塊,你可以調用其它文件中的程序。 first.py def laugh():print "Haha" moduleTD模塊組合攻略,second.py import first
first.laugh() import first as f
f.laugh() from