Re: Cheese Shop: some history for the new-comers

2006-03-11 Thread Mike C. Fletcher
A.M. Kuchling wrote: > On Sat, 11 Mar 2006 16:50:26 +1100, > richard <[EMAIL PROTECTED]> wrote: > >> So I did what people always do in this situation, I asked Barry Warsaw to >> name. it. And he did, "Cheese Shop". I liked the name, so it was done. When >> the new pydotorg machines went l

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread Sullivan WxPyQtKinter
I have Google the whole thing and find another way for alternative implementation of getting the function's name. But all they returns are just strings. If I would like to refer to the function object in order to call it recursively, what shall I do then? -- http://mail.python.org/mailman/listinf

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread Duncan Booth
Sullivan WxPyQtKinter wrote: > I have Google the whole thing and find another way for alternative > implementation of getting the function's name. But all they returns are > just strings. If I would like to refer to the function object in order > to call it recursively, what shall I do then? > a

Re: Why property works only for objects?

2006-03-11 Thread Michal Kwiatkowski
Alex Martelli napisał(a): obj.__dict__ > {} > > ...the presence of '__dict__' as an entry in C is confusing the issue, > because that's what you get in this case as obj.__dict__. It still bugs me. What's the actual procedure when doing attribute assignment? I understand it like this: obj.at

Dictionary project

2006-03-11 Thread brandon.mcginty
Hi All, First, I hope this post isn't against list rules; if so, I'll take note in the future. I'm working on a project for school (it's not homework; just for fun). For it, I need to make a list of words, starting with 1 character in length, up to 15 or so. It would look like: A B C d E F G ...

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread Kay Schluehr
Sullivan WxPyQtKinter wrote: > So how > could I refer to the function object per se, in the body of the > function itself? Just use the name. def f(): print f.__name__ >>> f() f -- http://mail.python.org/mailman/listinfo/python-list

Re: Attaching files in windows using Python.

2006-03-11 Thread Roger Upole
You might want to try using win32gui.GetOpenFileNameW. It uses keyword arguments and doesn't require that you build a struct yourself: win32gui.GetOpenFileNameW(File='myfile.txt', Filter='Texts and scripts\0*.txt;*.py\0Py stuff\0*.py\0') Roger "sri2097" <[EMAIL PROTECTED]> wrote in message

Re: Why property works only for objects?

2006-03-11 Thread Alex Martelli
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote: ... > Alex Martelli napisa?(a): > obj.__dict__ > > {} > > > > ...the presence of '__dict__' as an entry in C is confusing the issue, > > because that's what you get in this case as obj.__dict__. > > It still bugs me. What's the actual procedur

Re: API/C memory mananegemnt problem

2006-03-11 Thread plahey
This exactly what I was thinking. Are we wrong Alex? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why property works only for objects?

2006-03-11 Thread Shalabh Chaturvedi
Michal Kwiatkowski wrote: > Alex Martelli napisał(a): > obj.__dict__ >> {} >> >> ...the presence of '__dict__' as an entry in C is confusing the issue, >> because that's what you get in this case as obj.__dict__. > > It still bugs me. What's the actual procedure when doing attribute > assignme

Re: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?

2006-03-11 Thread Tim Peters
[robert] > ... > PS: how does ZODB work with this kind of problem? I thought is uses cPickle? It does. Each thread in a ZODB application typically uses its own connection to a database. As a result, each thread gets its own consistent view of database objects, which can (and routinely does) vary

Re: Dictionary project

2006-03-11 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > Hi All, > First, I hope this post isn't against list rules; if so, I'll take note in > the future. > > I'm working on a project for school (it's not homework; just for fun). > For it, I need to make a list of words, starting with 1 character in length, > up to 15 or so.

Re: Help Create Good Data Model

