Re: xml.sax.xmlreader and expat

2006-06-27 Thread Stefan Behnel
Fredrik Lundh wrote: > Gary Robinson wrote: > >> We're using xml.sax.xmlreader in our app (http://www.goombah.com, >> which is written in Python). >> >> In Python 2.3.x, does that use the C-language expat under the hood? > > yes. > >> The reason I'm asking is because we're wondering if we can sp

Re: a class variable question

2006-06-27 Thread Erik Max Francis
Pierre Quentel wrote: > In func1, _var1 = 1 creates a local variable _var1 (local to the > method), not an attribute of the instance. If you want an instance > attribute you must specify the reference to the instance by > self._var1 = 1 ; self must be passed as an attribute to func1 > > def f

Re: a class variable question

2006-06-27 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > class A: > _var1 = 0 > def __init__(self): > ## some initialization > self.func1() > > def func1(): > . > _var1 = 1 > You mean:: class A:

Re: a class variable question

2006-06-27 Thread Marco Wahl
Hi, just some lines added below. hth [EMAIL PROTECTED] wrote: > hi > i have define a class like this > > class A: > _var1 = 0 > def __init__(self): > ## some initialization > self.func1() > > def func1(): se

Re: a class variable question

2006-06-27 Thread Pierre Quentel
In func1, _var1 = 1 creates a local variable _var1 (local to the method), not an attribute of the instance. If you want an instance attribute you must specify the reference to the instance by self._var1 = 1 ; self must be passed as an attribute to func1 def func1(self): self._var1 = 1

a class variable question

2006-06-27 Thread micklee74
hi i have define a class like this class A: _var1 = 0 def __init__(self): ## some initialization self.func1() def func1(): . _var1 = 1 def getvarValue(self):

global name is not defined - error - but for array

2006-06-27 Thread a
def fn(): for i in range(l) global count count[i]= how do i declare count to be global if it is an array subsequently i should access or define count as an array error: global name 'count' is not defined thanks -a -- http://mail.python.org/mailman/listinfo/pyt

using TreeBuilder in an ElementTree like way

2006-06-27 Thread Greg Aumann
I am trying to write some python code for a library that reads an XML-like language from a file into elementtree data structures. Then I want to be able to read and/or modify the structure and then be able to write it out either as XML or in the original format. I really want the api for the XM

Re: global name is not defined - error

2006-06-27 Thread Marco Wahl
"a" <[EMAIL PROTECTED]> writes: > What I want > --- > I want to create a list of items from a function operating on an array > of strings Ok. > What I did > - > list=["s0","s1","s2"] > l=len(list) > for i in range(l): > d_list[i]=f.

Re: how do i make an array global

2006-06-27 Thread Erik Max Francis
a wrote: > def fn(): > for i in range(l) >global count >count[i]= > > how do i declare count to be global if it is an array count = [...] def fn(): global count for i in range(l): count[i] = ... -- Erik

how do i make an array global

2006-06-27 Thread a
def fn(): for i in range(l) global count count[i]= how do i declare count to be global if it is an array subsequently i should access or define count as an array error: global name 'count' is not defined thanks -a -- http://mail.python.org/mailman/listinfo/pyth

global name is not defined - error

2006-06-27 Thread a
What I want --- I want to create a list of items from a function operating on an array of strings What I did - list=["s0","s1","s2"] l=len(list) for i in range(l): d_list[i]=f.do(list[i]) print d_l

Help Installing smartypants.py

2006-06-27 Thread Scott McCracken
I just got Python 2.4 setup locally (Mac OS X) and am trying to extend it by installing both the markdown and smartypants plugins. Ultimately I'd like to be able use both in a custom CMS I'm building with Django. Installing markdown was a snap by following the instructions at http://www.freewisdom

Re: getting POST vars from BaseHTTPRequestHandler

2006-06-27 Thread and-google
Christopher J. Bottaro wrote: > When I make a post, it just hangs (in self.rfile.read()). I don't know about BaseHTTPRequestHandler in particular, but in general you don't want to call an unlimited read() on an HTTP request - it will try to read the entire incoming stream, up until the stream is

