I'm trying to call an application and pass a text file as a parameter. The text file has instructions. I tried passing a parameter when opening notepad but couldn't get it to work. Here is the code I'm trying:
import os
os.startfile(r"C:\Windows\notepad.exe c:\cobra\advancecalendar.txt")
If I don't include the path to the second file it launches notepad, but with the file name included i get the following error:
RESTART: C:/Users/timbo/AppData/Local/Programs/Python/Python36-32/Open exe module.py
Traceback (most recent call last):
File "C:/Users/timbo/AppData/Local/Programs/Python/Python36-32/Open exe module.py", line 3, in <module>
os.startfile(r"C:\Windows\notepad.exe c:\cobra\advancecalendar.txt")
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Windows\\notepad.exe c:\\cobra\\advancecalendar.txt'
How can I pass a parameter to the startfile so it opens a specific file? when I tried putting both in quotes it still got an error.