CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day06/function4.py
Views: 729
1
"""
2
Python常用模块
3
- 运行时服务相关模块: copy / pickle / sys / ...
4
- 数学相关模块: decimal / math / random / ...
5
- 字符串处理模块: codecs / re / ...
6
- 文件处理相关模块: shutil / gzip / ...
7
- 操作系统服务相关模块: datetime / os / time / logging / io / ...
8
- 进程和线程相关模块: multiprocessing / threading / queue
9
- 网络应用相关模块: ftplib / http / smtplib / urllib / ...
10
- Web编程相关模块: cgi / webbrowser
11
- 数据处理和编码模块: base64 / csv / html.parser / json / xml / ...
12
13
Version: 0.1
14
Author: 骆昊
15
Date: 2018-03-05
16
"""
17
18
import time
19
import shutil
20
import os
21
22
seconds = time.time()
23
print(seconds)
24
localtime = time.localtime(seconds)
25
print(localtime)
26
print(localtime.tm_year)
27
print(localtime.tm_mon)
28
print(localtime.tm_mday)
29
asctime = time.asctime(localtime)
30
print(asctime)
31
strtime = time.strftime('%Y-%m-%d %H:%M:%S', localtime)
32
print(strtime)
33
mydate = time.strptime('2018-1-1', '%Y-%m-%d')
34
print(mydate)
35
36
shutil.copy('/Users/Hao/hello.py', '/Users/Hao/Desktop/first.py')
37
os.system('ls -l')
38
os.chdir('/Users/Hao')
39
os.system('ls -l')
40
os.mkdir('test')
41
42