2006-03-11 Thread mwt
fumanchu: Interesting. I'm trying to understand atomicity. Also, since I want this class to work using the Observer pattern, I've complicated things, as shown below. I'll look into Dejavu for persistence (although most of the basic values are persisted elsewhere, so this app will mainly need only i

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread Sullivan WxPyQtKinter
I am sorry but you misunderstood my idea. What I want is a generalized method to print out the function name, or refer to the name of a function. If I use f.__name__, I think I should just use print "f" to save my keyboard. What I expect is using a method, or attribute, or another function to get t

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread James Stroud
Sullivan WxPyQtKinter wrote: If I would like to refer to the function object in order > to call it recursively, what shall I do then? I think the question is too simple. You can just refer to the function by its name. Here is an example: py> def f(start, end): ... if start >= end: ... pri

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-11 Thread robert
Alex Martelli wrote: > robert <[EMAIL PROTECTED]> wrote: >... > >>99.99% no. I would have to use a lock everywhere, where I add or remove >>something into a dict or list of the struct. Thats not the purpose of >>big thread locks. Such simple operations are already atomic by the >>definition

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-11 Thread Felipe Almeida Lessa
Em Sáb, 2006-03-11 às 23:44 +0100, robert escreveu: > > Farwell and best of luck in finding other languages which support > > threads in a way that is more to your liking than Python -- maybe Ruby > > suits you, I don't know for sure though. > > I looked several times on Ruby, but stay with Python

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread James Stroud
Sullivan WxPyQtKinter wrote: > I am sorry but you misunderstood my idea. > What I want is a generalized method to print out the function name, or > refer to the name of a function. If I use f.__name__, I think I should > just use print "f" to save my keyboard. What I expect is using a > method, or

Re: Why property works only for objects?

2006-03-11 Thread Michal Kwiatkowski
Shalabh Chaturvedi napisał(a): > Here is a step-by-step description of what happens when you set or get > an attribute on an object: > > http://cafepy.com/article/python_attributes_and_methods/ch01s05.html This description doesn't take __getattr__/__getattribute__/__setattr__ in count. mk -- .

Re: why "g".count('')==2 ?

2006-03-11 Thread James Stroud
Steven D'Aprano wrote: > On Sat, 11 Mar 2006 13:37:05 +0100, Fredrik Lundh wrote: > > >>"ygao" wrote: >> >> >>>my question is as title! >> >>my answer as code: >> >> >s = "g" >t = "" >s[0:0+len(t)] == t >> >>True >> >s[1:1+len(t)] == t >> >>True > > > > Or in other words, imagi

Re: How to refer to the function object itself in the function per se?

2006-03-11 Thread Kay Schluehr
Sullivan WxPyQtKinter wrote: > I am sorry but you misunderstood my idea. > What I want is a generalized method to print out the function name, or > refer to the name of a function. If I use f.__name__, I think I should > just use print "f" to save my keyboard. What I expect is using a > method, or

Re: Mutable complex numbers [was Re: output formatting for classes]

2006-03-11 Thread Schüle Daniel
Steven D'Aprano wrote: > On Fri, 10 Mar 2006 02:19:10 +0100, Schüle Daniel wrote: > > >>yeah, i miss some things in complex implementation >>for example c=complex() >>c.abs = 2**0.5 >>c.angle = pi/2 >> >>should result in 1+1j :) > > > Smiley noted, but consider: > > c = complex() > => what is

Re: Why property works only for objects?

2006-03-11 Thread Michal Kwiatkowski
Alex Martelli napisał(a): >> It still bugs me. What's the actual procedure when doing attribute >> assignment? I understand it like this: >> >> obj.attr = value >> * if instance class has __setattr__, call it >>* else: if class has an attribute with name "attr" check if it's a >> descript

Re: Dictionary project

2006-03-11 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > First, I hope this post isn't against list rules; if so, I'll take note > in > the future. > > I'm working on a project for school (it's not homework; just for fun). > For it, I need to make a list of words, starting with 1

Re: Help Create Good Data Model

2006-03-11 Thread mwt
Well, thank the gods for unit testing. Here's the fah_data module with fewer errors: import copy, threading, observable class FAHData(observable.Observable): """The data model for the [EMAIL PROTECTED] monitor.""" def __init__(self): observable.Observable.__init__(self) s

Python IDE: great headache....

2006-03-11 Thread Sullivan WxPyQtKinter
IDLE is no longer satisfactory for me. Other IDEs make me very confused. Really do not know which one to use. I use WinXP sp2 for current development. So far as I know, Eclipse + PyDev + PyDev Extension is perfect for source code editing. Since I am really not sure how to use the debugger module,

Re: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?

2006-03-11 Thread robert
EleSSaR^ wrote: > robert si è profuso/a a scrivere su comp.lang.python tutte queste > elucubrazioni: > > >>own deepcopy: thus, do you already know if the existing deepcopy has the >>same problem as cPickle.dump ?(as the problem araises rarely, it is >>difficult for me to test it out) > >

Re: Dictionary project

2006-03-11 Thread Ben C
On 2006-03-11, Michael Spencer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> Hi All, >> First, I hope this post isn't against list rules; if so, I'll take note in >> the future. >> >> I'm working on a project for school (it's not homework; just for fun). >> For it, I need to make a list

Re: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?

