I'm new to programming and this is my second script written in python. The code works fine in my programming environment. However, when I run it in cmd I get the following error:
Traceback (most recent call last): File
"C:\FS1\Python\Stiffness_punch\main.py", line 34, in <module>
with open(project_status) as f: IOError: [Errno 22] Invalid argument: '004.pch\r'
Here is the code:
print('Specify the name of the status project .pch file')
project_status = input("")
with open(project_status) as f:
status_lines = f.readlines()
I couldn't find any solution. As I understand the name of the file is being interpreted as "004.pch\r" instead of "004.pch", but I have no idea how to remove this "\r"
from the name of the file.