Re: How to determine that if a folder is empty?

2005-08-09 Thread Peter Hansen
could ildg wrote: > On 8/8/05, Peter Hansen <[EMAIL PROTECTED]> wrote: >>could ildg wrote: >>>I want to check if a folder named "foldername" is empty. >>>I use os.listdir(foldername)==[] to do this, >>>but it will be very slow if the folder has a lot of sub-files. >>>Is there any efficient ways to

.pth files

2005-08-09 Thread Sylvain Thenault
Hi there ! I've some questions regarding pth files (which btw are undocumented in the python reference, is this intentional ?) I thought that I could use a .pth file to be able to import zope products from both INSTANCE_HOME/Products and ZOPE_HOME/lib/python/Products from outside zope: [EMAIL P

Re: .pth files

2005-08-09 Thread Adriano Varoli Piazza
Sylvain Thenault ha scritto: > Hi there ! > > I've some questions regarding pth files (which btw are undocumented in the > python reference, is this intentional ?) > > I thought that I could use a .pth file to be able to import zope products > from both INSTANCE_HOME/Products and ZOPE_HOME/lib/py

Re: issues with doctest and threads

2005-08-09 Thread Michele Simionato
Thank you for your replies Jeff & Tim. The snippet I submitted is unfortunate, since I was writing an example (for a Python course I am going to give in September) to show that you cannot reliably assume that you will get exactly 9 dots, because of the limitations of 'sleep'. Mindlessly, I have cut

Re: .pth files

2005-08-09 Thread Sylvain Thenault
On Tue, 09 Aug 2005 09:37:47 +, Adriano Varoli Piazza wrote: > Sylvain Thenault ha scritto: >> Hi there ! >> >> I've some questions regarding pth files (which btw are undocumented in >> the python reference, is this intentional ?) >> >> I thought that I could use a .pth file to be able to im

Re: python for microcontrollers

2005-08-09 Thread Damir Hakimov
David Cuthbert wrote: >Paul Rubin wrote: > > >>I don't think you want to do this. Runtime type tags and the overhead >>of checking them on every operation will kill you all by themselves. >>Processors like that haven't been used much as Lisp targets either, >>for the same reasons. Pick a diffe

Re: .pth files

2005-08-09 Thread Richie Hindle
[Sylvain] > I've some questions regarding pth files (which btw are undocumented in the > python reference, is this intentional ?) http://google.com/search?q=site:docs.python.org%20pth The first hit explains how .pth files work (although it's the sort of documentation that makes Xah Lee explode w

Re: .pth files

2005-08-09 Thread Erik Max Francis
Richie Hindle wrote: > http://google.com/search?q=site:docs.python.org%20pth > > The first hit explains how .pth files work (although it's the sort of > documentation that makes Xah Lee explode with fury). That just makes it all the more delicious. -- Erik Max Francis && [EMAIL PROTECTED] && h

new python debugger

2005-08-09 Thread mrelectron
hi: Nir Aides who wrote the rpdb debugger has enhanced it and stuck a frontend on it whoo-hoo. it is fantastico! see and download it at http://www.digitalpeers.com/pythondebugger/ cheers mark -- http://mail.python.org/mailman/listinfo/python-list

Re: .pth files

2005-08-09 Thread Neil Benn
Sylvain Thenault wrote: >On Tue, 09 Aug 2005 09:37:47 +, Adriano Varoli Piazza wrote: > > > >>Sylvain Thenault ha scritto: >> >> >>>Hi there ! >>> >>>I've some questions regarding pth files (which btw are undocumented in >>>the python reference, is this intentional ?) >>> >>>I thought th

Re: .pth files

2005-08-09 Thread Peter Hansen
Neil Benn wrote: >* Site.py is prompted to load a sitecustomise.py file which is > located in the Lib directory - if it is there. This file is > automatically executed on the start up of python. Here you can > look for a command line argument (or a local config file) passed >

Re: Point and click GUI builder for Python

