Home > other >  Python for a timestamp
Python for a timestamp

Time:09-29

Have the following format text files, the first number is the order id, the second string is the driver id, behind the third string is a timestamp, respectively is the longitude and latitude

Organize genuflect is begged the code of the document

CodePudding user response:

 
Coding jianzhi=[" order ", "the driver ID", "time stamp", "longitude" and "latitude"]
Kongbiao=[]
Path=""//r file location
With the open (path, "a") as f:
Neirongs=f.r eadlines

For I in neirongs:
Xinbiao=i. plit () ", "
Zidianhua=dict (zip (jianzhi, xinbiao))
Kongbiao. Append (zidianhua)
Print (kongbiao)



CodePudding user response:

 
Coding jianzhi=[" order ", "the driver ID", "time stamp", "longitude" and "latitude"]
Kongbiao=[]
Path=""//r file location
With the open (path, "r") as f:
Neirongs=f.r eadlines

For I in neirongs:
Xinbiao=i. plit () ", "
Zidianhua=dict (zip (jianzhi, xinbiao))
Kongbiao. Append (zidianhua)
Print (kongbiao)



  • Related