Hello,
I'm not a programmer and I thought maybe you all could help with this. I am trying to get this script to allow white spaces on the aruguments that get added from the command line when it is run.
It is the part in bold that it is dying on. I got this from someone using it on Linux who doesn't seem to have the same issues as I am running on windows.
If I run python fire.py "TEST PAGES INTERNAL 15:28:40 on 12/24/17" TEST_PAGES_INTERNAL_2017_12_24_15_28_33.mp3 with quotes around the bold part it works but the program that calls this script pukes and dies with the ""'s
I'm not a programmer and I thought maybe you all could help with this. I am trying to get this script to allow white spaces on the aruguments that get added from the command line when it is run.
import argparse from twitter import * parser = argparse.ArgumentParser() parser.add_argument("description") parser.add_argument("audio_link") args = parser.parse_args() desc = args.description filename = args.audio_link #import os #head, tail = os.path.split(filename) #print (tail) twitter =Twitter(auth=OAuth("REMOVED)) with open("Fire.png", "rb") as imagefile: imagedata = imagefile.read() params = {"media[]": imagedata, "status":desc+" page received http://REMOVED/"+filename} twitter.statuses.update_with_media(**params)Command to run: python fire.py TEST PAGES INTERNAL 15:28:40 on 12/24/17 TEST_PAGES_INTERNAL_2017_12_24_15_28_33.mp3
It is the part in bold that it is dying on. I got this from someone using it on Linux who doesn't seem to have the same issues as I am running on windows.
If I run python fire.py "TEST PAGES INTERNAL 15:28:40 on 12/24/17" TEST_PAGES_INTERNAL_2017_12_24_15_28_33.mp3 with quotes around the bold part it works but the program that calls this script pukes and dies with the ""'s