Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Rhamphoryncus
On Oct 22, 10:31 pm, Andy <[EMAIL PROTECTED]> wrote: > > You seem confused.  PEP 3121 is for isolated interpreters (ie emulated > > processes), not threading. > > Please reread my points--inherently isolated interpreters (ie. the top > level object) are indirectly linked to thread independence.  I

Re: crossplatform standalone python apps

2008-10-22 Thread Gabriel Rossetti
Martin v. Löwis wrote: I like to create a cross-platform standalone python application, like Mac OS *.app dirs. The idea is to distribute a zip file containing everything (the python interpreter and all) so that a user just unzips it and runs it. I don't think this can possibly work. If t

"Music Theory Programming" Google Group

2008-10-22 Thread Chuck Cronan
Outstretched (Omar?) Today I answered a query you presented two years ago about programming music at VBAX, "Using Arrays and Indexes To Manipulate Variables ( A Music Project )". I don't know if you solved it but I realized that the notes and MIDI codes actually follow a base 12 (duodecimal

Re: Passing a memory address (pointer) to an extension?

2008-10-22 Thread Thomas Heller
Philip Semanchuk schrieb: > I'm writing a Python extension in C that wraps a function which takes > a void * as a parameter. (The function is shmat() which attaches a > chunk of shared memory to the process at the address supplied by the > caller.) I would like to expose this function to Pyth

Re: Possible read()/readline() bug?

2008-10-22 Thread Terry Reedy
Steven D'Aprano wrote: On Wed, 22 Oct 2008 16:59:45 -0400, Terry Reedy wrote: Mike Kent wrote: Before I file a bug report against Python 2.5.2, I want to run this by the newsgroup to make sure I'm not [missing something]. Good idea ;-). What you are missing is a rereading of the fine manua

Re: Need some advice

2008-10-22 Thread alex23
On Oct 23, 3:15 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Bruno is correct, the protocol IS https, you don't type shttp into your > browser > get secure http connection. https[1] and shttp[2] are two entirely different protocols. [1] http://en.wikipedia.org/wiki/Https [2] http://en.wikipedia.

Re: substitution of a method by a callable object

2008-10-22 Thread netimen
On 23 окт, 00:26, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > netimen a écrit : > (snip) > > > OK, I have implemented Bruno Desthuilliers example. But there is > > another question: can I having a method determine if it is an instance > > of given class. So: > > As the name imply, a method is

Re: which program I need for sftp using pramiko??

2008-10-22 Thread Larry Bates
sa6113 wrote: which program I have to install for using paramiko for sftp between a two windows machine in local network?? I have installed freeSSHd for server machine but I got an Authentication failed erro when try to connect to server using this code : sock.connect((hostname, port)) t = par

Re: socket programming (client-server)

2008-10-22 Thread Larry Bates
ryan wrote: i have implemented a small client server model to do file transfer over a LAN network. It work with some machines on the network and on others it doesnt. when i run the server.py file in some machine then it pops up a windows security alert. The message is as follows: Do you

Re: Need some advice

2008-10-22 Thread Larry Bates
azrael wrote: I mean shttp. (secure hyper text transfer protocol) On Oct 22, 9:48 am, Bruno Desthuilliers wrote: azrael a écrit : There have been some discutions with my partner about which protocol to use. We agreed to use also http. But we are looking for a possibility to use something to

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Andy
> You seem confused.  PEP 3121 is for isolated interpreters (ie emulated > processes), not threading. Please reread my points--inherently isolated interpreters (ie. the top level object) are indirectly linked to thread independence. I don't want to argue, but you seem hell-bent on not hearing w

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-22 Thread Joe Strout
On Oct 22, 2008, at 10:00 PM, Steven D'Aprano wrote: It would have been easy to avoid this: just copy the relevant bits of the / directory hierarchy in the user's home directory. Global settings go in /etc and per user settings go in ~/etc. Global temp files go into / tmp and per user temp f

Re: Possible read()/readline() bug?

2008-10-22 Thread Steven D'Aprano
On Wed, 22 Oct 2008 16:59:45 -0400, Terry Reedy wrote: > Mike Kent wrote: >> Before I file a bug report against Python 2.5.2, I want to run this by >> the newsgroup to make sure I'm not [missing something]. > > Good idea ;-). What you are missing is a rereading of the fine manual > to see what y