2005-08-09 Thread Benji York
Madhusudan Singh wrote: > Is there such a thing for python ? Like Qt Designer for instance ? I've had great success with wxDesigner (http://www.roebling.de/). It is a commercial product ($129 for a single license), but it does an exceptional job. -- Benji York -- http://mail.python.org/mailm

Gotchas in user-space matplotlib install?

2005-08-09 Thread Matt Feinstein
Hi all-- I'm planning to try to do a completely local install of matplotlib (in Fedora Core 1)-- the system administrator isn't going to stop me-- but he isn't going to cooperate either. I've got the tarballs for python, numeric, numarray, matplotlib, ipython, wxpython and freetype-- which I thin

Re: Point and click GUI builder for Python

2005-08-09 Thread Asbjørn Sæbø
Madhusudan Singh <[EMAIL PROTECTED]> writes: > Is there such a thing for python ? Like Qt Designer for instance ? Glade? >From http://glade.gnome.org/ : - Glade is a free user interface builder for GTK+ and GNOME, released under the GNU GPL License. The

Re: gettext again

2005-08-09 Thread cantabile
Ok, I'll try that. Thanks again Stasz ! -- http://mail.python.org/mailman/listinfo/python-list

namespaces

2005-08-09 Thread Paolino
Why descriptor mechanism doesn't apply to modules? I suspect another anomaly in the namespaces implementations. class Mosse(object): def __get__(self,*_): print 'HERE' m=Mosse() m # doesn't work import new mod=new.module('hopeless') mod.m=Mosse() assert 'm' in mod.__dict__ # this is said

[ANN] Dabo 0.4 Released

2005-08-09 Thread Ed Leafe
We are pleased to announce Dabo 0.4, the fourth major release of our data application framework. The Dabo framework is a true 3-tier design, with data access and UI code separated from your business logic. And since it's Python, and uses wxPython for its UI, it is completely cross-platform, havi

Re: namespaces

2005-08-09 Thread Peter Otten
Paolino wrote: > Why descriptor mechanism doesn't apply to modules? Because modules are instances of the module class and the descriptor has to be defined in the class in order to work with the instance. E. g.: >>> import sys >>> class Descr(object): ... def __get__(*args): print "__get__%r"

don't understand instanse creation

2005-08-09 Thread Maksim Kasimov
Hello, i have a class, such as below. when i try to make instances of the class, fields __data1 and __data2 gets different values: __data1 behaves like private field, __data2 - like static which is the thing i've missed? thanks for help. i

Re: don't understand instanse creation

2005-08-09 Thread Dan Sommers
On Tue, 09 Aug 2005 16:39:51 +0300, Maksim Kasimov <[EMAIL PROTECTED]> wrote: > Hello, > i have a class, such as below. > when i try to make instances of the class, > fields __data1 and __data2 gets different values: __data1 behaves like > private field, __data2 - like static > which is the thin

Recommendations for CVS systems

2005-08-09 Thread geskerrett
I was wondering if anyone could make recomendations/comments about CVS systems, their experiences and what perhaps the strengths of each. Currently we have 2 developers but expect to grow to perhaps 5. Most of the developement is Python, but some C, Javascript, HTML, etc. The IDE what have been

Python 32 and Python 64 bit

