How to send multipart/data to PHP using Python requests

I’ve been trying to send an image to another server for a very long time, but for some reason it doesn’t want to accept files through requests. In the response, I get {“error”: “No panorama provided. Files = []”, “files”: []}. How do I build a request correctly? Correct code JS: https://gitlab.com/nickw1/opentrailview/blob/master/js/uploader.js Python POST code:…

How can I convert a dictionary into a comma separated .txt file while maintaining the key:value pair? Python

I have a dictionary that I need to write in a .txt file in comma separated value format. I have tried mydict = {‘first’: [‘1′,’2′,’3’], ‘second’: [‘2′,’3′,’4’], ‘third’: [‘3′,’4′,’5’]} f = open(“doc.txt”,”w”) for key, values in mydict: f.write(‘,’.format(key, values)+”\n”) f.close() But it does not work , as the values are too many. I have also…

How to remove fields in the python set that contains a pattern from values exist in other set

By following code, I am trying to remove Chinese, and German from languages which is a set, but it doesn’t work. Can anybody please help me with this? #!/usr/bin/env python3.7 languages = {‘English’, ‘French’, ‘Persian’, ‘German’, ‘Chinese’} junk = {‘ine’, ‘erm’, ‘glo’} languages -= junk languages {‘English’, ‘French’, ‘Persian’, ‘German’, ‘Chinese’} Thank you in advance.