Re: re.search over a list

2008-10-22 Thread Steve Holden
Pat wrote: > Bruno Desthuilliers wrote: >> Pat a écrit : >>> While I can use a for loop looking for a match on a list, I was >>> wondering if there was a one-liner way. >>> >>> In particular, one of my RE's looks like this '^somestring$' so I >>> can't just do this: re.search( '^somestring$', str(

Re: What's the perfect (OS independent) way of storing filepaths ?

2008-10-22 Thread Steven D'Aprano
On Tue, 21 Oct 2008 10:00:35 -0500, Grant Edwards wrote: >> It is true that all kinds of programs will create .app files in your >> home dir which is not very polite. > > It _is_ polite. Polite means following the established rules and doing > what's expected of you. That's exactly what is expe

Re: socket programming (client-server) error

2008-10-22 Thread James Mills
On Thu, Oct 23, 2008 at 1:49 PM, ryan <[EMAIL PROTECTED]> wrote: > any ideas? As mentioned before, try: * Turning _off_ _all_ _firewalls_. cheers James -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing a memory address (pointer) to an extension?

2008-10-22 Thread Robert Kern
John Nagle wrote: Philip Semanchuk wrote: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the caller.) I would like to expose this function

Re: socket programming (client-server) error

2008-10-22 Thread ryan
On Oct 22, 6:18 pm, Python <[EMAIL PROTECTED]> wrote: > On 22 okt 2008, at 13:50, ryan fox wrote: > > > > > i have implemented a small client server model to do file transfer > > over a LAN network. > > > It work with some machines on the network and on others it doesnt. > > when i run the server.p

Re: Triple-quoted strings hath not the Python-nature

2008-10-22 Thread Steven D'Aprano
On Tue, 21 Oct 2008 21:58:57 +1300, Lawrence D'Oliveiro wrote: > If triple-quoted strings had the Python-nature, then they would take > indentation into account. Thus: > > """this > is a > multi-line > string.""" > > would be equivalent to > > "this\n is a\n multi-line\nst

Re: Passing a memory address (pointer) to an extension?

2008-10-22 Thread John Nagle
Philip Semanchuk wrote: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the caller.) I would like to expose this function to Python, but I do

Re: Py2exe and Module Error...

2008-10-22 Thread Gabriel Genellina
En Wed, 22 Oct 2008 20:34:39 -0200, <[EMAIL PROTECTED]> escribió: I am using py2exe and everything is working fine except one module, ClientCookie, found here: http://wwwsearch.sourceforge.net/ClientCookie/ Keeps coming up as not found no matter what I do. I have tried all these combinations f

Re: Passing a memory address (pointer) to an extension?

2008-10-22 Thread Gabriel Genellina
En Wed, 22 Oct 2008 19:10:27 -0200, Philip Semanchuk <[EMAIL PROTECTED]> escribió: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the ca

Re: How to import from a file which is not in the current directory?

2008-10-22 Thread Luis M . González
Lets say that you are in directory "C:\\Python25" and you want to import function "bar" defined in module "foo" located in your windows desktop. You do it like this: >>> import sys >>> sys.path.append('C:\\Users\\You\\Desktop') >>> from foo import bar So you add your desktop to "sys.path" and the

Re: How to import from a file which is not in the current directory?

2008-10-22 Thread Luis M . González
Lets say that you are in directory "C:\\Python25" and you want to import function "bar" defined in module "foo" located in your windows desktop. You do it like this: >>> import sys >>> sys.path.append('C:\\Users\\You\\Desktop') >>> from foo import blah So you add your desktop to "sys.path" and th

Re: [APSW] SELECT COUNT(*) not succesfull?

2008-10-22 Thread Gabriel Genellina
En Wed, 22 Oct 2008 20:14:42 -0200, Gilles Ganault <[EMAIL PROTECTED]> escribió: On Wed, 22 Oct 2008 18:35:35 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: It is - the problem is that cursor.execute doesn't return what you think... Truth is that according to the db-api specification,

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Rhamphoryncus
On Oct 22, 7:04 pm, Andy <[EMAIL PROTECTED]> wrote: > > What you describe, truly independent interpreters, is not threading at > > all: it is processes, emulated at the application level, with all the > > memory cost and none of the OS protections.  True threading would > > involve sharing most obj

