Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Replace external 'requests' lib with urllib #2

Merged
merged 1 commit into from

2 participants

@dbr

Slightly less tidy code, but means no external dependencies.

@dbr dbr Replace external 'requests' lib with urllib
Slightly less tidy code, but means no external dependencies.
e10c3bc
@ivolo ivolo merged commit 53dae87 into from
@ivolo
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 28, 2012
  1. @dbr

    Replace external 'requests' lib with urllib

    dbr authored
    Slightly less tidy code, but means no external dependencies.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 examples/loading.py
View
5 examples/loading.py
@@ -1,7 +1,7 @@
import os
import sys
-import requests
+import urllib
from random import randint
from time import sleep
@@ -51,7 +51,8 @@ def next_frame(index=0, offset=0, reverse=False,
"terminal": terminal
}
- return requests.get(BASE_URL, params=payload).text
+ params = urllib.urlencode(payload)
+ return urllib.urlopen(BASE_URL + "?" + params).read()
class ProgressBar:
Something went wrong with that request. Please try again.