Re: [Tutor] div_t

2006-01-12 Thread Kent Johnson
Burge Kurt wrote: >>divmod(...) >>divmod(x, y) -> (div, mod) > > > What is the easiest way to use div and mod seperately as an attribute like: > > if a = divmod(x,y) > > a.div or a.mod The result of calling divmod() is a two-element tuple. You access the elements by indexing: >>> a

Re: [Tutor] Finding the Index of a member of a Tuple

2006-01-12 Thread Kent Johnson
Steve Haley wrote: > Hello everyone, > > I need to do something very simple but I'm having trouble finding the > way to do it - at least easily. I have created a tuple and now need to > find the position of individual members of that tuple. Specifically, > the tuple is something like: words

Re: [Tutor] extra characters in XML

2006-01-12 Thread Ben Vinger
Thanks - it was exactly as you said --- Kent Johnson <[EMAIL PROTECTED]> wrote: > Most likely your XML file is 16-bit unicode, not > utf-8. When ascii text > is represented as unicode, every other byte will be > a null byte. That is > the extra character that shows up as a space or box > depen

Re: [Tutor] CPU Utilization

2006-01-12 Thread Alan Gauld
> shell out to perform the top command, parse the results, and report > those values to the job controller. I'd use vmstat rather than top since top is intended to run contuinuously whereas vmstat by default just returns a single line snapshot. I don't know of any native python mechanism for obt

[Tutor] (no subject)

2006-01-12 Thread David Christian
Thanks in advance for any help!How do you create a script in python...sorry to be so remedial...first script.   With my best regards always, David Christian BEGIN:VCARD VERSION:2.1 N:Christian;David FN:David Christian ([EMAIL PROTECTED]) TITLE:CRNA TEL;HOME;VOICE:9015262444 TEL;CELL;VOICE:901

Re: [Tutor] (no subject)

2006-01-12 Thread Danny Yoo
On Thu, 12 Jan 2006, David Christian wrote: > Thanks in advance for any help!How do you create a script in > python...sorry to be so remedial...first script. You might want to look at: http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/ Some of the information there is a bit outdated, b

Re: [Tutor] Finding the Index of a member of a Tuple

2006-01-12 Thread bob
At 10:52 PM 1/11/2006, Brian van den Broek wrote: >[snip] > >I assume Bob meant that tuples have no index or find method. No, Bob is sick and not thinking clearly. At 11:04 PM 1/11/2006, Terry Carroll wrote: >Does it have to be a tuple? If you make it a list, you can use index(): >[snip] At 03

Re: [Tutor] CPU Utilization

2006-01-12 Thread DS
Nico wrote: > I think that libgtop and its python binding (used in gdesklets for > example) would do the trick. > Thank you for your thoughts on that. I think in other applications this might have a shot. In this situation I am using diskless workstations with minimal configurations, so gnome li

Re: [Tutor] CPU Utilization]

2006-01-12 Thread DS
Alan Gauld wrote: >> shell out to perform the top command, parse the results, and report >> those values to the job controller. > > > I'd use vmstat rather than top since top is intended to run > contuinuously whereas vmstat by default just returns a single line > snapshot. > > I don't know of an