Re: add method to class dynamically?

2008-10-22 Thread Gabriel Genellina
En Wed, 22 Oct 2008 10:37:11 -0200, Jean-Paul Calderone <[EMAIL PROTECTED]> escribió: On Wed, 22 Oct 2008 08:29:08 -0400, Neal Becker <[EMAIL PROTECTED]> wrote: I have a class (actually implemented in c++ using boost::python). For an instance of this class, 'r', I'd like to support len (r)

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Andy
Jesse, Terry, Martin - First off, thanks again for your time and interest in this matter. It's definitely encouraging to know that time and real effort is being put into the matter and I hope my posts on this subject are hopefully an informative data point for everyone here. Thanks for that link

Re: [APSW] SELECT COUNT(*) not succesfull?

2008-10-22 Thread Cousin Stanley
> > Now I don't know what apsw is, but it's common for libraries > to provide their own wrapping of the db-api. > From the Debian GNU/Linux package manager APSW (Another Python SQLite Wrapper) is an SQLite 3 wrapper that provides the thinnest layer over SQLite 3 possi

YOU WANT TO EARN $$$ see my blog.

2008-10-22 Thread chinu
hai, i am srinu from india. i am sending a blog url for yours use. Right side Of The Blog Awsurvey Banner will appear. click on the banner and get a free signup with 6$ bonus and you will get more surveys. once you have completed one survey you will get minimem 4$ and more left side of the blog

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Andy
> > What you describe, truly independent interpreters, is not threading at > all: it is processes, emulated at the application level, with all the > memory cost and none of the OS protections.  True threading would > involve sharing most objects. > > Your solution depends on what you need: > * Kil

Re: Dummy explanation to win32com needed

2008-10-22 Thread Darcy Mason
On Oct 22, 3:43 pm, korean_dave <[EMAIL PROTECTED]> wrote: > Hi. I need a dummy's explanation to utilizing the win32com component > to access Microsoft Excel. > > So far, I have this code. > >     import win32com.client >     xl = win32com.client.Dispatch("Excel.Application") >     xl.Visible = 1 >

Re: Passing a memory address (pointer) to an extension?

2008-10-22 Thread Robert Kern
Philip Semanchuk wrote: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the caller.) I would like to expose this function to Python, but I do

YOUR INBOX EMAILS WILL GIVE U INCOME--

2008-10-22 Thread jaggu
YOUR INBOX EMAILS WILL GIVE U INCOME-- http://www.youmint.com/network-jagguzwx2 YOUR INCOMMING SMS PAY'S U INCOME-- EARN BY JUST READING SMS ON UR MOBILE http://www.mGinger.com/index.jsp?inviteId=623396 http://www.paisa4sms.com/Index.aspx?Inviteid=134129 IMPORTANT THINGS TO REMEMBER 1. EMAIL

Re: Best way to spawn process on back end computer

2008-10-22 Thread Michael Sparks
sophie_newbie wrote: > Hi, > > I'm running a python cgi script on a frontend web server and I want it > to spawn another script (that takes a long time to run) on a backend > number crunching server thats connected to the same network. What do > you think is the best way to do this? I have a few

Re: Commercial Products in Python

2008-10-22 Thread azrael
Why don't you give a try to IronPython. I began playin with it yesterday, and as far as I can see, My worries about selling a python application are gone, so far. On Oct 22, 12:08 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 21 Okt, 19:50, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > > >

Py2exe and Module Error...

2008-10-22 Thread vincehofmeister
Hey everyone: I am using py2exe and everything is working fine except one module, ClientCookie, found here: http://wwwsearch.sourceforge.net/ClientCookie/ Keeps coming up as not found no matter what I do. I have tried all these combinations from the command line: python run.py py2exe - Results

Re: substitution of a method by a callable object

