--- Steven D'Aprano wrote:
> On Sat, 26 May 2007 18:48:45 -0700, Steve Howell
> wrote:
>
> > It also has a ComplexNumber class, but I don't
> want to
> > scare away mathphobes.
>
>
> Is it as short as this one-liner?
>
> ComplexNumber = complex
>
Along the idea of not reinventing a class fr
--- Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Sat, 26 May 2007 18:48:45 -0700, Steve Howell
> wrote:
>
> > It also has a ComplexNumber class, but I don't
> want to
> > scare away mathphobes.
>
> Is it as short as this one-liner?
>
> ComplexNumber = complex
>
The "It" above refers to *t
Stefan Sonnenberg-Carstens wrote:
> Paul McGuire schrieb:
>> I'm starting a new thread for this topic, so as not to hijack the one
>> started by Steve Howell's excellent post titled "ten small Python
>> programs".
>>
>> In that thread, there was a suggestion that these examples should
>> conform to
Steven Bethard wrote:
> I just tried to upload new versions of the argparse module to PyPI, but
> it seems like I can no longer upload Windows installers:
>
> $ setup.py sdist bdist_wininst upload
> ...
> running upload
> Submitting dist\argparse-0.8.0.zip to http://www.python.org/pypi
>
En Sat, 26 May 2007 23:00:45 -0300, momobear <[EMAIL PROTECTED]> escribió:
> I feel really puzzled about fellowing code, please help me finger out
> what problem here.
>
> import threading
>
> class workingthread(threading.Thread):
> def __init__(self):
> self.quitEvent = threadi
On May 26, 2007, at 11:29 PM, [EMAIL PROTECTED] wrote:
> e.g.
rtfm = (100,100)
im.getpixel(rtfm)
--
http://mail.python.org/mailman/listinfo/python-list
Paul McGuire schrieb:
> I'm starting a new thread for this topic, so as not to hijack the one
> started by Steve Howell's excellent post titled "ten small Python
> programs".
>
> In that thread, there was a suggestion that these examples should
> conform to PEP-8's style recommendations, including
On Sat, 26 May 2007 18:48:45 -0700, Steve Howell wrote:
> It also has a ComplexNumber class, but I don't want to
> scare away mathphobes.
Is it as short as this one-liner?
ComplexNumber = complex
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
e.g.
--
http://mail.python.org/mailman/listinfo/python-list
On May 26, 9:58 pm, Paul McGuire <[EMAIL PROTECTED]> wrote:
> Out of curiosity, how does this style jibe with the latest embracing
> of Unicode identifiers? Ever tried to type an underscore on a non-US
> keyboard? I have a heck of a time finding/typing the '_' character
> when I visit our clients
I'm starting a new thread for this topic, so as not to hijack the one
started by Steve Howell's excellent post titled "ten small Python
programs".
In that thread, there was a suggestion that these examples should
conform to PEP-8's style recommendations, including use of
lower_case_with_underscore
Out of curiosity, how does this style jibe with the latest embracing
of Unicode identifiers? Ever tried to type an underscore on a non-US
keyboard? I have a heck of a time finding/typing the '_' character
when I visit our clients in Germany, but this may just be my own
personal Amerocentric issue
--- Paul McGuire <[EMAIL PROTECTED]> wrote:
> On May 26, 8:48 pm, Steve Howell
> <[EMAIL PROTECTED]> wrote:
> >
> > I'm thinking you could actually have a progression
> > from a 1 line program up to a 50-line program.
> The
> > number 50 is kind of arbitrary, but my gut says
> that
> > by a 50-l
Paul McGuire wrote:
> I ***love*** this "10 Little Programs" idea! As soon as I get a
> breathing space, I'm going to add a "10 Little Parsers" page to the
> pyparsing wiki!
>
> On May 26, 2:38 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
>>
>> Though the code should probably follow PEP 8 guide
On May 26, 8:48 pm, Steve Howell <[EMAIL PROTECTED]> wrote:
>
> I'm thinking you could actually have a progression
> from a 1 line program up to a 50-line program. The
> number 50 is kind of arbitrary, but my gut says that
> by a 50-line program, you will have demonstrated
> almost every useful co
I feel really puzzled about fellowing code, please help me finger out
what problem here.
import threading
class workingthread(threading.Thread):
def __init__(self):
self.quitEvent = threading.Event()
self.waitTime = 10
threading.Thread.__init__(self)
--- Paul McGuire <[EMAIL PROTECTED]> wrote:
> I ***love*** this "10 Little Programs" idea! As
> soon as I get a
> breathing space, I'm going to add a "10 Little
> Parsers" page to the
> pyparsing wiki!
>
Thanks. :)
I'm thinking you could actually have a progression
from a 1 line program up to
On May 27, 11:24 am, "Jack" <[EMAIL PROTECTED]> wrote:
> I'll save them in a file for further processing.
Further processing would be what?
Did you read the remainder of what I wrote?
--
http://mail.python.org/mailman/listinfo/python-list
Mathias Waack wrote:
> Andrew MacIntyre wrote:
>
>> Mathias Waack wrote:
>>> After switching my development environment to 64 bit I've got a
>>> problem with a python extension for a 32 bit application.
>> {...}
>>
>>> Ok, thats fine. So why is python complaining? Or even more
>>> interesting, wha
Paul McGuire wrote:
[...].
>
> I guess pyparsing with its mixedCase functions and attributes is
> doomed for the Dunce Corner. Too bad for BeautifulSoup, cElementTree,
> and wxPython that are also at variance with this canon of Python
> coding style. ("Modules should have short, all-lowercase nam
I'll save them in a file for further processing.
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On May 26, 6:17 pm, "Jack" <[EMAIL PROTECTED]> wrote:
>> I have tens of millions (could be more) of document in files. Each of
>> them
>> has other
>> properties in separa
I ***love*** this "10 Little Programs" idea! As soon as I get a
breathing space, I'm going to add a "10 Little Parsers" page to the
pyparsing wiki!
On May 26, 2:38 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
>
> Though the code should probably follow PEP 8 guidelines, e.g.
> under_scores inste
On Sat, 26 May 2007 23:23:19 +0200, Ivan Voras wrote:
> Is there an easy off-the-shelf way to get HTML formatting inside the
> TextArea widget?
Gtk does not support this currently, but they would love to see this
feature added into Gtk:
> http://bugzilla.gnome.org/show_bug.cgi?id=59390
It shoul
On May 26, 6:17 pm, "Jack" <[EMAIL PROTECTED]> wrote:
> I have tens of millions (could be more) of document in files. Each of them
> has other
> properties in separate files. I need to check if they exist, update and
> merge properties, etc.
And then save the results where?
Option (0) retain it in
Armağan Çelik wrote:
>>/ Have a nice day. Have a nice day.
> />/ Have a nice day.
> />/ Have a nice day.
> />/
> />/ the output is
> />/
> />/ a 4
> />/ day 4
> /
>>/ have 4
> />/ nice 4
> can you send c++ code of this output .This my homework/
>
If it's your homework, shouldn't *you* be doing
* Have a nice day. Have a nice day.
*>* Have a nice day.
*>* Have a nice day.
*>*
*>* the output is
*>*
*>* a 4
*>* day 4
*>* have 4
*>* nice 4
can you send c++ code of this output .This my homework*
--
http://mail.python.org/mailman/listinfo/python-list
Jeff Reavis wrote:
> Does python not ship with Tix for OS X? I know there was an issue with
> 2.5.0 and Tix on Windows, and upgrading to 2.5.1 fixed it.
> Unfortunately, I seem to have the same issue with OS X and 2.5.1. The
> error I get is:
>
>self.tk.eval('package require Tix')
>_tkinte
1) If you write (...) after a function name, it executes the
function(except when defining a function). And when you write (...)
after a function name it's known as a "function call":
def calc():
return 3.5
result = calc() + 2
2) Function calls are replaced in the code by the function's ret
On May 27, 5:25 am, erikcw <[EMAIL PROTECTED]> wrote:
> On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote:
> > > > I'm trying to run the following query:
> > > ...
> > > > member_id=%s AND expire_date > NOW() AND completed=1
I figured something out that succeeded in making the hostname
constant, and it allows me to run the socket programs without error.
I'm posting what I did for future seekers. This is for mac os 10.4.7:
1) In System Preferences>Sharing, there is a name entered there:
Computer Name: John S
I am getting an error with pyswip on xp that says the .dll isn't
installed as a shared library. Is there a manual way to install
the .dll as such??? prolog seems to work fine it is just the bridge
that gives an error
--
http://mail.python.org/mailman/listinfo/python-list
The problem is that in your function t is a string (one of the cards
in the list called "cards") and strings don't have the ability to use
the append method. But lists do. Therefore t.append is wrong but
cards.append works fine. (Append means "take the list you have and
add what is in the parent
On Sat, 2007-05-26 at 12:25 -0700, erikcw wrote:
> I tried adding the comma to make it a sequence - but now change.
>
> ('SELECT payment_id FROM amember_payments WHERE member_id=%s AND
> expire_date > NOW() AND completed=1 AND (product_id >11 AND product_id
> <21)', (1608L,))
> ()
>
> What else c
Hello,
I saw your post from last year about using python for a EE CAD program. What
were your conclusions? I'm thinking about converting a Java CAD program I
developed to Python with wxPython and C. I want to use C for the database
storage and manipulation and wxPython for the GUI and user scrip
On May 26, 11:19 am, bullockbefriending bard <[EMAIL PROTECTED]>
wrote:
> However, I hope someone reading this will be able to tell me that I'm
> being a total pessimist and that in fact it isn't very difficult to do
> what I want to do using SWIG. I'm not asking for a complete solution,
> more lik
Does python not ship with Tix for OS X? I know there was an issue with
2.5.0 and Tix on Windows, and upgrading to 2.5.1 fixed it.
Unfortunately, I seem to have the same issue with OS X and 2.5.1. The
error I get is:
self.tk.eval('package require Tix')
_tkinter.TclError: can't find package Ti
Hello,
I am writing this in the hopes of gathering as many programmers familiar with
the Python programming language as possible. There is a project that exists
called NVDA. NVDA is a screen reader project that is completely open source.
For those of you that may not know what a screen reader
Hi!
Is there an easy off-the-shelf way to get HTML formatting inside the
TextArea widget? I've looked at TextBuffer but it appears to have only
support for manual applying of attributes to portions of text. I don't
need anything complex, bold, italic and font-size would be enough.
--
(\__/)
(O.o
Bruno Desthuilliers wrote:
>> The error (not an exception, only the message appears and the handler
>> doesn't work):
>>
>> ** (finstall.py:7551): WARNING **: handler for 'on_button_next_clicked'
>> not callable or a tuple
>
> Is this the full message, or did you skip the preceding lines ?
The f
erikcw wrote:
> On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
>> On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote:
I'm trying to run the following query:
>>> ...
member_id=%s AND expire_date > NOW() AND completed=1 AND (product_id
>>> Shouldn't you be using the bind var
Hello all,
It has been a while, but I finally found the time to further investigate
my problems with connecting Python to a RTAI-XML server. As I cannot
tell if the problems I'm facing are caused by RTAI-XML (or more
precisely, the xmlrpc++0.7 library) or Python (xmlrpclib), I'm posting
this m
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Cameron Laird)
wrote:
> Hmmm; now you've got me curious. What *were* the first
> composite projectiles?
Fetchez la Vache!
--
http://mail.python.org/mailman/listinfo/python-list
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> Very cool! Do you mind putting this up on the Wiki
> somewhere so that we
> can link to it more easily? Maybe something like:
>
> http://wiki.python.org/moin/SimplePrograms
>
Done.
>
> Though the code should probably follow PEP 8
> guideli
I just tried to upload new versions of the argparse module to PyPI, but
it seems like I can no longer upload Windows installers:
$ setup.py sdist bdist_wininst upload
...
running upload
Submitting dist\argparse-0.8.0.zip to http://www.python.org/pypi
Server response (200): OK
Su
On May 26, 5:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On May 25, 7:55 pm, gert <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On May 26, 2:09 am, Paul McNett <[EMAIL PROTECTED]> wrote:
>
> > > gert wrote:
> > > > I made something that i was hoping it could make people happy enough
> > > >
Alexander Schmolck wrote the following on 05/25/2007 02:33 PM:
> I have no idea whether this will resolve your problem, but you could try
> updating to 0.90 (BTW what happens if you do axis([0,128,0,128])).
The problem appears to be with a matplotlibrc file. If I delete the
matplotlibrc file, th
Steve Howell wrote:
> I've always thought that the best way to introduce new
> programmers to Python is to show them small code
> examples.
>
> When you go to the tutorial, though, you have to wade
> through quite a bit of English before seeing any
> Python examples.
>
> Below is my attempt at
On May 26, 2007, at 3:17 PM, rzed wrote:
> If there were a standard Python GUI API (call it the PGA,
> say) that be the target for app developers, they wouldn't have to
> worry about the back end. The PGA would have to be flexible enough
> to handle incompatibilities among the various approaches t
On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote:
> > > I'm trying to run the following query:
> > ...
> > > member_id=%s AND expire_date > NOW() AND completed=1 AND (product_id
>
> > Shouldn't you be using the bind variable '?' ins
Brian Blais <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
[...]
> Finally, consider wax (http://zephyrfalcon.org/labs/wax.html).
> In my view, this is *exactly* what python needs, and its not
> being maintained anymore as far as I can tell. What I like
> about it is:
>
> 1) it is smal
On 11:43 Sat 26 May , Steve Howell wrote:
> I've always thought that the best way to introduce new
> programmers to Python is to show them small code
> examples.
>
> When you go to the tutorial, though, you have to wade
> through quite a bit of English before seeing any
> Python examples.
>
On 5/26/07, Steve Holden <[EMAIL PROTECTED]> wrote:
> I have taken the liberty of copying this back to the list, since other
> people may have stringer opinions than I on your approach.
>
> Frankly, I wouldn't worry about the "expense" of declaring two classes.
> If you need SQL-handling and XML-h
I've always thought that the best way to introduce new
programmers to Python is to show them small code
examples.
When you go to the tutorial, though, you have to wade
through quite a bit of English before seeing any
Python examples.
Below is my attempt at generating ten fairly simple,
represen
On May 25, 3:55 pm, William Chang <[EMAIL PROTECTED]> wrote:
> Is the different behavior between __repr__ and __str__ intentional
> when it comes to printing lists? Basically I want to print out a list
> with elements of my own class, but when I overwrite __str__, __str__
> doesn't get called but i
On May 26, 7:47 am, Roel Schroeven <[EMAIL PROTECTED]>
wrote:
> mosscliffe schreef:
>
> > for x,y in map("N/A", lista, listb): ## Fails - Can not call a
> > 'str'
> > print "MAP:", x, "<>", y
>
> > def fillwith(fillchars):
> > return fillchars
>
> > for x,y in map(fillwith("N/A"), l
In article <[EMAIL PROTECTED]>,
Hendrik van Rooyen <[EMAIL PROTECTED]> wrote:
.
.
.
>2) That the old NATO round (.308 Winchester) travels at
>around 2500 fps. - and this was some forty years ago,
>when I did my stint of milit
In article <[EMAIL PROTECTED]>,
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>On Sun, 6 May 2007 10:15:26 +0200, "Hendrik van Rooyen"
><[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>
>> A rifle bullet can travel at around 5000 feet per second.
>
> You've got some fast ri
In article <[EMAIL PROTECTED]>,
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
.
.
.
>> Did you know that the first military smokeless powder
>> round was for the French Lebel? - It threw a bronze
>> ball, and could punch throu
In article <[EMAIL PROTECTED]>,
Wildemar Wildenburger <[EMAIL PROTECTED]> wrote:
.
.
.
>Good God! Is there *anything* that python does not already do? I hardly
>feel the need to write programs anymore ...
>Its really 80% like
Jack wrote:
> "John Nagle" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Jack wrote:
>>> I need to process large amount of data. The data structure fits well
>>> in a dictionary but the amount is large - close to or more than the size
>>> of physical memory. I wonder what will h
Paul Boddie wrote:
> Ron Adam wrote:
>> Reseting the default browser with the gnome default application window
>> confirmed this. The browser selection can either have the quotes around
>> the args "%s" paremteter, or not depending on how and what sets it.
>>
>> Seems to me it should be quoted unl
kaens wrote:
> Thanks a lot. What actually got me started on this whole thing was a
> mention in pythons tutorial on classes that you could conditionally
> create classes (which you can).
>
> Anyhow, yes this is cleared up.
>
> I'll probably go with using inheritance for this, as it makes sense
>
Thanks a lot for all the responses
--
http://mail.python.org/mailman/listinfo/python-list
Andrew MacIntyre wrote:
> Mathias Waack wrote:
>> After switching my development environment to 64 bit I've got a
>> problem with a python extension for a 32 bit application.
>
> {...}
>
>> Ok, thats fine. So why is python complaining? Or even more
>> interesting, what do I have to do to compile
> No, it removes the association between the name 'item' and the object it is
> currently bound to. In CPython, removing the last such reference will
> cause the object to be gc'ed. In other implementations, actual deletion
> may occur later. You probably should close the files directly and arra
On May 25, 7:55 pm, gert <[EMAIL PROTECTED]> wrote:
> On May 26, 2:09 am, Paul McNett <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > gert wrote:
> > > I made something that i was hoping it could make people happy enough
> > > so i could make a living by providing support for commercial use of
> > >http:/
Thank you all very much.
I particularily found Roel's explanation and example most useful.
At this stage I am getting my head around syntax, rather than language
theory, although I know, I have to understand that as well.
Thanks again.
Richard
On 26 May, 12:47, Roel Schroeven <[EMAIL PROTECTED
mosscliffe schreef:
> for x,y in map("N/A", lista, listb): ## Fails - Can not call a
> 'str'
> print "MAP:", x, "<>", y
>
> def fillwith(fillchars):
> return fillchars
>
> for x,y in map(fillwith("N/A"), lista, listb): ## Fails also -
> Can not call a 'str'
> print "MA
In <[EMAIL PROTECTED]>, mosscliffe
wrote:
> for x,y in map(None, lista, listb): # Also fine - extends as
> expected
> print "MAP:", x, "<>", y
>
> for x,y in map("N/A", lista, listb): ## Fails - Can not call a
> 'str'
> print "MAP:", x, "<>", y
>
> def fillwith(fillchars):
>
On May 26, 4:54 am, mosscliffe <[EMAIL PROTECTED]> wrote:
> I thought I had the difference between 'zip' and 'map' sorted but when
> I try to fill missing entries with something other than 'None'. I do
> not seem to be able to get it to work - any pointers appreciated.
>
> Richard
>
> lista = ['a1'
I thought I had the difference between 'zip' and 'map' sorted but when
I try to fill missing entries with something other than 'None'. I do
not seem to be able to get it to work - any pointers appreciated.
Richard
lista = ['a1', 'a2']
listb = ['b10', 'b11','b12' ,'b13']
for x,y in zip(lista, lis
In <[EMAIL PROTECTED]>, Jack wrote:
> I have tens of millions (could be more) of document in files. Each of them
> has other properties in separate files. I need to check if they exist,
> update and merge properties, etc.
> And this is not a one time job. Because of the quantity of the files, I
>
"Sebastian Bassi" <[EMAIL PROTECTED]> writes:
> I would like to remove the namespace information from my elements and
> have just the tag without this information. This
> "{http://uniprot.org/uniprot}"; is preapended into all my output.
> I understand that the solution is related with "_namespace_
I've done all the requisite profiling and thought fairly deeply about
the efficiency of my python code, but am still going to have to speed
up the innermost guts of what I am doing.
Essentially, I need to pass a list of 6-tuples containing only
integers to my new sadly necessary super-fast compile
On May 25, 7:44 pm, kaens <[EMAIL PROTECTED]> wrote:
> So, I have a class that has to retrieve some data from either xml or
> an sql database.
> This isn't a problem, but I was thinking "hey, it would be cool if I
> could just not define the functions for say xml if I'm using sql", so
> I did some
Hi,
Thanks for both suggestions.
I have indeed tried gmpy. For me, it's not very important to choose between
numpy or gmpy.
I hope I won't be off topic. But, as I told you before, I have a C library
using "long double" numbers and I would like to be able to use it in Python.
I try to build a
If swap memery can not handle this efficiently, I may need to partition
data to multiple servers and use RPC to communicate.
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 25 May 2007 11:11:28 -0700, "Jack" <[EMAIL PROTECTED]>
> declaimed the following i
I suppose I can but it won't be very efficient. I can have a smaller
hashtable,
and process those that are in the hashtable and save the ones that are not
in the hash table for another round of processing. But chunked hashtable
won't work that well because you don't know if they exist in other chu
I have tens of millions (could be more) of document in files. Each of them
has other
properties in separate files. I need to check if they exist, update and
merge properties, etc.
And this is not a one time job. Because of the quantity of the files, I
think querying and
updating a database will
On 2007-05-25, 18:28 GMT, John J. Lee wrote:
> Not sure whether you know this already, but module mailbox in
> Python 2.5 supports writing mbox folders. If it's not 2.4
> compatible, it's fairly likely to be an easy backport.
Cool! Thanks a lot.
One more reason why to upgrade to Fedora Core 7
XiaQ wrote:
> You can use DOM
> http://diveintopython.org/, Chapter 9
> "ashish" wrote
>> Hi All,
>>
>> I want to know weather is there any api available in python for parsing
>> xml(XML parser)
>>
>> Regards
>> Ashish
Sure, you can use DOM, but if you want to get real work done with XML, lxml is
On 26 May 2007 00:23:32 -0700, mark <[EMAIL PROTECTED]> wrote:
> Hi I am trying to get a piece of code to work based on an exercise in
> a book. Any help appreciated. Can someone please explain what is going
> on here.
>
> I am trying to read from a text file a list of cards with the
> following fo
You can use DOM
http://diveintopython.org/, Chapter 9
"ashish" wrote
> Hi All,
>
> I want to know weather is there any api available in python for parsing
> xml(XML parser)
>
> Regards
> Ashish
>
--
http://mail.python.org/mailman/listinfo/python-list
Hi I am trying to get a piece of code to work based on an exercise in
a book. Any help appreciated. Can someone please explain what is going
on here.
I am trying to read from a text file a list of cards with the
following format and sort firstly by suit and then by rank
h 1
d 2
c 5
s 9
h2
d3
etc
Jack wrote:
> I need to process large amount of data. The data structure fits well
> in a dictionary but the amount is large - close to or more than the size
> of physical memory. I wonder what will happen if I try to load the data
> into a dictionary. Will Python use swap memory or will it fail?
>
"Karim Ali" wrote:
> Hi,
>
> Simple question. Is it possible in python to write code of the type:
>
> -
> while not eof <- really want the EOF and not just an empty line!
readline() reads to the next newline - an empty line *is* EOF -
a blank line has at least a
86 matches
Mail list logo