Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble passing arguments
#1
When I call the functions and go to pass arguments for the functions (specifically for download_clips and download_clip) I get an error. I'm unsure what is supposed to go in their. I've tried multiple arguments but I can't seem to get the correct one. Also, for download_clip can I put multiple clips in there? Is there a way to have download_clip download all .mov files?

def download_clip(clip):
    url = "http://10.1.1.27/media/" + clip
    print url

def download_clips(response):
    values = response.split(":")
    i = 0
    for word in values:
        i += 1
        if(word.find('clipname') > -1):
            clip = values[i].split(',')[0].translate(string.maketrans("",""), '[]{} \,\"\" ')
            if not os.path.exists(clip):
                print "Downloading clip: " + clip
        else:
            f = urllib.urlopen("http://10.1.1.27/config?action=set&paramid=eParamID_MediaState&value=0")
            print "No new clips found"
Error:
C:\Python26\python.exe C:/Users/nroman/PycharmProjects/Stuffz/FileRecorderVideoGrab.py Traceback (most recent call last): http://10.1.1.27/media/C1ATK26 File "C:/Users/nroman/PycharmProjects/Stuffz/FileRecorderVideoGrab.py", line 37, in <module> download_clips(response) NameError: name 'response' is not defined Process finished with exit code 1
Reply


Messages In This Thread
Trouble passing arguments - by underoathed - Nov-13-2017, 02:36 PM
RE: Trouble passing arguments - by AceScottie - Nov-13-2017, 04:02 PM
RE: Trouble passing arguments - by underoathed - Nov-13-2017, 04:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 475 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Passing writable arguments to functions. Assembler 11 1,093 Jan-15-2024, 11:32 PM
Last Post: sgrey
  Passing string functions as arguments Clunk_Head 3 1,298 Jun-15-2022, 06:00 AM
Last Post: Gribouillis
  redirect url_for passing arguments with the url Leon79 1 1,681 Jul-09-2020, 05:20 PM
Last Post: Leon79
  passing-arguments-from-one-script-to-another jacklee26 7 3,298 Apr-21-2020, 03:55 PM
Last Post: deanhystad
  Still confused about how passing arguments works RedSkeleton007 3 2,994 Apr-25-2018, 11:01 AM
Last Post: snippsat
  Functions (Arguments Passing,Changing a mutable ,Assignment to Arguments Names) Adelton 2 3,906 Mar-02-2017, 10:23 PM
Last Post: zivoni
  multiprocess passing multiple arguments double asterisk pic8690 1 5,317 Oct-23-2016, 08:51 AM
Last Post: Skaperen
  Effeciency of passing XML tree object as function arguments sandeepvl 3 5,769 Oct-13-2016, 07:58 AM
Last Post: sandeepvl

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020