Live data from Hacker News

Reworder – A tale of learning Python and launching an app in five days.

sahillavingia.com

1–10 of 37 posts

Re: Reworder – A tale of learning Python and launching an app in five days.

#2
make sure you use tabs to format all of your Python code

I disagree. Idiomatic Python uses 4 spaces per indent.

Either solely use tabs or solely use spaces, they don’t work well together, at least in my experience

Mixing tabs and spaces is indeed very unwise. You can run Python with the -tt option to make sure you're consistent.

Read Style Guide for Python Code for more advice on this front

I agree ;-) The author probably refers to PEP8, http://www.python.org/dev/peps/pep-0008/

Re: Reworder – A tale of learning Python and launching an app in five days.

#5
post #4

Hey, weren't you supposed to be a designer :) That's pretty quick to go from 0 to launch in 5 days in an unknown language. Congratulations!

Designer, developer, coder, sleep-deprived. I'm a dude of many properties! :)

Re: Reworder – A tale of learning Python and launching an app in five days.

#6
Traceback (most recent call last): File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__ handler.post(*groups) File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 140, in post synonym = synonym_for_word(stripped_word, tag) File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 201, in synonym_for_word return result.get(word_type)['syn'][0] KeyError: 'syn'

Re: Reworder – A tale of learning Python and launching an app in five days.

#7
post #2

make sure you use tabs to format all of your Python code I disagree. Idiomatic Python uses 4 spaces per indent. Either solely use tabs or solely use spaces, they don’t work well together, at least in my experience Mixing tabs and spaces is indeed very unwise. You can run Python with the -tt option to make sure you're consistent. Read Style Guide for Python Code for more advice on this front I agree ;-) The author pro…

Ah yes, I'll read more into it! thanks :)

Re: Reworder – A tale of learning Python and launching an app in five days.

#8
post #3

Completely unrelated to your write up but theres a bug. In FF if I back up and resubmit it doesn't update to the new text. I still see my first submission.

Ah yes, I randomly generate a permalink on load of the page, so it uses the old permalink, hence why it loads the first submission. Any ideas on how to change this?

Re: Reworder – A tale of learning Python and launching an app in five days.

#9

    Traceback (most recent call last):
      File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__
        handler.post(*groups)
      File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 140, in post
        synonym = synonym_for_word(stripped_word, tag)
      File "/base/data/home/apps/reworder/1.345779356045891791/reworder.py", line 201, in synonym_for_word
        return result.get(word_type)['syn'][0]
    KeyError: 'syn'

Re: Reworder – A tale of learning Python and launching an app in five days.

#10
post #3

Completely unrelated to your write up but theres a bug. In FF if I back up and resubmit it doesn't update to the new text. I still see my first submission.

Ah yes, I randomly generate a permalink on load of the page, so it uses the old permalink, hence why it loads the first submission. Any ideas on how to change this?

I guess just generate the permalink in the action and redirect to that instead of having it in the form itself.

Something like:

Form: /reworder/generate

Action: Generates text, creates permalink and then redirects user to that permalink.

In the web world this pattern is common, called redirect-after-post. I'm not sure if thats much help, I've only used python in the context of the Pylons framework (and have only a few days experience with it at that). If you need more guidance let me know and I'll try and clarify.

edit: Link to redirect after post: http://en.wikipedia.org/wiki/Post/Redirect/Get

edit2: I should also say this is a pretty sweet project, sorry if I just listed criticisms.

Post reply on HN