Re: Newbie edit/compile/run cycle question

2007-12-17 Thread Jan Claeys
Op Mon, 10 Dec 2007 16:00:04 -0800, schreef Matimus: better written: python -mpy_compile FILENAME The -m option doesn't work in all versions of cpython (I think since v2.4, or maybe 2.3?). -- JanC -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie edit/compile/run cycle question

2007-12-11 Thread Bruno Desthuilliers
Jeremy C B Nicoll a écrit : Bruno Desthuilliers [EMAIL PROTECTED] wrote: Jeremy C B Nicoll a écrit : Figuring out how IDLE works is a bit beyond me at this stage. Did you try out, or is it just an a priori ? Sort of, no and yes... A few weeks ago I started trying to use Python

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Simon Forman
On Dec 8, 6:45 pm, Jeremy C B Nicoll [EMAIL PROTECTED] wrote: Steve Howell [EMAIL PROTECTED] wrote: --- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: What command (in XP) does one need to issue to syntaxcheck a saved python script without running it? Perhaps oversimplifying a bit,

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread MartinRinehart
Bruno, Please explain why the NOP import is a GoodThing. Use small words please. I'm not as young as I used to be. I didn't know about reload(), but now that I'm informed on that point I'm still using os.remove('foo.pyc') reload(foo) A single command to do that would be nice. Martin Bruno

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Bruno, Please explain why the NOP import is a GoodThing. Use small words please. I'm not as young as I used to be. Because otherwise every import would result in overhead without any benefit. Think of a module like this: A_GLOBAL_VARIABLE =

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Bruno, Please explain why the NOP import is a GoodThing. Use small words please. I'm not as young as I used to be. Each module that need access to another module must explicitely import it. This means that, in a typical program, your main script will import a

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Jeremy C B Nicoll
Simon Forman [EMAIL PROTECTED] wrote: On Dec 8, 6:45 pm, Jeremy C B Nicoll [EMAIL PROTECTED] wrote: Ah, I've been using IDLE so far (but would probably prefer to write Python in my normal text editor). In IDLE Alt-X syntax checks the saved copy of the file being edited (at least it seems

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Bruno Desthuilliers
Jeremy C B Nicoll a écrit : Simon Forman [EMAIL PROTECTED] wrote: On Dec 8, 6:45 pm, Jeremy C B Nicoll [EMAIL PROTECTED] wrote: Ah, I've been using IDLE so far (but would probably prefer to write Python in my normal text editor). In IDLE Alt-X syntax checks the saved copy of the file

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Matimus
python -c import py_compile; py_compile.compile(r'FILENAME') ... where FILENAME is the filename of the python script you want to check. What this does in practice is (trying to) compile the source, and any errors or warnings will be reported. better written: python -mpy_compile FILENAME

Re: Newbie edit/compile/run cycle question

2007-12-10 Thread Jeremy C B Nicoll
Bruno Desthuilliers [EMAIL PROTECTED] wrote: Jeremy C B Nicoll a écrit : Figuring out how IDLE works is a bit beyond me at this stage. Did you try out, or is it just an a priori ? Sort of, no and yes... A few weeks ago I started trying to use Python IDLE and found a bug (which I

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Arnaud Delobelle
On Dec 9, 1:26 pm, [EMAIL PROTECTED] wrote: Thanks for all the help. Thought I'd spend my newbie days right in the Python shell (there's lots to test when you're just starting) but I guess that's not going to happen. It would be a shame not to use the shell. Everyone told me to get out of

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread MartinRinehart
Thanks for all the help. Thought I'd spend my newbie days right in the Python shell (there's lots to test when you're just starting) but I guess that's not going to happen. Everyone told me to get out of the Python shell, one way or another. OK. But this means that every execution must first load

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Thanks for all the help. Thought I'd spend my newbie days right in the Python shell (there's lots to test when you're just starting) but I guess that's not going to happen. Everyone told me to get out of the Python shell, one way or another. Everyone told you to

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Thanks for all the help. Thought I'd spend my newbie days right in the Python shell (there's lots to test when you're just starting) but I guess that's not going to happen. Everyone told me to get out of the Python shell, one way or another. OK. But this means

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Jeremy C B Nicoll
Steve Howell [EMAIL PROTECTED] wrote: --- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: Steve Howell [EMAIL PROTECTED] wrote: --- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: What command (in XP) does one need to issue to syntax check a saved python script without running

Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Jan Claeys
Op Sun, 09 Dec 2007 01:11:28 +, schreef Jeremy C B Nicoll: What command (in XP) does one need to issue to syntax check a saved python script without running it? Does a syntax check report all syntax errors or just the first one found? python -c import py_compile;

Newbie edit/compile/run cycle question

2007-12-08 Thread MartinRinehart
I'm a java guy used to the effective edit/run cycle you get with a good IDE. Today I'm writing my first Python, but can't seem to find the way to use Python's inherent edit/run cycle. I edit my source, import it into Python, run it. Fine. Then I edit again, but the next import doesn't notice

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I'm a java guy used to the effective edit/run cycle you get with a good IDE. Today I'm writing my first Python, but can't seem to find the way to use Python's inherent edit/run cycle. I edit my source, import it into Python, run it. Fine. Then I edit again,

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Steve Howell
--- [EMAIL PROTECTED] wrote: What don't I know that I should know to just edit/run, preferably at the tap of a function key? Most good editors let you do these things: 1) Save a file. 2) Run a script from the shell. 3) Turn steps 1 and 2 into a macro. 4) Allow you to map the

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Steve Howell
--- Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : I'm a java guy used to the effective edit/run cycle you get with a good IDE. Today I'm writing my first Python, but can't seem to find the way to use Python's inherent edit/run cycle. Use an IDE

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Terry Reedy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | What don't I know that I should know to just edit/run, preferably at | the tap of a function key? In IDLE, which come with Python, it is F5. (See Options/General/Autosave) Startup is about .1 sec since the program runs in a window of

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Jeremy C B Nicoll
Steve Howell [EMAIL PROTECTED] wrote: There are a zillion powerful editors out there. I've been productive in EditPlus, MultiEdit, SlickEdit, vim, and emacs, just to throw out a few examples. What command (in XP) does one need to issue to syntax check a saved python script without running

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Steve Howell
--- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: Steve Howell [EMAIL PROTECTED] wrote: There are a zillion powerful editors out there. I've been productive in EditPlus, MultiEdit, SlickEdit, vim, and emacs, just to throw out a few examples. What command (in XP) does one need to issue

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Jeremy C B Nicoll
Steve Howell [EMAIL PROTECTED] wrote: --- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: What command (in XP) does one need to issue to syntax check a saved python script without running it? Perhaps oversimplifying a bit, running python does a syntax check, and if it passes, moves on

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Steve Howell
--- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: Steve Howell [EMAIL PROTECTED] wrote: --- Jeremy C B Nicoll [EMAIL PROTECTED] wrote: What command (in XP) does one need to issue to syntax check a saved python script without running it? Perhaps oversimplifying a bit,