Delaney, Timothy (Tim) wrote:
> Nope - pretty sure that an earlier version of Python defaulted to a
> radix of 0, but it appears to default to a radix of 10 in Python 2.5.
>
> In any case, I've submitted a bug report and suggested new text for
> the documentation of int() to make it clear what ha
Carsten Haese wrote:
> On Mon, 2007-09-24 at 19:48 +0800, Delaney, Timothy (Tim) wrote:
>> Always be careful with int() incase any of the values have a leading
>> zero - check the documentation for int() carefully.
>
> Why would leading zeroes be a problem?
>
int("10")
> 10
int("010")
On Mon, 2007-09-24 at 19:48 +0800, Delaney, Timothy (Tim) wrote:
> Always be careful with int() incase any of the values have a leading
> zero - check the documentation for int() carefully.
Why would leading zeroes be a problem?
>>> int("10")
10
>>> int("010")
10
>>> int("0010")
10
>>> int("00010
On Mon, 2007-09-24 at 12:40 +0100, Robert Rawlins - Think Blue wrote:
> Woops,
>
>
>
> Spoke too soon, just wrapped them in int() and it works a charm :-D
I'm glad that you figured it out for yourself. I'd like to suggest that
you adjust your "give up and ask the list for help" threshold upwar
2007 5:10 PM
To: 'Robert Rawlins - Think Blue'; python-list@python.org
Subject: RE: Almost There - os.kill()
Woops,
Spoke too soon, just wrapped them in int() and it works a charm :-D
Rob
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
rg] On Behalf Of Robert Rawlins -
On Mon, 2007-09-24 at 12:23 +0100, Robert Rawlins - Think Blue wrote:
> os.kill(pid, 15)
>
> TypeError: an integer is required
>
>
>
> Which would suggest its passing those arguments in as the wrong data
> types to the kill command. What is the best way to convert these?
Instead of giving
Woops,
Spoke too soon, just wrapped them in int() and it works a charm :-D
Rob
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Robert Rawlins - Think Blue
Sent: 24 September 2007 12:23
To: python-list@python.org
Subject: Almost There - os.kill()
Hello Guys
Hello Guys,
Finally got around to sitting down to tidy up this script this morning but
I'm having a small syntax problem with os.kill() to kill a process on my
system. Here is the code:
def killApplication():
pid = file('/var/lock/MyApplication.lock').read().strip()