Re: too much memory use

2007-05-24 Thread Tim Roberts
rohit <[EMAIL PROTECTED]> wrote: > >i am making a program for desktop search. >in order to make it more effective im implementing the records in the >form of a tree(files starting with 'a','b','c'have different >trees ..so 26 trees in all) in memory and writing it down in file. >the max size fi

Re: 0 == False but [] != False?

2007-05-24 Thread Tim Roberts
Rajarshi <[EMAIL PROTECTED]> wrote: >This is a slightly naive question, but I know that 0 can be used to >represent False. So > 0 == False >True > >But, I know I can use [] to represent False as in > if not []: print 'empty' >... >empty > >But then doing the following gives a surprising

Python Uno Bridge Architecture

2007-05-24 Thread sneha29
Hi, I am trying to write a bridge similar to Python- Uno bridge. I have read from these links about the PyUNO bridge. http://udk.openoffice.org/python/python-bridge.html But I haven't found information about the basic achitecture of the bridge. Eg: the basic requirements of the files, library, spe

ANN: Veusz-0.99.0 - a scientific plotting package

2007-05-24 Thread Jeremy Sanders
I am pleased to announce a new beta of a largely rewritten Veusz plotting package. This now uses Qt4 and numpy, adding support for Windows. Windows and Linux binaries are provided. For details see below: Veusz 0.99.0 (new Qt4/numpy beta) Velvet Ember Under Sky Zenith

Re: Can I reference 1 instance of an object by more names ? rephrase

2007-05-24 Thread Bruno Desthuilliers
Maric Michaud a écrit : > Stef Mientki a écrit : (snip) >> # I need to read and write the individual bits of the byte object >> # so I can create 8 blocks of code like this, one for each bit position >> # I use it, like this >> #name1 = cpu_ports() >> #name1.p5 = True >> # or >> #name1.

Re: read file to a dictionary

2007-05-24 Thread rohit
ohh i think i forgot to include intricate details in dictionary i use the following: value: name of a file existing on disk Key : a unique number assigned to each file ,with no. assigned in increasing order to file appearing earlier in the "english dictionary" thanks rohit -- http://mail.python.o

Re: Call script which accepts com. line par. from another scriptand error control

2007-05-24 Thread Karim Ali
Hi James, Thanks for that. That is exactly what i needed for the error control bit... What I still dont know though is how do I handle the fact that the first script is expecting command line parameters. I would like to be able to replace the command line parameters by a variable such that the se

Re: Lists vs tuples (newbie)

