I took a function for python that I have found online
def sh_escape(s):
return s.replace("(","\\(").replace(")","\\)").replace(" ","\\ ")
And I used it with os.system (). It looks like this:
os.system(sh_escape('curl -X PUT http://admin:admin@127.0.0.1:5984/test/')+file+sh_escape(' -d @/home/user/Downloads/') +file)
file is the name he reads with os.walk()
When I run it, I am becoming
sh: 1: curl -X PUT http://admin:admin@127.0.0.1:5984/test/file -d @/home/user/Downloads/file: not found
Do you know, where my mistake is ? if I run the command directly in the terminal it works.
Python 3 used