C extensions and memory leakage

2006-11-16 Thread Sheldon
Hi, I have a program that I have extended with a C function. When the program is run once or twice everything is ok but in a loop of 5 to 12 iterations, the memory runs out and the program crashes. Now I have gone through this program thoroughly to check if all arrays have been deallocated prior t

Re: dict.reserve and other tricks

2006-11-16 Thread bearophileHUGS
Thank you for the answers Terry Reedy and Klaas. > Since you are writing extensions, you can create a built-in subclass of > dict to experiment with. I presume the 2.5 default dict should be a model. That way it's doable, but I think it's of limited use too; I'd like to remove elements from arbi

Re: problem with defining a global class instance

2006-11-16 Thread [EMAIL PROTECTED]
sharath B N wrote: > hi, > i am sort of newbie to python. I am trying to do a super Market > simulation with OOP in python. I have problems with using a class > instance as global... > def generate (... ,,...) > > " in this function i define the global variables " > global stock,stockManager,

Re: popen(1-4) as a seperate process

2006-11-16 Thread Astan Chee
Fredrik Lundh wrote: > Astan Chee wrote: > > >> Yes, that is true. But everytime I run a os.popen() it executes as a >> child process of the current running one. How do I launch as a seperate >> process? >> > > what's your definition of "separate process", and how is that different > fro

Re: [wxPython] wxFrame don't have Bind attribute ??

2006-11-16 Thread Franz Steinhaeusler
On 29 Oct 2006 22:31:09 -0800, "Jia Lu" <[EMAIL PROTECTED]> wrote: >Hi all > I am using wxPy 2.6.3.2-2, But when run an application with self.Bind >, I got an error that there is no Bind. > > How can I fix it. thanx Is it really an instance of wx.Frame? What do you get, if you make a "print self

Re: popen(1-4) as a seperate process

2006-11-16 Thread Fredrik Lundh
Astan Chee wrote: > Yes, that is true. But everytime I run a os.popen() it executes as a > child process of the current running one. How do I launch as a seperate > process? what's your definition of "separate process", and how is that different from a child process? (all processes created by

Re: problem with defining a global class instance

