Re: Problem with string -> int conversion ?
- From: "Fredrik Lundh" <fredrik@xxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 00:33:53 +0200
Madhusudan Singh wrote:
> I am working with an application that I designed with the Designer > pyuic
> workflow and I get the following error on trying to process the contents
> of
> a combobox :
>
> Traceback (most recent call last):
> File "measure.py", line 908, in acquiredata
> np=self.getNPrange()
> File "measure.py", line 1167, in getNPrange
> signalrange=int(signalrangestr)
> TypeError: int() argument must be a string or a number
>
> The code is :
>
> void Form3::getNPrange()
> {
what language is this?
> signalrangestr=self.NPcombobox.currentText()
> signalrange=int(signalrangestr)
> if globaldebug : print 'NP Signal range = ',signalrange
> return signalrange
> }
> Isn't signalrangestr above a string ? Or at the very least, a number.
if the callback code is Python, you should be able to add a print
statement to the line just before the failing "int" call:
print repr(signalrangestr), type(signalrangestr)
signalrange = int(signalrangestr)
that print statement should be all you need to figure out what
signalrangestr really is.
</F>
.
- Follow-Ups:
- Re: Problem with string -> int conversion ?
- From: Madhusudan Singh
- Re: Problem with string -> int conversion ?
- References:
- Problem with string -> int conversion ?
- From: Madhusudan Singh
- Problem with string -> int conversion ?
- Prev by Date: Re: Precise timings ?
- Next by Date: Re: Bicycle Repair Man usability
- Previous by thread: Problem with string -> int conversion ?
- Next by thread: Re: Problem with string -> int conversion ?
- Index(es):
Relevant Pages
|
|