2008-10-22 Thread Bruno Desthuilliers
netimen a écrit : (snip) OK, I have implemented Bruno Desthuilliers example. But there is another question: can I having a method determine if it is an instance of given class. So: As the name imply, a method is usually, well, an instance of type 'method' !-) class Obj(object): (snip) cl

Re: [APSW] SELECT COUNT(*) not succesfull?

2008-10-22 Thread Gilles Ganault
On Wed, 22 Oct 2008 18:35:35 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >It is - the problem is that cursor.execute doesn't return what you >think... Truth is that according to the db-api specification, the return >value of cursor.execute is not defined (IOW : can be absolutely >anyth

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Rhamphoryncus
On Oct 22, 10:32 am, Andy <[EMAIL PROTECTED]> wrote: > Dear Python dev community, > > I'm CTO at a small software company that makes music visualization > software (you can check us out atwww.soundspectrum.com).  About two > years ago we went with decision to use embedded python in a couple of > ou

Re: Finding the instance reference of an object

2008-10-22 Thread Fuzzyman
On Oct 17, 10:39 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: > > >> And my real point is that this is exactly the same as in every > >> other modern language. > > > No, it isn't.  In many other languages (C, Pascal, etc.), a > > "variable" is common

Re: How to import from a file which is not in the current directory?

2008-10-22 Thread Philip Semanchuk
On Oct 22, 2008, at 5:38 PM, Kurda Yon wrote: Hi, I would like to import a function from a file which is located not in the same directory as the main program (from which the function needed to be imported). Could anybody pleas tell me how to do that? Python will search for module files in

Re: substitution of a method by a callable object

2008-10-22 Thread netimen
On 23 окт, 00:34, Terry Reedy <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Oct 22, 12:13 pm, netimen <[EMAIL PROTECTED]> wrote: > > >> Can I substitute a method of a class by a callable object (not a > >> function)? I can very easy insert my function in a class as a method, > >> but an

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Jesse Noller
On Wed, Oct 22, 2008 at 5:34 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > The *current* developers seem to be more interested in exploiting multiple > processors with multiprocessing. Note that Google choose that route for > Chrome (as I understood their comic introduction). 2.6 and 3.0 come with

Re: socket and DynDNS

2008-10-22 Thread Stephan Schulz
In article <[EMAIL PROTECTED]>, Martin v. Löwis wrote: > >You should look at the TTL of the DNS record, and re-lookup when it >expires. Sure. I can do that. But it would be so much nicer if a lower level would already take care of that (i.e. by caching the lookup for the lease time and then renewi

How to import from a file which is not in the current directory?

2008-10-22 Thread Kurda Yon
Hi, I would like to import a function from a file which is located not in the same directory as the main program (from which the function needed to be imported). Could anybody pleas tell me how to do that? Thank you in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Terry Reedy
Andy wrote: This is just my second email, please be a little patient. :^) As a 10-year veteran, I welcome new contributors with new viewpoints and information. more appealing to commercial software developers. Hopefully, the python dev community doesn't underestimate the dev funding that

Re: What are the syntax for &&, ||

2008-10-22 Thread Peter Otten
RC wrote: > if condition1 && condition2: # and > doThis > elif condition3 || condition4: # or > doThat > In most of language have &&, || > > How do I do in Python? if condition1 and condition2: # && doThis elif condition3 or condition4: # || doThat See the patt

Re: What are the syntax for &&, ||

2008-10-22 Thread Tim Chase
if condition1 && condition2: # and doThis elif condition3 || condition4: # or doThat In most of language have &&, || How do I do in Python? Heh, you answered your own question in your comments: if condition1 and condition2: doThis() elif cond3 or cond4: doThat() -

What are the syntax for &&, ||

2008-10-22 Thread RC
if condition1 && condition2: # and doThis elif condition3 || condition4: # or doThat In most of language have &&, || How do I do in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Jesse Noller
On Wed, Oct 22, 2008 at 12:32 PM, Andy <[EMAIL PROTECTED]> wrote: > And, yes, I'm aware of the multiprocessing module added in 2.6, but > that stuff isn't lightweight and isn't suitable at all for many > environments (including ours). The bottom line is that if you want to > perform independent pr

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Terry Reedy
Andy wrote: I agree -- and I've been considering that (or rather, having our company hire/pay part of the python dev community to do the work). To consider that, the question becomes, how many modules are we talking about do you think? 10? 100? In your Python directory, everything in Lib is

Re: Append a new value to dict

2008-10-22 Thread Marc 'BlackJack' Rintsch
On Wed, 22 Oct 2008 10:12:56 -0700, bearophileHUGS wrote: > Frank Niemeyer: >> There's simply no >> way to increment a non-existent value - not without performing some >> obscure implict behind-the-scenes stuff. > > Like importing and using a defaultdict(int). > > >> > So you >> > either have t

Passing a memory address (pointer) to an extension?

2008-10-22 Thread Philip Semanchuk
I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the caller.) I would like to expose this function to Python, but I don't know how to defi

Re: Possible read()/readline() bug?

2008-10-22 Thread kdwyer
On 22 Oct, 19:54, Mike Kent <[EMAIL PROTECTED]> wrote: > Before I file a bug report against Python 2.5.2, I want to run this by > the newsgroup to make sure I'm not being stupid. > > I have a text file of fixed-length records I want to read in random > order. That file is being changed in real-tim

Re: Possible read()/readline() bug?

2008-10-22 Thread Terry Reedy
Mike Kent wrote: Before I file a bug report against Python 2.5.2, I want to run this by the newsgroup to make sure I'm not [missing something]. Good idea ;-). What you are missing is a rereading of the fine manual to see what you missed the first time. I recommend this *whenever* you are ha

Re: Using python22.dll with Python 2.5?

2008-10-22 Thread John Machin
On Oct 23, 12:43 am, Martin Schneider <[EMAIL PROTECTED] factory.de> wrote: > Hi! > > I'd like to use the numpy library (which runs on Python 2.5) in the same > project with another (mandatory) library which needs python22.dll. When > I try to compile I get an error similar to "python22.dll not com

Re: substitution of a method by a callable object

2008-10-22 Thread Terry Reedy
George Sakkis wrote: On Oct 22, 12:13 pm, netimen <[EMAIL PROTECTED]> wrote: Can I substitute a method of a class by a callable object (not a function)? I can very easy insert my function in a class as a method, but an object - can't. I have the following: class Foo(object): pass class O

Re: Function to Add List Elements?

2008-10-22 Thread Henry Chang
Very nice, that works! Thanks so much, Chris! On Wed, Oct 22, 2008 at 1:06 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Wed, Oct 22, 2008 at 12:59 PM, Henry Chang <[EMAIL PROTECTED]> wrote: > > This seems like a simple problem, but I can't find a simple solution. > > > > Suppose I have two l

Re: Function to Add List Elements?

2008-10-22 Thread Chris Rebert
On Wed, Oct 22, 2008 at 12:59 PM, Henry Chang <[EMAIL PROTECTED]> wrote: > This seems like a simple problem, but I can't find a simple solution. > > Suppose I have two lists of integers. > > List A = [A1, A2, A3] > List B = [B1, B2, B3] > > I just simply want a new list, such as: > > List C = [C1,

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Martin v. Löwis
> I would *love* for our company to be 10 times larger and be able to > add another zero to what we'd be able to hire/offer the python dev > community for work that we're looking for, but we unfortunately have > limits at the moment. There is another thing about open source that you need to consid

Re: Ordering python sets

2008-10-22 Thread Peter Otten
Duncan Booth wrote: > Peter Otten <[EMAIL PROTECTED]> wrote: > >> Here's another one: >> > set([1,9]) >> set([1, 9]) > set([9,1]) >> set([9, 1]) >> >> This time I did indeed search systematically... >> > You missed one with smaller values: set([8,0]) > set([8, 0]) set([0,8])

Function to Add List Elements?

2008-10-22 Thread Henry Chang
This seems like a simple problem, but I can't find a simple solution. Suppose I have two lists of integers. List A = [A1, A2, A3] List B = [B1, B2, B3] I just simply want a new list, such as: List C = [C1, C2, C3] where: C1 = A1 + B1 C2 = A2 + B2 C3 = A3 + B3 Is there a simple function to do

Re: Possible read()/readline() bug?

