On Jan 26, 3:04 am, Paddy <[EMAIL PROTECTED]> wrote:
> I thought a major use of an interface is to allow separate development
> that comes together at the interface. If so then such fluid interface
> changing would scupper separate development.
Yes, this wouldn't be appropriate for that particula
On Jan 24, 11:14 pm, John Nagle <[EMAIL PROTECTED]> wrote:
> How can I tell whether an object is of type Exception?
Use it as if it is one and catch any exceptions :-)
- Paddy. (Grabs coat, heads for the exit)
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 26, 5:43 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Wondering if there is a way to measure a child process's cpu usage
> (sys and user) when the child is still running. I see os.times()
> working fine in my system (Linux 2.6.9-42.7.ELsmp), but it gives valid
> data only after
On Jan 25, 11:59 pm, Paddy <[EMAIL PROTECTED]> wrote:
> On Jan 26, 5:43 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > Wondering if there is a way to measure a child process's cpu usage
> > (sys and user) when the child is still running. I see os.times()
> > working fine in my
On Jan 26, 5:03 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> While thinking about generational garbage collection, the thought of
> generational interfaces occurred to me. I'd thought I'd run it by you
> guys. I'm curious if there are any examples of this out there.
>
> I've opined on this chat ro
Hi,
I have a problem, I wanna write script to get result from web tools
http://202.120.37.186/bioinf/Gpos/index.htm
I created script like this:
#!/usr/bin/python
import urllib
def do_GposLoc(job_id,v=1):
seqOfProtein = """>P46748""".strip() + '\r\n'
seqOfProtein +=
"""MKTLSILDTIIKIPEKIEIH
That seems interesting but it's not quite what I want to do. To take
an example I would like to be able to do something similar to the
mysql shell when its pager is set to less. Displayhook is called
whenever an expression is being evaluated. I'd like to call 'less' on
the ouput of a statement.
Al
[EMAIL PROTECTED] writes:
> def posmax(seq, key=None):
> """Return the position of the first maximum item of a sequence.
> It accepts the usual key parameter too."""
> if key:
> return max(enumerate(seq), key=lambda k: key(k[1]))[0]
> else:
> return max(enumerate(seq
> Henry Baxter wrote:
> > def maxi(l):
> > m = max(l)
> > for i, v in enumerate(l):
> > if m == v:
> > return i
>
> What's about l.index(max(l)) ?
The version I use:
def posmax(seq, key=None):
"""Return the position of the first maximum item of a sequence.
It a
I think they can be called "soft interfaces" or "heuristic
interfaces", it's an example of machine learning. I think it's not
easy to apply such idea to a statically typed language, but probably
it can be done on Java. I presume in the future GUI will learn more
about the usage patterns of their us
Am 26.01.2008, 01:46 Uhr, schrieb David Erickson <[EMAIL PROTECTED]>:
>It is important to note that the header fields are not guaranteed
> to
>be in a particular order. They may appear in any order, and they
>have been known to be reordered occasionally when transported over
>the
Hi,
The term 'hashable'.
Am I right in thinking it means it can be indexed? like a string or a dict?
Thanks
Si
--
Linux user #458601 - http://counter.li.org.
--
http://mail.python.org/mailman/listinfo/python-list
Just wondering if it is possible to pass a custom class instance
instance to dict() by way of using methods like you can for iterators
(__iter__, __getitem__ etc.) I see there is no __dict__ -- is there
anything else I can use to achieve this?
Kind Regards,
Oliver
--
http://mail.python.org/mailma
On Sat, 26 Jan 2008 11:10:03 +, Simon Pickles wrote:
> Hi,
>
> The term 'hashable'.
>
> Am I right in thinking it means it can be indexed? like a string or a
> dict?
No.
A hash function is a function which takes an arbitrary object and
generates an integer from it.
Python has a built-i
On Sat, 26 Jan 2008 03:35:18 -0800, Oliver Beattie wrote:
> Just wondering if it is possible to pass a custom class instance
> instance to dict() by way of using methods like you can for iterators
> (__iter__, __getitem__ etc.) I see there is no __dict__ -- is there
> anything else I can use to ac
I ran into a very strange behaviour of raw_input().
I hope somebody can tell me how to fix this.
(Or is this a problem in the python source?)
I will explain the problem by using 3 examples. (Sorry, long email)
The first two examples are behaving normal, the thirth is
strange...
I wrote the fo
rndblnch <[EMAIL PROTECTED]> wrote:
> On Jan 25, 9:01 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>> rndblnch <[EMAIL PROTECTED]> wrote:
>> > the following example should also
>> > work:
>> > size = Point(width=23, height=45)
>> > w, h = size
>>
>> So you want the unpacking to depend on how the Po
On Jan 26, 12:01 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 26 Jan 2008 03:35:18 -0800, Oliver Beattie wrote:
> > Just wondering if it is possible to pass a custom class instance
> > instance to dict() by way of using methods like you can for iterators
> > (__iter__
> class vec2d(ctypes.Structure):
> """2d vector class, supports vector and scalar operators,
>and also provides a bunch of high level functions
>"""
> __slots__ = ['x', 'y']
>
> def __init__(self, x_or_pair, y = None):
>
> if y == None:
> self.x = x_o
nayanthara nake out
namitha hot photos
trisha bathing videos
http://www.geocities.com/terfavet/
http://www.geocities.com/terfavet/
http://www.geocities.com/terfavet/
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 26 Jan 2008 03:09:05 +, Steven D'Aprano wrote:
> On Wed, 23 Jan 2008 08:49:20 +0100, Christian Heimes wrote:
>
>> It's even
>> possible to write code with Python assembly and compile the Python
>> assembly into byte code.
>
> Really? How do you do that?
>
> I thought it might be com
trisha nake out
asin hot photos
namitha bathing videos
http://www.geocities.com/terfavet/
http://www.geocities.com/terfavet/
http://www.geocities.com/terfavet/
--
http://mail.python.org/mailman/listinfo/python-list
-On [20080125 14:07], Bruno Desthuilliers ([EMAIL PROTECTED]) wrote:
>I'm surprised you've not been flamed to death by now - last time I
>happened to write a pretty similar thing, I got a couple nut case
>accusing me of being a liar trying to spread FUD about Java vs Python
>respective VMs inner
[EMAIL PROTECTED] wrote:
> Intel processors can only process machine language[...] There's no
> way for a processor to understand any higher level language, even
> assembler, since it is written with hexadecimal codes and basic
> instructions like MOV, JMP, etc. The assembler compiler can
> conver
-On [20080126 08:31], Steven D'Aprano ([EMAIL PROTECTED]) wrote:
>The OP's code calls vec2d with a single tuple argument (0,0). Jeroen's
>version calls vec2d with two int arguments, 0 and 0.
Yes, but it was not what I intended at all.
I guess I am just a bit too used to tac
Hi friends,
How can i get system information like CPU load and RAM usage in linux.
Is there any packages for python
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 26, 7:23 am, Dox33 <[EMAIL PROTECTED]> wrote:
> I ran into a very strange behaviour of raw_input().
> I hope somebody can tell me how to fix this.
===CUT===
> *** Thirst, redirect stderr to file, STRANGE behaviour..
> From the command prompt I run:
> python script.py 2> stderr_catch.txt
Right, I've cleaned up my efforts a bit:
* tried to improve the efficiency of the 'fold' technique that I
posted earlier.
* taken on Dan's email about equivalence of expressions
* created a problem random generator
* created a little function test to time and compare various things,
and a 'ran
Paul Rubin:
> def posmax(seq, key=lambda x:x):
>return max(enumerate(seq), key=lambda k: key(k[1]))[0]
Is the Python max able to tell that's the identity function? I don't
think so, so your version may be slower and more memory hungry in the
common situation where you don't have a key function
Tim Rau <[EMAIL PROTECTED]> wrote in
news:0104616d-87be-4250-b3ef-
[EMAIL PROTECTED]
com:
> On Jan 26, 1:41 am, John Machin <[EMAIL PROTECTED]> wrote:
>> On Jan 26, 4:20 pm, Tim Rau <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > Traceback (most recent call last):
>> > File "C:\Documents and Settings\
Hi all,
I am trying to write a simple program that will accept an integral
"time" input in the HHMMSS format and output a "HH:MM:SS" form. My
code is as follows:
import string
def FormatTime(time):
'''Converts an HHMMSS string to HH:MM:SS format.'''
timeString = str
There doesn't seem to be any way to portably kill another process
in Python. "os.kill" is Mac/Unix only. The "signal" module only lets
you send signals to the current process. And the "subprocess" module
doesn't have a "kill" function.
Subprocess objects really should have a portable "i
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I am trying to write a simple program that will accept an integral
> "time" input in the HHMMSS format and output a "HH:MM:SS" form. My
> code is as follows:
>
> import string
>
> def FormatTime(ti
John Nagle wrote:
> There doesn't seem to be any way to portably kill another process
> in Python. "os.kill" is Mac/Unix only. The "signal" module only lets
> you send signals to the current process. And the "subprocess" module
> doesn't have a "kill" function.
>
> Subprocess objects re
On 1月27日, 上午1时02分, [EMAIL PROTECTED] wrote:
> Hi all,
>
> I am trying to write a simple program that will accept an integral
> "time" input in the HHMMSS format and output a "HH:MM:SS" form. My
> code is as follows:
>
> import string
>
> def FormatTime(time):
> '''Conver
[EMAIL PROTECTED] wrote:
> Hi all,
>
> I am trying to write a simple program that will accept an integral
> "time" input in the HHMMSS format and output a "HH:MM:SS" form. My
> code is as follows:
>
> import string
>
> def FormatTime(time):
> '''Converts an HHMMSS string
Hello,
Is it possible to replace one package with another at runtime, that is, I
have package a.blah which I want instead of b.blah, so I can "inject"
functionality in an existing package?
Thanks.
--
J. Pablo Fernández <[EMAIL PROTECTED]> (http://pupeno.com)
--
http://mail.python.org/mailman/l
En Fri, 25 Jan 2008 17:50:17 -0200, Paul Rubin
<"http://phr.cx"@NOSPAM.invalid> escribi�:
> Nicko <[EMAIL PROTECTED]> writes:
>> # The next line is order O(n) in the number of chunks
>> (line, fileindex) = min(mergechunks)
>
> You should use the heapq module to make this operation O(log
En Thu, 24 Jan 2008 20:49:33 -0200, Aldo Ceccarelli
<[EMAIL PROTECTED]> escribi�:
> Hi Everybody,
> TaLib (technical analysis package with function indicators coded in C/C
> ++, http://www.ta-lib.org ) has a complete library with source in C/C+
> +.
>
> I am new to SWIG (wrapper interface genera
Hi,
I have a program of about 300 lines of code that I wrote in
AutoHotKeys. I am looking for someone who might be interested in
making a little $ to help me bring this program into a mac compatable
language.
I can be reached at tim at rileyphotographic dot come
--
http://mail.python.org/ma
En Fri, 25 Jan 2008 14:46:13 -0200, Roman Bertle <[EMAIL PROTECTED]>
escribi�:
> I try to format monetary values using the locale module, python2.5:
locale.localeconv()
> {... 'mon_thousands_sep': ' '
locale.currency(1234.5678, grouping=True, symbol=False)
> '1234,57'
>
> As you can s
I am playing with wxPython 2.8.7.1 on OS X 10.4.11 with MacPython 2.5
When running the demo program, the ShapeWindow demo does not close the
window
on right click. It turns out that the wx.EVT_RIGHT_UP does not fire.
I discovered that one way to get it to fire is to bind the
wx.EVT_RIGHT_DOWN eve
I apologize for the lack of details in my last post. This time
formatting program is a piece of a larger program I am trying to write
to de-clutter GPS transmission. I have a GPS receiver that transmits
its readings via bluetooth. I've been able to use pySerial and store
X number of bytes, then
Christian Heimes wrote:
> John Nagle wrote:
>> There doesn't seem to be any way to portably kill another process
>> in Python. "os.kill" is Mac/Unix only. The "signal" module only lets
>> you send signals to the current process. And the "subprocess" module
>> doesn't have a "kill" function.
[EMAIL PROTECTED] writes:
> > def posmax(seq, key=lambda x:x):
> >return max(enumerate(seq), key=lambda k: key(k[1]))[0]
>
> Is the Python max able to tell that's the identity function? I don't
> think so, so your version may be slower and more memory hungry in the
> common situation where you
[A complimentary Cc of this posting was sent to
Summercool
<[EMAIL PROTECTED]>], who wrote in article <[EMAIL PROTECTED]>:
> so for example, it will grep for
>
> winter tire
> tire
> retire
> tired
>
> but will not grep for
>
> snow tire
> snow tire
> some snowtires
This does n
Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]
> > > nomine.org> wrote:
> > >> -On [20080126 06:26], Tim Rau ([EMAIL PROTECTED]) wrote:
>
> > >> >Line 147 reads:
> > >> >moi = cp.cpMomentForCircle(self.mass, .2, 0, vec2d((0,0)))
>
> &g
On Sat, 26 Jan 2008 12:40:26 -0800, Paul Rubin wrote:
> [EMAIL PROTECTED] writes:
>> > def posmax(seq, key=lambda x:x):
>> >return max(enumerate(seq), key=lambda k: key(k[1]))[0]
>>
>> Is the Python max able to tell that's the identity function? I don't
>> think so, so your version may be slo
The LEL mini language (there used for JRuby) seems nice, it may be
added to Tkinter:
http://ihate.rubyforge.org/profligacy/lel.html
http://ihate.rubyforge.org/profligacy/sample.html
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Joshua Kugler wrote:
> That page has a link to the Microsoft Visual C++ Toolkit 2003 page, which
> then says it's been discontinued and to use Visual C++ 2005 Express
> Edition. Sigh...
You can still find some copies of the free toolkit on the internet.
Christian
--
http://mail.python.org/mail
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Actually there is a big speed hit. Until such time that Python has a fast
> identity function, and lambda x:x isn't it, your version is about three
> times slower than Bearophile's.
Interesting. Fixing that speed hit probably needs compiler attentio
Steven D'Aprano:
> Much to my surprise, the fastest solution I've tried appears to be a pure
> Python version not even using max() at all.
That version is easy to translate to other languages and you can
probably find that Psyco makes it much faster still.
Bye,
bearophile
--
http://mail.python.o
Carl Banks <[EMAIL PROTECTED]> writes:
> On Jan 25, 6:45 pm, Ben Finney <[EMAIL PROTECTED]>
> wrote:
> > "Gabriel Genellina" <[EMAIL PROTECTED]> writes:
> > > You can also put, in animal/__init__.py:
> > > from monkey import Monkey
> > > and now you can refer to it as org.lib.animal.Monkey, but ke
En Fri, 25 Jan 2008 12:28:08 -0200, kj <[EMAIL PROTECTED]> escribi�:
> The one thing I couldn't
> find, and would greatly miss if not available, is the ability to
> set breakpoints by inserting a particular indication right in the
> code. In the Perl debugger one can insert something like the
> f
Hello Mike,
Thanks for your reply.
Since I momentarily do not have the ability to build a new python
executable, I would like to ask for your help in this case.
Are you able to supply me with a corrected version?
Friendly greetings
Rens Duijsens
On 26 jan, 16:50, Mike Kent <[EMAIL PROTECTED]> w
I am a fan of these people:
Goldie Hawn
Kate Hudson
Oliver Reed
Robert Conrad
Vic Morrow
Bill Bixby
Grant Edwards wrote:
>
> On 2006-03-02, John Salerno <[EMAIL PROTECTED]> wrote:
>
>> Since Python does so many things different, especially compared to
>> compiled and statically typed langu
I am a fan of Oliver Reeds since a toddler
HoustonJuliet wrote:
>
> I am a fan of these people:
>
> Goldie Hawn
> Kate Hudson
> Oliver Reed
> Robert Conrad
> Vic Morrow
> Bill Bixby
>
>
>
>
> Grant Edwards wrote:
>>
>> On 2006-03-02, John Salerno <[EMAIL PROTECTED]> wrote:
>>
>>> Since Py
I think the world of Oliver Reed, and I was so sad to learn about his death.
I always had a crush on Oliver Reed, and I have been a fan for over 35 years
now. I was born on June 13, 1972, and I am 35 years old.
HoustonJuliet wrote:
>
> I am a fan of Oliver Reeds since a toddler
>
> Housto
En Fri, 25 Jan 2008 15:50:29 -0200, Alan Nichols
<[EMAIL PROTECTED]> escribi�:
> It seems that for some types of user accounts (specifically regular
> users,
> not superusers or admins) MS Windows will not allow writes to the
> C:\Program
> Files directory. As a result, .py source files can
On Jan 27, 7:15 am, [EMAIL PROTECTED] wrote:
> I apologize for the lack of details in my last post.
There is nothing to apologise for. Unlike some, you gave enough
information, without prompting, to get answers to your questions.
Don't go to the other extreme :-)
> This time
> formatting program
On Jan 25, 8:52 pm, Hexamorph <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
> > Hexamorph wrote:
> >> You mean you want the ability to change for example the + operator
> >> for ints to something like calculating the cosine instead of doing
> >> addition?
>
> > Sure. Cosines are a monadic
On Jan 26, 2:58 pm, Clement <[EMAIL PROTECTED]> wrote:
> Hi friends,
> How can i get system information like CPU load and RAM usage in linux.
> Is there any packages for python
Good question.
I've just had a scout around on Google and found no "ready-made"
libraries, so it looks like you'll have
I have written a script which:
- opens a file
- does what it needs to do, periodically writing to the file... for a
few hours
- then closes the file when it's done
So my question is:
Would it be better to 'open' and 'close' my file on each write cycle?
e.g.
def writeStuff(content):
myFile = op
To answer the OP's question: GOF design patterns that solve problems due to
static typing (and there are some) are not needed with Python. Others do
apply and can be useful. There have been various mentions in c.l.p over
the years.
--
http://mail.python.org/mailman/listinfo/python-list
I believe a workaround to the bug of raw_input sending the prompt to stderr
is
print 'prompt:',
a = raw_input()
Not nice, but possibly better that waiting for a corrected binary.
--
http://mail.python.org/mailman/listinfo/python-list
Dox33 <[EMAIL PROTECTED]> writes:
> Thanks for your reply. Since I momentarily do not have the ability
> to build a new python executable, I would like to ask for your help
> in this case. Are you able to supply me with a corrected version?
You can simply choose not to use raw_input, and use sy
"Robb Lane (SL name)" <[EMAIL PROTECTED]> writes:
> ... or just leave it till it's done?
> I don't need to use the file contents until the script is done
> (although it would be nice... just to check it while it's working),
Use flush() to force the contents out at opportune times without
closing
| > > Sure. Cosines are a monadic operation and the monadic '+' is a NOP,
so
| > > why shouldn't I define +45 to return cosine of 45, (presuming I
needed
| > > lots of cosines). I'd even let you define your own operators. Lots of
| > > programmers really liked '++' and '--', for examples.
One c
I am using things like "%-20s%-60s%-10s" in tkinter listbox to make it look
like a table, with mono sized font like lucie system. But this does not work
with data contains "Les misérables", because it is unicode, and one byte is
not neccessary one character. Now how can I resolve this issue?
My
I probably should mention that what I want is to make all parts of the
string aligned, and look like table. I am not looking for other ways to make
it table-alike, but only interested in making % work with unicode -counting
characters not bytes...
--
http://mail.python.org/mailman/listinfo/pytho
On Sun, 27 Jan 2008 04:06:45 +, Peter Pei wrote:
> I probably should mention that what I want is to make all parts of the
> string aligned, and look like table. I am not looking for other ways to
> make it table-alike, but only interested in making % work with unicode
> -counting characters no
You didn't understand my question, but thanks any way.
Yes, it is true that %s already support unicode, and I did not contradict
that. But it counts the number of bytes instead of characters, and makes
things like %-20s out of alignment. If you don't understand my assertion,
please don't argue
I just sorted posts by from, and figured out that you are kind of PSF guy...
However that does not make you qualified, I care whether you are capable not
whether you have the time to spend for PSF.
Adios!
==
"Peter Pei" <[EMAIL PROTECTED]> wrote in message
For sure I can calculate the number of characters and do the padding myself,
but what's the point, and i surely hope that python does it for me.
"Peter Pei" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am using things like "%-20s%-60s%-10s" in tkinter listbox to mak
On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote:
> Yes, it is true that %s already support unicode, and I did not
> contradict that. But it counts the number of bytes instead of
> characters, and makes things like %-20s out of alignment. If you don't
> understand my assertion, please don't argu
[reformatting to bottom-post]
En Sat, 26 Jan 2008 08:26:37 -0200, Alex K <[EMAIL PROTECTED]>
escribi�:
> On 26/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> --- Alex K <[EMAIL PROTECTED]> escribió:
>>
>> > Thank you for this interesting tip. However I'm not
>> > sure to know how
>> >
Hi
We've been working on klik2, http://code.google.com/p/klikclient/, which
implements OSX like application files on linux (with applications working on
all distros), In which every user desktop application is 1 file
We've run into a bit of a problem with python apps, so while we can run a
compl
On Jan 26, 10:14 pm, [EMAIL PROTECTED] wrote:
> The LEL mini language (there used for JRuby) seems nice, it may be
> added to
> Tkinter:http://ihate.rubyforge.org/profligacy/lel.htmlhttp://ihate.rubyforge.org/profligacy/sample.html
>
> Bye,
> bearophile
Seems a good idea - I love the size of the
I have a problem which I think could be solved by using a dict as a
namespace, in a similar way that exec and eval do.
When using the timeit module, it is very inconvenient to have to define
functions as strings. A good alternative is to create the function as
normal, and import it:
def myfunc
On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote:
> You didn't understand my question, but thanks any way.
>
> Yes, it is true that %s already support unicode, and I did not
> contradict that. But it counts the number of bytes instead of
> characters, and makes things like %-20s out of alignme
80 matches
Mail list logo