Re: Having problems with strings in HTML

2006-06-27 Thread and-google
Sion Arrowsmith wrote: > I've never encountred a browser getting tripped up by it. I suppose you > might need it if you've got parameters called quot or nbsp There are many more entities than you can comfortably remember, and browsers can interpret anything starting with one as being an entity re

import chains

2006-06-27 Thread Wesley Henwood
I have a program which uses a combination of MFC multithreading, python multithreading, and extended and embedded python. This works: >From the C++ app, call python script A within a MFC thread. Script A imports module 2 which imports module 3. Module 3 is a c++ extension, the code for which is

Re: what is pygtk.require("2.0") for?

2006-06-27 Thread Matt Good
yaru22 wrote: > when I read a book, it just said we need to do > > import pygtk > pygtk.require("2.0") > import gtk > > in order to import gtk modules > > What is that pygtk.require("2.0") command for? It enables you to install multiple versions of pygtk in parallel and makes sure when you do "im

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Paul Rubin
David Hopwood <[EMAIL PROTECTED]> writes: > Note that I'm not claiming that you can check any desirable property of > a program (that would contradict Rice's Theorem), only that you can > express any dynamically typed program in a statically typed language -- > with static checks where possible and

Re: xml.sax.xmlreader and expat

2006-06-27 Thread Fredrik Lundh
Gary Robinson wrote: > We're using xml.sax.xmlreader in our app (http://www.goombah.com, which > is written in Python). > > In Python 2.3.x, does that use the C-language expat under the hood? yes. > The reason I'm asking is because we're wondering if we can speed up the > parsing significantl

Verify PyProtocols interfaces?

2006-06-27 Thread Terry Hancock
Hi all, PyProtocols is a very nice interface/component/adapter library, but it appears to lack one thing I'm quite hooked on, which is the ability to verify that objects implement a given interface. I'd like something like the 'verify' functionality that Zope3 interfaces provide. Is there somethi

what is pygtk.require("2.0") for?

2006-06-27 Thread yaru22
when I read a book, it just said we need to do import pygtk pygtk.require("2.0") import gtk in order to import gtk modules What is that pygtk.require("2.0") command for? -- http://mail.python.org/mailman/listinfo/python-list

Re: Function to prune dictionary keys not working

2006-06-27 Thread Serge Orlov
On 6/27/06, John Machin <[EMAIL PROTECTED]> wrote: > |>> '1.00' >= 0.5 > True > |>> '0.33' >= 0.5 > True > > Python (correctly) does very little (guesswork-based) implicit type > conversion. At the same time, Python (incorrectly :) compares incomparable objects. -- http://mail.python.org/mailman/

error in ConfigParser

2006-06-27 Thread pipehappy
Hello everyone: I came across the module ConfigParser and can use it correctly. import ConfigParser fp = open('test.cfg','w+') config = ConfigParser.ConfigParser() config.readfp(fp) config.add_section('test') config.set('test', 'haha', 'hehe') print config.sections() config.write(fp) ['test'] Tr

Re: Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > Thanks for the thorough explanation. > > What I am doing is converting data for processing that will be tab (for > columns) and newline (for row) delimited. Some of the data contains tabs > and newlines so, I have to convert them to something e

Re: Function to prune dictionary keys not working

2006-06-27 Thread John Machin
On 28/06/2006 12:15 PM, Girish Sahani wrote: > hi ppl, > Here is a simple function to remove those keys of a dictionary whose > values are less than some specified value. But it isnt working. Please > help. > > def prune(d,cp): > l = [] > for rule,value in d.iteritems(): > #print

Re: Function to prune dictionary keys not working

2006-06-27 Thread Terry Reedy
"Girish Sahani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi ppl, > Here is a simple function to remove those keys of a dictionary whose > values are less than some specified value. But it isnt working. Please > help. > > def prune(d,cp): >l = [] >for rule,value in d.i

Function to prune dictionary keys not working