2008-10-22 Thread pruebauno
On Oct 22, 3:44 pm, [EMAIL PROTECTED] wrote: > On Oct 22, 2:54 pm, Mike Kent <[EMAIL PROTECTED]> wrote: > > > > > Before I file a bug report against Python 2.5.2, I want to run this by > > the newsgroup to make sure I'm not being stupid. > > > I have a text file of fixed-length records I want to re

Re: Possible read()/readline() bug?

2008-10-22 Thread pruebauno
On Oct 22, 2:54 pm, Mike Kent <[EMAIL PROTECTED]> wrote: > Before I file a bug report against Python 2.5.2, I want to run this by > the newsgroup to make sure I'm not being stupid. > > I have a text file of fixed-length records I want to read in random > order. That file is being changed in real-t

Dummy explanation to win32com needed

2008-10-22 Thread korean_dave
Hi. I need a dummy's explanation to utilizing the win32com component to access Microsoft Excel. So far, I have this code. import win32com.client xl = win32com.client.Dispatch("Excel.Application") xl.Visible = 1 workbook = xl.Workbooks.Open("C:\test.xls") Now, my question is, whe

Re: substitution of a method by a callable object

2008-10-22 Thread netimen
On 22 окт, 20:46, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > netimen a écrit : > > > Can I substitute a method of a class by a callable object (not a > > function)? I can very easy insert my function in a class as a method, > > but an object - can't. > > functions implement the descriptor pro

Re: p2exe for python 2.6

