日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

File Modification Time | DaniWeb

系統 2052 0

File Modification Time | DaniWeb

The functions are contained in module os. Function os.path.getmtime() gives you the last modified time in seconds since the beginning of 1/1/1970 (epoch). You have to do some formatting with module time functions to make it readable for the ordinary mortal.

The size of the file is returned by os.path.getsize() in bytes, convert to kilobytes and format the result.

      
  1. import os
  2. import time
  3. # pick a file you have in the working folder ...
  4. fname = "Texture.py"
  5. print "File was last modified (12 hour format):"
  6. print time . strftime ( "%m/%d/%Y %I:%M:%S %p" , time . localtime ( os . path . getmtime ( fname ) ))
  7. fsize = os . path . getsize ( fname )
  8. print "size = %0.1f kb" % float ( fsize / 1000.0 )
  9. """
  10. possible result:
  11. File was last modified (12 hour format):
  12. 01/25/2003 11:38:30 AM
  13. size = 5.8 kb
  14. """

File Modification Time | DaniWeb


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 娱乐| 雷州市| 南召县| 库尔勒市| 宁阳县| 东光县| 资溪县| 台前县| 上杭县| 崇州市| 滨州市| 泾川县| 福州市| 清水县| 西昌市| 襄城县| 绥江县| 六安市| 马龙县| 湛江市| 石泉县| 金寨县| 肥城市| 宝鸡市| 湖南省| 河北省| 响水县| 宝兴县| 台北县| 宽甸| 安国市| 涟源市| 贺州市| 汶川县| 东兰县| 晋城| 玛沁县| 浦北县| 馆陶县| 溆浦县| 遵化市|