Re: check to see if value can be an integer instead of string

2006-02-06 Thread nephish
Thanks guys, No, i did not know about isdigit ? very helpful. Thanks. esp liked the "overloaded doohicky' bit. thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: check to see if value can be an integer instead of string

2006-01-18 Thread Steven D'Aprano
On Wed, 18 Jan 2006 04:23:17 -0800, nephish wrote: > it isn't really that i will want to change it to an integer anyway. the > script uses a table to reference a value to a key, if the key is a > group of letters, that code tells the script to do something. if the > value is a number, it means an

Re: check to see if value can be an integer instead of string

2006-01-18 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > it isn't really that i will want to change it to an integer anyway. the > script uses a table to reference a value to a key, if the key is a > group of letters, that code tells the script to do something. if the > value is a number, it means an equipment failure. The thi

Re: check to see if value can be an integer instead of string

2006-01-18 Thread nephish
it isn't really that i will want to change it to an integer anyway. the script uses a table to reference a value to a key, if the key is a group of letters, that code tells the script to do something. if the value is a number, it means an equipment failure. The thing is, all the values come out as

Re: check to see if value can be an integer instead of string

2006-01-18 Thread Steven D'Aprano
On Tue, 17 Jan 2006 18:02:52 -0800, nephish wrote: > Hello there, > i need a way to check to see if a certain value can be an integer. I > have looked at is int(), but what is comming out is a string that may > be an integer. Not in Python it isn't. int(value) returns an int, not a string. > i

Re: check to see if value can be an integer instead of string

2006-01-17 Thread nephish
this looks like the solution i am looking for. thanks for the education by the way. i have a couple of other try / except clauses. Never thought of pulling it off like that. thanks very much, really simple. -- http://mail.python.org/mailman/listinfo/python-list

Re: check to see if value can be an integer instead of string

2006-01-17 Thread gry
[EMAIL PROTECTED] wrote: > Hello there, > i need a way to check to see if a certain value can be an integer. I > have looked at is int(), but what is comming out is a string that may > be an integer. i mean, it will be formatted as a string, but i need to > know if it is possible to be expressed as

Re: check to see if value can be an integer instead of string

2006-01-17 Thread Brian Cole
Python uses "Exceptions" to catch these "Exceptional" situations:http://docs.python.org/tut/node10.html -Brian Cole On 17 Jan 2006 18:51:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > thanks for the reply, but wont python fail out if you try to make an > integer out of what cant be an i

Re: check to see if value can be an integer instead of string

2006-01-17 Thread nephish
thanks for the reply, but wont python fail out if you try to make an integer out of what cant be an integer? like this : var = int(abc) wont this crash ? -- http://mail.python.org/mailman/listinfo/python-list

Re: check to see if value can be an integer instead of string

2006-01-17 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Hello there, > i need a way to check to see if a certain value can be an integer. I > have looked at is int(), but what is comming out is a string that may > be an integer. i mean, it will be formatted as a string, but i need to > know if it is possible to be expressed as

check to see if value can be an integer instead of string

2006-01-17 Thread nephish
Hello there, i need a way to check to see if a certain value can be an integer. I have looked at is int(), but what is comming out is a string that may be an integer. i mean, it will be formatted as a string, but i need to know if it is possible to be expressed as an integer. like this var = some