Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Dec 16, 2012
fuho fuho Fixed 2 code mistakes in examples + embetterment 4c3672d
Commits on Dec 20, 2012
Paddy paddyforan Merge pull request #265 from fuho/patch-1
Fixed 2 code mistakes in examples + embetterment
9228ae6
Showing with 7 additions and 7 deletions.
  1. +7 −7 worker/languages/python/index.md
14 worker/languages/python/index.md
View
@@ -64,18 +64,18 @@ parse it as JSON.
In your worker:
{% highlight python %}
-payload = None
+import sys, json
+
payload_file = None
+payload = None
+
for i in range(len(sys.argv)):
if sys.argv[i] == "-payload" and (i + 1) < len(sys.argv):
- payload_file = sys.argv[i]
+ payload_file = sys.argv[i + 1]
+ with open(payload_file,'r') as f:
+ payload = json.loads(f.read())
break
-f = open(payload_file, "r")
-contents = f.read()
-f.close()
-
-payload = json.loads(contents)
{% endhighlight %}
### Environment

No commit comments for this range

Something went wrong with that request. Please try again.