python - Function call with IP address as argument -


I am working on a scraper which checks for progress for file transfers, a spicy list of IP addresses Closes when a file is completed, then I want to be removed from the sweet list of IP address and taken to a different spicy list, "complete".

Beginner:

  server = {"10.10.10.1": "", "10.10.10.2": "", "10.10.10.3": ""} skeys = Servers.keys () full = [] DEF Denith (server): If the server is in ski: full.append ("{0}". Format (server)) ServerPop ("{0}" .logging (server)) logging ('Server') to complete the list. '(Other than the' {}} to complete the list. 'Format (server) Other: logging.error (' \ '{0} \' unable to move to full list ' Format (Server))   

Desired Results: Dehnihith (10.10.10.1) Server = {"10.10.10.2": "", "10.10. 10.3 ":" "} complete = [" 10.10.10.1 "]

This is exactly what I get. The file "", line 1 slaves (10.10.10.1) ^ Syntax Error: Invalid syntax P> Alternatively, calling a function with quotation marks requires a TypeError to be an integer. Not sure how to work around it, because it looks like a simple problem like this

Extension on the quote solution:

  DIF check (server): # print "{0}" check. Format (server) logging.info ('Fetching {0}.' Format (server)) response = urllib2.urlopen ("http: //" + server + "/avicapture.html") tall = response.read () # The data string enters in HTML = Tall.rstrip () match = re.search ('in progress * (* *.%) * ', Html) if match: temp = match.group (1) result = temporary server [server] = temp if int (temp)> = 98 and int (temp)   

call this function

Tapping ("server") .

example:

  DIF check (server): Results in DNEVID ("server") DEF Denitude (server) dot_tings check (server)   

.

  check ( 10.10.10.3) ^ Syntex error: invalid syntax   

always with zero in the third set of digits ...

key is a st Ing you should do:

  Denhith ('10 .10.10.1 ')    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -