Re: wxPython and threads

2007-07-17 Thread Stef Mientki
Benjamin wrote: > I'm writing a search engine in Python with wxPython as the GUI. I have > the actual searching preformed on a different thread from Gui thread. > It sends it's results through a Queue to the results ListCtrl which > adds a new item. This works fine or small searches, but when the >

Weekly Python Patch/Bug Summary

2007-07-17 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 394 open ( +2) / 3827 closed (+35) / 4221 total (+37) Bugs: 1046 open ( +4) / 6773 closed (+16) / 7819 total (+20) RFE : 262 open ( -1) / 293 closed ( +1) / 555 total ( +0) New / Reopened Patches __ make buil

Open HTML file in IE

2007-07-17 Thread gravey
Hello. Apologies if this is a basic question, but I want to open a HTML file from my local drive (is generated by another Python script) in Internet Explorer. I've had a look at the webbrowser module and this doesn't seem to be what I need. Any help much appreciated. -- http://mail.python.org/ma

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Alex Martelli
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 16 Jul 2007 11:45:04 -0700, Chris Carlen > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > The more I play with Python, the more I like it. Perhaps I will > > understand OOP quicker than I thought. What I've learne

dejagnu equivalent

2007-07-17 Thread Rustom Mody
Does anyone know if a dejagnu equivalent exists for python? [Dejagnu is in tcl] -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython, threads, and search engine

2007-07-17 Thread Stephen Hansen
I'm assuming you're accessing this Queue in an idle loop maybe? How many items do you get out of it before you pass and wait for a re-invocation? Either way, you can try calling 'wx.Yield()' after each add to the GUI or every few or such, so the GUI can process events. On 7/17/07, Benjamin <[EMAI

Re: Single-stepping through a python script

2007-07-17 Thread Ben Finney
Craig Howard <[EMAIL PROTECTED]> writes: > Sorry, I didn't give enough detail. Is it possible to single-step > through a code object without using pdb? (Pdb uses the console which > is not what I want.) Rather than play elimination, could you tell us more about what you *do* want? That is, please

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Walker Lindley
This is probably way more simple than you mean, but str() can turn an int into a string and int() to go the opposite direction. Is that what you're talking about or do you need something else? -Walker Lindley On 7/17/07, Dan Bishop <[EMAIL PROTECTED]> wrote: On Jul 17, 7:40 am, mosi <[EMAIL P

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Dan Bishop
On Jul 17, 7:40 am, mosi <[EMAIL PROTECTED]> wrote: > Thank you, > this is great, > I thought that this should be standard in python 2.4 or 2.5 or in some > standard library (math ???) > Didn`t find anything. The bin() function is slated to be added to the next version of Python. Why there isn't

Re: accessing javascript variables within psp code

2007-07-17 Thread Daniel
On Wed, 18 Jul 2007 04:29:27 +0300, BAnderton <[EMAIL PROTECTED]> wrote: > > Hello all, > > Question: Is there any way to access a javascript variable from > within psp code? > > > I'm aware of how to do the reverse of this (js_var='<%=psp_var%>'). > > > Here's a non-working example of what I'm

Re: Semantics of file.close()

2007-07-17 Thread Paul Rubin
"Evan Klitzke" <[EMAIL PROTECTED]> writes: > Is this buffering being done by Python or the kernel? I think this refers to buffering done in the C stdio library, which Python uses. -- http://mail.python.org/mailman/listinfo/python-list

wxPython and threads

2007-07-17 Thread Benjamin
I'm writing a search engine in Python with wxPython as the GUI. I have the actual searching preformed on a different thread from Gui thread. It sends it's results through a Queue to the results ListCtrl which adds a new item. This works fine or small searches, but when the results number in the hun

Re: urllib to cache 301 redirections?

2007-07-17 Thread O.R.Senthil Kumaran
* John Nagle <[EMAIL PROTECTED]> [2007-07-16 12:34:00]: > That assumes you're reusing the same object to reopen another URL. > > Is this thread-safe? I don't know. I looked into few other cache requests (cache ftp) and saw how it was implemented. I am not getting as how this wont be thr

Re: urllib to cache 301 redirections?

2007-07-17 Thread O.R.Senthil Kumaran
* John J Lee <[EMAIL PROTECTED]> [2007-07-16 20:17:40]: > > I spent a little time thinking about a solution and figured out that the > > following changes to HTTPRedirectHandler, might be helpful in implementing > > this. > > Did you post it on the Python SF patch tracker? > > If not, please do,

Re: In a dynamic language, why % operator asks user for type info?

2007-07-17 Thread Asun Friere
On Jul 17, 5:38 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > indeed anything which has an __int__ method may be > passed to the %d formatter: Anything?! Sorry to be persnickety here, but what about this: class C : def __int__ (self) : pass '%d' % C() or this: def foo (val) : return val foo

Re: Semantics of file.close()

2007-07-17 Thread Evan Klitzke
On 7/17/07, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "Evan Klitzke" <[EMAIL PROTECTED]> writes: > > > You should take a look at the man pages for close(2) and write(2) (not > > fclose). Generally you will only get an error in C if you try to close > > a file that isn't open. In Python you don't e

Re: Break up list into groups

2007-07-17 Thread Ron Adam
Matt McCredie wrote: > That certainly is fast, unfortunately it doesn't pass all of the tests. > I came up with those tests so I don't know how important they are to the > original poster. I modified it and came up with a generator and a > non-generator version based (roughly) on your algorith

wxPython, threads, and search engine

2007-07-17 Thread Benjamin
I'm writing a search engine in Python with wxPython as the GUI. I have the actual searching preformed on a different thread from Gui thread. It sends it's results through a Queue to the results ListCtrl which adds a new item. This works fine or small searches, but when the results number in the hun

Re: Relative Imports

2007-07-17 Thread Scott David Daniels
Pat O'Hara wrote: > Hey guys, I know this is a really stupid question, but I've tried > googling and nothing came up. I also tried IRC, but it was too crowded > and I didn't get much useful information. > > I'm using Python 2.5 on WinXP, and I'm trying to do a relative import. > Here's the pack

accessing javascript variables within psp code

2007-07-17 Thread BAnderton
Hello all, Question: Is there any way to access a javascript variable from within psp code? I'm aware of how to do the reverse of this (js_var='<%=psp_var%>'). Here's a non-working example of what I'm trying to do: - - - (begin example) - - - function Test(txt) { a = confirm('Are you sure

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread [EMAIL PROTECTED]
On Jul 17, 7:40 am, mosi <[EMAIL PROTECTED]> wrote: > Thank you, > this is great, > I thought that this should be standard in python 2.4 or 2.5 or in some > standard library (math ???) > Didn`t find anything. You can also look up the gmpy module (not part of standard library). It contains a lot o

Single-stepping through a python script

2007-07-17 Thread Craig Howard
>>Craig Howard schrieb: >> Hello All: >> >> Is is possible to compile a code object and single-step through its >> execution? >import pdb; pdb.set_trace() > >Look up the pdb module documentation. > >Diez Sorry, I didn't give enough detail. Is it possible to single-step through a code

Re: sqlite3 db update extremely slow

2007-07-17 Thread Gerhard Häring
coldpizza wrote: > Thanks a lot, Roel, adding a single commit() at the end did solve the > speed problem. > > Another question is do I have to explicitly close the DB connection, > or is it automatically garbage collected? Is it Ok to no have any > cleanup code? > > Another question would be how

A new Classifieds Website has been Launched.

2007-07-17 Thread Anmolads
A new Classifieds Website has been Launched. Place Full page Ad for free at Anmolads.com http://www.Anmolads.com Get your desired Job from our Job Portal... www.Anmoljobs.com/forum Logon to www.anmolads.com for further details. Place Full Page For Free at www.Anmolads.com , www.earnyourcash.com

[ANN] pysqlite 2.3.5 released

2007-07-17 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pysqlite 2.3.5 released === I'm pleased to announce the availability of pysqlite 2.3.5. This is a bugfix release. Go to http://pysqlite.org/ for downloads, online documentation and reporting bugs. What is pysqlite? pysqlite

Re: Lookup encoding aliases in Python 2.4

2007-07-17 Thread Omari Norman
Forget about that--I then found /usr/lib/python2.5/encodings/aliases.py, which is also in Python 2.4. Sorry for the silly question! On Tue, Jul 17, 2007 at 07:04:59PM -0400, Omari Norman wrote: > My program creates new XML files (not through the DOM, but just by > simple file.write calls.) It woul

Lookup encoding aliases in Python 2.4

2007-07-17 Thread Omari Norman
My program creates new XML files (not through the DOM, but just by simple file.write calls.) It would be nice if said files would be in the default system encoding. So in Python 2.5 I use ENCODING = codecs.lookup(locale.getdefaultlocale()[1]).name locale.getdefaultlocale()[1] sometimes returns a

Re: really small values

2007-07-17 Thread John Machin
On 18/07/2007 7:13 AM, Dee Asbury wrote: > In multiplying a value of xe^-325 with ye^-4, Python is returning zero. > How do I get it to give me back my tiny value? > It is difficult to understand what you mean by xe^-325 etc ... in Python, ^ is the bitwise exclusive-or operator. The power opera

Re: Interpreting non-ascii characters.

2007-07-17 Thread Omari Norman
> I want to create a script which reads files in a > current directory and renames them according to some > scheme. The file names are in Russian - sometimes > the names encoded as win-1251, sometimes as koi8-r etc. > I want to read in file name and convert it to list for > further processing. T

Re: Single-stepping through a python script

2007-07-17 Thread Diez B. Roggisch
Craig Howard schrieb: > Hello All: > > Is is possible to compile a code object and single-step through its > execution? import pdb; pdb.set_trace() Look up the pdb module documentation. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Semantics of file.close()

2007-07-17 Thread Matthew Woodcraft
Donn Cave <[EMAIL PROTECTED]> wrote: > I don't think there's any remedy for it, other than the obvious - > either always flush, or wrap an explicit close in its own exception > handler. Even if you have flushed, close() can give an error with some filesystems. -M- -- http://mail.python.org/mai

Re: Interpreting non-ascii characters.

2007-07-17 Thread John Machin
On 18/07/2007 4:11 AM, ddtl wrote: > Hello everybody, > > I want to create a script which reads files in a > current directory and renames them according to some > scheme. The file names are in Russian - sometimes > the names encoded as win-1251, sometimes as koi8-r etc. You have a file system

Re: Embedding/Extending Python in/with C++: non-static members?

2007-07-17 Thread Nick Craig-Wood
dmoore <[EMAIL PROTECTED]> wrote: > I've obviously spent too much time with dynamic languages. The problem > with what I'm trying to do is obvious: In C++ you simply can't pass > pointers to call a particular instance of a C++ class method so there > is no way to initialize the PyMethodDef with

Single-stepping through a python script

2007-07-17 Thread Craig Howard
Hello All: Is is possible to compile a code object and single-step through its execution? Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: really small values

2007-07-17 Thread Gary Herron
Dee Asbury wrote: > In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How > do I get it to give me back my tiny value? > > Thanks! > Dee > > > Of course, Python is doing no such thing. The floating point arithmetic hardware on your machine is doing the multiplication a

Re: Semantics of file.close()

2007-07-17 Thread Hrvoje Niksic
"Evan Klitzke" <[EMAIL PROTECTED]> writes: > You should take a look at the man pages for close(2) and write(2) (not > fclose). Generally you will only get an error in C if you try to close > a file that isn't open. In Python you don't even have to worry about > that -- if you close a regular file

Re: How to organize control access to source code ?

2007-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Boddie <[EMAIL PROTECTED]> wrote: >On 17 Jul, 01:16, [EMAIL PROTECTED] wrote: >> >> Thanks for your response, >> But I want to know if there is a process or best practices, to give >> not the access to all of the project. in other words, must every >> developer

Pickled objects over the network

2007-07-17 Thread Walker Lindley
I'm working on a distributed computing program and need to send Python objects over a TCP socket. Specifically, the objects that I'm working with subclass the builtin list type (I don't know whether or not that matters), but also include other data fields. These objects are put into dictionaries a

Re: Semantics of file.close()

2007-07-17 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: ... > > How do I ensure that the close() methods in my finally clause do not > > throw an exception? > You should take a look at the man pages for close(2) and write(2) (not > fclose). Generally you will only get an error

Re: sqlite tuples

2007-07-17 Thread John K Masters
On 17:30 Tue 17 Jul , Carsten Haese wrote: > On Tue, 2007-07-17 at 21:49 +0100, John K Masters wrote: > > I am fairly new to Python and am trying to get to grips with pysqlite2. > > >From what I have read data is returned as a list of tuples when using > > SELECT via connection.cursor. But I h

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Jay Loden
Steve Holden wrote: > It took a little bit more careful planning to get Icon pattern-matching > structures right, but there was much more explicit control of > backtracking. I only wish they'd grafted more OO concepts into it, then > I might never have bothered with Python! Someone did do an OO

Re: sqlite tuples

2007-07-17 Thread Carsten Haese
On Tue, 2007-07-17 at 21:49 +0100, John K Masters wrote: > I am fairly new to Python and am trying to get to grips with pysqlite2. > >From what I have read data is returned as a list of tuples when using > SELECT via connection.cursor. But I have not, despite frantic googling, > found how to INSER

* * * New eBooks Store * * *

2007-07-17 Thread Billy Bean
Multiple categories including literature, business, home & garden, computers & internet, and more! Learn how to make money at home, start your own business, try new recipes, etc. Complete resell rights included! http://www.grandgold.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Design question regarding exceptions.

2007-07-17 Thread James Stroud
asincero wrote: > I have a class called Users that provides a higher level of > abstraction to an underlying "users" table in a pgsql database. It > has methods like "addUser()" and "deleteUser()" which, obviously, wrap > the corresponding SQL statements. My question is would it better to > let a

really small values

2007-07-17 Thread Dee Asbury
In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How do I get it to give me back my tiny value? Thanks! Dee "The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'" - Isaac Asimov -- http://mai

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Daniel
On Tue, 17 Jul 2007 21:22:03 +0300, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > Bruno Desthuilliers wrote: >> mosi a écrit : >> >>> Problem: >>> how to get binary from integer and vice versa? >>> [snip] >>> What`s the simplest way to do this? >>> >> >> [EMAIL PROTECTED]:~$ python >> Pyt

Re: Break up list into groups

2007-07-17 Thread Matt McCredie
That certainly is fast, unfortunately it doesn't pass all of the tests. I came up with those tests so I don't know how important they are to the original poster. I modified it and came up with a generator and a non-generator version based (roughly) on your algorithm, that are almost as quick, and

sqlite tuples

2007-07-17 Thread John K Masters
I am fairly new to Python and am trying to get to grips with pysqlite2. >From what I have read data is returned as a list of tuples when using SELECT via connection.cursor. But I have not, despite frantic googling, found how to INSERT a list of tuples into a sqlite table. If I convert the tuple to

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Karthik Gurusamy
On Jul 17, 5:35 am, Bruno Desthuilliers wrote: > mosi a écrit : > > > > > Problem: > > how to get binary from integer and vice versa? > > The simplest way I know is: > > a = 0100 > > a > > 64 > > > but: > > a = 100 (I want binary number) > > does not work that way. > > > a.__hex__ exists > > a._

Re: Implementaion of random.shuffle

2007-07-17 Thread Steve Holden
Josiah Carlson wrote: > shabda raaj wrote: [...] > >> Anyway, is there some test harness we can run to test the robustness >> of shuffle? We can run that test harness for large values and see at >> what point all permutations are not possible or come with unequal >> probability. > > Shuffle works

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread hg
Chris Carlen wrote: > Hi: > > From what I've read of OOP, I don't get it. I have also found some > articles profoundly critical of OOP. I tend to relate to these articles. > > However, those articles were no more objective than the descriptions of > OOP I've read in making a case. Ie., what

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Steve Holden
Wolfgang Strobl wrote: > Steve Holden <[EMAIL PROTECTED]>: > >> I'm happy you are proceeding with so little trouble. Without wishing to >> confuse you, however, I should point out that this aspect of Python has >> very little to do with its object-orientation. There was a language >> called Ico

Design question regarding exceptions.

2007-07-17 Thread asincero
I have a class called Users that provides a higher level of abstraction to an underlying "users" table in a pgsql database. It has methods like "addUser()" and "deleteUser()" which, obviously, wrap the corresponding SQL statements. My question is would it better to let any exceptions thrown by th

PDF2ODT

2007-07-17 Thread orehon
Hello, I need to convert PDF to ODT or PDF to DOC using python! I was taking a look at http://www.kde-apps.org/content/show.php/show.php?content=18638&vote=bad&tan=6679097&PHPSESSID=a342d14ea5b9afdfe38580e29ff8bdd9 and this project is outdated. So any idea? Thank you! -- http://mail.pyt

Re: how to compile python to have gtk and Tkinter modules in Linux environment.

2007-07-17 Thread Zentrader
On Jul 16, 8:16 pm, [EMAIL PROTECTED] wrote: > import gtk and Tkinter modules. Those don't seem to be included when > I use the default ./configure or python setup.py. Tkinter is supposed to be included by default, although that depends on who's Python you are using and ./configure. You have to

Interpreting non-ascii characters.

2007-07-17 Thread ddtl
Hello everybody, I want to create a script which reads files in a current directory and renames them according to some scheme. The file names are in Russian - sometimes the names encoded as win-1251, sometimes as koi8-r etc. I want to read in file name and convert it to list for further proces

Pexpect, SSH, and CVS

2007-07-17 Thread Ben Snider
Hello all, So I'm setting up a script that runs when CVS wants to connect to an ext type server by setting CVS_RSH to my script so I can log in with a password. IE CVS_RSH=/etc/projects/blah.py. Which runs when I type say "cvs -d:ext:[EMAIL PROTECTED]:/cvsroot co module". I need this because of

directpython simple texture

2007-07-17 Thread ...:::JA:::...
Hello, Is there any real easy example for loading an texture in your directpython window??? For example this is my code: # loading directpython modules import d3dx import d3d from d3dc import * import d3dgui import time #making a window fr=d3dx.Frame(u"Bok kaj ima") # trying to load an texture

Deleting files and folders used by other processes on Windows

2007-07-17 Thread tkondal
Hi, I have been looking into making my file cleaning script more intelligent. The goal of the script is to delete everything on a drive except for a couple of folders which are skipped by the script. Recently, I noticed that some files where not being deleted because a process was using them. Is

Re: Dict Help

2007-07-17 Thread pruebauno
On Jul 17, 5:57 am, "Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote: > Morning Gabriel, > > I'm looking for a little more advice on this dictionary/list to > defaultdict/set conversion that we were talking about, there were a few > things I was looking to clarify. Firstly, what is the diffe

Re: Break up list into groups

2007-07-17 Thread Ron Adam
Matimus wrote: > I did some more experimenting and came up with the code below. It > shows several methods. When run, the script tests the robustness of > each method (roughly), and profiles it using timeit. The results from > running on my laptop are shown below the code. Try this one... def g

Re: Best method for inter process communications

2007-07-17 Thread Irmen de Jong
JamesHoward wrote: > I am looking for a way of performing inter process communication over > XML between a python program and something else creating XML data. What is that "something else"? --irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Wildemar Wildenburger
Bruno Desthuilliers wrote: > mosi a écrit : > >> Problem: >> how to get binary from integer and vice versa? >> [snip] >> What`s the simplest way to do this? >> > > [EMAIL PROTECTED]:~$ python > Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) > [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2

Re: Compiling python2.5 on IBM AIX

2007-07-17 Thread pruebauno
On Jul 17, 3:58 am, [EMAIL PROTECTED] wrote: > > I haven't compiled it myself, but I'm told that the installation I > > work with was compiled with: > > > export PATH=$PATH:/usr/vacpp/bin:/usr/vacpp/lib > > ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable- > > ipv6 AR="ar -X64"

Re: In a dynamic language, why % operator asks user for type info?

2007-07-17 Thread star . public
On Jul 17, 2:19 am, Paddy <[EMAIL PROTECTED]> wrote: > On Jul 17, 1:10 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > The string format operator, %, provides a functionality similar to the > > snprintf function in C. In C, the function does not know the type of > > each of

install python to custom prefix with custom library directories

2007-07-17 Thread Poor Yorick
Today I needed to install python from source on linux to a custom path. /usr/lib/libtk8.3.so existed, but I wanted python to link to /my/custom/path/lib/libtk8.4.so. I had LDFLAGS set: LDFLAGS="-L/my/custom/path/lib -Wl,-rpath,$base/lib -Wl,--enable-new-dtags" configure looked like this: ./c

Re: Semantics of file.close()

2007-07-17 Thread Evan Klitzke
On 7/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I'm a Python beginner and I'm trying to open, write and close a file > in a > correct manner. I've RTFM, RTFS, and I've read this thread: > http://groups.google.ca/group/comp.lang.python/browse_thread/thread/73bbda2c920521c/98c73

Re: Break up list into groups

2007-07-17 Thread Matimus
I did some more experimenting and came up with the code below. It shows several methods. When run, the script tests the robustness of each method (roughly), and profiles it using timeit. The results from running on my laptop are shown below the code. seqs = [# Original: [0xF0, 1, 2, 3, 0

Re: chmod directories recursively

2007-07-17 Thread Fabian Steiner
Jennifer Thacher wrote: > Fabian Steiner wrote: >> As far as I can see os.chmod() doesn't adjust permissions on directories >> recusively. Is there any other possibility to achieve this aim except for >> calling os.system('chmod -R /dir') directly? >> >> Thanks, >> Fabian > > Check out os.path.w

Re: merge two ranges

2007-07-17 Thread Marc 'BlackJack' Rintsch
On Tue, 17 Jul 2007 17:29:41 +, anoweb wrote: > I have two ranges of numbers and I need to determine if they overlap > or adjacent and if so return a new range containing the values. The > values are low and high for each pair, such that the first value of > the tuple is always less than or e

Relative Imports

2007-07-17 Thread Pat O'Hara
Hey guys, I know this is a really stupid question, but I've tried googling and nothing came up. I also tried IRC, but it was too crowded and I didn't get much useful information. I'm using Python 2.5 on WinXP, and I'm trying to do a relative import. Here's the package structure A/ __init__.

Re: how to find available classes in a file ?

2007-07-17 Thread Gabriel Genellina
En Tue, 17 Jul 2007 11:05:17 -0300, Alex Popescu <[EMAIL PROTECTED]> escribió: > On Jul 17, 4:41 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> > On Jul 17, 1:44 am, Stef Mientki <[EMAIL PROTECTED]> >> > wrote: >> >> I want to have a (dynamically) list of all classes defined in a >> p

merge two ranges

2007-07-17 Thread anoweb
I have two ranges of numbers and I need to determine if they overlap or adjacent and if so return a new range containing the values. The values are low and high for each pair, such that the first value of the tuple is always less than or equal to the second value in the tuple. for example: a = (0

building static python with Numeric

2007-07-17 Thread Alan
Dears, It's about Pyhton for Linux X86. First, I would like to know if it's possible to build a fully static python binary, something that does not depends on others libraries when using 'ldd python', e.g. If so, how? Second, I would like to build a python for distribution that would include (st

merge two ranges

2007-07-17 Thread anoweb
I have two ranges of numbers and I need to determine if they overlap or adjacent and if so return a new range containing the values. The values are low and high for each pair, such that the first value of the tuple is always less than or equal to the second value in the tuple. for example: a = (0

Re: Fetching a clean copy of a changing web page

2007-07-17 Thread star . public
On Jul 16, 4:50 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > John Nagle wrote: > >>I'm reading the PhishTank XML file of active phishing sites, > >> at "http://data.phishtank.com/data/online-valid/"; This changes > >> frequently, and it's big (about 10MB right now

Re: chmod directories recursively

2007-07-17 Thread Jennifer Thacher
Fabian Steiner wrote: > Hello! > > As far as I can see os.chmod() doesn't adjust permissions on directories > recusively. Is there any other possibility to achieve this aim except for > calling os.system('chmod -R /dir') directly? > > Thanks, > Fabian Check out os.path.walk. James -- http://ma

Re: Embedding/Extending Python in/with C++: non-static members?

2007-07-17 Thread dmoore
(I thought I'd follow up on this post so as not to send unsuspecting readers down a hopeless path) duh! I've obviously spent too much time with dynamic languages. The problem with what I'm trying to do is obvious: In C++ you simply can't pass pointers to call a particular instance of a C++ class

chmod directories recursively

2007-07-17 Thread Fabian Steiner
Hello! As far as I can see os.chmod() doesn't adjust permissions on directories recusively. Is there any other possibility to achieve this aim except for calling os.system('chmod -R /dir') directly? Thanks, Fabian -- http://mail.python.org/mailman/listinfo/python-list

Re: Implementaion of random.shuffle

2007-07-17 Thread Josiah Carlson
shabda raaj wrote: > The code for shuffle is > > if random is None: > random = self.random > for i in reversed(xrange(1, len(x))): > # pick an element in x[:i+1] with which to exchange x[i] > j = int(random() * (i+1)) > x[i], x[

Python with TestDirector

2007-07-17 Thread Lee, Solon
Hello Mr. Golawala, I am glad to spot this on the web search - "python and Test Director", However can you or anyone tell me more specifically how this COM objects works in between Python and "Test Director" or to where should I refer?? Thanks. Solon Lee E-mail confidentiality.

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: > .So adding SNOBOL patterns to another library would be a wonderful > gift to the Python community... Snobol patterns were invented at a time when nobody knew anything about parsing. They were extremely powerful (recursive with arbitrary amounts of backtracking)

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Eddie Corns
[EMAIL PROTECTED] (Aahz) writes: >In article <[EMAIL PROTECTED]>, >Wolfgang Strobl <[EMAIL PROTECTED]> wrote: >> >>SNOBOLs powerfull patterns still shine, compared to Pythons clumsy >>regular expressions. >Keep in mind that Python regular expressions are modeled on the >grep/sed/awk/Perl model

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Aahz
In article <[EMAIL PROTECTED]>, Wolfgang Strobl <[EMAIL PROTECTED]> wrote: > >SNOBOLs powerfull patterns still shine, compared to Pythons clumsy >regular expressions. Keep in mind that Python regular expressions are modeled on the grep/sed/awk/Perl model so as to be familiar to any sysadmin -- b

Re: how to find available classes in a file ?

2007-07-17 Thread Alex Popescu
On Jul 17, 4:41 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 16 Jul 2007 20:13:19 -0300, Alex Popescu > <[EMAIL PROTECTED]> escribió: > > > On Jul 17, 1:44 am, Stef Mientki <[EMAIL PROTECTED]> > > wrote: > >> I want to have a (dynamically) list of all classes defined in a py-file.

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Duncan Booth
John Machin <[EMAIL PROTECTED]> wrote: > Here's a sketch; I'll leave you to fill in the details -- you may wish > to guard against interesting input like b < 2. > def anybase(n, b, digits='0123456789abcdef'): > ...tmp = [] > ...while n: > ... n, d = divmod(n, b) > ... tmp

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Neil Cerutti
On 2007-07-17, mosi <[EMAIL PROTECTED]> wrote: > Thank you, > this is great, > I thought that this should be standard in python 2.4 or 2.5 or in some > standard library (math ???) > Didn`t find anything. Support is built-in for string representations of numbers in other than base 10, but conversio

Re: Binary blobs to jpeg

2007-07-17 Thread jayharvard
On Jul 16, 7:54 pm, [EMAIL PROTECTED] wrote: > On Jul 16, 3:23 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > > > > > On 2007-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > >> Have you tried to open the file in "wb" mode? > > > > The data is coming from a record set selection from th

RE: Dict Help

2007-07-17 Thread Steven D'Aprano
On Tue, 17 Jul 2007 10:57:29 +0100, Robert Rawlins - Think Blue wrote: > Morning Gabriel, > > I'm looking for a little more advice on this dictionary/list to > defaultdict/set conversion that we were talking about, there were a few > things I was looking to clarify. Firstly, what is the differenc

Re: How to organize control access to source code ?

2007-07-17 Thread Paul Boddie
On 17 Jul, 01:16, [EMAIL PROTECTED] wrote: > > Thanks for your response, > But I want to know if there is a process or best practices, to give > not the access to all of the project. in other words, must every > developer work on the entire copy of the project locally ? You probably want to split

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread mosi
Thank you, this is great, I thought that this should be standard in python 2.4 or 2.5 or in some standard library (math ???) Didn`t find anything. On Jul 17, 2:05 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 17, 9:09 pm, mosi <[EMAIL PROTECTED]> wrote: > > > > > Problem: > > how to get bin

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Daniel
On Tue, 17 Jul 2007 14:09:35 +0300, mosi <[EMAIL PROTECTED]> wrote: > > Problem: > how to get binary from integer and vice versa? > The simplest way I know is: > a = 0100 > a > 64 Also that is not binary - that is octal, binary would be: '0100' (denoted as a string, since 0100 in octal

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Bruno Desthuilliers
mosi a écrit : > Problem: > how to get binary from integer and vice versa? > The simplest way I know is: > a = 0100 > a > 64 > > but: > a = 100 (I want binary number) > does not work that way. > > a.__hex__ exists > a.__oct__ exists > > but where is a.__bin__ ??? > > > What`s the simplest wa

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Daniel
On Tue, 17 Jul 2007 14:09:35 +0300, mosi <[EMAIL PROTECTED]> wrote: > > Problem: > how to get binary from integer and vice versa? > The simplest way I know is: > a = 0100 > a > 64 > > but: > a = 100 (I want binary number) > does not work that way. > > a.__hex__ exists > a.__oct__ exists > > but

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread John Machin
On Jul 17, 9:09 pm, mosi <[EMAIL PROTECTED]> wrote: > Problem: > how to get binary from integer and vice versa? > The simplest way I know is: > a = 0100 > a > 64 > > but: > a = 100 (I want binary number) > does not work that way. > > a.__hex__ exists > a.__oct__ exists > > but where is a.__bin__

Re: Compiling python2.5 on IBM AIX

2007-07-17 Thread George Trojan
[EMAIL PROTECTED] wrote: >> I haven't compiled it myself, but I'm told that the installation I >> work with was compiled with: >> >> export PATH=$PATH:/usr/vacpp/bin:/usr/vacpp/lib >> ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable- >> ipv6 AR="ar -X64" >> make >> make install

a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread mosi
Problem: how to get binary from integer and vice versa? The simplest way I know is: a = 0100 a 64 but: a = 100 (I want binary number) does not work that way. a.__hex__ exists a.__oct__ exists but where is a.__bin__ ??? What`s the simplest way to do this? Thank you very much. -- http://mail

RE: Dict Help

2007-07-17 Thread Robert Rawlins - Think Blue
Morning Gabriel, I'm looking for a little more advice on this dictionary/list to defaultdict/set conversion that we were talking about, there were a few things I was looking to clarify. Firstly, what is the difference between a standard dict and a default dict? Is it purely a performance issue?

Re: Implementaion of random.shuffle

2007-07-17 Thread Hrvoje Niksic
Steven D'Aprano <[EMAIL PROTECTED]> writes: > In the case of CPython, the current implementation uses the Mersenne > Twister, which has a huge period of 2**19937. However, 2081! is > larger than that number, which means that at best a list of 2081 > items or longer can't be perfectly shuffled (not

Re: how to find available classes in a file ?

2007-07-17 Thread Stef Mientki
Gabriel Genellina wrote: > En Mon, 16 Jul 2007 20:13:19 -0300, Alex Popescu > <[EMAIL PROTECTED]> escribió: > >> On Jul 17, 1:44 am, Stef Mientki <[EMAIL PROTECTED]> >> wrote: >>> I want to have a (dynamically) list of all classes defined in a py-file. >>> Is there a way of getting this list, wit

  1   2   >