assigning a value to input data (scanf-ish)????

Emile van Sebille emile at fenx.com
Thu May 4 11:09:46 EDT 2000


Take a look at raw_input, eg:

name = raw_input("Name: ")

HTH

Emile van Sebille
emile at fenx.com
-------------------


----- Original Message -----
From: Shaun <shogan at iel.ie>
To: python <python-list at cwi.nl>
Sent: Thursday, May 04, 2000 6:47 AM
Subject: assigning a value to input data (scanf-ish)????


>
> right,
> what i wanna do is...
> print to the screen:
> ('please enter yer name:')
> here i want to take the name the user entered and assign a value, say
'name'
> to it
> ('please enter yer number')
> here i want to take the name the user entered and assign a value, say
'num'
> to it
> ('please enter yer email:')
> same
> ('please enter yer address:')
> same
> ('please enter the cost:')
> same
>
> then using the xdrlib module i want to pack all the info together to
make a
> single byte data stream....like....
>
> import xdrlib
> p=xdrlib.Packer()
> p.pack_string(name)
> p.pack_int(num)
> p.pack_string(email)
> p.pack_string(add)
> p.pack_float(cost)
>
> so how do i keep the value entered by the user in the memory with the
value
> name, num ect.... assigned to it and will the way i have this
structured
> work?
>
> thanks
> Shaun
> =====================
> Shaun Hogan
> Interactive Enterprise Ltd.
> alt. E-mail : shaun_hogan at yahoo.com
> +353 86 8342529
>
>
>
>
> --
> http://www.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list