[ANN] Data Plotting Library DISLIN 9.1

2006-11-17 Thread Helmut Michels
Dear Python users, I am pleased to announce version 9.1 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as X

Re: wxFrame don't have Bind attribute ??

2006-11-17 Thread Jia Lu
Franz Steinhaeusler wrote: > Is it really an instance of wx.Frame? > What do you get, if you make a "print self" statement? sovled it I think it is an installation problem. I used yum on FC6 to install wxPython 2.6 But after that I got that error. Now I uninstalled them and did an installation of

Re: Yield

2006-11-17 Thread Fredrik Lundh
Danny Colligan wrote: > Carsten mentioned that generators are more memory-efficient to use when > dealing with large numbers of objects. Is this the main advantage of > using generators? Also, in what other novel ways are generators used > that are clearly superior to alternatives? the main adv

Re: Py3K idea: why not drop the colon?

2006-11-17 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > have anyone counted the number of colons used in this way by the OP, > in his first few posts ? (if there isn't a name for the law that > states that the number for a "let's remove the colons" proposal is > always greater than zero, someone should com

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
"Stephan Kuhagen" <[EMAIL PROTECTED]> wrote: > The problem with linux kernel limits are, that they won't work really good > on MacOSX and Windows... OTOH the idea is the right one, but the effect can > be achieved inside of Python. Since Python does byte compile the code and > the interpreter eva

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
"Stephan Kuhagen" <[EMAIL PROTECTED]> wrote: > The problem with linux kernel limits are, that they won't work really good > on MacOSX and Windows... OTOH the idea is the right one, but the effect can > be achieved inside of Python. Since Python does byte compile the code and > the interpreter eva

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
"Stephan Kuhagen" <[EMAIL PROTECTED]> wrote: > The problem with linux kernel limits are, that they won't work really good > on MacOSX and Windows... OTOH the idea is the right one, but the effect can > be achieved inside of Python. Since Python does byte compile the code and > the interpreter eva

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
"Stephan Kuhagen" <[EMAIL PROTECTED]> wrote: > The problem with linux kernel limits are, that they won't work really good > on MacOSX and Windows... OTOH the idea is the right one, but the effect can > be achieved inside of Python. Since Python does byte compile the code and > the interpreter eva

Re: How fuzzy is get_close_matches() in difflib?

2006-11-17 Thread Steven D'Aprano
On Thu, 16 Nov 2006 22:59:41 -0800, John Henry wrote: > 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.

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

2006-11-17 Thread John Machin
ronrsr top-posted [uncorrected]: > 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. len(result) is 248 because y

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

2006-11-17 Thread Fredrik Lundh
ronrsr wrote: > 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. from python's perspective, the data structure

Re: Secure Python

2006-11-17 Thread Stephan Kuhagen
Hendrik van Rooyen wrote: > I seem to recall previous discussion on this group about a thing called > the bastion module, > and that it was deprecated. Not sure if it has any relevance. Never heard about it, maybe it's worth a look for the OP. Stephan -- http://mail.python.org/mailman/listin

Re: C extensions and memory leakage

2006-11-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Sheldon wrote: > Now I am wondering if the problem is in Python and the wrapper? Does > anybody have any idea or experience with this? I am running on > Mandrake10 using python 2.3. I am not exactly sure which C wrapper I am > using as I have copied it from another person.

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

2006-11-17 Thread Astan Chee
Dennis Lee Bieber wrote: > On Fri, 17 Nov 2006 18:53:41 +1100, Astan Chee <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >> What would be a good method to do this? I've tried your >> os.system("command&") and the spawned process is still the child of the >> current

Re: Secure Python

2006-11-17 Thread Fredrik Lundh
Stephan Kuhagen wrote: > Never heard about it, maybe it's worth a look for the OP. $ more Misc/HISTORY ... What's New in Python 2.3 alpha 2? = *Release date: 19-Feb-2003* ... - Bastion.py and rexec.py are disabled. These modules are not safe

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

2006-11-17 Thread Laurent Pointal
gabor a écrit : > 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." Maybe, for each filename, you can test if it is an unicode string, and

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

2006-11-17 Thread Leo Kislov
krishnakant Mane 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 lazer or ink jet pr

Re: Secure Python

2006-11-17 Thread Stefan Behnel
krishnakant Mane wrote: > I need to use python for a very mission critical project. may be I > will also use zope. > so I will like to know how far I can trust python for security in its > absolute (platform independent ) sence? > I mean running unwanted code at run-time etc. If you want a secure

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

2006-11-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Jean-Paul Calderone wrote: >>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? Suppose you have a directory with just some files having a name that

Re: How fuzzy is get_close_matches() in difflib?

2006-11-17 Thread John Machin
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? Are you desperate to understand the inner workings of difflib, or do you want merely to do some fuzzy matching of strings using a well-kno

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

2006-11-17 Thread Leo Kislov
Leo Kislov wrote: > CUPS only have command line interface: > My mistake: CUPS actually has official C API and unofficial python bindings . -- http://m

Bitwise operators. Differences from javascript and PHP.

2006-11-17 Thread skorobogatov
I can't understand a little thing in bitwise operations. In PHP and Javascript 4653896912>>13 = -212992 In Python and Ruby 4653896912>>13 = 568102 In Python and Ruby - it's ok. I understand. But i need to get in Python same value as in PHP and Javascript. How can i do this? -- http://mail.pyt

Re: Bitwise operators. Differences from javascript and PHP.

2006-11-17 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I can't understand a little thing in bitwise operations. > > In PHP and Javascript > 4653896912>>13 = -212992 > > In Python and Ruby > 4653896912>>13 = 568102 > > In Python and Ruby - it's ok. I understand. > But i need to get in Python same value as in PHP and Javasc

Re: C extensions and memory leakage

2006-11-17 Thread Sheldon
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Sheldon wrote: > > > Now I am wondering if the problem is in Python and the wrapper? Does > > anybody have any idea or experience with this? I am running on > > Mandrake10 using python 2.3. I am not exactly sure which C wrapper I am > > usi

Re: C extensions and memory leakage

2006-11-17 Thread Fredrik Lundh
Sheldon wrote: > I am very new at this C extensions in Python so my term wrapper was > probably a misnomer. Perhaps glue is better or the interface that > allows the exchange of data between Python and C. > Yes, I am using python objects in my C extension. > Tell me where I can find out more about

Re: Bitwise operators. Differences from javascript and PHP.

2006-11-17 Thread John Machin
[EMAIL PROTECTED] wrote: > I can't understand a little thing in bitwise operations. > > > In PHP and Javascript > 4653896912>>13 = -212992 > > In Python and Ruby > 4653896912>>13 = 568102 > > In Python and Ruby - it's ok. I understand. > But i need to get in Python same value as in PHP and Javascr

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

2006-11-17 Thread gabor
Laurent Pointal wrote: Laurent Pointal wrote: > gabor a écrit : >> 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." > > Maybe, for ea

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

2006-11-17 Thread Leo Kislov
Martin v. Löwis 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 did, > > and it did not work. it dies in the os.path.jo

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

2006-11-17 Thread gabor
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Jean-Paul > Calderone wrote: > >>> 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? > > Suppose you have a directo

Re: Bitwise operators. Differences from javascript and PHP.

2006-11-17 Thread Fredrik Lundh
John Machin wrote: > http://theopensourcery.com/phplogic.htm > > "In effect the bitwise operations [words "can be" omitted, I presume] "can only be", more likely. > safely applied to integer variables - their effect on booleans, > float/double or string variables can be predicted but are not re

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

2006-11-17 Thread gabor
Fredrik Lundh wrote: > 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 i

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

2006-11-17 Thread gabor
Martin v. Löwis wrote: > 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? yes, i would not have been surprised. beca

Re: Python v PHP: fair comparison?

2006-11-17 Thread Paul Boddie
Luis M. González skrev: > > > OK. But since when has python been considered a viable alternative for > > > web development? [...] > The problem is (or was) for mere mortals trying to create a web site on > shared hostings. Yes, that was the "barrier to entry" observation, but you have to implici

Re: Bitwise operators. Differences from javascript and PHP.

2006-11-17 Thread John Machin
On Nov 17, 9:38 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > John Machin wrote: > >http://theopensourcery.com/phplogic.htm > > > "In effect the bitwise operations [words "can be" omitted, I presume]"can > > only be", more likely. Yes, probably. > > > safely applied to integer variables - the

Re: Writing to Registry

2006-11-17 Thread Samantha
That was the fix. S "Mark Elston" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Note: this is untested (since I don't like screwing around > in the registry...) > > Have you tried using REG_DWORD? > > Mark >> -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python for me?

2006-11-17 Thread Magnus Lycka
I think Python is for you. lennart wrote: > Can you define 'large'? Is that large in code, or large in database? I > don't know which database is supported. If its a external db, like > MySql, the query is performed through the software of MySql, am I > right? If I'm correct, the 'slowness' comes

Re: A question on Encoding and Decoding.

2006-11-17 Thread Johan von Boisman
[EMAIL PROTECTED] wrote: > Hello, > I think this remark is more to the point. In my experience, the general > problem is that python operates with the default encoding "ascii" as in > sys.getdefaultencoding(). It is possible to set the defaultencoding in > sitecustomize.py, with sys.setdefaultencod

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

2006-11-17 Thread Leo Kislov
gabor wrote: > Martin v. Löwis wrote: > > 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? > > > yes, i w

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

2006-11-17 Thread krishnakant Mane
On 17/11/06, Tim Roberts <[EMAIL PROTECTED]> wrote: > Making the PDF is easy. Go get ReportLab from www.reportlab.org. I > consider it the best Python PDF solution. wow! you solved my major problem before I even asked it. seams that python programmers also have dynamic mind reading capability *s

Re: A question on Encoding and Decoding.

2006-11-17 Thread John Machin
On Nov 17, 9:18 pm, Johan von Boisman <[EMAIL PROTECTED]> wrote: > I missed the beginning of this thread, but why not write > > s = u"äÄöÖüÜß" > > Is there ever a reason _not_ to exclusively use the unicode stringtype > throughout your Python program? (of course you may need to encode/decode > wh

numpy magic: cast scalar returns auto to python types float & int ?

2006-11-17 Thread robert
Turning algs for old NumPy modules into numpy code I suffer from this: Upon further processing of returns of numpy calculations, lots of data in an apps object tree will become elementary numpy types. First there is some inefficiency in calculations. And then you get data inflation and questionab

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

2006-11-17 Thread Johan von Boisman
Laurent Pointal wrote: > gabor a écrit : >> 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." > > Maybe, for each filename, you can te

Re: A question on Encoding and Decoding.

2006-11-17 Thread Fredrik Lundh
Johan von Boisman wrote: > Is there ever a reason _not_ to exclusively use the unicode stringtype > throughout your Python program? speed and memory use. in 2.5, the unicode datatype is almost often as fast as the string type at the algorithm level, but it's still limited by memory bandwidth

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

2006-11-17 Thread Fredrik Lundh
krishnakant Mane wrote: > double wow! as it is my customer wants me to print to the default printer. > can you please help me with the command for rendering the pdf to the > printer with acrobat using python? see: http://tgolden.sc.sabren.com/python/win32_how_do_i/print.html or possibly:

Re: C extensions and memory leakage

2006-11-17 Thread Sheldon
Fredrik Lundh wrote: > Sheldon wrote: > > > I am very new at this C extensions in Python so my term wrapper was > > probably a misnomer. Perhaps glue is better or the interface that > > allows the exchange of data between Python and C. > > Yes, I am using python objects in my C extension. > > Tell

Re: Will GPL Java eat into Python marketshare?

2006-11-17 Thread Boris Borcic
Harry George wrote: > > Personally, I've never gotten jpype to work. Is it just me, or is it > a troublesome install? > It worked for my purpose (connecting to a 4D database via JDBC over Open4D, as the ODBC driver for that db is really horrible) until I tried to use this setup together with

pyserial port connection problem

2006-11-17 Thread Jon
Hi, I wrote some code to read in info from a port using pyserial. the code reads info sent by a box that is connected to my computer by an rs232-to usb adapter. When I was writing the code and testing it on my computer it worked fine. I ran py2exe on the program (which uses wxpython for its gui) a

Understanding Python Source Code - where to start?

2006-11-17 Thread Thomas Ploch
Hello folks, I am thinking about reading and understanding the Source Code of Python, but where would it be best to start? Possibly someone can give me a little hint. I am getting into socketmodule.c a little bit at the moment, but thats not what I want. Greetz, Thomas -- Der GMX SmartSurfe

Re: Multithreaded C API Python questions

2006-11-17 Thread robert
Svein Seldal wrote: > A real beauty about the PyGILState_Ensure() is the fact that if it's > called from a thread that is (yet) unknown to python, it will actually > create the thread state object for you (with PyThreadState_New) and > acquire the lock. Hence, I dont have to worry about the pro

Re: Understanding Python Source Code - where to start?

2006-11-17 Thread Fredrik Lundh
Thomas Ploch wrote: > I am thinking about reading and understanding the Source Code > of Python, but where would it be best to start? Possibly > someone can give me a little hint. I am getting into > socketmodule.c a little bit at the moment, but thats not > what I want. http://effbot.org/pyf

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

2006-11-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, gabor wrote: > Marc 'BlackJack' Rintsch wrote: >> In <[EMAIL PROTECTED]>, Jean-Paul >> Calderone wrote: >> 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 n

What python modules are available?

2006-11-17 Thread Why Tea
How do I find out what python modules are installed on a Solaris platform? I tried to import numarray, but python couldn't find it. /Why Tea -- http://mail.python.org/mailman/listinfo/python-list

Re: What python modules are available?

2006-11-17 Thread Dan Lenski
Why Tea wrote: > How do I find out what python modules are installed on a Solaris > platform? > > I tried to import numarray, but python couldn't find it. > > /Why Tea They're usually stored in something like /usr/lib/python2.4 And you can find most of the available modules at http://python.org/py

Re: C extensions and memory leakage

2006-11-17 Thread Sheldon
Fredrik Lundh wrote: > Sheldon wrote: > > > I am very new at this C extensions in Python so my term wrapper was > > probably a misnomer. Perhaps glue is better or the interface that > > allows the exchange of data between Python and C. > > Yes, I am using python objects in my C extension. > > Tell

Re: What python modules are available?

2006-11-17 Thread Fredrik Lundh
Why Tea wrote: > How do I find out what python modules are installed on a Solaris > platform? ask the person who did the installation? or run this script: http://svn.effbot.python-hosting.com/pydotorg/listmodules/listmodules.py > I tried to import numarray, but python couldn't find it. numarr

Re: What python modules are available?

2006-11-17 Thread Why Tea
> http://svn.effbot.python-hosting.com/pydotorg/listmodules/listmodules.py Thanks. The script worked nicely. > > I tried to import numarray, but python couldn't find it. > > numarray isn't a standard module; see the library reference for a list > of modules that you can expect to be available on

python on tivo (series2)?

2006-11-17 Thread Neal Becker
I'd like to find python for my tivo (series 2). I believe it runs linux on mips. Google found one, but it complained about shared libs when I tried to run python. (Unfortunately, it didn't say which libs, and tools like ldd seem to be missing on the tivo). I'd rather not have to setup a cross-c

String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
Hello: I am hoping someone knows if there is an easier way to do this or someone already implemented something that does this, rather than reinventing the wheel: I have been using the string.replace(from_string, to_string, len(string)) to replace names in a file with their IP address. For ex

Re: numpy magic: cast scalar returns auto to python types float & int ?

2006-11-17 Thread Tim Hochberg
robert wrote: > Turning algs for old NumPy modules into numpy code I suffer from this: > Upon further processing of returns of numpy calculations, lots of data in an > apps object tree will become elementary numpy types. > First there is some inefficiency in calculations. And then you get data >

Re: Secure Python

2006-11-17 Thread Fredrik Tolf
On Thu, 2006-11-16 at 08:43 +0200, Hendrik van Rooyen wrote: > "Fredrik Tolf" <[EMAIL PROTECTED]> wrote: > > > I was thinking that maybe it could be possible to load and run untrusted > > Python code, simply by loading it in a module with a modified version of > > __builtins__. Without any reacha

Re: String Replace only if whole word?

2006-11-17 Thread Juho Schultz
Michael Yanowitz wrote: > Hello: > > I am hoping someone knows if there is an easier way to do this or someone > already implemented something that does this, rather than reinventing the > wheel: > I have been using the string.replace(from_string, to_string, len(string)) > to replace names in a

ANN: Dabo 0.7 released!

2006-11-17 Thread Ed Leafe
It's been a while since we've had the chance to take a breath and compile a release, but it's here! Dabo 0.7 is now official, and it is available for download on our download page: http://dabodev.com/download If you're not familiar with Dabo, it is the leading framework for b

Which one is better for me , SIP or SWIG ?

2006-11-17 Thread [EMAIL PROTECTED]
Hi all, I am going to generate a python wrapper of a C library, and I am wondering which one is a better tool for me, SIP or SWIG ? SWIG supports many scripting languages such as python, ruby, and perl, while SIP is specific to python, so I think maybe SIP is more suitable to generate better w

Re: How to pass an argument to a python program open in IDLE?

2006-11-17 Thread TonyHa
Hello Josh, Thanks for the reply. But I am not sure I understand your reply, may be I need to explain my problem a bit more. I have a Python script which needs an input argument to run. e.g. python myscript.py xilinx. which run fine. My problem is this: When I start IDLE GUI, then I open my scrip

Re: Secure Python

2006-11-17 Thread Hendrik van Rooyen
"Stephan Kuhagen" <[EMAIL PROTECTED]> wrote: > The problem with linux kernel limits are, that they won't work really good > on MacOSX and Windows... OTOH the idea is the right one, but the effect can > be achieved inside of Python. Since Python does byte compile the code and > the interpreter eva

function for allocating memory for string array

2006-11-17 Thread Sheldon
Hi, Can someone tell me how to remove the conflicts here ? #include static char*** Memory2DStr(int R, int C); static void MemoryFreeStr(int C, char*** array); void main() { unsigned char ***arr_scenes=NULL; int R = 15; int C = 15; arr_scenes = Memory2DStr(nscenes,2); MemoryFreeStr(2,arr_scenes

Re: Question about unreasonable slowness

2006-11-17 Thread allenjo5
Leif K-Brooks wrote: > [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

Code feedback

2006-11-17 Thread Tor Erik Soenvisen
Hi, all I would like some feedback on a multithreaded HTTP server I've written. The server serves python-scripts by dynamically loading scripts in the same directory as itself. When a request is made to one of these scripts the script is executed and its output is returned to the requester. Here

Python list Limit

2006-11-17 Thread Bugra Cakir
Hi, What is the size limit of list data type in Python ? I've found an MemoryError while extending a list with samplelist.extend("tail") Thanks !!! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass an argument to a python program open in IDLE?

2006-11-17 Thread [EMAIL PROTECTED]
TonyHa wrote: > Hello Josh, > > Thanks for the reply. But I am not sure I understand your reply, may be > I need to explain my problem a bit more. I have a Python script which > needs an input argument to run. > e.g. python myscript.py xilinx. which run fine. > > My problem is this: When I start I

Re: function for allocating memory for string array

2006-11-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Sheldon wrote: > Can someone tell me how to remove the conflicts here ? What do you mean by conflicts? I see a bunch of undeclared functions here. Just look at the compiler messages and fix the problems one by one. > #include Here is missing a ``.h`` suffix. > static

Re: Secure Python

2006-11-17 Thread Steve Holden
Hendrik van Rooyen wrote: > "Stephan Kuhagen" <[EMAIL PROTECTED]> wrote: > > >> The problem with linux kernel limits are, that they won't work really good >> on MacOSX and Windows... OTOH the idea is the right one, but the effect can >> be achieved inside of Python. Since Python does byte compile

Re: How to pass an argument to a python program open in IDLE?

2006-11-17 Thread Fredrik Lundh
"TonyHa" wrote: > My problem is this: When I start IDLE GUI, then I open my script with > the edit window. (i.e. > File -> open). I run my script under the edit window using run -> run > module or F5. But IDLE does not allow me to input the argument to my > script, i.e. IDLE runs without prompting

Re: How fuzzy is get_close_matches() in difflib?

2006-11-17 Thread Antoon Pardon
On 2006-11-17, John Henry <[EMAIL PROTECTED]> wrote: > 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 d

Re: Python list Limit

2006-11-17 Thread Fredrik Lundh
Bugra Cakir wrote: > What is the size limit of list data type in Python ? there is no limit, beyond the size of a pointer, and the limitations put on your program by the operating system. > I've found an MemoryError while extending a list with > > samplelist.extend("tail") when the list is resi

RE: String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
>Michael Yanowitz wrote: >> Hello: >> >> I am hoping someone knows if there is an easier way to do this or someone >> already implemented something that does this, rather than reinventing the >> wheel: >> I have been using the string.replace(from_string, to_string, len(string)) >> to replace na

Re: pyserial port connection problem

2006-11-17 Thread Grant Edwards
On 2006-11-17, Jon <[EMAIL PROTECTED]> wrote: > I ran py2exe on the program (which uses wxpython for its gui) > and sent the output from the py2exe to another computer. now > when I try to run it on this other computer it fails to open > the port. it gives the error that it cannot createfile. the

Re: Question about unreasonable slowness

2006-11-17 Thread Łukasz Langa
[EMAIL PROTECTED]: > Ok, I built Python 2.5 (same AIX 5.1 machine). With the "for line in > shellOut" loop in, it now takes "only" 7 secs instead of the 11 secs in > python 2.4.3. So, that's better, but still unreasonably slow. And to > answer another's question, I'm using the ksh builtin 'time

Re: numpy magic: cast scalar returns auto to python types float & int ?

2006-11-17 Thread robert
Tim Hochberg wrote: > robert wrote: >> To avoid this you'd need a type cast in Python code everywhere you get >> scalars from numpy into a python variable. Error prone task. Or >> check/re-render your whole object tree. >> Wouldn't it be much better if numpy would return Python scalars for >> fl

Re: String Replace only if whole word?

2006-11-17 Thread Tim Chase
> I have been using the string.replace(from_string, to_string, len(string)) > to replace names in a file with their IP address. > For example, I have definitions file, that looks something like: > 10.1.3.4 LANDING_GEAR > 20.11.222.4 ALTIMETER_100 > 172.18.50.138 SIB > 172.18.50.138 LAPTOP >

Re: pyserial port connection problem

2006-11-17 Thread Nick Craig-Wood
Jon <[EMAIL PROTECTED]> wrote: > I wrote some code to read in info from a port using pyserial. the code > reads info sent by a box that is connected to my computer by an > rs232-to usb adapter. When I was writing the code and testing it on my > computer it worked fine. > I ran py2exe on the pr

Re: Heap Memory

2006-11-17 Thread Gregory Piñero
On 11/17/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > The default configuration for WinXP is 2GB shared OS, and 2GB > process... I believe there is some registry setting that can change that > to 1GB/3GB. I did some research and it looks like it does apply to XP (http://support.micro

Python v PHP for web, and restarting Apache?

2006-11-17 Thread walterbyrd
I think I have read somewhere that using Python to develop web-applications requires some restarting of the Apache server, whereas PHP does not. Also, I seem to remember reading something about PHP being able to recover from Apache restarting more easily than Python. I am not trying to suggest a

Re: Python v PHP for web, and restarting Apache?

2006-11-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, walterbyrd wrote: > I am not trying to suggest anything here. I'm just asking. Asking what? Asking something usually involves a question. ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Gregg Lind
One difficulty I am having with using Python for scientific computing is that I cannot figure out good ways to get arbitrary (unpatterned?) slices. As an example, in R or Matlab / Octave, syntax exists such that: vals = range(6) wanted = [1,2,3,1,1,1] vals[wanted] = [1,2,3,1,1,1] Both of those

Re: Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Fredrik Lundh
Gregg Lind wrote: > One difficulty I am having with using Python for scientific computing is > that I cannot figure out good ways to get arbitrary (unpatterned?) slices. > In Python, solutions I have found for these tasks are: > > [vals[ii] for ii in wanted]# task 1 > > [a[1] for in zip

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

2006-11-17 Thread [EMAIL PROTECTED]
ronrsr wrote: > 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. One string composed of multiple data elements

Slicing / subsetting list in arbitrary fashion

2006-11-17 Thread Gregg Lind
I wish something like this was part of the standard python installation, and didn't require one to use Numpy or Numarray. This sort of list subsetting is useful in many, many contexts. -- http://mail.python.org/mailman/listinfo/python-list

Re: Heap Memory

2006-11-17 Thread Fredrik Lundh
Gregory Piñero wrote: > How does Python use memory on a 64 bit OS? Is there a lot more > available to it by default? as we've already said a couple of hundred times in this thread, Python uses *all* the memory it can get from the operating system. no more, no less. (the link I posted yesterd

remove a list from a list

2006-11-17 Thread Rares Vernica
Hi, I have the following problem: I have a list like e = ['a', 'b', 'e'] and another list like l = ['A', 'a', 'c', 'D', 'E'] I would like to remove from l all the elements that appear in e case-insensitive. That is, the result would be r = ['c', 'D'] What is a *nice* way of doing it?

Re: Python v PHP for web, and restarting Apache?

2006-11-17 Thread gabor
walterbyrd wrote: > I think I have read somewhere that using Python to develop > web-applications requires some restarting of the Apache server, whereas > PHP does not. > first thing... there are many many ways how to run a python-apache web application.. - mod_python - cgi - fastcgi - sci - pr

Re: remove a list from a list

2006-11-17 Thread Tim Chase
> I have a list like >e = ['a', 'b', 'e'] > and another list like >l = ['A', 'a', 'c', 'D', 'E'] > I would like to remove from l all the elements that appear in e > case-insensitive. That is, the result would be >r = ['c', 'D'] > > What is a *nice* way of doing it? Well, it's usuall

Re: Python v PHP for web, and restarting Apache?

2006-11-17 Thread Michael Ströder
walterbyrd wrote: > I think I have read somewhere that using Python to develop > web-applications requires some restarting of the Apache server, whereas > PHP does not. Using Python to develop web-applications is a very broad topic. E.g. you don't have to restart Apache if you develop simple shor

Re: numpy magic: cast scalar returns auto to python types float & int ?

2006-11-17 Thread Robert Kern
robert wrote: > Didn't find the relevant reasoning within time. Yet guess the reason is > isolated-module-centric. I gave you a brief rundown on this list already. http://mail.python.org/pipermail/python-list/2006-October/411145.html And I'll note again that a fuller discussion is given in

Re: How fuzzy is get_close_matches() in difflib?

2006-11-17 Thread John Henry
I suppose you are right. I guess I ended up with an odd case. I was thinking that: To change "HIDE*S*ST1" to "HIDE*D*ST1", all you do is remove the "*S*" from the source and the "*D*" from the target. In order to change "HIDE*SC*T1" to "HIDE*DS*T1", I thought you have to remove 2 characters *SC

Re: What python modules are available?

2006-11-17 Thread Robert Kern
Why Tea wrote: > All I need is something to provide me with array features. I can't > remember why I chose to use numarray a while ago... You will probably want numpy these days. numarray is being phased out. http://numpy.scipy.org/ -- Robert Kern "I have come to believe that the whole world

Re: How fuzzy is get_close_matches() in difflib?

2006-11-17 Thread John Henry
Learn something new everyday. I always wondered how spell checkers are done. Thanks. John Machin wrote: > 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? > > Are you desperate to un

Re: What python modules are available?

2006-11-17 Thread km
Hi all, Thats ridiculous! why is that the numpy implementation documentation is put on sale and not available freely to everyone? regards, KM --- On 11/18/06, Robert Kern <[EMAIL PROTECTED]> wr

Re: About alternatives to Matlab

2006-11-17 Thread Brian Blais
Matimus 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 > > software/lang that is open & with comparable

Re: Will GPL Java eat into Python marketshare?

2006-11-17 Thread Michael
>> Short answer: People use Python instead of Java because people (at >> least intelligent people) tend to avoid pain. >> > Intelligent people don't suffer from fanboy sentiments. They just pick a > language that works best for them. I agree with the previous poster and don't think it's just

  1   2   >