2006-06-27 Thread Girish Sahani
hi ppl, Here is a simple function to remove those keys of a dictionary whose values are less than some specified value. But it isnt working. Please help. def prune(d,cp): l = [] for rule,value in d.iteritems(): #print value if value >= cp: l.append(rule) re

Re: How do you use this list ?

2006-06-27 Thread Dan Sommers
On Tue, 27 Jun 2006 14:22:19 -, Grant Edwards <[EMAIL PROTECTED]> wrote: > Actually having mailing lists send you mail is insane. +1 QOTW I remember an episode of M*A*S*H (first there was the book, then there was an American TV show) where some General or other high ranking army type said, "

problem with http server

2006-06-27 Thread placid
Hi all, Im having trouble with the following code for handling GET requests from a client to my HTTP server. What i want to do is restrict access only to a folder and contents(files) within this folder. But when trying to open files (eg text files) i get file not found error from send_head() metho

HTTP server

2006-06-27 Thread placid
Hi all, Im having trouble with the following code for handling GET requests from a client to my HTTP server. What i want to do is restrict access only to a folder and contents(files) within this folder. But when trying to open files (eg text files) i get file not found error from send_head() metho

Re: Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread John Machin
On 28/06/2006 9:44 AM, Mike Currie wrote: > > What I am doing is converting data for processing that will be tab (for > columns) and newline (for row) delimited. Some of the data contains tabs > and newlines so, I have to convert them to something else so the file > integrity is good. > > No

Re: logging error with RotatingFileHandler

