在电脑Pycharm环境下能正常运行的脚本,移植到Linux服务器上,脚本和要处理的文件在同一个路径下,
1. 在提示输入文件名字的时候,直接回车,
$ v./process_file
I am here 1
请输入带后缀的完整文件名: 若直接回车,则默认输入文件名为 "roam.csv" :
Traceback (most recent call last):
File "./process_file", line 33, in <module>
infilename = input('请输入带后缀的完整文件名: 若直接回车,则默认输入文件名为 "roam.csv" : ')
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
2. 在提示输入文件名字的时候,输入 roam.csv
$ ./process_file
请输入带后缀的完整文件名: 若直接回车,则默认输入文件名为 "roam.csv" : roam.csv
Traceback (most recent call last):
File "./process_file", line 32, in <module>
infilename = input('请输入带后缀的完整文件名: 若直接回车,则默认输入文件名为 "roam.csv" : ')
File "<string>", line 1, in <module>
NameError: name 'roam' is not defined
3. 后来输入文件格式为 “roam.csv” 或者 'roam.csv' 后,脚本能正常运行了。