Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: for-loop on cmd-line

Thread Tools

Re: for-loop on cmd-line

Gisle Vanem
Posts: n/a
"Dave Angel" <(E-Mail Removed)> wrote:

> it has nothing to do with being on a command line. You're using
> semicolon to combine several statements, and there are restrictions on
> what can be combined that way. One restriction is the looping
> constructs, for, if, while.

Ok, I suspected something like that.

> You can do it easily enough with a list comprehension. Let us know if
> you can't work that out.

Later. I'm only scratching the surface of Python.

> Any reason why you don't just make a one-file python script, and run
> that instead of your one line batch file?

I though of calling that python line from a C-program using
popen() and parsing the output. Since popen() on Win32 AFAIK doesn't accept
multiple lines, I guess I must write a .py-file to %TEMP first.

Thank to all.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off