Re: Variables

2005-04-23 Thread Robert Kern
Richard Blackwood wrote: Bengt Richter wrote: On Sat, 23 Apr 2005 22:45:14 -0400, Richard Blackwood <[EMAIL PROTECTED]> wrote: Robert Kern wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable

Re: Variables

2005-04-23 Thread Terry Reedy
>>In mathematics, the word 'variable' is generally an undefined meta-term >>that is *notorious* for having multiple possible meanings and shades of >>meaning. One mathematician/linguist once claimed to have discerned >>somewhere around 15 different meanings and shades thereof. >> > What is his

Re: Variables

2005-04-23 Thread Ron
Richard Blackwood wrote: He would argue strongly against your notion of variable. In the statement "foo = 5", foo is constant. He would thus argue that foo is a constant and not a variable (regardless of whether you change foo's value in subsequent statements). Sounds like his mind is made up an

Re: Variables

2005-04-23 Thread Richard Blackwood
Robert Kern wrote: Richard Blackwood wrote: Robert Kern wrote: If you must, http://en.wikipedia.org/wiki/Variable Fantastic, wikipedia deals precisely with the difference between variables in mathematics versus programming. However, he would never trust a definition from such an "unreputable" so

Re: Variables

2005-04-23 Thread Robert Kern
Richard Blackwood wrote: Robert Kern wrote: If you must, http://en.wikipedia.org/wiki/Variable Fantastic, wikipedia deals precisely with the difference between variables in mathematics versus programming. However, he would never trust a definition from such an "unreputable" source. If you have a

Re: Variables

2005-04-23 Thread Richard Blackwood
Bengt Richter wrote: On Sat, 23 Apr 2005 22:45:14 -0400, Richard Blackwood <[EMAIL PROTECTED]> wrote: Robert Kern wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. If you guy

Re: Variables

2005-04-23 Thread Bengt Richter
On Sat, 23 Apr 2005 22:45:14 -0400, Richard Blackwood <[EMAIL PROTECTED]> wrote: >Robert Kern wrote: > >> Richard Blackwood wrote: >> >>> To All: >>> >>>Folks, I need your help. I have a friend who claims that if I write: >>> >>> foo = 5 >>> >>> then foo is NOT a variable, necessarily. If you

Re: Variables

2005-04-23 Thread Richard Blackwood
Terry Reedy wrote: "Richard Blackwood" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Indeed, this language is math. In mathematics, the word 'variable' is generally an undefined meta-term that is *notorious* for having multiple possible meanings and shades of meaning. One

Re: GUI woes

2005-04-23 Thread Roger Binns
"jeff elkins" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > under debian sid, I installed (via apt-get) the various wxpython stuff > available.: > > libwxgtk2.4-python > libwxgtk2.5.3-python > python-opengl > python-pythoncard > python2.1-opengl > python2.2-opengl > python2.3-opengl

Re: Variables

2005-04-23 Thread Terry Reedy
"Richard Blackwood" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Indeed, this language is math. In mathematics, the word 'variable' is generally an undefined meta-term that is *notorious* for having multiple possible meanings and shades of meaning. One mathematician/linguist

Re: Variables

2005-04-23 Thread Richard Blackwood
Dan Bishop wrote: Richard Blackwood wrote: Steven Bethard wrote: Richard Blackwood wrote: Indeed, this language is math. My friend says that foo is a constant and necessarily not a variable. If I had written foo = raw_input(), he would say that foo is a variab

Re: Variables

2005-04-23 Thread Richard Blackwood
Mike Meyer wrote: Richard Blackwood <[EMAIL PROTECTED]> writes: Robert Kern wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. If you guys can define for me what a variable is

Re: Variables

2005-04-23 Thread Dan Bishop
Richard Blackwood wrote: > Steven Bethard wrote: > > > Richard Blackwood wrote: > > > >> Indeed, this language is math. My friend says that foo is a constant > >> and necessarily not a variable. If I had written foo = raw_input(), > >> he would say that foo is a variable. > > > > > > Then what does

Re: Variables

2005-04-23 Thread Richard Blackwood
Robert Kern wrote: Richard Blackwood wrote: Kent Johnson wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. Indeed, this language is math. My friend says that foo is a constant and ne

Re: Variables

2005-04-23 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > Robert Kern wrote: >> Richard Blackwood wrote: >>> To All: >>> >>>Folks, I need your help. I have a friend who claims that if I write: >>> >>> foo = 5 >>> >>> then foo is NOT a variable, necessarily. If you guys can define for >>> me what a varia

Re: help with binary file io, perhaps with generators?

2005-04-23 Thread Terry Reedy
"Marcus Goldfish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I need to write a "fast" file reader in python for binary files structured >as: > > … x[0] y[0] z[0] x[1] y[1] z[1] … > > where c[k] is the k-th element from sequence c. As mentioned, the > file is binary -- spaces

Re: Variables

2005-04-23 Thread Robert Kern
Richard Blackwood wrote: Kent Johnson wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. Indeed, this language is math. My friend says that foo is a constant and necessarily not a var

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: >> >>> Mike Meyer wrote: >>> "Simon John" <[EMAIL PROTECTED]> writes: > I still love Perl, it's a bit of an art form, as "there's more than > one way to do it", whereas Python

Re: Variables

2005-04-23 Thread Richard Blackwood
Kent Johnson wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. Indeed, this language is math. My friend says that foo is a constant and necessarily not a variable. Well, we mostly t

Re: Variables

2005-04-23 Thread Robert Kern
Richard Blackwood wrote: Indeed, this language is math. My friend says that foo is a constant and necessarily not a variable. If I had written foo = raw_input(), he would say that foo is a variable. Which is perfectly fine except that he insists that since programming came from math, the concept

Re: Bounding box on clusters in a 2D list

2005-04-23 Thread Bengt Richter
On 23 Apr 2005 13:17:55 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >If I have > >ex: x = [[1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0], > [1,1,1,0,1,1,0,0,0,0,0,1,1,1,1,0,0,0], > [1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,0,0,0], > [0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0]] >what I wan

Re: Variables

2005-04-23 Thread Richard Blackwood
Steven Bethard wrote: Richard Blackwood wrote: Indeed, this language is math. My friend says that foo is a constant and necessarily not a variable. If I had written foo = raw_input(), he would say that foo is a variable. Then what does he say if you write: foo = 5 foo = 6 ? STeVe He says that fo

Re: Variables

2005-04-23 Thread Kent Johnson
Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. Indeed, this language is math. My friend says that foo is a constant and necessarily not a variable. Well, we mostly talk Python here, not ma

Re: Variables

2005-04-23 Thread Steven Bethard
Richard Blackwood wrote: Indeed, this language is math. My friend says that foo is a constant and necessarily not a variable. If I had written foo = raw_input(), he would say that foo is a variable. Then what does he say if you write: foo = 5 foo = 6 ? STeVe -- http://mail.python.org/mailman/list

Re: Unicode problems, yet again

2005-04-23 Thread John Machin
On Sun, 24 Apr 2005 03:15:02 +0200, Ivan Voras <[EMAIL PROTECTED]> wrote: >I have a string fetched from database, in iso8859-2, with 8bit >characters, "8bit characters"?? Maybe you did once, or you thought you did, but what you have now is a Unicode string, and socket.write() is expecting an ord

Re: Variables

2005-04-23 Thread Richard Blackwood
Robert Kern wrote: Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. If you guys can define for me what a variable is and what qualifications you have to back you, I can pass this along to, hop

Re: Variables

2005-04-23 Thread Robert Kern
Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. If you guys can define for me what a variable is and what qualifications you have to back you, I can pass this along to, hopefully, convince hi

Re: Variables

2005-04-23 Thread Richard Blackwood
Indeed, but is it not a variable? Is a variable in programming not merely a name associated with a value (which can changed over the course of code execution)? James Stroud wrote: I think, strictly speaking, foo would be a "name" in python. foo Traceback (most recent call last): Fil

Re: Variables

2005-04-23 Thread James Stroud
I think, strictly speaking, foo would be a "name" in python. >>> foo Traceback (most recent call last): File "", line 1, in ? NameError: name 'foo' is not defined On Saturday 23 April 2005 07:20 pm, so sayeth Richard Blackwood: > To All: > > Folks, I need your help. I have a friend who cl

Variables

2005-04-23 Thread Richard Blackwood
To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. If you guys can define for me what a variable is and what qualifications you have to back you, I can pass this along to, hopefully, convince him that foo is indeed a va

Re: Unicode problems, yet again

2005-04-23 Thread Kent Johnson
Ivan Voras wrote: I have a string fetched from database, in iso8859-2, with 8bit characters, and I'm trying to send it over the network, via a socket: File "E:\Python24\lib\socket.py", line 249, in write data = str(data) # XXX Should really reject non-string non-buffers UnicodeEncodeError:

help with binary file io, perhaps with generators?

2005-04-23 Thread Marcus Goldfish
I need to write a "fast" file reader in python for binary files structured as: … x[0] y[0] z[0] x[1] y[1] z[1] … where c[k] is the k-th element from sequence c. As mentioned, the file is binary -- spaces above are just for visualization. Each element, c[k], is a 16-bit int. I can assume I kno

Re: Unicode problems, yet again

2005-04-23 Thread Jp Calderone
On Sun, 24 Apr 2005 03:15:02 +0200, Ivan Voras <[EMAIL PROTECTED]> wrote: I have a string fetched from database, in iso8859-2, with 8bit characters, and I'm trying to send it over the network, via a socket: You don't have a string fetched from a database, in iso-8859-2, alas. That is the root o

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
Peter Ammon wrote: I'm bewildered why you haven't mentioned magic quotes. A one line change to the configuration file can render your PHP site almost entirely immune to SQL injection attacks. PHP's magic quotes is one of the most poorly-designed features I can think of. Instead of magically esc

Re: GUI woes

2005-04-23 Thread Kartic
The Great jeff elkins uttered these words on 4/23/2005 5:45 PM: test.py crashes with the error below. Any clues? === Running test.py: Traceback (most recent call last): File "./test.py", line 87, in ? app = MyApp(0) # Create an instance of the application class File "/usr/l

GUI woes

2005-04-23 Thread jeff elkins
Howdy, This may not belong here, if so apologies... I'm a python newbie, but have completed a console app that I'd like to run under X. Reading recent postings here, wxpython seemed a reasonable choice so under debian sid, I installed (via apt-get) the various wxpython stuff available.: libwx

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> "Simon John" <[EMAIL PROTECTED]> writes: >> >>> I still love Perl, it's a bit of an art form, as "there's more than >>> one way to do it", whereas Python usually only allows one way to do >>> it, which may or may not be a better mant

Unicode problems, yet again

2005-04-23 Thread Ivan Voras
I have a string fetched from database, in iso8859-2, with 8bit characters, and I'm trying to send it over the network, via a socket: File "E:\Python24\lib\socket.py", line 249, in write data = str(data) # XXX Should really reject non-string non-buffers UnicodeEncodeError: 'ascii' codec can'

Re: Bounding box on clusters in a 2D list

2005-04-23 Thread bearophileHUGS
I hope this is what you need, sometimes understanding the question is one of the hardest parts :-) If you can use a graph data structure, you can create a graph, and then you can find the lenght of all its connected components (indentations reduced to 2 spaces): . def mat2graph(g, m, good=None, w

Re: Python or PHP?

2005-04-23 Thread Peter Ammon
Leif K-Brooks wrote: John Bokma wrote: my $sort = $cgi->param( "sort" ); my $query = "SELECT * FROM table WHERE id=? ORDER BY $sort"; And the equivalent Python code: cursor.execute('SELECT * FROM table WHERE id=%%s ORDER BY %s' % sort, [some_id]) You're right, of course, about being *able* to wr

Re: Using Ming on Windows

2005-04-23 Thread André Roberge
Colin J. Williams wrote: Jack Diederich wrote: On Sat, Apr 23, 2005 at 05:13:29PM -0300, Andr? Roberge wrote: I tried to install Ming (http://sourceforge.net/projects/ming/) on Windows to use with Python *but* I can't [/don't know how to] use "make" to install it. I installed MinGW on a Windows XP

Re: Using Ming on Windows

2005-04-23 Thread Colin J. Williams
Jack Diederich wrote: On Sat, Apr 23, 2005 at 05:13:29PM -0300, Andr? Roberge wrote: I tried to install Ming (http://sourceforge.net/projects/ming/) on Windows to use with Python *but* I can't [/don't know how to] use "make" to install it. Does anyone know where I could find a ready-made compiled v

Re: Handling lists

2005-04-23 Thread Michael Spencer
[EMAIL PROTECTED] wrote: ... list = [[10,11,12,13,14,78,79,80,81,300,301,308]] how do I convert it so that I arrange them into bins . so If i hvae a set of consecutive numbers i would like to represent them as a range in the list with max and min val of the range alone. I shd get something like l

Re: Python or PHP?

2005-04-23 Thread Leif Biberg Kristensen
Leif K-Brooks skrev: > But Python's DB-API (the standard way to connect to an SQL database > from Python) makes escaping SQL strings automatic. You can do this: > > cursor.execute('UPDATE foo SET bar=%s WHERE id=%s', ["foo'bar", 123]) So. I've been writing SQL queries in Python like this, using

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
John Bokma wrote: my $sort = $cgi->param( "sort" ); my $query = "SELECT * FROM table WHERE id=? ORDER BY $sort"; And the equivalent Python code: cursor.execute('SELECT * FROM table WHERE id=%%s ORDER BY %s' % sort, [some_id]) You're right, of course, about being *able* to write code with SQL inj

Re: PDF Printing support from Python

2005-04-23 Thread Grant Edwards
On 2005-04-23, Mike Meyer <[EMAIL PROTECTED]> wrote: >>> No, you don't. My print system does that, and I don't have >>> acrobat installed. I have ghostscript installed, which >>> includes pdf2ps - which handles this particular translation. >>> >> Okay, so you've converted one page layout lang

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
John Bokma wrote: Not. Perl and Java use similar methods where one can specify place holders, and pass on the data unescaped. But still injection is possible. How? -- http://mail.python.org/mailman/listinfo/python-list

Re: PDF Printing support from Python

2005-04-23 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Fri, 22 Apr 2005 17:41:22 -0500, Mike Meyer <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> No, you don't. My print system does that, and I don't have acrobat >> installed. I have ghostscript installed, which includes pdf2p

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
"Simon John" <[EMAIL PROTECTED]> writes: > I still love Perl, it's a bit of an art form, as "there's more than one > way to do it", whereas Python usually only allows one way to do it, > which may or may not be a better mantra The Python mantra leads to 1) less programmer overhead, and 2) fas

Re: func_code vs. string problem

2005-04-23 Thread Steven Bethard
Filip Dreger wrote: Uzytkownik "Steven Bethard" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] See the documentation: http://docs.python.org/ref/dynamic-features.html """The eval(), execfile(), and input() functions and the exec statement do not have access to the full environme

Re: func_code vs. string problem

2005-04-23 Thread Filip Dreger
Uzytkownik "Steven Bethard" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > See the documentation: > > http://docs.python.org/ref/dynamic-features.html > > """The eval(), execfile(), and input() functions and the exec > statement do not have access to the full environment for r

Why is Python not supporting full derivation of built-in file class?

2005-04-23 Thread Pierre Rouleau
Greetings, I'm wondering why the >> operator does not use the write() method of a class derived from the built-in file class as in DerivedFile below. In the following example: - StringFile is just a file-like string accumulation class that can be used in place of a real file to accumulate string

Re: func_code vs. string problem

2005-04-23 Thread Steven Bethard
Filip Dreger wrote: If I had a magic function 'exec in current scope' I would implement it like this: class actor: def __init__(): self.roles=[] def act(): for i in self.roles: exec i in current scope then the roles would simply be functions defined in any importable file. For

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
Mage wrote: However one of the worst cases is the sql injection attack. And sql injections must be handled neither by php nor by python but by the programmer. But Python's DB-API (the standard way to connect to an SQL database from Python) makes escaping SQL strings automatic. You can do this: cu

Re: func_code vs. string problem

2005-04-23 Thread Filip Dreger
Uzytkownik "Steven Bethard" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > Filip Dreger wrote: >> I am trying to find a way of executing functions without creating a >> nested scope, so they can share local and global namespace (even if >> they are declared in some other modu

Re: Handling lists

2005-04-23 Thread James Stroud
On Saturday 23 April 2005 12:50 pm, [EMAIL PROTECTED] wrote: > I have a question on python lists. > Suppose I have a 2D list > list = [[10,11,12,13,14,78,79,80,81,300,301,308]] > how do I convert it so that I arrange them into bins  . > so If i hvae a set of consecutive numbers i would like to repr

Re: memory profiler?

2005-04-23 Thread John Reese
On Wed, 20 Apr 2005 23:06:51 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: > John Reese wrote: >> Is there a memory or heap profiler for python programs? So that, for >> example, if a program was bloating over time I could see how many of >> each object there were and maybe even where the referen

Re: Using Ming on Windows

2005-04-23 Thread Jack Diederich
On Sat, Apr 23, 2005 at 05:13:29PM -0300, Andr? Roberge wrote: > I tried to install Ming > (http://sourceforge.net/projects/ming/) > on Windows to use with Python *but* > I can't [/don't know how to] use "make" to install it. > > Does anyone know where I could find a ready-made compiled > version

Re: XML file parsing with SAX

2005-04-23 Thread Uche Ogbuji
On 4/23/05, Willem Ligtenberg <[EMAIL PROTECTED]> wrote: > so that will be sax.handler.feature_external_ges = "false" Yes. > And it will work? Honestly, I'm not sure. It should, but I've found these edge cases a bit hard to predict in the Python built-in libs :-( > But what about using a cata

Re: func_code vs. string problem

2005-04-23 Thread Steven Bethard
Filip Dreger wrote: I am trying to find a way of executing functions without creating a nested scope, so they can share local and global namespace (even if they are declared in some other module). Why? Can you explain what the use case is? STeVe -- http://mail.python.org/mailman/listinfo/python-

Re: func_code vs. string problem

2005-04-23 Thread Steven Bethard
Filip Dreger wrote: Each function has a func_code property that is suposed to contain the pure bytecode of the function. All the context (including reference to relevant namespaces) is stored in different fields of the function object. Since 'exec' is able to execute any string or bytecode in th

Re: Handling lists

2005-04-23 Thread [EMAIL PROTECTED]
yes that makes sense.But the problem I am facing is if list= [300,301,303,305] I want to consider it as one cluster and include the range as [300,305] so this is where I am missing the ranges. so If the list has l = [300,301,302,308,401,402,403,408] i want to include it as [[300,308],[401,408]].

Re: XML file parsing with SAX

2005-04-23 Thread Willem Ligtenberg
I didn't make the XML file. And I don't like messing with other peoples data. So I just want my SAX parser to ignore it. I can't help if other people make it hard for me to read their xml file... On Sat, 23 Apr 2005 13:48:49 -0600, Uche Ogbuji wrote: > On Sat, 2005-04-23 at 15:20 +0200, Willem Li

Re: func_code vs. string problem

2005-04-23 Thread Filip Dreger
I came up with a simpler description of the problem. It's all in the simple source: # we define 'print b' in three different ways: as a string, # a bytecode and a function string="print b" code=compile(string,'string','exec') def function(): print b # now we make functions that test if it is

Bounding box on clusters in a 2D list

2005-04-23 Thread [EMAIL PROTECTED]
If I have ex: x = [[1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0], [1,1,1,0,1,1,0,0,0,0,0,1,1,1,1,0,0,0], [1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,0,0,0], [0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0]] what I want is a boundingbox over the region where we find clusters of 1's.So for instance in th

Re: Does numarray search for blas and lapack during installation?

2005-04-23 Thread RickMuller
IIRC, no. But the setup.py script is fairly easy to hack to link in your own blas/lapack libraries. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-23 Thread F. Petitjean
Le Sat, 23 Apr 2005 19:11:19 +0200, Fredrik Lundh a écrit : > in PHP, good programmers are able to write bad programs without > even noticing. +1 QOTW --- The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. Dr. E.W. Dijkstra -- http://mail.pyth

Re: Handling lists

2005-04-23 Thread Mage
[EMAIL PROTECTED] wrote: >I have a question on python lists. >Suppose I have a 2D list >list = [[10,11,12,13,14,78,79,80,81,300,301,308]] >how do I convert it so that I arrange them into bins . >so If i hvae a set of consecutive numbers i would like to represent >them as a range in the list with

Using Ming on Windows

2005-04-23 Thread André Roberge
I tried to install Ming (http://sourceforge.net/projects/ming/) on Windows to use with Python *but* I can't [/don't know how to] use "make" to install it. Does anyone know where I could find a ready-made compiled version for Windows to just "put in" my site-packages directory. Any help would be app

Handling lists

2005-04-23 Thread [EMAIL PROTECTED]
I have a question on python lists. Suppose I have a 2D list list = [[10,11,12,13,14,78,79,80,81,300,301,308]] how do I convert it so that I arrange them into bins . so If i hvae a set of consecutive numbers i would like to represent them as a range in the list with max and min val of the range alo

Re: XML file parsing with SAX

2005-04-23 Thread Uche Ogbuji
On Sat, 2005-04-23 at 15:20 +0200, Willem Ligtenberg wrote: > I decided to use SAX to parse my xml file. > But the parser crashes on: > File "/usr/lib/python2.3/site-packages/_xmlplus/sax/handler.py", line 38, > in fatalError > raise exception > xml.sax._exceptions.SAXParseException: NCBI_En

python and Tile Studio

2005-04-23 Thread André Roberge
Has anyone used Python with Tile Studio to create games? http://tilestudio.sourceforge.net/ André -- http://mail.python.org/mailman/listinfo/python-list

Re: python modules in home dir

2005-04-23 Thread Uche Ogbuji
On Sat, 2005-04-16 at 08:12 -0600, Uche Ogbuji wrote: > On Sat, 2005-04-09 at 14:09 -0700, dzieciou wrote: > > > I'm new-comer in Python. > > I want to install few Python modules (4Suite, RDFLib, Twisted and Racoon) > > in my home directory, since Python installation is already installed in the >

Re: Python or PHP?

2005-04-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-04-23 15:53:17 +0200: > Lad wrote: > > >Is anyone capable of providing Python advantages over PHP if there are > >any? > > I am also new to python but I use php for 4 years. I can tell: > > - python is more *pythonic* than php > - python has its own perfume > http://w

Re: Python or PHP?

2005-04-23 Thread Jeremy Bowers
On Sat, 23 Apr 2005 20:13:24 +0200, Mage wrote: > Avoid them is easy with set_type($value,"integer") for integer values and > correct escaping for strings. "Avoiding buffer overflows in C is easy, as long as you check the buffers each time." The *existence* of a technique to avoid problems is not

Re: Python or PHP?

2005-04-23 Thread Mage
Fredrik Lundh wrote: > >sql injection? what's your excuse for not using data binding? > > I am not sure I truly understand your question. So far my own servers didn't get successful sql injection attack. I just saw some on other sites and did one for demonstration. Avoid them is easy with set_

Re: PDF Printing support from Python

2005-04-23 Thread M.E.Farmer
> You're use of the word "driver" is one with which I'm not > familiar. But I don't really "do windows" so it's probably a > Widnowism. It is a windowism but not exclusively ;). http://www.collaborium.org/onsite/romania/UTILS/Printing-HOWTO/winprinters.html This is the first link I found that men

Re: Python or PHP?

2005-04-23 Thread Fredrik Lundh
"Mage" wrote: > I don't think so. Bad programmers are able to write bad programs in any > language. in PHP, good programmers are able to write bad programs without even noticing. (every successful server attack I've seen closely the last few years have been through PHP. it's totally without com

Re: Python Imaging Library and PyGTK - color image path?

2005-04-23 Thread Jeremy Bowers
On Sat, 23 Apr 2005 10:20:29 +0200, Fredrik Lundh wrote: > which discusses draw_rgb_image and friends, and says that "if you can > convert your PIL image to a pixel data string or buffer object, you could > use them to display the image". here's some code that seems to do exactly > that: > >

Does numarray search for blas and lapack during installation?

2005-04-23 Thread Edward C. Jones
I have a PC with Debian sid installed. I install all my Python stuff in /usr/local. I just installed numarray 1.3.1. Blaslite and lapacklite were compiled. Did the installation process search for blas and lapack? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-23 Thread Simon John
I've been a PHP and Perl programmer (amongst others) for 10 years or more now, and a Python coder for 3 or so. I have come to hate PHP now, it's pseudo-OOP is awful, it's dog slow at handling XML, it's so easy to use that most of the programmers I've had contact with are very sloppy and do things

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-23 Thread Bengt Richter
On 22 Apr 2005 21:16:04 -0700, [EMAIL PROTECTED] wrote: >>>I think of it like the ''.join semantics. The object knows best how >to >>>handle join (even if it looks wierd to some people). In the #! case, >>>the program knows best how to start itself. > >>This I don't understand ;-) > >With ','.joi

Re: Trouble Installing TTX/FontTools (asks for .NET FrameworkPackages)

2005-04-23 Thread Fredrik Lundh
Jesper Olsen wrote: > > Apparently setup.py tries to compile a c file, which of course > doesn't > > work if there's no compiler. > > In fact it does not work even if there is a compiler - seems distutils > has been broken in python2.4 (it works in python2.3). distutils works just fine in 2.4. b

Re: Python or PHP?

2005-04-23 Thread Kirk Job Sluder
"Lad" <[EMAIL PROTECTED]> writes: > Is anyone capable of providing Python advantages over PHP if there are > any? > Cheers, > L. PHP is strongly wedded to providing web-based content, while Python can be used to build a large number of different types of applications. -- Kirk Job-Sluder "The

func_code vs. string problem

2005-04-23 Thread Filip Dreger
Each function has a func_code property that is suposed to contain the pure bytecode of the function. All the context (including reference to relevant namespaces) is stored in different fields of the function object. Since 'exec' is able to execute any string or bytecode in the current scope, it

Re: Python or PHP?

2005-04-23 Thread Mage
Tim Tyler wrote: >Mage <[EMAIL PROTECTED]> wrote or quoted: > > > >>check this: http://wiki.w4py.org/pythonvsphp.html >> >> > >Good - but it hardly mentions the issue of security - which seems >like a bit of a problem for PHP at the moment. > > I don't think so. Bad programmers are able to

Re: XML parsing per record

2005-04-23 Thread Kent Johnson
Willem Ligtenberg wrote: Is there an easy way, to couple data together. Because I have discoverd an irritating feature in the xml file. Sometimes this is a database reference: UCSC 1234 And sometimes: UCS

Re: a=[ lambda t: t**n for n in range(4) ]

2005-04-23 Thread Bengt Richter
On 22 Apr 2005 20:45:55 -0700, "El Pitonero" <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> I still don't know what you are asking for, but here is a toy, >> ... >> But why not spend some time with the tutorials, so have a few more >cards in your deck >> before you try to play for real? ;-) >

Re: Python licence again

2005-04-23 Thread Tim Tyler
fuzzylollipop <[EMAIL PROTECTED]> wrote or quoted: > try spelling license correctly next time and heading the google > suggestions that probably looked like "didn't you mean : Python License" How do you spell license correctly? -- __ |im |yler http://timtyler.org/ [EMAIL PROTECTED] R

Re: Python or PHP?

2005-04-23 Thread Tim Tyler
Mage <[EMAIL PROTECTED]> wrote or quoted: > check this: http://wiki.w4py.org/pythonvsphp.html Good - but it hardly mentions the issue of security - which seems like a bit of a problem for PHP at the moment. -- __ |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply.

Re: Trouble Installing TTX/FontTools (asks for .NET Framework Packages)

2005-04-23 Thread Jesper Olsen
weston wrote: > This problem may be addressed here: > > http://sourceforge.net/mailarchive/message.php?msg_id=1702374 > > Apparently setup.py tries to compile a c file, which of course doesn't > work if there's no compiler. In fact it does not work even if there is a compiler - seems distutils ha

Re: Python or PHP?

2005-04-23 Thread Diez B. Roggisch
> php doesn't have any smell au contraire! I've seen many code smells in PHP. http://c2.com/cgi/wiki?CodeSmell -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-23 Thread Ville Vainio
> "Leif" == Leif K-Brooks <[EMAIL PROTECTED]> writes: Leif> Lad wrote: >> Is anyone capable of providing Python advantages over PHP if there are >> any? Leif> Python is a programming language in more ways than simple Turing Leif> completeness. PHP isn't. +1 QOTW. -- Vil

Re: Frog 1.4 (web log aka blogging server)

2005-04-23 Thread Irmen de Jong
limodou wrote: great! How about change the bbcode like editor to FCKeditor? I think FCKeditor is much better, or make it as an optional editor which the user could select it himself. Isn't that pretty heavyweight for a blog? I mean; Frog is not a CMS with which you write HTML pages... Then again, i

Caching compiled regexps across sessions (was Re: Regular Expressions - Python vs Perl)

2005-04-23 Thread Ville Vainio
> "Ilpo" == Ilpo NyyssÃnen writes: >> so you picked the wrong file format for the task, and the slowest Ilpo> What would you recommend instead? Ilpo> I have searched alternatives, but somehow I still find XML Ilpo> the best there is. It is a standard format with standard

Re: a=[ lambda t: t**n for n in range(4) ]

2005-04-23 Thread Scott David Daniels
Mage wrote: Scott David Daniels wrote: See, the body of your anonymous function just looks for "the current value of n" when it is _invoked_, not when it is _defined_. The "lambda functions" was an unclear part of the tutorial I read. Should I use them? Are they pythonic? As far I see they are good

Re: a=[ lambda t: t**n for n in range(4) ]

2005-04-23 Thread Harald Massa
Mage <[EMAIL PROTECTED]> wrote in news:mailman.2339.1114242211.1799.python- > The "lambda functions" was an unclear part of the tutorial I read. > Should I use them? Are they pythonic? > As far I see they are good only for type less a bit. And to obfusicate code. lambda is evil, do not play with

Re: PDF Printing support from Python

2005-04-23 Thread Grant Edwards
On 2005-04-23, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> You're use of the word "driver" is one with which I'm not >> familiar. But I don't really "do windows" so it's probably a >> Widnowism. > > It could be that he means that creating PDFs on windows is > done using a fake printer that wil

Re: Python callbacks & PyGILState_Release()

2005-04-23 Thread Randall Hopper
Thomas Heller: |> Python -> C++ -> Python Callback |> |> (example attached) an exception raised in the callback doesn't make it back |> across C++ to Python. ... |> void callback_wrapper( void *user_data ) |> { |> // Acquire interpreter lock |> PyGILState_STATE gstate = PyGILState_

Re: Python or PHP?

2005-04-23 Thread Mage
Lad wrote: >Is anyone capable of providing Python advantages over PHP if there are >any? > > I am also new to python but I use php for 4 years. I can tell: - python is more *pythonic* than php - python has its own perfume http://www.1976.com.tw/image/trussardi_python_uomo.jpg and it's nice. ph

  1   2   >