[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
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
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
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
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
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
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
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?
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
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
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
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
Can you please explain in more details (1) choice?
Thanks
Regards,
L
--
http://mail.python.org/mailman/listinfo/python-list
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
--
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
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:
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:
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
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.
19 matches
Mail list logo