Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
37 changes: 37 additions & 0 deletions Chapter8/rain_data/climate_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: UTF-8 -*-
__author__ = 'zy'
__time__ = '2019/4/16 20:01'
import os


def file_name(file_dir):

for root, dirs, files in os.walk(file_dir):
print(root) # 当前目录路径
print(dirs) # 当前路径下所有子目录
print(files) # 当前路径下所有非目录子文件

print('---------')
print(files)
return files

if __name__=='__main__':
root_source=r'C:\Users\hp\Desktop\气象数据'
file_list=file_name(root_source)
path=r'C:\Users\hp\Desktop\java_file'
# 修改当前工作目录
os.chdir(path)
# 查看修改后的工作目录
retval = os.getcwd()
print(retval)
cmds=[]
for i in file_list:
print(i)
i=r'C:\Users\hp\Desktop\气象数据'+'\\'+i
cmds.append('java -classpath . ishJava'+' '+i+' '+i+'.out')

for cmd in cmds:
os.system(cmd)
print('处理一个')


Binary file added Chapter8/rain_data/ishJava.class
Binary file not shown.
Loading