Extract file name from path, no matter what the os/path format

Using os.path.split or os.path.basename as others suggest won’t work in all cases: if you’re running the script on Linux and attempt to process a classic windows-style path, it will fail. Windows paths can use either backslash or forward slash as path separator. Therefore, the ntpath module (which is equivalent to os.path when running on windows) … Read more

How to use Python to execute a cURL command?

I want to execute a curl command in Python. Usually, I just need to enter the command in the terminal and press the return key. However, I don’t know how it works in Python. The command shows below: There is a request.json file to be sent to get a response. I searched a lot and … Read more

anaconda update all possible packages?

TL;DR: dependency conflicts: Updating one requires (by it’s requirements) to downgrade another You are right: is actually the way to go1. Conda always tries to upgrade the packages to the newest version in the series (say Python 2.x or 3.x). Dependency conflicts But it is possible that there are dependency conflicts (which prevent a further … Read more