0
URL = input("Plz enter you Url")

import os

os.system("youtube-dl -f 95  -g **URL**")

I asked user for a url and I want to use the provided url on line 3

2
  • You can probably do something like os.system(f"youtube-dl -f 95 -g {URL}") Commented Jul 20, 2022 at 6:30
  • per PEP8 all imports should be at the top of the file also you seem to need to cover some Python basics Commented Jul 20, 2022 at 7:14

2 Answers 2

1

Use string formatting:

URL = input("Plz enter you Url")

import os

os.system(f"youtube-dl -f 95  -g {URL}")
Sign up to request clarification or add additional context in comments.

1 Comment

how can i get output of code in python
0

You can use .format in python

so

URL = input("Plz enter you Url")

import os

os.system("youtube-dl -f 95  -g {}".format(URL))

1 Comment

"old" method and it's slower and less readable than f strings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.