Hacker News new | past | comments | ask | show | jobs | submit | more dgulino's comments login

fyi: This requires django 1.4. I ran w/1.3.1 and got this error when running the helloworld example:

ImportError: No module named wsgi

I updated to 1.4.5 and it worked fine.


There are a few scripts that facilitate the use of python on the command line:

https://gist.github.com/dgulino/4750088 (mine)

http://code.activestate.com/recipes/437932-pyline-a-grep-lik...


Similar Perl/Awk syntax for Python one-liners with BEGIN/END: http://code.activestate.com/recipes/577075-pyliner-script-to...


The -e is what tells perl that "this is code, not a filename." One I regularly use (with perl) that doesn't seem to be mentioned yet is -p -i -e to inline modify files line-by-line. This is very nice for global search/replace actions on files found via find, grep or ack.


Yup, -i is very very useful, though I prefer to always call it as -i.bak (=> do the edit in place and make a backup of the original file as "filename.original.bak"), in case I do something hideously wrong.

For what it's worth (you may know this but maybe not everyone does), Ruby also provides the -i flag.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: