Re: How can i do this in Python?

2007-01-26 Thread Gabriel Genellina
[EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I'm just curious, what's the advantage of using itemgetter there compared to something simpler like this (untested!)? None! -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: How can i do this in Python?

2007-01-25 Thread bearophileHUGS
Gabriel Genellina: import operator,fileinput mapper = map(operator.itemgetter, [0,1,20,21,2,10,12,14,11,4,5,6]) for line in fileinput.input(): fields = line.split() print '\t'.join(m(fields) for m in mapper) I'm just curious, what's the advantage of using itemgetter there compared

How can i do this in Python?

2007-01-24 Thread NoName
perl -ane print join(qq(\t),@F[0,1,20,21,2,10,12,14,11,4,5,6]).qq(\n) file.txt -a autosplit mode with -n or -p (splits $_ into @F) -n assume while () { ... } loop around program -- http://mail.python.org/mailman/listinfo/python-list

Re: How can i do this in Python?

2007-01-24 Thread Jerry
Well, the python interpreter has no equivalent to -n or -a in the perl interpreter. You'd have to implement it using an actual while loop and because of the indention sensitivity in Python, I don't believe you can do it on the command line. (I may be very wrong here, but I've not gotten it to

Re: How can i do this in Python?

2007-01-24 Thread Gabriel Genellina
At Thursday 25/1/2007 01:25, NoName wrote: perl -ane print join(qq(\t),@F[0,1,20,21,2,10,12,14,11,4,5,6]).qq(\n) Must be done on a single line? I'm not sure if I've got right the behavior - it's been some time since I quit writing Perl code. The script iterates over all lines contained on

Re: How can i do this in Python?

2007-01-24 Thread NoName
Thanks;) On 25 Янв., 17:47, Gabriel Genellina [EMAIL PROTECTED] wrote: At Thursday 25/1/2007 01:25, NoName wrote: perl -ane print join(qq(\t),@F[0,1,20,21,2,10,12,14,11,4,5,6]).qq(\n)Must be done on a single line? I'm not sure if I've got right the behavior - it's been some time since I

Re: How can I do this with python ?

2006-05-09 Thread Harold Fellermann
Better go for the subprocess module. It is supposed to replace os.popen and has a much nicer interface. - harold - -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I do this with python ?

2006-05-08 Thread Tim N. van der Leeuw
Your question is insufficiently clear for me to answer. Do you want to know how to read from standard-input in a Python program? Do you want to know how to start an external program from Python, and then connect something to that programs standard input? Do you want to know something else?

Re: How can I do this with python ?

2006-05-08 Thread Xiao Jianfeng
Tim N. van der Leeuw wrote: Your question is insufficiently clear for me to answer. Do you want to know how to read from standard-input in a Python program? Do you want to know how to start an external program from Python, and then connect something to that programs standard input? Do you

Re: How can I do this with python ?

2006-05-08 Thread Philippe Martin
Xiao Jianfeng wrote: Tim N. van der Leeuw wrote: Your question is insufficiently clear for me to answer. Do you want to know how to read from standard-input in a Python program? Do you want to know how to start an external program from Python, and then connect something to that programs

How can I do this with python ?

2006-05-07 Thread Xiao Jianfeng
Dear all, In a shell script, I can run a command which need interactive input like this, #!/bin/sh A_Command-EOF a b c EOF But, how can I do this with python ? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I do this in Python?

2005-11-27 Thread Jonathan Gardner
I don't know what engine you are using. Basically all you have to do is render the login form at the url of the page that needs the login. You're going to have to hook in the authentication code before you render the page normally. For instance, this is a common way I've been doing it in various

Re: How can I do this in Python?

2005-11-05 Thread Lad
Can you please explain in more details (1) choice? Thanks Regards, L -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I do this in Python?

2005-11-05 Thread Kent Johnson
Lad wrote: Can you please explain in more details (1) choice? If you are using CGI you might be interested in the VoidSpace logintools which seems to handle much of this process. See http://www.voidspace.org.uk/python/logintools.html#no-login-no-access Kent --

How can I do this in Python?

2005-11-04 Thread Lad
Hi, I have a web program and a user can have access to a page only after he logged in. So, the program comes with a Login form and the user logins.But I do not know how to return the user back to where he came from, after a successful login. Something like this: PageWhereUserMustBeLogin

Re: How can I do this in Python?

2005-11-04 Thread David Wahler
Lad wrote: Hi, I have a web program and a user can have access to a page only after he logged in. So, the program comes with a Login form and the user logins.But I do not know how to return the user back to where he came from, after a successful login. Something like this:

Re: How can I do this in Python?

2005-11-04 Thread Steve Holden
David Wahler wrote: Lad wrote: Hi, I have a web program and a user can have access to a page only after he logged in. So, the program comes with a Login form and the user logins.But I do not know how to return the user back to where he came from, after a successful login. Something like this:

Re: How can I do this in Python?

2005-11-04 Thread Leif K-Brooks
Steve Holden wrote: Another alternative might be to serve a script that sent the browser back 2 pages in its history, as long as server state hasn't changed in the meantime. What about users with JavaScript disabled? -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I do this in Python?

2005-11-04 Thread [EMAIL PROTECTED]
I strongly suggest using redirect as David Wahler suggested. A note, Mozilla type browsers don't do an excellent job sending referer. You can't really trust that header anymore. If you want to go back after login, either: (1) Render the login page INSTEAD of the normal content at the same url.