Re: [Tutor] ValueError

2011-05-03 Thread Kushal Kumaran
On Tue, May 3, 2011 at 5:31 PM, Peter Otten <__pete...@web.de> wrote: > > > Also you should make the try...except as narrow as possible > > try: >    centimeters = float(centimeters) > except ValueError as e: >    print e > > is likely to catch the float conversion while with many statements in th

Re: [Tutor] Unpack requires a string argument of length 8

2011-05-03 Thread Jim Richardson
On Mon, May 2, 2011 at 1:17 PM, Marc Tompkins wrote: > On Mon, May 2, 2011 at 12:36 PM, Susana Iraiis Delgado Rodriguez > wrote: >> >> I'm working on getting information that comes from a dbf file (database), >> this dbf file is related to another file in the system, a shapefile. My code >> is tr

Re: [Tutor] Alternate credentials

2011-05-03 Thread Bill Allen
I am running on MS Windows XP & Server 2003. Sent from my iPhone On May 3, 2011, at 12:02, Tim Golden wrote: > On 03/05/2011 5:35 PM, Bill Allen wrote: >> I am needing to run a Python networked application with a specific >> set of credentials, Windows AD, rather than the user's own so that >>

Re: [Tutor] Alternate credentials

2011-05-03 Thread Alan Gauld
"Bill Allen" wrote I am needing to run a Python networked application with a specific set of credentials, Windows AD, rather than the user's own so that the app can access the needed CIFS shares. Where should I start? Since its more a Windows question than a Python one I suggest you try

Re: [Tutor] Filtering out unique list elements

2011-05-03 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 06:20 PM, Spyros Charonis wrote: > [cat, dog, cat, cat, cat, dog, dog, tree, tree, tree, bird, bird, woods, > woods] > > I am wondering how to truncate this list so that I only print out the unique > elements, i.e. the same list but with

Re: [Tutor] Filtering out unique list elements

2011-05-03 Thread Prasad, Ramit
>>> set(['cat', 'dog', 'cat', 'cat', 'cat', 'dog', 'dog', 'tree', 'tree', >>> 'tree', 'bird', 'bird', 'woods', 'wood']) set(['woods', 'tree', 'dog', 'cat', 'wood', 'bird']) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phon

[Tutor] Filtering out unique list elements

2011-05-03 Thread Spyros Charonis
Dear All, I have built a list with multiple occurrences of a string after some text processing that goes something like this: [cat, dog, cat, cat, cat, dog, dog, tree, tree, tree, bird, bird, woods, woods] I am wondering how to truncate this list so that I only print out the unique elements, i.e

Re: [Tutor] Alternate credentials

2011-05-03 Thread Tim Golden
On 03/05/2011 5:35 PM, Bill Allen wrote: I am needing to run a Python networked application with a specific set of credentials, Windows AD, rather than the user's own so that the app can access the needed CIFS shares. Where should I start? By saying what operating system you're running on, whi

[Tutor] Alternate credentials

2011-05-03 Thread Bill Allen
I am needing to run a Python networked application with a specific set of credentials, Windows AD, rather than the user's own so that the app can access the needed CIFS shares. Where should I start? --Bill Sent from my iPhone ___ Tutor maillist - T

Re: [Tutor] ValueError

2011-05-03 Thread Johnson Tran
I am using python 2.5...and adding raw_input has fixed the issue, thank you! On May 3, 2011, at 5:01 AM, Peter Otten wrote: > Johnson Tran wrote: > >> Thanks for the replies..so I added the "try" block but it still does not >> seem to be outputting my default error message: >> >> def Conversion

Re: [Tutor] ValueError

2011-05-03 Thread Peter Otten
Johnson Tran wrote: > Thanks for the replies..so I added the "try" block but it still does not > seem to be outputting my default error message: > > def Conversion(): > try: > > print "This program converts the first value from inches to > centimeters and second value

Re: [Tutor] ValueError

2011-05-03 Thread Johnson Tran
Thanks for the replies..so I added the "try" block but it still does not seem to be outputting my default error message: def Conversion(): try: print "This program converts the first value from inches to centimeters and second value centimeters to inches." print "(1

Re: [Tutor] ValueError

2011-05-03 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 06:30 AM, Johnson Tran wrote: > Hi All, > > i am trying to create a program module with two functions (conversion inches > to centimeters then centimeter to inches, I have my program working although > I am trying to adda Value Error

Re: [Tutor] ValueError

2011-05-03 Thread Nitin Pawar
When you take input its bydefault is in string format you might want to typecast and validate teh input On Tue, May 3, 2011 at 4:00 PM, Johnson Tran wrote: > Hi All, > > i am trying to create a program module with two functions (conversion > inches to centimeters then centimeter to inches, I ha

[Tutor] ValueError

2011-05-03 Thread Johnson Tran
Hi All, i am trying to create a program module with two functions (conversion inches to centimeters then centimeter to inches, I have my program working although I am trying to adda Value Error function to my program but cannot seem to it to work: def Conversion(): print "This program con