近期學習python的小問題及解決方案

①定義空的二維列表來讀取放置文件的內容:html

在python中定義二維數組 - woshare - 博客園
https://www.cnblogs.com/woshare/p/5823303.htmlpython

調用電腦功能的sys模塊(如打開某文件夾,打開某瀏覽器網頁,打開cmd並執行):數組

python之sys模塊詳解 - archie’s - 博客園
https://www.cnblogs.com/Archie-s/p/6860301.html瀏覽器

③python隨機數:ide

玩轉 Python 中的隨機數
http://baijiahao.baidu.com/s?id=1596465591200328534&wfr=spider&for=pc工具

④py文件調用/使用另外一個py文件:學習

方法1、spa

import oshtm

os.system("python filename.py")blog

方法二:

execfile('xx.py'),括號內爲py文件路徑;

調用:from xxx import xx

xxx.py xx變量名

Python入門基礎之導入問題:from import 與import 詳解
https://baijiahao.baidu.com/s?id=1595360515695157210&wfr=spider&for=pc

⑤python字符串基礎操做:

Python 字符串操做(截取/替換/查找/分割) - baoendemao - 博客園
https://www.cnblogs.com/baoendemao/p/3804664.html

學習網址:(基礎教程)

Python 基礎教程 | 菜鳥教程
https://www.runoob.com/python/python-tutorial.html

Python 在線工具 | 菜鳥工具https://c.runoob.com/compile/6

相關文章
相關標籤/搜索