Akshay
Akshay

Reputation: 11

How can I use url variable as url in code

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

Upvotes: 0

Views: 41

Answers (2)

Nicolas Perez
Nicolas Perez

Reputation: 354

Use string formatting:

URL = input("Plz enter you Url")

import os

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

Upvotes: 1

SarthakJain
SarthakJain

Reputation: 1706

You can use .format in python

so

URL = input("Plz enter you Url")

import os

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

Upvotes: 0

Related Questions