2007-05-24 Thread Hendrik van Rooyen
"Duncan Booth" <[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > > Aside from the hashing issue, there is nothing that a tuple can do > > that can't be done as well or better by a list. > > There are a few other cases where you have to use a tuple, for example in

Re: [Fwd: Re: managed lists?]

2007-05-24 Thread Jorgen Bodde
@ Larry, As much as I like to follow the idiom that Python has, I do not see the usefulness of making an add function that checks the interface that other objects might need. Besides the fact it is a bit overhead and not to mention performance draining, in an application that I develop myself, wit

Web Archtecture using tow layers in Phyton

2007-05-24 Thread Wagner Garcia Campagner
Hello, I need to develop an web applications that meet the following requirements: - 2 layers: the first one is the user interface (browser) and the second one is the interaction with the operacional system of the server. - the second layer must be developed using Python. I'd like to know if it

Different methods with same name but different signature?

2007-05-24 Thread william dy
william dy christin de los santos lynor laxina - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. -- http://mail.python.org/mailman/listinfo/python-list

Re: Call script which accepts com. line par. from another scriptand error control

2007-05-24 Thread Peter Otten
Karim Ali wrote: > What I still dont know though is how do I handle the fact that the first > script is expecting command line parameters. I would like to be able to > replace the command line parameters by a variable such that the second > script can call: first_script.main("command line"). Is th

Re: Inheriting from Python list object(type?)

2007-05-24 Thread irstas
On May 23, 10:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > This is the winner: > > class Point(list): > def __init__(self, x, y, z = 1): > super(Point, self).__init__([x, y, z]) > self.x = x > self.y = y > self.z = z > > def __getattr__(self, name): >

The Relative Importance of Web Development

2007-05-24 Thread martinig
If you follow the evolution of software development on Internet, you may have the impression that every new development is Web based and that the main areas of concern are whether you should develop new application with Ruby on Rail or if you should choose Flash rather than Ajax for the interface.

Locale case change not working

2007-05-24 Thread Clodoaldo
When using unicode the case change works: >>> print u'É'.lower() é But when using the pt_BR.utf-8 locale it doesn't: >>> locale.setlocale(locale.LC_ALL, 'pt_BR.utf-8') 'pt_BR.utf-8' >>> locale.getlocale() ('pt_BR', 'utf') >>> print 'É'.lower() É What am I missing? I'm in Fedora Core 5 and Pytho

function nested

2007-05-24 Thread Gigs_
i have this function. def f(start): stack = [] def f1(start): for fname in os.listdir(startDir): path = os.path.join(startDir, fname) if os.path.isfile(path): stack.append(path) else: f1(path) return stack

Re: Basic Class/Instance Question

2007-05-24 Thread Antoon Pardon
On 2007-05-23, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >>> This is a FAQ. Default arguments are only evaled once - when the def >>> statement is evaled (which is usually at import time). The solution is >>> simple: don't use mutable objects as default arguments: >>

Re: Locale case change not working

2007-05-24 Thread Peter Otten
Clodoaldo wrote: > When using unicode the case change works: > print u'É'.lower() > é > > But when using the pt_BR.utf-8 locale it doesn't: > locale.setlocale(locale.LC_ALL, 'pt_BR.utf-8') > 'pt_BR.utf-8' locale.getlocale() > ('pt_BR', 'utf') print 'É'.lower() > É > > What

Re: function nested

2007-05-24 Thread Peter Otten
Gigs_ wrote: > i have this function. > > def f(start): > stack = [] > def f1(start): > for fname in os.listdir(startDir): > path = os.path.join(startDir, fname) > if os.path.isfile(path): > stack.append(path) > else: >

Checking parameters prior to object initialisation

2007-05-24 Thread Brett_McS
Fairly new to Python (and loving it!) In C++ (gack!) I got used to creating a helper function with each class to check the class object initialisation parameters prior to creating the object. In Python, this would be --- import example if example.Par

Re: how to use imaageop.scale

2007-05-24 Thread Amit Khemka
On 23 May 2007 18:58:28 -0700, Bruce <[EMAIL PROTECTED]> wrote: > On May 23, 5:31 pm, "Amit Khemka" <[EMAIL PROTECTED]> wrote: > > On 23 May 2007 00:02:34 -0700, Bruce <[EMAIL PROTECTED]> wrote: > > > > > Hi, I want to compress a jpg file. e.g. a jpg file which has RGB band > > > (24bit per pixel),

Re: function nested

2007-05-24 Thread Gigs_
def f(start): stack = [] def f1(start): for fname in os.listdir(start): path = os.path.join(start, fname) if os.path.isfile(path): stack.append(path) else: f1(path) f1(start) return stack i feel s stu

Re: Locale case change not working

2007-05-24 Thread Clodoaldo
On May 24, 6:40 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Clodoaldo wrote: > > When using unicode the case change works: > > print u'É'.lower() > > é > > > But when using the pt_BR.utf-8 locale it doesn't: > > locale.setlocale(locale.LC_ALL, 'pt_BR.utf-8') > > 'pt_BR.utf-8' > loca

Re: function nested

2007-05-24 Thread Amit Khemka
On 5/24/07, Gigs_ <[EMAIL PROTECTED]> wrote: > def f(start): > stack = [] > def f1(start): > for fname in os.listdir(start): > path = os.path.join(start, fname) > if os.path.isfile(path): > stack.append(path) > else: >

Re: CP4E revival

2007-05-24 Thread Richard Jones
Michael Tobis wrote: > http://tinyurl.com/yr62r3 > > seems to short-circuit some pointless hoop-jumping to get you to the > article. Hoop-jumping implemented to prevent just this kind of direct linking (and thus not saving of the PDF to local disk to view, and thus increasing the load on the serv

Re: Checking parameters prior to object initialisation

2007-05-24 Thread Peter Otten
Brett_McS wrote: > In C++ (gack!) I got used to creating a helper function with each class to > check the class object initialisation parameters prior to creating the > object. > > In Python, this would be > --- > import example > > if example.Paramete

Re: function nested

2007-05-24 Thread Bruno Desthuilliers
Gigs_ a écrit : > > i have this function. > > def f(start): > stack = [] > def f1(start): > for fname in os.listdir(startDir): >path = os.path.join(startDir, fname) >if os.path.isfile(path): >stack.append(path) >else: >

Re: Checking parameters prior to object initialisation

2007-05-24 Thread Bruno Desthuilliers
Brett_McS a écrit : > Fairly new to Python (and loving it!) > > In C++ (gack!) I got used to creating a helper function with each class to > check the class object initialisation parameters prior to creating the > object. > > In Python, this would be > --

Hiring Lead Python Programmer for Mozilla-Based Project

2007-05-24 Thread Alok, MetaStart
We're a US-based start-up building new software with the Mozilla Platform and are at present seeking a lead programmer/architect for our project. At present, we're planning to build a team in India, so we'd need the lead to be on-site for 6 to 12 months. We may, however, end up developing in the

Re: 0 == False but [] != False?

2007-05-24 Thread Steven D'Aprano
On Thu, 24 May 2007 06:59:32 +, Tim Roberts wrote: > As a general rule, I've found code like "if x == False" to be a bad idea in > ANY language. Surely that should be written as "if (x == False) == True"? -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple omniORBpy example throws exception with error 0x41540002

2007-05-24 Thread Samuel
On May 22, 6:53 pm, Duncan Grisby <[EMAIL PROTECTED]> wrote: > I think ORBit is configured to only listen on its proprietary Unix > domain socket protocol by default, not TCP, so omniORB doesn't know > how to talk to it. You should either tell ORBit to listen on TCP > (Google for how), or use omniO

Re: 0 == False but [] != False?

2007-05-24 Thread Rex Turnbull
Steven D'Aprano : > On Thu, 24 May 2007 06:59:32 +, Tim Roberts wrote: > >> As a general rule, I've found code like "if x == False" to be a bad idea in >> ANY language. > > > Surely that should be written as "if (x == False) == True"? > > Why compare to False? " if not x : ... " It reall

Changing Unicode object to Tuple Type

2007-05-24 Thread laxmikiran . bachu
Can we have change a unicode string Type object to a Tuple type object.. If so how -- http://mail.python.org/mailman/listinfo/python-list

Changing Unicode object to Tuple Type

2007-05-24 Thread laxmikiran . bachu
Can we have change a unicode string Type object to a Tuple type object.. If so how -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing Unicode object to Tuple Type

2007-05-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Can we have change a unicode string Type object to a Tuple type > object.. If so how Why? Are you getting an error that makes you think that's a good idea? Tuples are basically structs, unicode objects are strings. There is no canonical way to convert them. Tel

Re: Changing Unicode object to Tuple Type

2007-05-24 Thread John Machin
On May 24, 9:45 pm, [EMAIL PROTECTED] wrote: > Can we have change a unicode string Type object to a Tuple type > object.. If so how >>> x = u'fubar' >>> y = tuple(x) >>> y (u'f', u'u', u'b', u'a', u'r') >>> type(x) >>> type(y) >>> But I'm quite sure that's not the question you should be a

Re: Changing Unicode object to Tuple Type

2007-05-24 Thread Amit Khemka
On 24 May 2007 04:45:32 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can we have change a unicode string Type object to a Tuple type > object.. If so how *Loosely* speaking a tuple is a collection of multiple objects. So what are the objects that you want to put in that tuple ?! Or

Re: Call script which accepts com. line par. from another scriptanderror control

2007-05-24 Thread Karim Ali
>Karim Ali wrote: > > > What I still dont know though is how do I handle the fact that the first > > script is expecting command line parameters. I would like to be able to > > replace the command line parameters by a variable such that the second > > script can call: first_script.main("command lin

Re: Web Archtecture using tow layers in Phyton

2007-05-24 Thread Amit Khemka
On 5/23/07, Wagner Garcia Campagner <[EMAIL PROTECTED]> wrote: > Hello, > > I need to develop an web applications that meet the following requirements: > > - 2 layers: the first one is the user interface (browser) and the second one > is the interaction with the operacional system of the server. >

Re: Changing Unicode object to Tuple Type

2007-05-24 Thread laxmikiran . bachu
On May 24, 5:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > Can we have change a unicode string Type object to a Tuple type > > object.. If so how > > Why? Are you getting an error that makes you think that's a good idea? > > Tuples are basically struc

installing cx_Oracle.

2007-05-24 Thread Carl K
I am trying to use this: http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html it is a real module, right? sudo easy_install cx_Oracle did not easy_install cx_Oracle. http://www.python.org/pypi/cx_Oracle/4.3.1 doesn't give me any clue. I got the source from http://prdownloads.sourceforge

Re: converting text and spans to an ElementTree

2007-05-24 Thread Neil Cerutti
On 2007-05-23, Steven Bethard <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2007-05-22, Steven Bethard <[EMAIL PROTECTED]> wrote: >>> Thanks a lot! This put me on the right track (though the >>> devil's definitely in the details). It's working now:: >>> >>> >> tree = xmltools.text_and_

RE:A few questions

2007-05-24 Thread JYOUNG79
Just wanted to send a quick "Thank You!" to everyone who helped answer my questions. This list is awesome!! I'm currently reading "How to Think Like a Computer Scientist" (thanks Basilisk96) and it's got some excellent tutorial info. I still want to take a look at "Dive into Python" as well

Re: installing cx_Oracle.

2007-05-24 Thread Bill Scherer
Carl K wrote: > I am trying to use this: > http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html > it is a real module, right? > It is indeed. > sudo easy_install cx_Oracle did not easy_install cx_Oracle. > > http://www.python.org/pypi/cx_Oracle/4.3.1 doesn't give me any clue. > > I got

configobj - use of

2007-05-24 Thread Bruce
I assume that you know the module configobj. I use it like this: I have a config_file : [sec1] [[subsec1]] a = 1 b = 2 [[subsec2]] a = 3 b = 1 .. ans so on Then in the code I have c = configobj.ConfigObj(path_to_config file) then I go like for instance for s in c['sec1']: print c['sec1

Re: installing cx_Oracle.

2007-05-24 Thread Diez B. Roggisch
Carl K schrieb: > I am trying to use this: > http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html > it is a real module, right? > > sudo easy_install cx_Oracle did not easy_install cx_Oracle. > > http://www.python.org/pypi/cx_Oracle/4.3.1 doesn't give me any clue. > > I got the source f

Re: Changing Unicode object to Tuple Type

2007-05-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > On May 24, 5:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] schrieb: >> >>> Can we have change a unicode string Type object to a Tuple type >>> object.. If so how >> Why? Are you getting an error that makes you think that's a good idea?

Re: Lists vs tuples (newbie)

2007-05-24 Thread Duncan Booth
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Duncan Booth" <[EMAIL PROTECTED]> wrote: >> "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >> >> > Aside from the hashing issue, there is nothing that a tuple can do >> > that can't be done as well or better by a list. >> >> There are a few oth

Re: A few questions

2007-05-24 Thread scott
[EMAIL PROTECTED] wrote: > Just wanted to send a quick "Thank You!" to everyone who helped answer my > questions. This > list is awesome!! I'm finding the same, this list is amazing. There is a more welcome feeling than the C or C++ list I have seen. > I'm currently reading "How to Think Like

Re: (Modular-)Application Framework / Rich-Client-Platform in Python

2007-05-24 Thread Jorge Mazzonelli
Maybe I'm missing the point but the mozilla platform doesn't meet you're needs? I know it's not a pure python solution but there's work in progress to use python as a scripting language instead of javascript to develop the components. I did not made anything on the python + XUL side but tested 2 y

Re: installing cx_Oracle.

2007-05-24 Thread Bill Scherer
Bill Scherer wrote: > Carl K wrote: > >> I am trying to use this: >> http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html >> it is a real module, right? >> >> > It is indeed. > >> sudo easy_install cx_Oracle did not easy_install cx_Oracle. >> >> http://www.python.org/pypi/cx_

problems to write a wav file

2007-05-24 Thread Gautier Krings
Hello, I have a small problem for writing a .wav file. I can't find in which format I have to pass my data in the writeframes function of the wave module. here's my code, I am just trying to open a wav file, extracting the data from it, and writing it in another wav file. The problem is that the

Re: installing cx_Oracle.

2007-05-24 Thread Carl K
Getting closer, thanks Bill and Diez. $ export ORACLE_HOME $ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client $ python setup.py build $ sudo python setup.py install $ python -c "import cx_Oracle" Traceback (most recent call last): File "", line 1, in ? ImportError: libclntsh.so.

Re: 0 == False but [] != False?

2007-05-24 Thread Grant Edwards
On 2007-05-24, Rex Turnbull <[EMAIL PROTECTED]> wrote: > Steven D'Aprano : >> On Thu, 24 May 2007 06:59:32 +, Tim Roberts wrote: >> >>> As a general rule, I've found code like "if x == False" to be a bad idea in >>> ANY language. >> >> >> Surely that should be written as "if (x == False) ==

Re: Python and GUI

2007-05-24 Thread Brian Blais
Peter Decker wrote: > On 5/21/07, Paul McNett <[EMAIL PROTECTED]> wrote: > >> Shameless plug: consider using Dabo on top of wxPython - we feel it >> makes wxPython even easier and more pythonic, but admittedly there's a >> bit of a learning curve there too. Even though Dabo is a full >> applicatio

Re: installing cx_Oracle.

2007-05-24 Thread Bill Scherer
Carl K wrote: > Getting closer, thanks Bill and Diez. > > $ export ORACLE_HOME > $ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client > $ python setup.py build > $ sudo python setup.py install > > $ python -c "import cx_Oracle" > Traceback (most recent call last): >File "", line 1,

Re: Python on Vista installation issues

2007-05-24 Thread Chris Gonnerman
Okay, I've figured it out. It's easy (but stupid)... right click the extension installer program, and choose Run as Administrator. Just posting this so the next Google search for an answer might actually find one. --

Re: installing cx_Oracle.

2007-05-24 Thread Carl K
Bill Scherer wrote: > Carl K wrote: >> Getting closer, thanks Bill and Diez. >> >> $ export ORACLE_HOME >> $ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client >> $ python setup.py build >> $ sudo python setup.py install >> >> $ python -c "import cx_Oracle" >> Traceback (most recent ca

Bootstrapping

2007-05-24 Thread Mauler
I need some help with adding bootstrap code to the core of python, the idea is to leave a super base core inside a zip file (python25.zip works right out of the box) and leave the rest in separate zip modules. Making it more friendly with pendrives and more practical as a standalone runtime (ie, wi

Invalid thread state for this thread

2007-05-24 Thread Martin Evans
I know this has been seen before but it is not making too much sense (after reading many posts). It all appears to work fine but then dies after about 40 invocations. My app has Python embedded, it is embedded as part of a dll which initializes python and finalizes on load and unload (see below

Re: Python and GUI

2007-05-24 Thread Grant Edwards
On 2007-05-24, Brian Blais <[EMAIL PROTECTED]> wrote: > I'd like to ask the Python community about this, because it > seems to me that there is a real need that is not being met > very effectively. [...] "...but wx is written in C++ and > definitely shows, even in the Python port". It's just not

Re: configobj - use of

2007-05-24 Thread Steve Holden
Bruce wrote: > I assume that you know the module configobj. I use it like this: > I have a config_file : > > [sec1] > [[subsec1]] > a = 1 > b = 2 > [[subsec2]] > a = 3 > b = 1 > > .. ans so on > > Then in the code I have c = configobj.ConfigObj(path_to_config file) > > then I go like for instan

What is an instance and what isn't?

2007-05-24 Thread Gre7g Luterman
I suppose I was lulled into complacency by how Python makes so many things look like classes, but I'm starting to realize that they're not, are they? I'm writing a C program which handles Python objects in different ways based on their type. I do a PyInstance_Check(PyObj) to determine if the PyO

Re: Bootstrapping

2007-05-24 Thread ici
On May 24, 5:53 pm, Mauler <[EMAIL PROTECTED]> wrote: > I need some help with adding bootstrap code to the core of python, the > idea is to leave a super base core inside a zip file (python25.zip > works right out of the box) and leave the rest in separate zip > modules. Making it more friendly wit

Re: Python and GUI

2007-05-24 Thread Ed Leafe
On May 24, 2007, at 10:22 AM, Brian Blais wrote: > Then there is Dabo, which I personally have had problems with. I > am looking for a > pythonic, professional looking GUI framework. I first tried dabo > with python 2.4, > and had to install sqlite, which seemed a bit odd for trying to > j

How can I time a method of a class in python using Timeit

2007-05-24 Thread [EMAIL PROTECTED]
Hi, I am using timeit to time a global function like this t = timeit.Timer("timeTest()","from __main__ import timeTest") result = t.timeit(); But how can i use timeit to time a function in a class? class FetchUrlThread(threading.Thread): def aFunction(self): # do something

of destructors, open files and garbage collection

2007-05-24 Thread massimo s.
Hi, Python 2.4, Kubuntu 6.06. I'm no professional programmer (I am a ph.d. student in biophysics) but I have a fair knowledge of Python. I have a for loop that looks like the following : for item in long_list: foo(item) def foo(item): item.create_blah() #<--this creates item.blah;

Reading (and writing?) audio file tags

2007-05-24 Thread Paul Moore
I'd like to write some scripts to analyze and manipulate my music files. The files themselves are in MP3 and FLAC format (mostly MP3, but FLAC where I ripped original CDs and wanted a lossless format). I've no idea what form of tags are used in the files (ID3v1, ID3v2, OGG, APE, ...) I just used wh

Re: Shared Memory Space - Accross Apps & Network

2007-05-24 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tim Golden <[EMAIL PROTECTED]> wrote: . . . >PyLinda - http://www-users.cs.york.ac.uk/~aw/pylinda/ > >This implements the tuplespace paradigm. It's great >fun to use, but as far as I know this i

Re: of destructors, open files and garbage collection

2007-05-24 Thread Paul Moore
On 24 May, 16:40, "massimo s." <[EMAIL PROTECTED]> wrote: > Now, what I thought is that if I call > > del(item) > > it will delete item and also all objects created inside item. Sort of, but it's a bit more subtle. You'll stop the name "item" from referring to your item - if nothing else refers to

Module imports fine from interactive, not from script

2007-05-24 Thread Joshua J. Kugler
Yes, I've read this: http://mail.python.org/pipermail/python-list/2006-August/395943.html That's not my problem. I installed PlanetPlanet via the package's "setup.py install" command (as root). planet.py will not run, however, giving me this error: Traceback (most

Re: Reading (and writing?) audio file tags

2007-05-24 Thread darren kirby
quoth the Paul Moore: > I'd like to write some scripts to analyze and manipulate my music > files. The files themselves are in MP3 and FLAC format (mostly MP3, > but FLAC where I ripped original CDs and wanted a lossless format). > I've no idea what form of tags are used in the files (ID3v1, ID3v2,

Re: of destructors, open files and garbage collection

2007-05-24 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, massimo s. wrote: > I have a for loop that looks like the following : > > for item in long_list: >foo(item) > > def foo(item): >item.create_blah() #<--this creates item.blah; by doing that it > opens a file and leaves it open until blah.__del__() is called

Re: Module imports fine from interactive, not from script

2007-05-24 Thread Paul Moore
On 23 May, 02:20, "Joshua J. Kugler" <[EMAIL PROTECTED]> wrote: > Yes, I've read > this:http://mail.python.org/pipermail/python-list/2006-August/395943.html > That's not my problem. > > I installed PlanetPlanet via the > package's "setup.py install" command (as root)

Re: installing cx_Oracle.

2007-05-24 Thread Steve Holden
Dennis Lee Bieber wrote: > On Thu, 24 May 2007 09:07:07 -0500, Carl K <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Getting closer, thanks Bill and Diez. >> >> $ export ORACLE_HOME >> $ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client > > Don't those

Re: Module imports fine from interactive, not from script

2007-05-24 Thread Steve Holden
Joshua J. Kugler wrote: > Yes, I've read this: > http://mail.python.org/pipermail/python-list/2006-August/395943.html > That's not my problem. > > I installed PlanetPlanet via the > package's "setup.py install" command (as root). planet.py will not run, > however, g

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread vasudevram
On May 24, 8:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am using timeit to time a global function like this > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > result = t.timeit(); > > But how can i use timeit to time a function in a class? > class FetchUrlTh

need advice on building core code for python and PHP

2007-05-24 Thread digimotif
All, I'm currently working with a small development company on a PHP application they already have. There are several processing tasks that could be scripted in Python and run in the background to modify a database, instead of the way they have it now, which waits for a webpage to return from proc

Re: Reading (and writing?) audio file tags

2007-05-24 Thread Paul Moore
On 24 May, 17:22, darren kirby <[EMAIL PROTECTED]> wrote: > quoth the Paul Moore: > > > I'd like to write some scripts to analyze and manipulate my music > > files. The files themselves are in MP3 and FLAC format (mostly MP3, > > but FLAC where I ripped original CDs and wanted a lossless format). >

No file from stdin

2007-05-24 Thread Tartifola
Hi, suppose a script of python is waiting for a file from the stdin and none is given. How can I make the script to stop and, for example, print an error message? Sorry for the n00b question and thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: of destructors, open files and garbage collection

2007-05-24 Thread massimo s.
> It will delete the *name* `item`. It does nothing to the object that was > bound to that name. If the name was the only reference to that object, it > may be garbage collected sooner or later. Read the documentation for the > `__del__()` method for more details and why implementing such a meth

Re: of destructors, open files and garbage collection

2007-05-24 Thread massimo s.
> Relying on the `__del__()` method isn't a good idea because there are no > really hard guaranties by the language if and when it will be called. Ok, I read the __del__() docs and I understand using it is not a good idea. I can easily add a close_files() method that forces all dangling files to

Re: installing cx_Oracle.

2007-05-24 Thread Carl K
Dennis Lee Bieber wrote: > On Thu, 24 May 2007 09:07:07 -0500, Carl K <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Getting closer, thanks Bill and Diez. >> >> $ export ORACLE_HOME >> $ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client > > Don't those

Re: Different methods with same name but different signature?

2007-05-24 Thread Robert Kern
No. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

modifying values of List or Dictionary when iterating on them

2007-05-24 Thread aspineux
Hello I just want to update the data inside List or Dictionary without adding or deleting object. is this correct ? l=[1, 2, 3] for i, v in enumerate(l): l[i]=v+1 d=dict(a=1, b=2, c=3) for k, v in d.iteritems(): d[k]=d[k]+1 Both works, but : are they correct ? are they optimum for big

Re: Bootstrapping

2007-05-24 Thread Mauler
I've seen it, but its different, the idea behind pyinstaller is to bundle python for a specific application, my idea is to modularize and compact the core of python and reuse the egg concept for extensions. The thing is that refuses to load the site-packages when the core is compressed. thanks agai

Re: No file from stdin

2007-05-24 Thread aspineux
On 24 mai, 18:48, Tartifola <[EMAIL PROTECTED]> wrote: > Hi, > suppose a script of python is waiting for a file from the stdin and none > is given. How can I make the script to stop and, for example, print an > error message? > > Sorry for the n00b question and thanks import sys import os.path if

Re: 0 == False but [] != False?

2007-05-24 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Paul McGuire <[EMAIL PROTECTED]> wrote: > This has *got* to rank up there among the VFAQ's of them all, along > with the mysterious shared default empty list argument. I think this > particular question has been asked in one form or another at least > twice a week

Re: modifying values of List or Dictionary when iterating on them

2007-05-24 Thread Christopher Anderson
> d=dict(a=1, b=2, c=3) > for k, v in d.iteritems(): > d[k]=d[k]+1 You might as well do: d[k] = v + 1, like for the list. -- http://mail.python.org/mailman/listinfo/python-list

Re: CP4E revival

2007-05-24 Thread Michael Tobis
On May 24, 5:03 am, Richard Jones <[EMAIL PROTECTED]> wrote: > Michael Tobis wrote: > >http://tinyurl.com/yr62r3 > > > seems to short-circuit some pointless hoop-jumping to get you to the > > article. > > Hoop-jumping implemented to prevent just this kind of direct linking (and > thus not saving of

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
On May 24, 9:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am using timeit to time a global function like this > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > result = t.timeit(); > > But how can i use timeit to time a function in a class? > class FetchUrlTh

Re: need advice on building core code for python and PHP

2007-05-24 Thread Szabolcs Nagy
> Is there a way I could code the base (core) code in Python and have > PHP call it? I've really liked using SQLAlchemy and there are other * quick and dirty solution: in a shell: $ python yourscript.py pipe_out in the php script: fwrite(pipe_in, input_data); results = fread(pipe_out, size

Re: installing cx_Oracle.

2007-05-24 Thread Carsten Haese
On Thu, 2007-05-24 at 16:15 +, Dennis Lee Bieber wrote: > On Thu, 24 May 2007 09:07:07 -0500, Carl K <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Getting closer, thanks Bill and Diez. > > > > $ export ORACLE_HOME > > $ ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/prod

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
On May 24, 11:30 am, 7stud <[EMAIL PROTECTED]> wrote: > On May 24, 9:36 am, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > Hi, > > > I am using timeit to time a global function like this > > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > > result = t.timeit(); > > >

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
Actually, you can do this: class Dog(object): def aFunction(self): result = 20 + 2 def run(self): #do stuff aFunction() #do other stuff import timeit t = timeit.Timer("d.aFunction()", "from __main__ import Dog; d = Dog()") print t.timeit() Since you only

Re: pyodbc data corruption problem

2007-05-24 Thread Joe Salmeri
I have done some additiona investigate into this problem and found the following: As described below the problem does not begin to appear until the return value size is > 2048. Once the return value is greater than 2048 bytes the value returned by pyodbc is 2 times the actual size of the retur

Re: Windows Debugging w/o MS

2007-05-24 Thread Christopher Anderson
> Debug builds are incompatible with release builds. You'll need to > build every binary extension in debug mode (assuming the original > authors don't provide debug builds). Right, and this is what I would like to avoid having to do. Thanks, Chris PS. Sorry for the duplicate olsongt -- http:/

question about getch()

2007-05-24 Thread gliquidsnake
Hey all, I'm having a problem with using msvcrt.getch() . What I want is some functionality like this: print 'blah blah blah, good_input to do blah blah blah, exit_key to exit' while input != exit_key: input = get_input_from_getch() if input == good_input: print input

Re: need advice on building core code for python and PHP

2007-05-24 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, digimotif <[EMAIL PROTECTED]> wrote: >All, >I'm currently working with a small development company on a PHP >application they already have. There are several processing tasks >that could be scripted in Python and run in the background to modify a >database, instead

Re: question about getch()

2007-05-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hey all, > > I'm having a problem with using msvcrt.getch() . What I want is some > functionality like this: > > print 'blah blah blah, good_input to do blah blah blah, exit_key to exit' > > while input != exit_key: > input = get_input_from_getch() > > i

  1   2   >