Advertisement
Guest User

Untitled

a guest
Jul 16th, 2016
1,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. 1. Download the files to your computer, yada yada
  2. 2. Modify main.py lines 235-237 to look like this. Replace the stuff "<your_username>" with "azn_dude1" for example:
  3.  
  4. parser.add_argument("-u", "--username", help="PTC Username", default="<your_username>", required=False)
  5. parser.add_argument("-p", "--password", help="PTC Password", default="<your_password>", required=False)
  6. parser.add_argument("-l", "--location", help="Location", default="<your_location>", required=False)
  7. 3. Copy the files to /storage/emulated/0/com.hipipal/qpylus/scripts. On some Android devices, the "0" directory might be called "legacy".
  8. 4. Install the 4 packages in QPython (click on Libraries->Pip console, then type "pip install protobuf geopy requests s2sphere", no quotes.)
  9. 5. In QPython, go to Programs->click on main.py and it should work.
  10.  
  11. BONUS: To use your device's GPS coordinates to specify the location, make the following changes:
  12.  
  13. 1. Add this line to the top of the file:
  14.  
  15. import androidhelper as android
  16. 2. In the main() (around where you made the changes in the previous step 2), add these lines to the top:
  17.  
  18. droid = android.Android()
  19. droid.startLocating()
  20. myloc = droid.getLastKnownLocation()
  21. droid.stopLocating()
  22. mylat = myloc.result['gps']['latitude']
  23. mylong = myloc.result['gps']['longitude']
  24. 3. Finally, instead of "default=<your_location>" (in that last line you modified in the previous step 2), put
  25.  
  26. default=str(my_lat) + ', ' + str(mylong)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement