getting stuff from file and displaying on screen
Psybar Phreak
psybar_phreak at yahoo.com
Mon May 5 18:33:16 EDT 2003
RE: getting stuff from file and displaying on screenonly prob is, the file is not always "user1.dat" - it can change depending on the user
what i was ultimatel looking for, was a way to pass the usernumber from one script on the login page to the "welcome' page (never done it - but its where you go something like "welcome.cgi?id=3" or something like that...
thanks
"Batista, Facundo" <FBatista at uniFON.com.ar> wrote in message news:mailman.1052144899.2138.python-list at python.org...
#- im saving to file the user's details in the format
#- ID
#- firstName
#- lastName
#- email
Each info in a separated line?
If yes:
#- in a file called user1.dat
datafile = open("user1.dat", "r") # open the file
alllines = datafile.readlines() # read all the lines
datafile.close() # remember always to close the file
firstname = alllines[1] # we get the second line
print "Hi %s" %firstname # just output the info
Hope this works for you...
Facundo
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADVERTENCIA
La información contenida en este mensaje y cualquier archivo anexo al mismo, son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por la ley.
Si Ud. No es uno de los destinatarios consignados o la persona responsable de hacer llegar este mensaje a los destinatarios consignados, no está autorizado a divulgar, copiar, distribuir o retener información (o parte de ella) contenida en este mensaje. Por favor notifíquenos respondiendo al remitente, borre el mensaje original y borre las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo.
Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones Personales S.A. o alguna empresa asociada.
Los mensajes electrónicos pueden ser alterados, motivo por el cual Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación cualquiera sea el resultante de este mensaje.
Muchas Gracias.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030506/a1b123d3/attachment.html>
More information about the Python-list
mailing list