I'm on Python 3.6. How I can extract part of URL so I can use it as variable. For example, the URL is http://example.com/comp/project.sec and I would like to get the project part without .sec as variable.
How can I achieve that?
I'm on Python 3.6. How I can extract part of URL so I can use it as variable. For example, the URL is http://example.com/comp/project.sec and I would like to get the project part without .sec as variable.
How can I achieve that?
url = "http://example.com/comp/project.sec"
project = url.split("/")[-1].split(".")[0]