2006-06-27 Thread flupke
Vinay Sajip wrote: > flupke wrote: > > >> File "C:\Python24\lib\logging\handlers.py", line 134, in doRollover >>self.handleError(record) >>NameError: global name 'record' is not defined > > > There's a bug in doRollover's exception handling, which is masking the > true error - which is mos

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-27 Thread Greg Ewing
Brian Blais wrote: > I have found a very similar problem trying to replace a method using a > function defined in pyrex. Functions defined in Pyrex are C-implemented functions, which don't trigger the method binding magic when you access them through a class. The same thing happens if you try to

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread David Hopwood
Joe Marshall wrote: > David Hopwood wrote: >>Joe Marshall wrote: >> >>>(defun blackhole (argument) >>> (declare (ignore argument)) >>> #'blackhole) >> >>This is typeable in any system with universally quantified types (including >>most practical systems with parametric polymorphism); it has type

Re: Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread Mike Currie
Thanks for the thorough explanation. What I am doing is converting data for processing that will be tab (for columns) and newline (for row) delimited. Some of the data contains tabs and newlines so, I have to convert them to something else so the file integrity is good. Not my idea, I've bee

Re: Python UTF-8 and codecs

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > Well, not really. It doesn't affect the result. I still get the error > message. Did you get a different result? Yes, the program succesfully wrote text file. Without magic abilities to read the screen of your computer I guess you now get ex

Re: What is Expressiveness in a Computer Language [correction]

2006-06-27 Thread David Hopwood
David Hopwood wrote: > Joe Marshall wrote: > >>(defun blackhole (argument) >> (declare (ignore argument)) >> #'blackhole) > > This is typeable in any system with universally quantified types (including > most practical systems with parametric polymorphism); it has type > "forall a . a -> #'blac

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Joe Marshall
David Hopwood wrote: > Joe Marshall wrote: > > > (defun blackhole (argument) > > (declare (ignore argument)) > > #'blackhole) > > This is typeable in any system with universally quantified types (including > most practical systems with parametric polymorphism); it has type > "forall a . a -> #

Re: Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread John Machin
On 28/06/2006 7:46 AM, Mike Currie wrote: > Can anyone explain why I'm getting an ascii encoding error when I'm trying > to write out using a UTF-8 encoder? > f = codecs.open('foo.txt', 'wU', 'utf-8') print filteredLine > thisêhasêàtabsêandêlineàbreaks f.write(filteredLine) > Trac

Re: Python UTF-8 and codecs

2006-06-27 Thread Mike Currie
Well, not really. It doesn't affect the result. I still get the error message. Did you get a different result? "Serge Orlov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: >> Okay, >> >> Here is a sample of what I'm doing: >>

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Greg Buchholz
Joe Marshall wrote: > It isn't clear to me which programs we would have to give up, either. > I don't have much experience in sophisticated typed languages. It is > rather easy to find programs that baffle an unsophisticated typed > language (C, C++, Java, etc.). > > Looking back in comp.lang.lisp

Re: How do you use this list ?

2006-06-27 Thread Slawomir Nowaczyk
On Tue, 27 Jun 2006 14:22:19 + Grant Edwards <[EMAIL PROTECTED]> wrote: #> Actually having mailing lists send you mail is insane. Just curious: what's insane about it? -- Best wishes, Slawomir Nowaczyk ( [EMAIL PROTECTED] ) Never attribute to malice that which can be adequately ex

Re: Looking for Python code to obsfucate mailto links on web site

2006-06-27 Thread Andrew McLean
Dan Sommers wrote: > On Sun, 25 Jun 2006 21:10:31 +0100, > Andrew McLean <[EMAIL PROTECTED]> wrote: > >> I'm looking at putting some e-mail contact addresses on a web site, >> and wanted to make it difficult for spammers to harvest them. > > [ ... ] > >> Searching the web it looks like the best

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Chris Smith
Pascal Costanza <[EMAIL PROTECTED]> wrote: > You can ignore the #'. In Scheme this as follows: > > (define blackhole (argument) >blackhole) > > It just means that the function blackhole returns the function blackhole. So, in other words, it's equivalent to (Y (\fa.f)) in lambda calculus, wh

Re: Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread Robert Kern
Mike Currie wrote: > Can anyone explain why I'm getting an ascii encoding error when I'm trying > to write out using a UTF-8 encoder? Please read the Python Unicode HOWTO. http://www.amk.ca/python/howto/unicode -- Robert Kern "I have come to believe that the whole world is an enigma, a har

Re: Python UTF-8 and codecs

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > Okay, > > Here is a sample of what I'm doing: > > > Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> filterMap = {} > >>> for i in rang

Re: Problem with sets and Unicode strings

2006-06-27 Thread Robert Kern
Dennis Benzinger wrote: > Serge Orlov wrote: >> On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: >>> Hi! >>> >>> The following program in an UTF-8 encoded file: >>> >>> >>> # -*- coding: UTF-8 -*- >>> >>> FIELDS = ("Fächer", ) >>> FROZEN_FIELDS = frozenset(FIELDS) >>> FIELDS_SET = set(FIELDS

Re: Tkinter - Button Overrelief

2006-06-27 Thread Fuzzyman
Eric Brunel wrote: > On Tue, 27 Jun 2006 14:06:05 +0200, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > Hello all, > > > > I have some Tkinter buttons that display images. I would like to change > > these to 'active' images when the mouse is over the button. > > > > I see that the button widget can tak

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Greg Buchholz
George Neuner wrote: > That was interesting, but the authors' method still involves runtime > checking of the array bounds. IMO, all they really succeeded in doing > was turning the original recursion into CPS and making the code a > little bit clearer. Hmm. There is a comparison in both the

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Joe Marshall
QCD Apprentice wrote: > Joe Marshall wrote: > > Marshall wrote: > >> > >> The real question is, are there some programs that we > >> can't write *at all* in a statically typed language, because > >> they'll *never* be typable? > > > > Certainly! As soon as you can reflect on the type system you c

Re: Exchanging data with a C program using shared memory (sysV IPC)

2006-06-27 Thread slacker
Al wrote: > I want my python application to communicate with an legacy C program which > read/write data in a shared memory (Unix Sys V IPC). Have you looked at the dl module? Types and portability aside, it might provide you with what you need. Cheers, - slacker -- http://mail.python.org/ma

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread David Hopwood
Pascal Costanza wrote: > David Hopwood wrote: >> Marshall wrote: >> >>> The real question is, are there some programs that we >>> can't write *at all* in a statically typed language, because >>> they'll *never* be typable? >> >> In a statically typed language that has a "dynamic" type, all >> dynam

Re: Problem with sets and Unicode strings

2006-06-27 Thread Serge Orlov
On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: > Serge Orlov wrote: > > On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: > >> Hi! > >> > >> The following program in an UTF-8 encoded file: > >> > >> > >> # -*- coding: UTF-8 -*- > >> > >> FIELDS = ("Fächer", ) > >> FROZEN_FIELDS = fro

Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread Mike Currie
Can anyone explain why I'm getting an ascii encoding error when I'm trying to write out using a UTF-8 encoder? Thanks Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> filterMap = {} >>> for i

Re: Execute Commands on Remote Computers over Network

2006-06-27 Thread dylpkls91
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "dylpkls91" <[EMAIL PROTECTED]> wrote: > > >I have been researching this topic and come up with some code to make > >it work. It uses SSL and requires the 3rd party package Paramiko (which > >requires PyCrypto). > > Why not just spawn

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Joe Marshall
Marshall wrote: > Joe Marshall wrote: > > Looking back in comp.lang.lisp, I see these examples: > > > > (defun noisy-apply (f arglist) > > (format t "I am now about to apply ~s to ~s" f arglist) > > (apply f arglist)) > > > > (defun blackhole (argument) > > (declare (ignore argument)) > >

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread David Hopwood
Joe Marshall wrote: > It isn't clear to me which programs we would have to give up, either. > I don't have much experience in sophisticated typed languages. It is > rather easy to find programs that baffle an unsophisticated typed > language (C, C++, Java, etc.). > > Looking back in comp.lang.lis

RE: SWIG problems with gcc and Cygwin?

2006-06-27 Thread Michael Yanowitz
Thanks. It now works for me in Cygwin. I would never have guessed to write it as a dll. Michael Yanowitz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Norman Vine Sent: Tuesday, June 27, 2006 4:21 PM To: python-list@python.org Subject: Re: SWIG problems

Re: Python UTF-8 and codecs

2006-06-27 Thread Mike Currie
Okay, Here is a sample of what I'm doing: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> filterMap = {} >>> for i in range(0,255): ... filterMap[chr(i)] = chr(i) ... >>> filterMap[chr(

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Pascal Costanza
Marshall wrote: > Joe Marshall wrote: >> Marshall wrote: >> It isn't clear to me which programs we would have to give up, either. >> I don't have much experience in sophisticated typed languages. It is >> rather easy to find programs that baffle an unsophisticated typed >> language (C, C++, Java,

Re: Problem with sets and Unicode strings

2006-06-27 Thread Dennis Benzinger
Serge Orlov wrote: > On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: >> Hi! >> >> The following program in an UTF-8 encoded file: >> >> >> # -*- coding: UTF-8 -*- >> >> FIELDS = ("Fächer", ) >> FROZEN_FIELDS = frozenset(FIELDS) >> FIELDS_SET = set(FIELDS) >> >> print u"Fächer" in FROZEN_FIE

xml.sax.xmlreader and expat

2006-06-27 Thread Gary Robinson
Hi, We're using xml.sax.xmlreader in our app (http://www.goombah.com, which is written in Python). In Python 2.3.x, does that use the C-language expat under the hood? The reason I'm asking is because we're wondering if we can speed up the parsing significantly. Thanks in advance for any input

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Pascal Costanza
David Hopwood wrote: > Marshall wrote: >> The real question is, are there some programs that we >> can't write *at all* in a statically typed language, because >> they'll *never* be typable? > > In a statically typed language that has a "dynamic" type, all > dynamically typed programs are straight

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Ole Nielsby
David Hopwood <...nospamuk> wrote: > A good debugger is invaluable regardless of your attitude > to type systems. I found that certain language features help greatly in pinning the errors, when programming in my own impure fp language (PILS). Originally, I implemented a single-stepping debug

Re: What is a type error?

2006-06-27 Thread Pascal Costanza
Marshall wrote: > Pascal Costanza wrote: >> Consider division by zero: appropriate arguments for division are >> numbers, including the zero. > > A bold assertion! > > The general question is, what do we do about partial functions? > > >> The dynamic type check will typically not >> check wheth

Re: What is a type error?

2006-06-27 Thread Pascal Costanza
Chris Smith wrote: > Pascal Costanza <[EMAIL PROTECTED]> wrote: >>> Clearly, in this example, the program >>> is invoking an operation (division) on values that are not appropriate >>> (zero for the second argument). Hence, if your definition really is a >>> definition, then this must qualify.

Re: languages with full unicode support

2006-06-27 Thread Matthias Blume
Tin Gherdanarra <[EMAIL PROTECTED]> writes: > Oliver Bandel wrote: >> こんいちわ Xah-Lee san ;-) > > Uhm, I'd guess that Xah is Chinese. Be careful > with such things in real life; Koreans might > beat you up for this. Stay alive! And the Japanese might beat him up, too. For butchering their language

Re: to py or not to py ?

2006-06-27 Thread Carl J. Van Arsdall
Serge Orlov wrote: > On 6/27/06, Chandrashekhar kaushik <[EMAIL PROTECTED]> wrote: > >> HI all >> I have the following prob. >> I am to write a parallel vis application . >> I wud have by default used C++ for the same but somehow >> thought if py cud help me .. >> It does as in many things that

Re: to py or not to py ?

2006-06-27 Thread Serge Orlov
On 6/27/06, Chandrashekhar kaushik <[EMAIL PROTECTED]> wrote: > HI all > I have the following prob. > I am to write a parallel vis application . > I wud have by default used C++ for the same but somehow > thought if py cud help me .. > It does as in many things that i would otherwise have written d

Re: Python UTF-8 and codecs

2006-06-27 Thread Mike Currie
I did make a mistake, it should have been 'wU'. The starting data is ASCII. What I'm doing is data processing on files with new line and tab characters inside quoted fields. The idea is to convert all the new line and characters to 0x85 and 0x88 respectivly, then process the files. Finally r

Re: What is Expressiveness in a Computer Language [correction]

2006-06-27 Thread David Hopwood
David Hopwood wrote: > Marshall wrote: >>David Hopwood wrote: >>>Marshall wrote: >>> The real question is, are there some programs that we can't write *at all* in a statically typed language, because they'll *never* be typable? >>> >>>In a statically typed language that has a "dynamic"

Parallel Port and FreeBSD

2006-06-27 Thread navalha
I'm trying to run pyparallel to control de parallel port in python but i cant, because it doesnt find pyparallelioctl.py, and i cant find it anywhere in the internet does anyone have any ideas or another option to control de parallel port int freebsd? thanks -- http://mail.python.org/mailman/li

Re: Python UTF-8 and codecs

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > I'm trying to write out files that have utf-8 characters 0x85 and 0x08 in > them. Every configuration I try I get a UnicodeError: ascii codec can't > decode byte 0x85 in position 255: oridinal not in range(128) > > I've tried using the codecs.op

Re: SWIG problems with gcc and Cygwin?

2006-06-27 Thread Norman Vine
"Michael Yanowitz"wrote > > >I am just trying out SWIG, but quickly ran into problems. > Using Cygwin gcc, I tried the following: > > 3)ran in cygwin: swig -i python example.i try 'swig -python example.i' > 4)Attempted to run on cygwin: ld -shared example.o example_wrap.o -o > _exampl

Re: Problem with sets and Unicode strings

2006-06-27 Thread Serge Orlov
On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: > Hi! > > The following program in an UTF-8 encoded file: > > > # -*- coding: UTF-8 -*- > > FIELDS = ("Fächer", ) > FROZEN_FIELDS = frozenset(FIELDS) > FIELDS_SET = set(FIELDS) > > print u"Fächer" in FROZEN_FIELDS > print u"Fächer" in FIELDS_S

Event objects Threading on Serial Port on Win32

2006-06-27 Thread Gabriel
David: Tube el mismo problema que vos con el hilo del ejemplo de pyserial. Me paso que en Linux andaba bien, obvio, pero tenia un pequeño problemilla en Windows, también obvio. Lo solucione de la siguiente manera: Asi es el codigo original de la función ComPortThread def ComPortThread(self):

Re: How to disable tk inclusion in py build

2006-06-27 Thread venkatbo
Hi Fredrick, > since _tkinter.so is only built if it's found by the setup script, > and if built, it's only loaded if you actually use it, why bother > "disabling" it ? I don't want it to build tk into the py dist, even if it finds it on the build box - its not needed in the deployment. Keeping i

Re: Python UTF-8 and codecs

2006-06-27 Thread Dennis Benzinger
Mike Currie wrote: > I'm trying to write out files that have utf-8 characters 0x85 and 0x08 in > them. Every configuration I try I get a UnicodeError: ascii codec can't > decode byte 0x85 in position 255: oridinal not in range(128) > > I've tried using the codecs.open('foo.txt', 'rU', 'utf-8',

Python UTF-8 and codecs

2006-06-27 Thread Mike Currie
I'm trying to write out files that have utf-8 characters 0x85 and 0x08 in them. Every configuration I try I get a UnicodeError: ascii codec can't decode byte 0x85 in position 255: oridinal not in range(128) I've tried using the codecs.open('foo.txt', 'rU', 'utf-8', errors='strict') and that do

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread David Hopwood
Marshall wrote: > David Hopwood wrote: >>Marshall wrote: >>>David Hopwood wrote: Marshall wrote: >The real question is, are there some programs that we >can't write *at all* in a statically typed language, because >they'll *never* be typable? In a statically typed lang

Problem with sets and Unicode strings

2006-06-27 Thread Dennis Benzinger
Hi! The following program in an UTF-8 encoded file: # -*- coding: UTF-8 -*- FIELDS = ("Fächer", ) FROZEN_FIELDS = frozenset(FIELDS) FIELDS_SET = set(FIELDS) print u"Fächer" in FROZEN_FIELDS print u"Fächer" in FIELDS_SET print u"Fächer" in FIELDS gives this output False False Traceback (mos

Re: Questions about OSS projects.

2006-06-27 Thread Grant Edwards
On 2006-06-27, bio_enthusiast <[EMAIL PROTECTED]> wrote: > I was wondering how to go about starting an open source > project for doing routine biological problems? Generally you either start writing code to fulfill a need of yours, or you pay somebody else to write it for you. > There is a pleth

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Marshall
Joe Marshall wrote: > Marshall wrote: > > > > Yes, an important question (IMHO the *more* important question > > than the terminology) is what *programs* do we give up if we > > wish to use static typing? I have never been able to pin this > > one down at all. > > It would depend on the type system

Re: using pydoc in an application

2006-06-27 Thread timw.google
I went and looked at the pydoc.py code, and it looks like it isn't really meant to be used from inside another python program. After some tinkering arond with my code, I ended up with this: (Google is messing up my indentation) (in my __init__ function) ... menuBar.addmenuitem('Help', 'co

Questions about OSS projects.

2006-06-27 Thread bio_enthusiast
I was wondering how to go about starting an open source project for doing routine biological problems? There is a plethora of scripts and a fairly large biopython project to back up anyone who tried, these however cater to the bioinformatics community and it loses the vast majority of the wet-lab s

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Marshall
David Hopwood wrote: > Marshall wrote: > > David Hopwood wrote: > >>Marshall wrote: > >> > >>>The real question is, are there some programs that we > >>>can't write *at all* in a statically typed language, because > >>>they'll *never* be typable? > >> > >>In a statically typed language that has a

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Chris Smith
Dr.Ruud <[EMAIL PROTECTED]> wrote: > > So it seems to me that we have this ideal point at which it is > > possible to write all correct or interesting programs, and impossible > > to write buggy programs. > > I think that is a misconception. Even at the idealest point it will be > possible (and ea

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Chris Smith
George Neuner wrote: > We're talking at cross purposes. I'm questioning whether a strong > type system can be completely static as some people here seem to > think. I maintain that it is simply not possible to make compile time > guarantees about *all* runtime behavior and that, in particular, >

Re: Extracting 3-byte integers

2006-06-27 Thread Bob Greschke
>I have some binary data read from a file that is arranged like > > <3-byte int> <3-byte int> <3-byte int> etc. > > The "ints" are big-endian and there are 169 of them. Is there any clever > way to convert these to regular Python ints other than (struct) unpack'ing > them one at a time and doi

Re: How to disable tk inclusion in py build

2006-06-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I'd like to disable the inclusion of tk graphics lib in my py build. > Looked around but couldn't find a clear answer. Which one of > the following would I need to use in the configure step: > --disable-tkbuild > --without-tk since _tkinter.so is only built if it's

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread David Hopwood
Marshall wrote: > David Hopwood wrote: >>Marshall wrote: >> >>>The real question is, are there some programs that we >>>can't write *at all* in a statically typed language, because >>>they'll *never* be typable? >> >>In a statically typed language that has a "dynamic" type, all >>dynamically typed

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread QCD Apprentice
Joe Marshall wrote: > Marshall wrote: >> Yes, an important question (IMHO the *more* important question >> than the terminology) is what *programs* do we give up if we >> wish to use static typing? I have never been able to pin this >> one down at all. > > It would depend on the type system, natur

Re: [W2k, wxPython 2.6.1.0] - MDISashDemo bug?

2006-06-27 Thread w.p.
Steve Holden wrote: >> > Well done! Do you know how to feed this information on to the developers > (probably Robin Dunn)? All such changes are valuable. > Hmm... i dont know. wxpython.org -> "submit a patch" or "Report a bug" ? w.p. -- http://mail.python.org/mailman/listinfo/python-list

Re: file writing question

2006-06-27 Thread diffuser78
Thanks BrunoThis helps me. Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > > Hi, I am a newbie so not very confident in file handling. > > > > I want to write to a file atrributes in this fashion > > #NameOfComputer:MAC_Address:IP_Address > > > > --computer_details.txt > > begins--

Exchanging data with a C program using shared memory (sysV IPC)

2006-06-27 Thread Al
Hello, I want my python application to communicate with an legacy C program which read/write data in a shared memory (Unix Sys V IPC). It seems that there are no official shm nor sysV ipc module, and that non-official ones are dead. I can't modify the C code to change its communication method. H

Re: Python database access

2006-06-27 Thread Damjan
> The odbc module is part of the Python Standard Library. Since when? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Diez B. Roggisch
>> The C++ type system is Turing complete, although in practical terms >> it limits how much processing power it will spend on types at >> compile time. > > I think templates only have to expand to seven levels, so you are > severely limited here. You can adjust the iteration-depth. However, as t

Re: [W2k, wxPython 2.6.1.0] - MDISashDemo bug?

2006-06-27 Thread Steve Holden
w.p. wrote: > w.p. wrote: > >>When i run MDISashDemo and maximize main frame, minimize and maximize >>again - LayoutMDIFrame in OnSize dont work more... >>Why? >> >>I need this feature for main MDI frame with toolbar and statusbar with >>panels&sizers&bitmapbuttons :) >> >>Windows 2000, wxPython

Re: Unbound Local error? How?

2006-06-27 Thread Steve Holden
Hari Sekhon wrote: > Bruno Desthuilliers wrote: > >>Hari Sekhon wrote: >> >> >>>I've got some code as follows: >>> >>>import re >>>re_regexname = re.compile('abc') >>> >>>. >>>. various function defs >>>. >>> >>>def func1(): >>> ... >>> func2() >>> ... >>> >>>def func2(): >>>

Re: new python icons for windows

2006-06-27 Thread chowychow
Istvan Albert wrote: > [EMAIL PROTECTED] wrote: > > > > For example it resembles the icon for text files. > > > > This is intentional: to make it obvious that .py files are the > > readable, editable scripts, contrasting with .pyc's binary gunk - > > I think this is a mistake, it does not seem obi

  1   2   >