2006-03-11 Thread robert
Tim Peters wrote: > [robert] > >>... >>PS: how does ZODB work with this kind of problem? I thought is uses cPickle? > > > It does. Each thread in a ZODB application typically uses its own > connection to a database. As a result, each thread gets its own > consistent view of database objects,

Re: Python IDE: great headache....

2006-03-11 Thread Rene Pijlman
Sullivan WxPyQtKinter: >I hope that an IDE should be featured with: I use WingIDE 2.1.0 (beta1) and I'm pleased with it. >1. Grammar Colored highlights. Yes, Wing does that. >2. Manage project in a tree view or something alike, ie, a project file >navigator. Yes. >3. Code collapse and foldin

Re: Which GUI toolkit is THE best?

2006-03-11 Thread Michael Ekstrand
On Sat, 11 Mar 2006 00:07:52 +0100 Alan Franzoni <[EMAIL PROTECTED]> wrote: > > again to make a choice is difficult; is there also some guy liking > > pyqt is it worse or should it be avoided because of the licencing > > policy for qt (which I also like..)? > > > > * Which one is the most fun

Jython

2006-03-11 Thread rtilley
Is development still going on with Jython? Version 2.1 came out in 2001 and it's still the most current stable release. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Global Lock for Python Threading ? - Re: "RuntimeError: dictionary changed ...

2006-03-11 Thread robert
robert wrote: > > Guess it would be more wise to not expose deepcopy, cPickle.dump etc. to > this kind of RuntimeError unnecessarily. > The speed gain of the iterator-method - if any - is minor, compared to > the app crash problems, which are not easy to discover and work-around > (because they

Re: Python IDE: great headache....

2006-03-11 Thread Michael Ekstrand
On Sun, 12 Mar 2006 01:03:36 +0100 Rene Pijlman <[EMAIL PROTECTED]> wrote: > >5. Debugging: Breakpoints, conditional pause. watch for > >variables.step into, over and out of a function. > > Yes. I'll second the recommendation of Wing's debugging. Best debugger I've seen, any language, period. Onl

IOS-style command line interface module?

2006-03-11 Thread David Wilson
Hi folks, I seem to remember seeing a module some time in the distant past that provided an API for implementing Cisco IOS-like command line interfaces. I can't for the life of me find a reference to it on Google now. Does anyone know what I'm talking about? Thanks, David. -- http://mail.pyt

Re: Help Create Good Data Model

2006-03-11 Thread Carl Banks
mwt wrote: > def get_data(self, key): > """Returns a COPY of data element.""" > try: > self.mutex.acquire() > return copy.deepcopy(self.data[key]) > finally: > self.mutex.release() self.mutex.acquire() should be outside the try bloc

Re: Help Create Good Data Model

2006-03-11 Thread fumanchu
I didn't say that right. As long as you are using deepcopy (or any operation which might iterate over the keys or values in self.data), your setter methods need that mutex, *and* it should probably be a threading.Lock, not an RLock, just in case that iteration ends up mutating the dict somehow. You

anonymous memory mapping

2006-03-11 Thread Fabiano Sidler
Hi folks! Is there any way to use anonymous memory mapping in python, versions earlier than 2.5? Greetings, F. Sidler -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary project

2006-03-11 Thread Michael Spencer
> [EMAIL PROTECTED] wrote: ... >> I'm working on a project for school (it's not homework; just for fun). >> For it, I need to make a list of words, starting with 1 character in length, >> up to 15 or so. >> It would look like: >> >> A B C d E F G ... Z Aa Ab Ac Ad Ae Aaa Aab Aac ... >> If there is

Re: Dictionary project

2006-03-11 Thread Ben C
> So here's a different approach, which I think does meet the spec: > > from itertools import tee > def allwords2(alphabet="abcd", maxlen = 4): > def wordgen(): > for char in alphabet: > yield char > for partial in allwordstee[1]: > if len(partial) =

Re: Cheese Shop: some history for the new-comers

2006-03-11 Thread Peter Decker
On 3/11/06, Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > I realise it's an incredibly boring name, but what about pronouncing it > as "the package index" or "the Python Package Index". Spelling it > "PyPI" if one insists on a very short name in some written context is > fine, but try not to use

Re: Python IDE: great headache....

2006-03-11 Thread Don Taylor
Sullivan WxPyQtKinter wrote: > IDLE is no longer satisfactory for me. Other IDEs make me very > confused. Really do not know which one to use. > > I use WinXP sp2 for current development. > > So far as I know, Eclipse + PyDev + PyDev Extension is perfect for > source code editing. Since I am real

Re: API/C memory mananegemnt problem