2008-10-22 Thread Benjamin Kaplan
On Wed, Oct 22, 2008 at 2:43 PM, Stefaan Himpe <[EMAIL PROTECTED]>wrote: > How can convert my python script in exe for the python version 2.6? >> > > You must use a standalone executable builder like >* py2exe (Windows) >* py2app (Mac OS) >* PyInstaller (all platforms) >* cx_Freeze

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Andy
> > - In python 3, the C module API now supports true interpreter > > independence, but have all the modules in the python codebase been > > converted over? > > No, none of them. :^) > > > - How close is python 3 really to true multithreaded use? > > Python is as thread-safe as ever (i.e. compl

Re: Interface to Matlab

2008-10-22 Thread Daniel
On Oct 17, 2:26 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, Daniel > wrote: > > > Have you looked at > >http://www.scipy.org/ > > andhttp://matplotlib.sourceforge.net/ > > > They do an awful lot of what matlab does. > > This one

Possible read()/readline() bug?

2008-10-22 Thread Mike Kent
Before I file a bug report against Python 2.5.2, I want to run this by the newsgroup to make sure I'm not being stupid. I have a text file of fixed-length records I want to read in random order. That file is being changed in real-time by another process, and my process want to see the changes to

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Andy
Hi Thomas - I appreciate your thoughts and time on this subject. > > The result is that separate COM objects implemented as Python modules and > converted into separate dlls by py2exe do not share their interpreters even > if they are running in the same process.  Of course this only works on >

Re: substitution of a method by a callable object

2008-10-22 Thread Bruno Desthuilliers
netimen a écrit : Can I substitute a method of a class by a callable object (not a function)? I can very easy insert my function in a class as a method, but an object - can't. functions implement the descriptor protocol so when looked up as class attributes, the lookup invoke their __get__ met

Re: p2exe for python 2.6

2008-10-22 Thread Stefaan Himpe
How can convert my python script in exe for the python version 2.6? You must use a standalone executable builder like * py2exe (Windows) * py2app (Mac OS) * PyInstaller (all platforms) * cx_Freeze (Windows and Linux) * bbFreeze (Windows and Linux) Presumably you could use GU

Re: error estimation in a non-linear least squares fitting

2008-10-22 Thread Robert Kern
Evelien wrote: Thanks Robert for your reply. I must say I am kind of disappointed if that is the only solution. I thought that such a standard problem as least squares fitting, would always give you an estimation of the error bars, without having to look up how you can convert a covariance matrix

Re: [APSW] SELECT COUNT(*) not succesfull?

2008-10-22 Thread Bruno Desthuilliers
Gilles Ganault a écrit : Hello I'm trying to use the APSW package to access a SQLite database, but can't find how to check if a row exists. I just to read a tab-separated file, extract a key/value from each line, run "SELECT COUNT(*)" to check whether this tuple exists in the SQLite database, an

Re: Ordering python sets

2008-10-22 Thread Duncan Booth
Peter Otten <[EMAIL PROTECTED]> wrote: > Here's another one: > set([1,9]) > set([1, 9]) set([9,1]) > set([9, 1]) > > This time I did indeed search systematically... > You missed one with smaller values: >>> set([8,0]) set([8, 0]) >>> set([0,8]) set([0, 8]) You can work some of it out

Re: IRC

2008-10-22 Thread Lie Ryan
On Tue, 21 Oct 2008 05:59:43 -0700, Amie wrote: > HI All, > > Please can you perhaps provide me with links or good places where I can > learn what IRC is, how to work with it and how to write to a large log > file at the same time as letting the IRC spy read and write to the > server. > > Thank

Re: no module named _tkinter

2008-10-22 Thread Ben ZX
On Oct 21, 9:11 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Oct 22, 2:10 am, Ben ZX <[EMAIL PROTECTED]> wrote: > > > When I type Thanks. Right on. > > > import Tkinter > > > I get > > > no module named _tkinter. > > > I compiled my own python 2.5.2, and I didn't do anything special: jus

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Martin v. Löwis
> - In python 3, the C module API now supports true interpreter > independence, but have all the modules in the python codebase been > converted over? No, none of them. > Are they all now truly compliant? It will only take > a single static/global state variable in a module to potentially cause

Re: socket and DynDNS

2008-10-22 Thread Martin v. Löwis
> My naive and ugly alternative is to periodically (e.g. every 5 > minutes) do a manual lookup and use the last address. You should look at the TTL of the DNS record, and re-lookup when it expires. There will be *no* kind of protection for UDP messages. When the machine loses its IP address, it w

Re: Python 2.5.chm problem

2008-10-22 Thread Martin v. Löwis
> When I try to open the 2.5 Python help, I got error message: > "A fájl (mk:@MSITStore:c:\Python25\Doc\Python25.chm) nem nyitható meg." Can you please elaborate what precisely you do to "open the 2.5 Python help"? What operating system are you using, how did you install Python, and where are y

Re: ANN: Enthought Python Distribution - New Release

2008-10-22 Thread Guido van Rossum
Hey Travis, Congratulations with this release! Are you guys thinking of Python 2.6 yet, now that it's been released? --Guido On Tue, Oct 21, 2008 at 2:53 PM, Travis Vaught <[EMAIL PROTECTED]> wrote: > Greetings, > > Enthought, Inc. is very pleased to announce the newest release of the > Enthough

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Thomas Heller
Andy schrieb: > Dear Python dev community, > > [...] Basically, > we use embedded python and use it to wrap our high performance C++ > class set which wraps OpenGL, DirectX and our own software renderer. > In addition to wrapping our C++ frameworks, we use python to perform > various "worker" tas

Re: Ordering python sets

2008-10-22 Thread bearophileHUGS
Mr.SpOOn: > Is there another convenient structure or shall I use lists and define > the operations I need? As Python becomes accepted for more and more "serious" projects some more data structures can eventually be added to the collections module: - SortedSet, SortedDict: can be based on red-blac

Re: substitution of a method by a callable object

2008-10-22 Thread George Sakkis
On Oct 22, 12:13 pm, netimen <[EMAIL PROTECTED]> wrote: > Can I substitute a method of a class by a callable object (not a > function)? I can very easy insert my function in a class as a method, > but an object - can't. > > I have the following: > > class Foo(object): >     pass > > class Obj(obje

Re: Ordering python sets

2008-10-22 Thread Peter Otten
Peter Pearson wrote: > On Wed, 22 Oct 2008 15:37:03 +0200, Peter Otten <[EMAIL PROTECTED]> wrote: >> Tim Chase wrote: >> >>> Though for each test, in 2.3, 2.4, and 2.5 that I've got >>> installed on my local machine, they each printed "s" in-order, >>> and the iteration occurred in-order as well,

Re: substitution of a method by a callable object

2008-10-22 Thread Terry Reedy
netimen wrote: Can I substitute a method of a class by a callable object (not a function)? I can very easy insert my function in a class as a method, but an object - can't. Yes you can and did. class Foo(object): pass class Obj(object): def __call__(self, obj_self): print 'Ob

Re: Append a new value to dict

2008-10-22 Thread bearophileHUGS
Frank Niemeyer: > There's simply no > way to increment a non-existent value - not without performing some > obscure implict behind-the-scenes stuff. Like importing and using a defaultdict(int). > > So you > > either have to use a workaround: > > >  >>> try: > > ...   counter['B'] += 1 > > ... ex

Re: error estimation in a non-linear least squares fitting

2008-10-22 Thread Evelien
Thanks Robert for your reply. I must say I am kind of disappointed if that is the only solution. I thought that such a standard problem as least squares fitting, would always give you an estimation of the error bars, without having to look up how you can convert a covariance matrix into error bars.

Re: Why can't I assign a class method to a variable?

2008-10-22 Thread Diez B. Roggisch
ed wrote: > I'm trying to make a shortcut by doing this: > > t = Globals.ThisClass.ThisMethod > > Calling t results in an unbound method error. > > Is it possible to do what I want? I call this method in hundreds of > locations and I'm trying to cut down on the visual clutter. You need to mak

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-22 Thread Terry Reedy
rishi pathak wrote: The below piece of code should give you some understanding import tty import sys tty.setraw(sys.stdin.fileno()) char='' print "Press x to exit" while char != 'x' : char = sys.stdin.read(1) print "You entered : ",char # Your code here Does not work on

Why can't I assign a class method to a variable?

2008-10-22 Thread ed
I'm trying to make a shortcut by doing this: t = Globals.ThisClass.ThisMethod Calling t results in an unbound method error. Is it possible to do what I want? I call this method in hundreds of locations and I'm trying to cut down on the visual clutter. Thank you! -- http://mail.python.org/ma

2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Andy
Dear Python dev community, I'm CTO at a small software company that makes music visualization software (you can check us out at www.soundspectrum.com). About two years ago we went with decision to use embedded python in a couple of our new products, given all the great things about python. We we

[APSW] SELECT COUNT(*) not succesfull?

2008-10-22 Thread Gilles Ganault
Hello I'm trying to use the APSW package to access a SQLite database, but can't find how to check if a row exists. I just to read a tab-separated file, extract a key/value from each line, run "SELECT COUNT(*)" to check whether this tuple exists in the SQLite database, and if not, run an INSERT. T

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-22 Thread Chris Ortner
Is there a way to do the opposite of tty.setraw afterwards to prevent the terminal from not displaying any characters that are typed in? Of course, this can be resolved by re-opening it, but thats not really convenient. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordering python sets

2008-10-22 Thread Peter Pearson
On Wed, 22 Oct 2008 15:37:03 +0200, Peter Otten <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: > >> Though for each test, in 2.3, 2.4, and 2.5 that I've got >> installed on my local machine, they each printed "s" in-order, >> and the iteration occurred in-order as well, even without the >> added "so

substitution of a method by a callable object

2008-10-22 Thread netimen
Can I substitute a method of a class by a callable object (not a function)? I can very easy insert my function in a class as a method, but an object - can't. I have the following: class Foo(object): pass class Obj(object): def __call__(self, obj_self): print 'Obj' def func(self)

Re: Python 2.6, multiprocessing module and BSD

2008-10-22 Thread Philip Semanchuk
On Oct 22, 2008, at 11:37 AM, Jesse Noller wrote: On Wed, Oct 22, 2008 at 11:06 AM, Philip Semanchuk <[EMAIL PROTECTED] > wrote: One oversight I noticed the multiprocessing module docs is that a semaphore's acquire() method shouldn't have a timeout on OS X as sem_timedwait() isn't supported o

Re: static variables in Python?

2008-10-22 Thread Stephan Schulz
In article <[EMAIL PROTECTED]>, kj wrote: > > >Yet another noob question... > >Is there a way to mimic C's static variables in Python? Or something >like it? The idea is to equip a given function with a set of >constants that belong only to it, so as not to clutter the global >namespace with vari

  1   2   >