with open('hello.txt', 'r') as f:
print(f.read())
hello world
Setuptools中py2exe库
使用py2app
py2applet --make-setup Demo.py
import sys
print(sys.path)
['C:\\Users\\MACHENIKE\\Desktop', 'C:\\Users\\MACHENIKE\\AppData\\Local\\Programs\\Python\\Python38-32\\python38.zip', 'C:\\Users\\MACHENIKE\\AppData\\Local\\Programs\\Python\\Python38-32\\DLLs', 'C:\\Users\\MACHENIKE\\AppData\\Local\\Programs\\Python\\Python38-32\\lib',
'C:\\Users\\MACHENIKE\\AppData\\Local\\Programs\\Python\\Python38-32'
import os
print(os.system('ipconfig'))
import time
print(time.asctime())
Wed Aug 19 23:47:05 2020
import time
print(time.localtime(1888888888))
time.struct_time(tm_year=2029, tm_mon=11, tm_mday=9, tm_hour=11,
tm_min=21, tm_sec=28, tm_wday=4, tm_yday=313, tm_isdst=0)
import time
print(time.mktime(2020, 7, 3, 21, 48, 56, 4, 21, 0)))
1593784136.0
import time
print(time.strptime('Sun Jul 5 08:29:51 2025'))
time.struct_time(tm_year=2025, tm_mon=7, tm_mday=5, tm_hour=8,
tm_min=29, tm_sec=51, tm_wday=6, tm_yday=186, tm_isdst=-1)
import time
import random
t = list(range(20))
print(t)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
random.shuffle(t)
print(t)
[4, 16, 14, 17, 9, 13, 2, 1, 10, 6, 0, 15, 12, 7, 8, 5, 19, 18, 3, 11]
人生漫漫其修远兮,网安无止境。
一同前行,加油!