2006-11-16 Thread Fredrik Lundh
sharath B N wrote: > def generate (... ,,...) > > " in this function i define the global variables " > global stock,stockManager, manager etc. > > > class Manager > ... > ... > ... > def create_stockManager(..) > """ this is a method in class manager""" > stockManager = StockManager( name

problem with defining a global class instance

2006-11-16 Thread sharath B N
hi, i am sort of newbie to python. I am trying to do a super Market simulation with OOP in python. I have problems with using a class instance as global... def generate (... ,,...) " in this function i define the global variables " global stock,stockManager, manager etc. class Manager ... .

Re: how to print pdf with python on a inkjet printer.

2006-11-16 Thread Tim Roberts
"krishnakant Mane" <[EMAIL PROTECTED]> wrote: > >hello all. >I am developing an ncurses based python application that will require >to create pdf reports for printing. >I am not using py--qt or wx python. >it is a consol based ui application and I need to make a pdf report >and also send it to a la

Re: Python v PHP: fair comparison?

2006-11-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Huh? I've been doing paid python web work since 2000. I'm fairly sure > that Yahoo! groups predates that by a while http://en.wikipedia.org/wiki/EGroups -- http://mail.python.org/mailman/listinfo/python-list

Re: determining the bounds of a tuple returned from a database

2006-11-16 Thread ronrsr
very sorry, that was my error - len(result[0]) and len(result[1]) both return 1 -- i think I'm misunderstanding what len() does - to me they appear to have 2 or 3 elements, or at least be composed of a string of some length. I guess len() isn't the function i'm looking for then. How do I tell ho

Re: popen(1-4) as a seperate process

2006-11-16 Thread Astan Chee
Fredrik Lundh wrote: Astan Chee wrote: Im trying to popen (or more specifically os.popen4() ) from wxPython. I've read the documentation on popen and it says I can do a popen as a seperate process or popen not as a child process where does it say that? afaik, the whole point of the

Re: popen(1-4) as a seperate process

2006-11-16 Thread Fredrik Lundh
Astan Chee wrote: > Im trying to popen (or more specifically os.popen4() ) from wxPython. > I've read the documentation on popen and it says I can do a popen as a > seperate process or popen not as a child process where does it say that? afaik, the whole point of the popen API is to run an ex

Re: How fuzzy is get_close_matches() in difflib?

2006-11-16 Thread John Henry
I encountered a case where I am trying to match "HIDESST1" and "HIDESCT1" against ["HIDEDST1", "HIDEDCT1", "HIDEDCT2", "HIDEDCT3"] Well, they both hit "HIDEDST1" as the first match which is not exactly the result I was looking for. I don't understand why "HIDESCT1" would not hit "HIDEDCT1" as a f

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Fredrik Lundh
gabor wrote: > get an Unicode-exception, as everywhere else. you see, exceptions are > ok, i can deal with them. > p.s: one additional note. if you code expects os.listdir to return > unicode, that usually means that all your code uses unicode strings. > which in turn means, that those filenam

Re: determining the bounds of a tuple returned from a database

2006-11-16 Thread Fredrik Lundh
ronrsr wrote: > it looks like the len() function is the one I want. > > for: len(result) - i get 248, > > but for len(result[0]) or len(result[1]) i always get 0. that's a bit surprising, because both items are tuples that contain exactly one item: >> (('Agricultural subsidies; Foreign aid

Re: PIL - "despeckle" image ?

2006-11-16 Thread Paul McGuire
On Nov 16, 10:58 pm, [EMAIL PROTECTED] wrote: > Hi - I have some images which I would like to remove specks from using > the PIL. I would like to be able to say that if a pixel is in a blob of > less than n contiguous pixels then all pixels in that blob should be > removed. > > The images are 8 bit

Re: determining the bounds of a tuple returned from a database

2006-11-16 Thread ronrsr
it looks like the len() function is the one I want. for: len(result) - i get 248, but for len(result[0]) or len(result[1]) i always get 0. ronrsr wrote: > here is my result. > How do I determine the number of tuples in this array, returned from a > mysql database? > > How do I determine the

Re: python and accessibility issues.

2006-11-16 Thread Paddy
krishnakant Mane wrote: > this question is streight forward, short and sweet. > I am developing some applications and being blind myself, expect that > including me, all other blind people must be able to use it. > so my question is, > is wx python complying with Microsoft Active Accessibility or

determining the bounds of a tuple returned from a database

2006-11-16 Thread ronrsr
here is my result. How do I determine the number of tuples in this array, returned from a mysql database? How do I determine the number of characters or entry in each tuple? thanks very much for your assistance, -rsr- (('Agricultural subsidies; Foreign aid',), ('Agriculture; Sustainable Agricu

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Martin v. Löwis
gabor schrieb: > i also recommend this approach. > > also, raising an exception goes well with the principle of the least > surprise imho. Are you saying you wouldn't have been surprised if that had been the behavior? How would you deal with that exception in your code? Regards, Martin -- http:

Re: Heap Memory

2006-11-16 Thread Thinker
Gregory Pi鎑ro wrote: > This computer it was running on has 2GB of RAM and 6GB of virtual > memory so I really doubt I had used up all of that memory. I didn't > watch it the whole time so I can't be sure though. Any ideas what > could have been going on there? > > -Greg > What is your OS? Mayb

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Martin v. Löwis
Jean-Paul Calderone schrieb: >> How would you propose listdir should behave? > > Umm, just a wild guess, but how about raising an exception which includes > the name of the file which could not be decoded? There may be multiple of these, of course, but I assume that you want it to report the firs

Re: cPickle problems

2006-11-16 Thread Klaas
Jeff Poole wrote: > Good idea. Well, I did that, and I found out that the object causing > problems is a ParseResults object (a class from PyParsing) and that the > __getstate__ member is in fact an empty string (''). I'm not sure > where this leaves me... The PyParsing code clearly never crea

Re: dict.reserve and other tricks

2006-11-16 Thread Klaas
[EMAIL PROTECTED] wrote: > I have started doing practice creating C extensions for CPython, so > here are two ideas I have had, possibly useless. > > If you keep adding elements to a CPython dict/set, it periodically > rebuilds itself. So maybe dict.reserve(n) and a set.reserve(n) methods > may hel

Re: Heap Memory

2006-11-16 Thread Gregory Piñero
On 11/16/06, Thinker <[EMAIL PROTECTED]> wrote: > What is your OS? Maybe you should show out the memory usage of your python > process. In FreeBSD, you should set evironment variable > 'MALLOC_OPTIONS=P' to > print out usage of malloc()。Maybe you can find a way, in your system, > to print out usage

Re: How fuzzy is get_close_matches() in difflib?

2006-11-16 Thread Steven D'Aprano
On Thu, 16 Nov 2006 20:19:50 -0800, John Henry wrote: > I did try them and I am impressed. It helped me found a lot of useful > info. I just want to get a feel as to what constitutes a "match". The source code has lots of comments, but they don't explain the basic algorithm (at least not in th

Re: Press button to load data

2006-11-16 Thread jim-on-linux
Without being able to run the code my question is where is the id in the lambda defined? On Thursday 16 November 2006 22:31, jim wrote: > Thanks for your help, but now I have a another > problem so here is my code again > when I run this it prints id> > > from Tkinter import * > import shel

PIL - "despeckle" image ?

2006-11-16 Thread shearichard
Hi - I have some images which I would like to remove specks from using the PIL. I would like to be able to say that if a pixel is in a blob of less than n contiguous pixels then all pixels in that blob should be removed. The images are 8 bit images with only 0 and 255 values. I can think of quite

popen(1-4) as a seperate process

2006-11-16 Thread Astan Chee
Hi, Im trying to popen (or more specifically os.popen4() ) from wxPython. I've read the documentation on popen and it says I can do a popen as a seperate process or popen not as a child process but it doesnt say how. Can anyone help? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2006-11-16 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 416 open (-14) / 3463 closed (+16) / 3879 total ( +2) Bugs: 930 open ( +8) / 6333 closed (+17) / 7263 total (+25) RFE : 244 open ( -1) / 244 closed ( +3) / 488 total ( +2) New / Reopened Patches __ tkSimpleD

Re: How fuzzy is get_close_matches() in difflib?

2006-11-16 Thread John Henry
I did try them and I am impressed. It helped me found a lot of useful info. I just want to get a feel as to what constitutes a "match". Steven D'Aprano wrote: > On Thu, 16 Nov 2006 16:40:49 -0800, John Henry wrote: > > > I am just wondering what's with get_close_matches() in difflib. What's >

Re: Printing/writing an integer to a file

2006-11-16 Thread Ben Finney
"Steven D'Aprano" <[EMAIL PROTECTED]> writes: > On Fri, 17 Nov 2006 14:18:12 +1100, Ben Finney wrote: > > > The function call syntax doesn't allow a space between the > > function name and the opening parenthesis. > > Are you sure? Are you kidding? Do you think I'd post to this newsgroup if I was

Re: Printing/writing an integer to a file

2006-11-16 Thread Steven D'Aprano
On Fri, 17 Nov 2006 14:18:12 +1100, Ben Finney wrote: > The function call syntax doesn't allow a space between the function > name and the opening parenthesis. Are you sure? I thought it was allowed but not recommended because it is hard to read. >>> len ([1, 2, 3]) 3 Seems to work for me. An

Re: Printing/writing an integer to a file

2006-11-16 Thread Ben Finney
PS <[EMAIL PROTECTED]> writes: > Friends, Please, don't send message bodies to public discussion forums in any format other than plain text. HTML email in particular has wildly differing implementations and renderings. > I am new to python and did search on the web on how to achieve this: > ( I

Re: dict.reserve and other tricks

2006-11-16 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you keep adding elements to a CPython dict/set, it periodically > rebuilds itself. So maybe dict.reserve(n) and a set.reserve(n) methods > may help, reserving enough (empty) memory for about n *distinct* keys > the programmer wants

Re: cPickle problems

2006-11-16 Thread Jeff Poole
Good idea. Well, I did that, and I found out that the object causing problems is a ParseResults object (a class from PyParsing) and that the __getstate__ member is in fact an empty string (''). I'm not sure where this leaves me... The PyParsing code clearly never creates such a member and my cod

Re: Printing/writing an integer to a file

2006-11-16 Thread Gabriel Genellina
At Thursday 16/11/2006 22:33, PS wrote: Friends, I am new to python and did search on the web on how to achieve this: ( I am trying to append the line numbers to all the lines of a file for now) But you forget to say what went wrong... Next time, post the error message including the full tr

Re: How fuzzy is get_close_matches() in difflib?

2006-11-16 Thread Steven D'Aprano
On Thu, 16 Nov 2006 16:40:49 -0800, John Henry wrote: > I am just wondering what's with get_close_matches() in difflib. What's > the magic? How fuzzy do I need to get in order to get a match? Why don't you try it and see? >>> from difflib import get_close_matches >>> get_close_matches("appel

Re: Writing to Registry

2006-11-16 Thread Gabriel Genellina
At Thursday 16/11/2006 21:39, Samantha wrote: > http://docs.python.org/lib/module--winreg.html#l2h-5827 Thanks for the link. Notice that surely you already have the full Python documentation, it comes with the standard distribution. -- Gabriel Genellina Softlab SRL _

Re: cPickle problems

2006-11-16 Thread Gabriel Genellina
At Thursday 16/11/2006 21:48, Jeff Poole wrote: File "/usr/lib/python2.4/pickle.py", line 313, in save rv = reduce(self.proto) File "/usr/lib/python2.4/copy_reg.py", line 83, in _reduce_ex dict = getstate() TypeError: 'str' object is not callable Someway, self.__getstate__ is a st

Re: Python v PHP: fair comparison?

2006-11-16 Thread Luis M. González
[EMAIL PROTECTED] ha escrito: > Luis M. González wrote: > > Cameron Laird ha escrito: > > > Perhaps it's timely to clarify the "newer" above: Guido > > > made Python public in '89-90, and Rasmus showed PHP to > > > others in '94-95. > > > > OK. But since when has python been considered a viable

Re: Writing to Registry

2006-11-16 Thread Mark Elston
Note: this is untested (since I don't like screwing around in the registry...) Have you tried using REG_DWORD? Mark * Samantha wrote (on 11/16/2006 3:48 PM): > I am working with this recipes: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011 > > The problem I am having is setting

Printing/writing an integer to a file

2006-11-16 Thread PS
Friends, I am new to python and did search on the web on how to achieve this: ( I am trying to append the line numbers to all the lines of a file for now) Thanks!! = import os, sys fileName = os.path.join("C:", "temp", "x1.txt") fileobject = open

Re: cPickle problems

2006-11-16 Thread Jeff Poole
To clutter this up with yet another message, this is what happens if I use pickle instead of cPickle. Same error, but it has more of a stack trace so someone more advanced than myself might be able to pick out what is going amiss. Traceback (most recent call last): File "./generateTools.py", li

dict.reserve and other tricks

2006-11-16 Thread bearophileHUGS
I have started doing practice creating C extensions for CPython, so here are two ideas I have had, possibly useless. If you keep adding elements to a CPython dict/set, it periodically rebuilds itself. So maybe dict.reserve(n) and a set.reserve(n) methods may help, reserving enough (empty) memory f

How fuzzy is get_close_matches() in difflib?

2006-11-16 Thread John Henry
I am just wondering what's with get_close_matches() in difflib. What's the magic? How fuzzy do I need to get in order to get a match? -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to Registry

2006-11-16 Thread Samantha
Thanks for the link. S "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At Thursday 16/11/2006 20:48, Samantha wrote: > >>I am working with this recipes: >>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011 >> >>The problem I am having is setting a hex v

Re: Secure Python

2006-11-16 Thread Paul Boddie
timmy wrote: > Paul Boddie wrote: > > Diez B. Roggisch wrote: [Re-adding material...] > >>At least to me - and I presume pretty much everybody except you in this > >>thread - this means that he is interested in executing arbitrary pieces of > >>python code inside the interpreter, which comes from

Re: cPickle problems

2006-11-16 Thread Jeff Poole
Oh, and I suppose I should provide some version information: $ python Python 2.4.3 (#1, May 18 2006, 07:40:45) [GCC 3.3.3 (cygwin special)] on cygwin Jeff Poole wrote: > This is going to be a pretty vague message because it involves a large > block of code I'd rather avoid posting. Basically,

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread gabor
Jean-Paul Calderone wrote: > On Fri, 17 Nov 2006 00:31:06 +0100, "\"Martin v. Löwis\"" > <[EMAIL PROTECTED]> wrote: >> gabor schrieb: All this code will typically work just fine with the current behavior, so people typically don't see any problem. >>> >>> i am sorry, but it will not

Re: Writing to Registry

2006-11-16 Thread Gabriel Genellina
At Thursday 16/11/2006 20:48, Samantha wrote: I am working with this recipes: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011 The problem I am having is setting a hex value. This line --- SetValueEx(aKey,"MyNewKey",0, REG_SZ, r"c:\winnt\explorer.exe") I want something Like --

cPickle problems

2006-11-16 Thread Jeff Poole
This is going to be a pretty vague message because it involves a large block of code I'd rather avoid posting. Basically, I've been pickling a dictionary of instances of a class I've created (which contains references to other instances of other classes). At some point in the last few weeks, pick

Re: Secure Python

2006-11-16 Thread timmy
Paul Boddie wrote: > Diez B. Roggisch wrote: > > > [Multiplayer game servers] > > >>Now how exactly does linux (or any other resource limiting technique on any >>OS) help here - killing the whole game server surely isn't a desirable >>solution when one player goes berserk, might it be intention

Re: Secure Python

2006-11-16 Thread timmy
Diez B. Roggisch wrote: >>as posted before, linux kernel limit. >> >>then you and your users can go as crazy as you want and you won't take >>out your system. >> >>maybe you should think a little more before going on the attack like that. > > > You should maybe read a little bit more when making

Re: accessing fortran modules from python

2006-11-16 Thread sam
thanks guys, i'll follow this up more in a couple of weeks when i know what i need to do better. sam -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Jean-Paul Calderone
On Fri, 17 Nov 2006 00:31:06 +0100, "\"Martin v. Löwis\"" <[EMAIL PROTECTED]> wrote: >gabor schrieb: >>> All this code will typically work just fine with the current behavior, >>> so people typically don't see any problem. >>> >> >> i am sorry, but it will not work. actually this is exactly what i

Re: pyj file extension

2006-11-16 Thread Paul Boddie
Diez B. Roggisch wrote: > > http://www.crazy-compilers.com/decompyle/ > > But only up to python 2.3. No idea if that is sufficient & if there is > anything newer out there. Usual service message: sources available from here... http://packages.debian.org/unstable/source/decompyle Paul -- http:/

Re: How to make a python file to a DLL?

2006-11-16 Thread Larry Bates
many_years_after wrote: > Any solution? > > Thanks. > You can certainly make python program/function into a COM object which can be called from other languages quite easily and I think is the more preferred method in newer software. py2exe has examples of creating COM objects. -Larry -- http:/

Writing to Registry

2006-11-16 Thread Samantha
I am working with this recipes: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011 The problem I am having is setting a hex value. This line --- SetValueEx(aKey,"MyNewKey",0, REG_SZ, r"c:\winnt\explorer.exe") I want something Like -- SetValueEx(aKey,"MyNewSize",0, REG_SZ, 120 or s

Re: About alternatives to Matlab

2006-11-16 Thread Robert Kern
Matimus wrote: > There is also Scilab. I've only used it a tiny bit but for the task it > worked well. I do know that it has a somewhat restrictive license. It > is open source, but you aren't allowed to modify and redistribute the > source. I get the feeling that some people avoid Scilab but I'm n

Re: deciding what is a dir (folder) in a zip file

2006-11-16 Thread Gabriel Genellina
At Thursday 16/11/2006 10:48, Jim wrote: I'm trying to read .zip files and drop from the listing those files that are directories. I'm using the zipfile module. Googling has increased my suspicion that it is not just a matter of seeing if the file name ends in '/' and that the relevant externa

Re: About alternatives to Matlab

2006-11-16 Thread Matimus
Boris wrote: > Hi, is there any alternative software for Matlab? Although Matlab is > powerful & popular among mathematical & engineering guys, it still > costs too much & not publicly open. So I wonder if there's similar > software/lang that is open & with comparable functionality, at least

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Martin v. Löwis
gabor schrieb: >> All this code will typically work just fine with the current behavior, >> so people typically don't see any problem. >> > > i am sorry, but it will not work. actually this is exactly what i did, > and it did not work. it dies in the os.path.join call, where file_name > is convert

Re: Multithreaded C API Python questions

2006-11-16 Thread Svein Seldal
robert wrote: > Forget all the low level PyGIL... functions.' Quite the contrary, I would say! From the Py C API doc, I interpret the PyGIL... functions to be higher leveled than eg. PyEval_SaveThread(). I've checked into the source of python to find out what's really going on, and I've learn

Re: Python v PHP: fair comparison?

2006-11-16 Thread walterbyrd
Tim Chase wrote: > I can't say I've come across any hosting places that serve up PHP > for $10/yr either...the closest I've found is about $3.50/mo > (which also provides Python CGI). dollar-hosting.net offers php5 and python 2.3, for $10 a year. the-protagonist.net has PHP 4.4 hosting for $10

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: > >> or am i using os.listdir the "wrong way"? how do other people deal with >> this? > > You didn't say why the behavior causes a problem for you - you only > explained what the behavior is. > > Most people use os.listdir in a way like this: > > for nam

Re: About alternatives to Matlab

2006-11-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, sturlamolden <[EMAIL PROTECTED]> wrote: >Boris wrote: >> Hi, is there any alternative software for Matlab? Although Matlab is >> powerful & popular among mathematical & engineering guys, it still >> costs too much & not publicly open. So I wonder if there's similar >

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Martin v. Löwis
gabor schrieb: > so basically i'd like to ask here: am i reading something incorrectly? You are reading it correctly. This is how it behaves. > or am i using os.listdir the "wrong way"? how do other people deal with > this? You didn't say why the behavior causes a problem for you - you only exp

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread Terry Reedy
"gabor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > so if the to-unicode-conversion fails, it falls back to the original > byte-string. i went and have read the patch-discussion. > > and now i'm not sure what to do. > i know that: > > 1. the documentation is completely wrong. it

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Paul Boddie
Maurice LING wrote: > > I take a simplistic view that Java bytecodes is all that is to be dealt > with. Well, that and things like class loading. You'll need a library implementing the "standard" Java API, although that's never been hard to obtain, and the official implementation will be genuinely

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Maurice LING
Paul Boddie wrote: > Maurice LING wrote: > >>Say given cytoscape.jar, I'll like to be able to do this: >> >> >>> from cytoscape javaimport cytoscape >> >>> c = cytoscape() >> >>And the tighest way I see that this can be done is for Python VM to >>execute Java bytecodes like Python bytecodes. That

Re: Python v PHP: fair comparison?

2006-11-16 Thread [EMAIL PROTECTED]
Luis M. González wrote: > Cameron Laird ha escrito: > > Perhaps it's timely to clarify the "newer" above: Guido > > made Python public in '89-90, and Rasmus showed PHP to > > others in '94-95. > > OK. But since when has python been considered a viable alternative for > web development? > As a gene

Re: Question about unreasonable slowness

2006-11-16 Thread Steven D'Aprano
On Thu, 16 Nov 2006 12:45:18 -0800, allenjo5 wrote: > [ Warning: I'm new to Python. Don't know it at all really yet, but had > to examine some 3rd party code because of performance problems with it. > ] > > Here's a code snippet: > > i = 0 > while (i < 20): > i = i + 1 You probably want to

Re: About alternatives to Matlab

2006-11-16 Thread Ramon Diaz-Uriarte
R (http://cran.r-project.org) might be an alternative, specially if you do a lot of statistics and graphics. (R is probably the most widely used language/system in statistical research). R. On 16 Nov 2006 13:09:03 -0800, sturlamolden <[EMAIL PROTECTED]> wrote: > Boris wrote: > > Hi, is there any

Re: Question about unreasonable slowness

2006-11-16 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > i = 0 > while (i < 20): > i = i + 1 for i in xrange(20): > (shellIn, shellOut) = os.popen4("/bin/sh -c ':'") # for testing, the > spawned shell does nothing > print 'next' > # for line in shellOut: > # print line > > On my system (AIX 5.1 if it matters, w

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Paul Boddie
Maurice LING wrote: > > Say given cytoscape.jar, I'll like to be able to do this: > > >>> from cytoscape javaimport cytoscape > >>> c = cytoscape() > > And the tighest way I see that this can be done is for Python VM to > execute Java bytecodes like Python bytecodes. That is, Python VM > executes

Re: About alternatives to Matlab

2006-11-16 Thread John Henry
Bill Gates will have you jailed! :-) On a more serious note, is there any alternative to Simulink though? sturlamolden wrote: >and is infinitely > more expensive. > > Does anyone wonder why I am not paying for Matlab maintenance anymore? > > Sorry Mathworks, I have used your product for years, bu

RE: Question about unreasonable slowness

2006-11-16 Thread Éric Daigneault
[ Warning: I'm new to Python. Don't know it at all really yet, but had to examine some 3rd party code because of performance problems with it. ] Here's a code snippet: i = 0 while (i < 20): i = i + 1 (shellIn, shellOut) = os.popen4("/bin/sh -c ':'") # for testing, the spawned shell does not

Re: accessing fortran modules from python

2006-11-16 Thread Robert Kern
sam wrote: > hello all, > > i am currently in the process of planning a piece of software to model > polymerisation kinetics, and intend to use python for all the > high-level stuff. the number-crunching is something i would prefer to > do in fortran (which i have never used, but will learn), but

Re: multi split function taking delimiter list

2006-11-16 Thread Paul McGuire
On Nov 14, 5:41 pm, "Sam Pointon" <[EMAIL PROTECTED]> wrote: > On Nov 14, 7:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Hi, I'm looking for something like: > > > multi_split( 'a:=b+c' , [':=','+'] ) > > > returning: > > ['a', ':=', 'b', '+', 'c'] > > > whats the python way to achi

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Maurice LING
Stephen Eilert wrote: > Maurice LING escreveu: > > >>>I once wrote a partial JVM in Modula-3 (strictly a researchware >>>effort), so I can imagine it being done technically. But why? >>> >>>The big problem with Java-and-Python is not the VMs underneath. It is >>>the fact that Java has layers u

Re: Decimal() instead of float?

2006-11-16 Thread Gabriel Genellina
At Thursday 16/11/2006 04:40, Fredrik Lundh wrote: internal rowid's are best treated as pointers, though. they're more like memory addresses than labels. (from a design perspective, it's not entirely obvious that it's a good idea to use rowid's to point *into* the database from the outside, bu

Re: About alternatives to Matlab

2006-11-16 Thread sturlamolden
Boris wrote: > Hi, is there any alternative software for Matlab? Although Matlab is > powerful & popular among mathematical & engineering guys, it still > costs too much & not publicly open. So I wonder if there's similar > software/lang that is open & with comparable functionality, at least > for

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Stephen Eilert
Maurice LING escreveu: > > > > I once wrote a partial JVM in Modula-3 (strictly a researchware > > effort), so I can imagine it being done technically. But why? > > > > The big problem with Java-and-Python is not the VMs underneath. It is > > the fact that Java has layers upon layers upon layer

os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread gabor
hi, from the documentation (http://docs.python.org/lib/os-file-dir.html) for os.listdir: "On Windows NT/2k/XP and Unix, if path is a Unicode object, the result will be a list of Unicode objects." i'm on Unix. (linux, ubuntu edgy) so it seems that it does not always return unicode filenames.

Re: numpy/scipy: error of correlation coefficient (clumpy data)

2006-11-16 Thread robert
sturlamolden wrote: > robert wrote: > >> Think of such example: A drunken (x,y) 2D walker is supposed to walk along a >> diagonal, but he makes frequent and unpredictable pauses/slow motion. You >> get x,y coordinates in 1 per second. His speed and time pattern at all do >> not matter - you jus

Question about unreasonable slowness

2006-11-16 Thread allenjo5
[ Warning: I'm new to Python. Don't know it at all really yet, but had to examine some 3rd party code because of performance problems with it. ] Here's a code snippet: i = 0 while (i < 20): i = i + 1 (shellIn, shellOut) = os.popen4("/bin/sh -c ':'") # for testing, the spawned shell does not

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Maurice LING
> > I once wrote a partial JVM in Modula-3 (strictly a researchware > effort), so I can imagine it being done technically. But why? > > The big problem with Java-and-Python is not the VMs underneath. It is > the fact that Java has layers upon layers upon layers of idiosyncratic > libraries and

pyfits problem

2006-11-16 Thread Tommy Grav
I am trying to load in a fits-image and get this error wiyn05dec/n1 -> display -i obj062.fits Traceback (most recent call last): File "/Users/tgrav/Work/Astronomy/MyCode/Python/Redspit/ display.py", line 48, in ? main() File "/Users/tgrav/Work/Astronomy/MyCode/Python/Redspit/ display.

Re: Python v PHP: fair comparison?

2006-11-16 Thread Paul Boddie
John Bokma wrote: > "Luis M. González" <[EMAIL PROTECTED]> wrote: > > > > I know, but would you consider a python cgi application a good > > competence against php? > > php running as cgi you mean. Perhaps not: he's referring to deployment on really cheap hosting solutions which might support mod_

RE: Python v PHP: fair comparison?

2006-11-16 Thread John Bokma
"Demel, Jeff" <[EMAIL PROTECTED]> wrote: > What kind of hosting does one get for $10 a *year*? And I'm not just > talking Python here, but any hosting at all. I pay $12/year (see other posts, I am not going to name them again) for hosting a phpBB board and wiki, with 100+ members and currently

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Ravi Teja
> Personally, I've never gotten jpype to work. Is it just me, or is it > a troublesome install? > > Harry George > PLM Engineering Architecture It works fine for me now. However, I do recall having an issue a while ago (most likely me, rather than JPype). -- http://mail.python.org/mailman/listi

Re: Py3K idea: why not drop the colon?

2006-11-16 Thread Ron Adam
Steve Holden wrote: > I'm always surprised by the amount of energy that's put into this type > of discussion - even the OP has suggested that this isn't a big issue. > If it's not a big issue why is this thread still going? Every language > has a syntax. Why not just accept it as a given and ge

Re: Heap Memory

2006-11-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Gregory Piñero wrote: > This computer it was running on has 2GB of RAM and 6GB of virtual > memory so I really doubt I had used up all of that memory. On 32 bit systems the per process limit is usually 2 GiB, no matter how much physical and virtual memory you have. And wi

Re: Heap Memory

2006-11-16 Thread Fredrik Lundh
Gregory Piñero wrote: > This computer it was running on has 2GB of RAM and 6GB of virtual > memory so I really doubt I had used up all of that memory. I didn't > watch it the whole time so I can't be sure though. Any ideas what > could have been going on there? bogus configuration? http:/

Fun with generators

2006-11-16 Thread Kay Schluehr
While this has been possible before and I guess ( from somewhat superficial reading ) Michael Sparks Kamaelia project is all about this kind of stuff, Python 2.5 generators can be used trivially to turn higher order functions like reduce or map into generators producing streams. After reading a thr

Re: Heap Memory

2006-11-16 Thread Gregory Piñero
On 11/16/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > what are you guys talking about? there are no artificial memory > limitations in Python; a Python process simply uses all the memory it > can get from the operating system. I wish I could easily reproduce one of these errors I'm thinking of.

RE: Python v PHP: fair comparison?

2006-11-16 Thread Demel, Jeff
> Walterbyrd wrote: >> Okay, where can I get Python and Apache 2.X for $10 a year? > I replied: > Webfaction.com Tkc then came back with: >Um, I think you're off by an order of magnitude. Walterbyrd asked > about $10/*year* and webfaction.com charges $7.50/*month*. >Well, I suppose if one only

Re: Python v PHP: fair comparison?

2006-11-16 Thread John Bokma
Tim Chase <[EMAIL PROTECTED]> wrote: > Demel, Jeff wrote: >> Walterbyrd wrote: >>> Okay, where can I get Python and Apache 2.X for $10 a year? >> >> Webfaction.com > > Um, I think you're off by an order of magnitude. Walterbyrd > asked about $10/*year* and webfaction.com charges $7.50/*month*.

  1   2   3   >