-1

I need help with this problem:

temp = "video.mp4"
way_to_file = r"C:\Users\Lukas\Desktop\auto youtube channel\" + temp

the problem is I close the string and can put it together the string and temp I mean It is not working

error:

Traceback (most recent call last):
  File "<pyshell#42>", line 1, in <module>
    subprocess.call(['hello.py', 'htmlfilename.htm'])
  File "C:\Python34\lib\subprocess.py", line 537, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Python34\lib\subprocess.py", line 858, in __init__
    restore_signals, start_new_session)
  File "C:\Python34\lib\subprocess.py", line 1111, in _execute_child
    startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application
  • The closing `"` is escaped (`\"`), use `os.path.join` instead to join paths (`os.path.join(r"C:\Users\Lukas\Desktop\auto youtube channel", "temp")`). – DjaouadNM Jan 15 '22 at 17:58

2 Answers2

0

try instead:

temp = "video.mp4"
way_to_file = "C:\\Users\\Lukas\\Desktop\\auto youtube channel\\" + temp
XxJames07-
  • 1,833
  • 1
  • 4
  • 17
0

You can use just

way_to_file = f"C:\\Users\\Lukas\\Desktop\\auto youtube channel\\{temp}"

or

way_to_file = rf"C:\Users\Lukas\Desktop\auto youtube channel\{temp}"
G Baz
  • 20
  • 3