2006-03-11 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > This exactly what I was thinking. > > Are we wrong Alex? Nope, you're not -- since ints aren't "immortal" (but rather limited to being reused as other ints), then, if at no _other_ place in your program do you ever need to be storing N ints at the same time, looping

Re: Why property works only for objects?

2006-03-11 Thread Alex Martelli
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote: ... > Can you also check my reasoning for getting attributes? > > value = obj.attr > * if instance class has __getattribute__, call it > * else: lookup "attr" in all parent classes using class __mro__; > if it's a descriptor call its __get__

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-11 Thread Alex Martelli
robert <[EMAIL PROTECTED]> wrote: ... > What? When I add/del an item to a dict or list, this is not an atomic > thread-safe operation? Exactly: there is no such guarantee in the Python language. > E.g.: > One thread does things like d['x']='y' > Another thread reads d['z'] or sets d['z']='w'

Re: MS Access db (mdb): viewing table attributes

2006-03-11 Thread gau . tai
Thanks so much for the information, both of you. I guess I should have just looked at it more simply to begin with. Now, I can move on to more complicated information retrieval :-) My ultimate plan with this task is to get whatever table attributes I can, like foreign/primary keys, data types &

Re: Python IDE: great headache....

2006-03-11 Thread gregarican
Sullivan wrote: > IDLE is no longer satisfactory for me. Other IDEs make me very > confused. Really do not know which one to use. > > I use WinXP sp2 for current development. Personally I have gotten used to coding using ActiveState's Komodo. It doesn't get in my way and offers the basic features

Re: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?

2006-03-11 Thread EleSSaR^
robert si è profuso/a a scrivere su comp.lang.python tutte queste elucubrazioni: > Yes, a "backup" / autosave while all threads are running. It doesn't > matter if 'before' of 'after' another item has been added/deleted > atomically. But it does matter if the autosave happens *while* an item i

Re: Jython

2006-03-11 Thread Wei Zhuo
jython2.2 is under developing, you can download the alpha version in sourceforge.2006/3/12, rtilley <[EMAIL PROTECTED]>: Is development still going on with Jython? Version 2.1 came out in 2001and it's still the most current stable release.Thanks!--http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop -> BSOL?

2006-03-11 Thread Andrew Gwozdziewycz
> > Tadpoles ( http://python.org/images/python-logo.gif ) are immature > frogs. If we keep the logo, we can change the name of the language to > "frog". Then the eggs would be found in lilypad.frog.org . I > personally > do not like this choice but it would have the virtue of consistency. > (Did

Re: Which GUI toolkit is THE best?

2006-03-11 Thread Roger Binns
"invitro81" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > But I've no idea which one I should use to start with.. One thing you'll need to carefully decide is where you want to end up. The different toolkits have different limits on where you can go. A simple example is printing

Re: Python source cross reference doc generator?

2006-03-11 Thread gene tani
Colin J. Williams wrote: > Harry Fuecks wrote: > > Hi All, > > > > Wondering if a tool exists to generate "cross reference" documentation > > for Python code bases? > > > > Particularly after something like phpxref - > > http://phpxref.sourceforge.net/ : written in Perl, scans a bunch of > > PHP s

Tkinter - Drawing rotated text in a widget

2006-03-11 Thread Eric Apperley
How do I draw rotated text in a Tkinter widget using the draw.text method? Alternatively, if I draw text as normal, how can I then subsequently rotate it about its start point? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python source cross reference doc generator?

2006-03-11 Thread Roger Binns
"Harry Fuecks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Wondering if a tool exists to generate "cross reference" documentation > for Python code bases? PyXR does cross referencing. epydoc generates good doc from comments (javadoc style): http://pyxr.sourceforge.net/ http

Re: Python IDE: great headache....

2006-03-11 Thread SPE - Stani's Python Editor
I've got used to SPE(editor)+WinPdb(debugger) not surprisingly of course ;-) Concerning the free-of-charge IDE's, things might change quite a bit. You might have read this: http://groups.google.nl/group/comp.lang.python.announce/browse_thread/thread/240c000583168029/2dec4ae34efe16e2#2dec4ae34efe1

Re: Cheese Shop -> BSOL?

2006-03-11 Thread Bertrand Mansion
On 3/12/06, Andrew Gwozdziewycz <[EMAIL PROTECTED]> wrote: > > Look at the 'tadpoles' (i don't really think it's tadpoles really... > but i'll bite for now), > notice that it is a + sign, which we also always associate with life, > and health (red cross comes to mind). Python > is a healthy languag

<    1   2