2005-08-09 Thread Nx
Suse Linux 9.2 64 Python 2.3 64 bit Python 2.4 32 bit My question is : I have a python prog which is installed for python 2.3 but I need some variables filled with data, which I only can get with running a python prog via python 2.4 (data is comming from a firebird database server via kinterbase

Re: Recommendations for CVS systems

2005-08-09 Thread Neil Benn
[EMAIL PROTECTED] wrote: >I was wondering if anyone could make recomendations/comments about CVS >systems, their experiences and what perhaps the strengths of each. > >Currently we have 2 developers but expect to grow to perhaps 5. > >Most of the developement is Python, but some C, Javascript, HTM

Re: namespaces

2005-08-09 Thread Paolino
Peter Otten wrote: > Paolino wrote: > > >>Why descriptor mechanism doesn't apply to modules? > > > Because modules are instances of the module class and the descriptor has to > be defined in the class in order to work with the instance. E. g.: > > Got it,thanks. Then there is no way of having

Re: Recommendations for CVS systems

2005-08-09 Thread Jorge Godoy
[EMAIL PROTECTED] wrote: > The IDE what have been using/experimenting with are drPython and > eclipse with PyDev. Eclipse has a fine integration with both CVS and Subversion. If you'll be having a lot of images and binary objects or you don't have the design right by the time you start coding, I

Re: don't understand instanse creation

2005-08-09 Thread Maksim Kasimov
i see, thaks you very match! Dan Sommers wrote: > On Tue, 09 Aug 2005 16:39:51 +0300, > Maksim Kasimov <[EMAIL PROTECTED]> wrote: > > >>Hello, > > >>i have a class, such as below. >>when i try to make instances of the class, >>fields __data1 and __data2 gets different values: __data1 behaves

Re: Python -- (just) a successful experiment?

2005-08-09 Thread Michael Hudson
Robert Kern <[EMAIL PROTECTED]> writes: > What I'm trying to say is that posting to c.l.py is absolutely > ineffective in achieving that goal. Code attracts people that like > to code. Tedious, repetitive c.l.py threads attract people that like > to write tedious, repetitive c.l.py threads. +1 QO

Re: don't understand instanse creation

2005-08-09 Thread Christopher Subich
Maksim Kasimov wrote: > > Hello, > > i have a class, such as below. > when i try to make instances of the class, > fields __data1 and __data2 gets different values: __data1 behaves like private field, __data2 - like static > which is the thing i've missed? Firstly, you get interesting be

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-09 Thread Stuart Corrie
Did you use the excel macro recorder and look at the results to help you write that program? It seems to bear all the hallmarks of code generated that way. The macro recorder can be great, but almost always it is possible to speed up code by altering it afterwards, to condense and speed up the

Re: issues with doctest and threads

2005-08-09 Thread Tim Peters
[Michele Simionato] > Thank you for your replies Jeff & Tim. The snippet I submitted is > unfortunate, since I was writing an example (for a Python course I am > going to give in September) to show that you cannot reliably assume > that you will get exactly 9 dots, because of the limitations of 'sl

Re: Python -- (just) a successful experiment?

2005-08-09 Thread Michael Hudson
Michael Hudson <[EMAIL PROTECTED]> writes: > Robert Kern <[EMAIL PROTECTED]> writes: > >> What I'm trying to say is that posting to c.l.py is absolutely >> ineffective in achieving that goal. Code attracts people that like >> to code. Tedious, repetitive c.l.py threads attract people that like >>

Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Gregory Piñero
Hey guys, would someone mind giving me a quick rundown of how references work in Python when passing arguments into functions? The code below should highlight my specific confusion: bool1=True lst1=[1,2,3] def func1(arg1): arg1.append(4) def func2(arg1): arg1=False >>func1(lst1) >>lst1 [1,2,

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Christopher Subich
Gregory Piñero wrote: > Hey guys, would someone mind giving me a quick rundown of how > references work in Python when passing arguments into functions? The > code below should highlight my specific confusion: All arguments are passed by reference, but in Python equality rebinds the name. > >

Re: Why does __init__ not get called?

2005-08-09 Thread Rob Conner
Ah ok, thats interesting I hadn't even tried a valid date yet. Now how do I get this thing to call __init__ when I pass in an invalid date and the ValueError is thrown and caught within __new__. dt = DateTime(2005, 02, 30) -- http://mail.python.org/mailman/listinfo/python-list

What are modules really for?

2005-08-09 Thread N.Davis
I am very new to Python, but have done plenty of development in C++ and Java. One thing I find weird about python is the idea of a module. Why is this needed when there are already the ideas of class, file, and package? To my mind, although one CAN put many classes in a file, it is better to p

Re: namespaces

2005-08-09 Thread Scott David Daniels
Paolino wrote: > Peter Otten wrote: >> Paolino wrote: >>> Why descriptor mechanism doesn't apply to modules? >> Because modules are instances of the module class and the descriptor >> has to be defined in the class in order to work with the instance > Then there is no way of having descriptors

sqlobject vs mysqldb module

2005-08-09 Thread yaffa
dear group, i have a python script that scrapes contents from an html file and i would like to have the script write values to a mysql db. do you recommend i go with the sqlobject or the mysqldb module? thank you yaffa -- http://mail.python.org/mailman/listinfo/python-list

Re: What are modules really for?

2005-08-09 Thread skip
Nick> One thing I find weird about python is the idea of a module. Why Nick> is this needed when there are already the ideas of class, file, Nick> and package? A module is a namespace object that maps one-to-one to a file (ignoring the new module's features). A file by itself is just

Re: What are modules really for?

2005-08-09 Thread Richard Brodie
"N.Davis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To my mind, although one CAN put many classes in a file, it is better to > put one class per file, for readability and maintainability. Zero classes in a file works well too ;) -- http://mail.python.org/mailman/listinfo/

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Christopher Subich wrote: > Gregory Piñero wrote: > >> Hey guys, would someone mind giving me a quick rundown of how >> references work in Python when passing arguments into functions? The >> code below should highlight my specific confusion: This URL is always tossed out: http://starship.pytho

Re: sqlobject vs mysqldb module

2005-08-09 Thread skip
yaffa> i have a python script that scrapes contents from an html file yaffa> and i would like to have the script write values to a mysql db. yaffa> do you recommend i go with the sqlobject or the mysqldb module? They are really quite different beasts. You'll have to consider your requ

Re: What are modules really for?

2005-08-09 Thread infidel
> I am very new to Python, but have done plenty of development in C++ and > Java. And therein lies the root of your question, I believe. > One thing I find weird about python is the idea of a module. Why is this > needed when there are already the ideas of class, file, and package? One reason is

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread infidel
> in Python equality rebinds the name Assignment (=) rebinds the name. Equality (==) is something else entirely. -- http://mail.python.org/mailman/listinfo/python-list

Illegal IMail List Server Command!

2005-08-09 Thread List Server
IMail List Server for Windows NT, Ipswitch, Inc. Valid Commands are: To subscribe to a list, send a mail message to "imailsrv" at this address with the following in the body of the message: subscribe listname your_

Re: Advanced concurrancy

2005-08-09 Thread Matt Hammond
Hi Stefan, On Fri, 05 Aug 2005 07:20:36 +0100, Stefan Rank <[EMAIL PROTECTED]> wrote: >>> So do you plan on including a kind of scheduler-aware blocking >>> communication (like the `channels` of the `tasklets` in stackless)? Not at the moment. The kinds of applications we've mainly been lookin

Re: Decline and fall of scripting languages ?

2005-08-09 Thread Bengt Richter
On 08 Aug 2005 20:37:01 -0700, Paul Rubin wrote: [...] >Right now I'm mainly interested in OCaml, Haskell, Erlang, and maybe >Occam. Haskell seems to have the happiest users, which is always a >good thing. Erlang has been used for real-world systems and has >built-in co

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Gregory Piñero
Ahh, so it's a mutable thing. That makes sense that I can't change a mutable object and thus can't affect it outside of the function. Does that mean Python functions aren't always byref, but are sometimes byval for nonmutables? -Greg On 8/9/05, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On

Re: new python debugger

2005-08-09 Thread Franz Steinhäusler
On 9 Aug 2005 03:52:00 -0700, "mrelectron" <[EMAIL PROTECTED]> wrote: >hi: > >Nir Aides who wrote the rpdb debugger has enhanced it and stuck a >frontend on it whoo-hoo. it is fantastico! see and download it at >http://www.digitalpeers.com/pythondebugger/ > >cheers mark Hello Mark, thank you for

Build errors for Objects/complexobject.c

2005-08-09 Thread peter . havens
Hi all, I'm attempting to build Python 2.4.1 on Solaris 10 using gcc 3.4.3. I get the following build error: gcc -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o Objects/complexobject.o Objects/complexobject.c Objects/complexobject.c: In func

Re: Build errors for Objects/complexobject.c

2005-08-09 Thread peter . havens
Okay, after further review, I realized that 'make test' wasn't completely successful. The test 'test_complex' passed, but 'test_long' failed: test_long test test_long crashed -- exceptions.OverflowError: long int too large to convert to float ...do you think my changes caused this failure? Pet

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Dan
> Does that mean Python functions aren't always byref, > but are sometimes byval for nonmutables? Don't think of it as byref or byval (as they are used in Visual Basic). All parameters are passed the same way: by reference instead of by copy. It's a little difficult to get your head around, but

Examples and tutorials about popen2/3, smtplib/multipart and icq/jabber?

2005-08-09 Thread Alessandro Bottoni
Is there any good tutorial/example about popen2 and popen3? I have to execute a given command on Linux and Windows from within a Python program. If possible, on Linux I would like to be able to set the executing user (setuid) and the niceness level of the command. (and yes: I know it is a dangerou

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Gregory Piñero wrote: > Ahh, so it's a mutable thing. That makes sense that I can't change a > mutable object and thus can't affect it outside of the function. If you meant "immutable" for the second mutable, you're right. > Does > that mean Python functions aren't always byref, but are someti

Re: namespaces

2005-08-09 Thread Bengt Richter
On 31 Jul 2005 21:03:36 -0700, Paul Rubin wrote: >Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Most languages can create self-modifying code. That's not the >> question. The question is whether developers should write >> self-modifying code, not whether language design

Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
I am hoping someone can help me solve a bit of a puzzle. We are working on a data file reader and extraction tool for an old MS-DOS accounting system dating back to the mid 80's. In the data files, the text information is stored in clearly readable ASCII text, so I am comfortable that this file i

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Christopher Subich
Dennis Lee Bieber wrote: > In a more simplistic view, I'd reverse the phrasing... The name > "x" is assigned to the object "y" (implying it is no longer attached to > whatever used to have the name) No, because that'd imply that the object 'y' somehow keeps track of the names assigned to it

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Christopher Subich
infidel wrote: >>in Python equality rebinds the name > > > Assignment (=) rebinds the name. Equality (==) is something else > entirely. Good catch. I was thinking of it as the "equals" operator. -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Christopher Subich
Rocco Moretti wrote: > Variables in Python are names. They aren't the cubbyholes into which you > put values, they are sticky notes on the front of the cubby hole. +1 MOTW (Metaphor of the Week) -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlobject vs mysqldb module

2005-08-09 Thread Jeffrey E. Forcier
Skip is correct, they're somewhat different: SQLObject is an 'ORM' or 'Object-Relational Mapping', meaning that it allows you to handle everything related to the database with objects. The table handles are objects, the result set is an object, the individual rows in a result set are objects with

Re: Recommendations for CVS systems

2005-08-09 Thread Jeffrey E. Forcier
Thirding the Subversion/SVN suggestions. It's generally a newer, better CVS with some new features and a lot less of the negative features/lack thereof, of the older system. If any of your team has CVS experience they should have no real problem with the switch, and anyone without prior version co

Re: namespaces

2005-08-09 Thread Bengt Richter
On Tue, 09 Aug 2005 08:35:38 -0700, Scott David Daniels <[EMAIL PROTECTED]> wrote: >Paolino wrote: >> Peter Otten wrote: >>> Paolino wrote: Why descriptor mechanism doesn't apply to modules? >>> Because modules are instances of the module class and the descriptor >>> has to be defined in th

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Christopher Subich
[EMAIL PROTECTED] wrote: > I am hoping someone can help me solve a bit of a puzzle. > > We are working on a data file reader and extraction tool for an old > MS-DOS accounting system dating back to the mid 80's. > > In the data files, the text information is stored in clearly readable > ASCII tex

Re: Why does __init__ not get called?

2005-08-09 Thread Rob Conner
Not takers? This is my attempt to get some attention by bumping my own post. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Dejan Rodiger
[EMAIL PROTECTED] said the following on 9.08.2005 19:29: > We are working on a data file reader and extraction tool for an old > MS-DOS accounting system dating back to the mid 80's. Could you tell us what is the extension of those files? Could you post full 5-10 records (ASCII + HEX)? -- Dejan

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Dennis Lee Bieber wrote: > On Tue, 09 Aug 2005 10:39:29 -0500, Rocco Moretti > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>Change it to "the object referenced by y is assigned to the name of x", >>and you're closer to the truth. > > In a more simplistic view, I'

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Christopher Subich wrote: > Rocco Moretti wrote: > >> Variables in Python are names. They aren't the cubbyholes into which >> you put values, they are sticky notes on the front of the cubby hole. > > > +1 MOTW (Metaphor of the Week) Thanks, but please note it's not really mine - I've seen it s

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Dejan Rodiger
[EMAIL PROTECTED] said the following on 9.08.2005 19:29: > Phone 1: 5616864700 > Hex On Disk: C0DBA8ECF441 5616864700(10)=14ECA8DBC(16) 14 EC A8 DB Cleftshift by 4 bits (it will add 0 on last C) C0 DB A8 EC 14 00 write bytes from right to left C0 DB A8 EC F4 41 Add E041 > Phone 1: 8003346488

Re: What are modules really for?

2005-08-09 Thread en.karpachov
On Tue, 09 Aug 2005 16:32:31 +0100 N.Davis wrote: > With single inheritance in C++ or Java, if you wanted to see what a > method did and it appeared to be inherited, you would simply look in the > base class's file, and if necessary recurse up the inheritance hierarchy > until you found the met

Re: Why does __init__ not get called?

2005-08-09 Thread infidel
I think you have to call type.__new__ like this: def __new__(cls, year, month, day, *args, **kw): print "new called" try: return _datetime.__new__(cls, year, month, day, *args, **kw) except ValueError: return type.__new__(cls, ...) Are you sure

Re: Why does __init__ not get called?

2005-08-09 Thread infidel
> Are you sure you can specify arbitrary arguments to the __new__ method? > I thought they had to be the class object, the tuple of bases, and the > dictionary of names. Nevermind, I think I was imagining metaclasses rather than just regular overriding of __new__ -- http://mail.python.org/mailma

Re: Decline and fall of scripting languages ?

2005-08-09 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Michael Hudson <[EMAIL PROTECTED]> wrote: > Donn Cave <[EMAIL PROTECTED]> writes: > > > On the contrary, there are a couple. Ghc is probably the > > leading implementation these days, and by any reasonable > > measure, it is serious. > > > > Objective CAML is in

Import question

2005-08-09 Thread ncf
In file A, I have an instance of a class and then I import file B (import fileB as fb). In file B, I need to access file A's class instance. Is there anyway I can do this? (I hope that was descriptive enough :\) -Wes -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Gregory Piñero
Thanks everyone. I understand now. Everything is a reference, all that matters is whether I can go inside the "cubbyhole" and change something. Immutables don't allow this. So what if I do want to share a boolean variable like so: sharedbool=True class cls1:pass cl=cls1() cl.sharedbool1=shared

Re: namespaces

2005-08-09 Thread Aahz
In article <[EMAIL PROTECTED]>, Paolino <[EMAIL PROTECTED]> wrote: > >Why descriptor mechanism doesn't apply to modules? The real answer: Because Guido doesn't want it to -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ The way to build large Python applications is

Re: Import question

2005-08-09 Thread Lonnie Princehouse
Circular import issues can usually be resolved by moving import statements into the bodies of functions which aren't executed when the module itself is imported. Simple example: fileA.py -- import fileB as fb foo = 10# we're going to access foo from fileB fb.do_something_with_foo()

Re: Import question

2005-08-09 Thread Paul McNett
ncf wrote: > In file A, I have an instance of a class and then I import file B > (import fileB as fb). In file B, I need to access file A's class > instance. Is there anyway I can do this? (I hope that was descriptive > enough :\) Let's see... # -- fileA.py class Test(object): pass myInstance =

Re: PEP: Specialization Syntax

2005-08-09 Thread Martin v. Löwis
Nicolas Fleury wrote: > Well, I'm using the alternatives. Perhaps not to the full power. > __arrayTypes = {} > def makeArrayType(arg1, arg2=someDefault): > if (arg1, arg2) in __arrayTypes: > return __arrayTypes[arg1, arg2] > renamed_arg1 = arg1 > renamed_arg2 = arg2 > clas

Re: Why does __init__ not get called?

2005-08-09 Thread infidel
This doesn't work. I'm out of my league here. -- http://mail.python.org/mailman/listinfo/python-list

Re: Build errors for Objects/complexobject.c

2005-08-09 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > I'm attempting to build Python 2.4.1 on Solaris 10 using gcc 3.4.3. I > get the following build error: This is a GCC bug, which I think got fixed in gcc 4.0.1. You can work around it by removing the definition of _XOPEN_SOURCE, POSIX_SOURCE, XOPEN_SOURCE_EXTENDED from py

Re: Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
the extension on the files is *.mas but I a pretty sure it is not relevant. I beleive it used by the application. I can posted records as it will take up to much space. But all three phone numbers are stored in 8 bytes with null bytes (ie. 00) stored in the leading positions (ie. the left hand si

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Christopher Subich
Dejan Rodiger wrote: > 8003346488(10)=1DD096038(16) > 1D D0 96 03 8 > 80 03 96 D0 1D 00 > 80 03 96 d0 fd 41 Add E041 I'm pretty sure that the last full byte is a parity check of some sort. I still thing that Phone2 (..F1) is a typo and should be 41. Even if it's not, it could be a more detail

Re: Why does __init__ not get called?

2005-08-09 Thread Lonnie Princehouse
What kinds of illegal date values are you trying to represent? The reason I ask is that it's not going to be as easy as subclassing datetime... datetime is implemented in C. and so enforcement of legal values is going to be in the C code. For the time.h functions, you're also going to be constra

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Christopher Subich
Gregory Piñero wrote: > So what if I do want to share a boolean variable like so: Well, the easiest way is to wrap it in a list: mybool = [True] mybool[0] = False mybool[0] = True and so on. Alternately, what is this boolean attached to that's so significant? Sharing an arbitrary boolean, with

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Roel Schroeven
Dejan Rodiger wrote: > [EMAIL PROTECTED] said the following on 9.08.2005 19:29: > >>Phone 1: 5616864700 >>Hex On Disk: C0DBA8ECF441 > > > 5616864700(10)=14ECA8DBC(16) > 14 EC A8 DB Cleftshift by 4 bits (it will add 0 on last C) > C0 DB A8 EC 14 00 write bytes from right to left > C0 DB A8 EC

Re: Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
You are correct, that was a typo. the second example should end in F441. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax error after upgrading to Python 2.4

2005-08-09 Thread Reinhold Birkenfeld
Michael Hudson wrote: > [EMAIL PROTECTED] writes: > >> On Sat, Aug 06, 2005 at 05:15:22PM -0400, Terry Reedy wrote: >>> In any case letting developers add new features is part of the price of >>> getting unpaid bug fixes for free software. But note that PSF does not >>> make you to upgrade. He

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Grant Edwards
On 2005-08-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I can posted records as it will take up to much space. But all > three phone numbers are stored in 8 bytes with null bytes (ie. > 00) stored in the leading positions (ie. the left hand side) > > I do have some more examples; > > I have

pyuic and Qt Designer plugins

2005-08-09 Thread Madhusudan Singh
Hi I managed to compile and install the FileChooser plugin (.so file) in /usr/share/qt3/plugins/designer and use it in my form in Designer. Then I tried to use pyuic which generated the .py code from the ui file. An attempt to execute the python file quits with : Traceback (most recent call last

Re: Does any one recognize this binary data storage format

2005-08-09 Thread geskerrett
Yes I double checked as I appreciate any help, but that is what is stored on disk. If it helps, we modified Ex#3. to be 777-777- On disk this is now 00 00 10 87 77 F9 Fc 41 All the input fields are filled in this new example. -- http://mail.python.org/mailman/listinfo/python-list

Re: python for microcontrollers

2005-08-09 Thread Evil Bastard
Paul Rubin wrote: > I don't think you want to do this. Runtime type tags and the overhead > of checking them on every operation will kill you all by themselves. > Processors like that haven't been used much as Lisp targets either, > for the same reasons. Pick a different language. On thinking ab

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Dejan Rodiger
[EMAIL PROTECTED] said the following on 9.08.2005 22:45: > Yes I double checked as I appreciate any help, but that is what is > stored on disk. > > If it helps, we modified Ex#3. to be 777-777- > On disk this is now 00 00 10 87 77 F9 Fc 41 > > All the input fields are filled in this new examp

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Scott David Daniels
Grant Edwards wrote: >>Ex #1) 333- >>Hex On disk: 00 00 00 80 6a 6e 49 41 >> >>Ex #2) 666- >>Hex On disk: 00 00 00 80 6a 6e 59 41 > > So there's only a 1-bit different between the on-disk > representation of 333- and 666-. > > That sounds pretty unlikely. Are you 100% sure you'

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Dejan Rodiger
Dejan Rodiger said the following on 9.08.2005 23:28: > [EMAIL PROTECTED] said the following on 9.08.2005 22:45: > >>Yes I double checked as I appreciate any help, but that is what is >>stored on disk. >> >>If it helps, we modified Ex#3. to be 777-777- >>On disk this is now 00 00 10 87 77 F9 Fc

Adding and attribute to an instance

2005-08-09 Thread J
Hi, I am trying to add new data attributes to my extension classes from within a script. I am under the impression that python allows that implicity This is the definition of my class PyTypeObject CmdPlace::PyType = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/

MainThread blocks all others

2005-08-09 Thread Nodir Gulyamov
Hello All! I met some strange situation. In MainThread my program wating changes of some variable. This variable should be changed in another thread, but loop, which wait changing variable blocks all other threads. Code below: class class1: def __init__(self): self.counter = 0

Re: Embedding a runtime graph in Qt3 designer generated UI

2005-08-09 Thread Madhusudan Singh
Phil Thompson wrote: >> 2. In the same vein, how does one embed a runtime plot in a qt3 UI ? It >> will >> need to be a python solution since I am using python libraries to acquire >> the data. > > Have a look at PyQwt which is a set of Python bindings for the Qt-based > Qwt plotting library. >

Re: PEP: Specialization Syntax

2005-08-09 Thread Nicolas Fleury
Martin v. Löwis wrote: > Nicolas Fleury wrote: > >>Well, I'm using the alternatives. > > Perhaps not to the full power. Not perhaps, surely;) Who does anyway;) > So you don't want to write the makeArrayType function, right? > > How about this: > > # declaration > class Array(object): > __t

Re: gettext again

2005-08-09 Thread cantabile
stas a écrit : > As a reminder, make sure that you install gettext in the namespace > of your toplevel module. > What I mean is this: > > test1.py imports test2.py and test3.py > test2.py imports test4.py > > Now you have to place the gettext.install call in test1.py and > then the other modules

Re: Does any one recognize this binary data storage format

2005-08-09 Thread Grant Edwards
On 2005-08-09, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >>>Ex #1) 333- >>>Hex On disk: 00 00 00 80 6a 6e 49 41 >>> >>>Ex #2) 666- >>>Hex On disk: 00 00 00 80 6a 6e 59 41 >> >> So there's only a 1-bit different between the on-disk >> representation of 333-

SPE: New website & Mac Os X fund raising

2005-08-09 Thread spe . stani . be
SPE (Stani's Python Editor) is an open-source python IDE with auto indentation & completion, call tips, syntax coloring & highlighting, UML diagrams, class explorer, source index, auto todo list, sticky notes, pycrust shell, file browsers, drag&drop, context help, Blender support, ... Spe ships wit

  1   2   >