Re: PDB command <-> variable clashes

2011-10-08 Thread Jon Redgrave
On Oct 8, 1:18 pm, Kääriäinen Anssi wrote: > I am currently debugging the django test cases, and there are a lot of > variables names like w, q, where, condition and so on. Especially variables > like w, q, c, r are really annoying. It would be cool if pdb would detect a > clash and in that cas

Re: One line command line filter

2011-09-05 Thread Jon Redgrave
> > Am I missing something obvious? > > ls | python -c "for line in __import__('sys').stdin: print (line.upper())" Ah, so I am missing something - it is possible - but 'obvious'? Do people think it should be more accessible -- http://mail.python.org/mailman/listinfo/python-list

One line command line filter

2011-09-05 Thread Jon Redgrave
It seems unreasonably hard to write simple one-line unix command line filters in python: eg: ls | python -c " print x.upper()" to get at sys.stdin or similar needs an import, which makes a subsequent for-loop illegal. python -c "import sys; for x in sys.stdin(): print x" <<- SyntaxError Am I mi

Re: Running a Python script from crontab

2008-12-02 Thread Jon Redgrave
On Dec 2, 2:35 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: ... Try using the "screen" utility - change the line in your crontab: cd /home/myusername/src && python myscript.py to cd /home/myusername/src && screen -dmS mypthon python -i myscript.py then once cron has started your program attach