Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-06 Thread casevh
I downloaded and tried the CVS version. Division still didn't work as expected. >>> import gmpy >>> gmpy.version() '1.01' >>> gmpy.mpz(9)//gmpy.mpz(4) Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for //: 'mpz' and 'mpz' >>> from __future__ impor

Re: Distributed Cache Server?

2005-11-06 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: > Does anyone know if a "distributed caching system" has been developed > for use with Python? I've seen mention of memcached, but was really > after something natively python. [...] Too bad, because memcached implements all the difficult parts already (like failover if o

Re: strange sockets

2005-11-06 Thread Skink
Bryan, > > Sion Arrowsmith is right about what causes the delay. > Just in case your real code looks like this, I'll note: > >> len, = struct.unpack("!i", s.recv(4)) >> data = s.recv(len) yes, my mistake ;) > > > First, you almost certainly don't want to use the name 'len'. > Ought not

Re: strange sockets

2005-11-06 Thread Skink
Sion, > Solutions: either change > > >> conn.sendall(struct.pack("!i", len(data))) >> conn.sendall(data) > > > to > > conn.sendall(struct.pack("!i", len(data)) + data) > > or after creating conn > > conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1) > > to disable Nagle. t

Re: how to present Python's OO feature in design?

2005-11-06 Thread Kay Schluehr
pcmanlin wrote: > because i have a problem that python's oo feature is so great, but > maybe when the project become larger, python's no-declaration cannot > mapping the design to practice? > > I am not sure about it. As far cartoon-ware ( UML ) is concerned note that it is NOT Pythons non-declara

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread aum
On Sun, 06 Nov 2005 21:23:03 -0800, Roger Binns wrote: >> To me, wxPython is like a 12-cylinder Hummer, with fuzzy dice hanging >> from the mirror, fridge and microwave in the back, and DVD consoles on >> every seat, towing a campervan - absolute power and luxury, giving 8mpg >> if you're lucky. >

Re: Distributed Cache Server?

2005-11-06 Thread Roger Binns
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does anyone know if a "distributed caching system" has been developed > for use with Python? BitTorrent :-) > Yes, "distributed caching system" is a bit of a general term, but am > really just talking about something as simple as key +

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Roger Binns
"aum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To me, wxPython is like a 12-cylinder Hummer, with fuzzy dice hanging > from the mirror, fridge and microwave in the back, and DVD consoles on > every seat, towing a campervan - absolute power and luxury, giving 8mpg > if you're l

gmpy 1.01 rc near... anybody wanna test>

2005-11-06 Thread Alex Martelli
I have fixed almost all of the outstanding bugreports and feature request for gmpy: divm doesn't leak memory any more, truediv and floordiv are implemented for all types, etc -- in the current CVS version (one thing I must still look at is divm's behavior when its args are not mutually prime). It

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Bugs
Hi Peter, I just used the setup.py that comes in the singlefile/gui sample. However, py2exe does still also require the msvcr71.dll runtime as well, which is 340kb. Here it is, it's a bit lengthy: # If run without args, build executables, in quiet mode. if len(sys.argv) == 1: sys.argv.appe

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Steven D'Aprano
Brendan wrote: > Hi all > > I'm new to Python (and programming in general), and I can't decide what > is the most 'pythonic' way to approach a problem. Your advice would be > appreciated. > > I have a bunch of 'scans', containing the data measured from one of > several types of 'model'. Each 'm

Re: how to present Python's OO feature in design?

2005-11-06 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > aum wrote: >>On Sun, 06 Nov 2005 19:06:49 -0800, pcmanlin wrote: >>>As I know java has many UML tools to design for its OO feature, is >>>there any tools or good concept for Python project Modeling? >> >>Just code the bloody thing! >> >>One of Python's strengths is its ra

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Peter Hansen
Bugs wrote: > Peter Hansen wrote: >> The wxPython program below, py2exe'd on my machine (1.6GHz Pentium M), >> comes to only 12MB (2-3MB of which is Python itself), and takes 1-2 >> seconds to load (actually less than one second after the first >> invocation following a fresh reboot). > > And e

Circe

2005-11-06 Thread Sargun Dhillon
Me and my friends are working on a project, Circe we'd like some people to test it: The site: http://circe.nick125.com The download link: http://circe.nick125.com/node/2 The digg link (please digg): http://digg.com/software/Circe_-_A_new_Python_IRC_client -- http://mail.python.org/mailman/listinf

ANN: Internationalization in Django

2005-11-06 Thread Adrian Holovaty
Thanks to great contributions from the community, Django now has full internationalization support. (Django is a full-stack Python Web framework that encourages rapid development and clean, pragmatic design. See http://www.djangoproject.com/ .) Django now has: * Full support for specifying t

Re: how to present Python's OO feature in design?

2005-11-06 Thread [EMAIL PROTECTED]
aum wrote: > On Sun, 06 Nov 2005 19:06:49 -0800, pcmanlin wrote: > > > As I know java has many UML tools to design for its OO feature, is > > there any tools or good concept for Python project Modeling? > > Just code the bloody thing! > > One of Python's strengths is its rapid design/programming/t

Re: how to present Python's OO feature in design?

2005-11-06 Thread aum
On Sun, 06 Nov 2005 19:06:49 -0800, pcmanlin wrote: > As I know java has many UML tools to design for its OO feature, is > there any tools or good concept for Python project Modeling? Just code the bloody thing! One of Python's strengths is its rapid design/programming/testing turnaround. And vi

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Steve Holden
aum wrote: > On Sun, 06 Nov 2005 16:31:54 -0800, Paul Rubin wrote: > > >>aum <[EMAIL PROTECTED]> writes: >> >>>To me, wxPython is like a 12-cylinder Hummer, ... >>>Whereas PyFLTK feels more like an average suburban 4-door sedan >> >>Interesting. What would Tkinter be at that car dealership? Wha

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 6)

2005-11-06 Thread Cameron Laird
QOTW: "- don't use SAX unless your document is huge - don't use DOM unless someone is putting a gun to your head" - Istvan Albert "I wouldn't fret too much about a sharp remark from Fredrik Lundh. They're pretty much all that way. ;) It looks like you already did the right thing - read past the

Re: how to present Python's OO feature in design?

2005-11-06 Thread pcmanlin
because i have a problem that python's oo feature is so great, but maybe when the project become larger, python's no-declaration cannot mapping the design to practice? I am not sure about it. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to present Python's OO feature in design?

2005-11-06 Thread jmdeschamps
Do you mean code-generators for Python from UML? If not, please give some hints in what OOP features you're interested in, because I can't see how use-case, class, instance (objects), package, sequence,( ... other ) diagram would differ in Python from Java from an OOP perspective? -- http://mail

how to present Python's OO feature in design?

2005-11-06 Thread pcmanlin
As I know java has many UML tools to design for its OO feature, is there any tools or good concept for Python project Modeling? -- http://mail.python.org/mailman/listinfo/python-list

Re: click event

2005-11-06 Thread jmdeschamps
I guess you mean draw lines from the laast coordinates to the new one? then add a few global variables: lastX="" lastY="" # and modify lastX="" lastY="" def click(event): global lastX, lastY if lastX != "": c.create_line(lastX,lastY,event.x,event.y,fill="white") lastX = event.x

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Bugs
Peter Hansen wrote: > > The wxPython program below, py2exe'd on my machine (1.6GHz Pentium M), > comes to only 12MB (2-3MB of which is Python itself), and takes 1-2 > seconds to load (actually less than one second after the first > invocation following a fresh reboot). > And even 12MB seems h

Re: socket receive file does not match sent file

2005-11-06 Thread [EMAIL PROTECTED]
when I test the two program in the same OS, i mean from a redhat 9 OS to a redhat 9 OS, It's ok. receivefile match sent file. But when I run receiver on a Redhat 9, and send file from a windows XP, the received file's size is randomized. May be that's where the problem is. -- http://mail.pyt

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Peter Hansen
aum wrote: > To me, wxPython is like a 12-cylinder Hummer, with fuzzy dice hanging > from the mirror, fridge and microwave in the back, and DVD consoles on > every seat, towing a campervan - absolute power and luxury, giving 8mpg > if you're lucky. > > wxPython has the cost of a massive disk and m

Re: python gc performance in large apps

2005-11-06 Thread Tim Peters
[Robby Dermody] > ... > -len(gc.get_objects()) will show linearly increasing counts over time > with the director (that match the curve of the director's memory usage > exactly), but with the harvester, the object count doesn't increase over > time (although memory usage does). This might mean that

click event

2005-11-06 Thread Shi Mu
I have the following workable code and every time i click on the canvas, the coordinates are reported. i wonder how i can draw the lines when i click the canvas using these coordinates? from Tkinter import * root = Tk() c = Canvas(root, bg='#0e2e0e', height=500, width=1000) def click(event):

Re: text widget example?

2005-11-06 Thread James Stroud
On Sunday 06 November 2005 16:25, wanwan wrote: > I need my GUI to open and display a text file. I'm thinking of using a > text widget but it looks so complicated in the tkinter manual. > > question I have is: > > is there an example anyone can find on the internet? Couldn't find a good one, so he

Re: text widget example?

2005-11-06 Thread jmdeschamps
Well, in the 'give me a free example' type questions, I guess I'm a bit blue tonight, so here goes: ( no personal pun intended, just look up some recent post in this newsgroup...) # Start the example Python code to show some text file in a text widget from Tkinter import * # import Tkinter in __ma

Re: I need Motivation

2005-11-06 Thread jmdeschamps
And you know what? I almost sure most people on this newsgroup wouldn't feel maligned if somebody told them that's what happened to them. I'd put money that most pythonistas here would think 'Hey Great for you! good luck, and make these machines ever more useful and/or enjoyable for the rest of the

Re: Running autogenerated code in another python instance

2005-11-06 Thread Paul Cochrane
On Mon, 07 Nov 2005 00:01:29 +, Bengt Richter wrote: > On Thu, 03 Nov 2005 14:23:53 +1000, Paul Cochrane <[EMAIL PROTECTED]> wrote: > >>On Wed, 02 Nov 2005 06:33:28 +, Bengt Richter wrote: >> >>> On Wed, 2 Nov 2005 06:08:22 + (UTC), Paul Cochrane <[EMAIL PROTECTED]> >>> wrote: >>> >

Re: Running autogenerated code in another python instance

2005-11-06 Thread Paul Cochrane
On Thu, 03 Nov 2005 19:56:48 +, Tom Anderson wrote: > On Thu, 3 Nov 2005, Paul Cochrane wrote: > >> On Wed, 02 Nov 2005 06:33:28 +, Bengt Richter wrote: >> >>> On Wed, 2 Nov 2005 06:08:22 + (UTC), Paul Cochrane <[EMAIL PROTECTED]> >>> wrote: >>> I've got an application that I'm

Re: mod_python

2005-11-06 Thread Carsten Haese
On Sun, 06 Nov 2005 23:29:01 -, Jim Segrave wrote > In article <[EMAIL PROTECTED]>, > Little <[EMAIL PROTECTED]> wrote: > >cursor.execute( > >"""INSERT INTO InventoryList (artist, title, rating) VALUES (%s, > >%s, %s)""", (z_Name, z_rating, z_price) ) > > I hate to ask, but what happen

Re: mod_python

2005-11-06 Thread Diez B. Roggisch
> I hate to ask, but what happens when I enter "a, b, c);DROP DATABASE;" as > the entry for z_name? (Or some similar attempt to close the > SQL statement and start a new one). I think you want to google for "SQL > injection" and think about sanitising user input a bit. And using the parametrized f

Re: Clearing output screen

2005-11-06 Thread Ivan Shevanski
On 11/6/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Ivan Shevanski wrote> I know there is a way to do this, but google doesn't seem to want to find it> =) There is a command to clear the output screen right?no, because "output screen" isn't a well-defined concept on modern operating systems.  the

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread aum
On Sun, 06 Nov 2005 16:31:54 -0800, Paul Rubin wrote: > aum <[EMAIL PROTECTED]> writes: >> To me, wxPython is like a 12-cylinder Hummer, ... >> Whereas PyFLTK feels more like an average suburban 4-door sedan > > Interesting. What would Tkinter be at that car dealership? What > about PyGTK? Tki

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Paul Rubin
aum <[EMAIL PROTECTED]> writes: > To me, wxPython is like a 12-cylinder Hummer, ... > Whereas PyFLTK feels more like an average suburban 4-door sedan Interesting. What would Tkinter be at that car dealership? What about PyGTK? -- http://mail.python.org/mailman/listinfo/python-list

text widget example?

2005-11-06 Thread wanwan
I need my GUI to open and display a text file. I'm thinking of using a text widget but it looks so complicated in the tkinter manual. question I have is: is there an example anyone can find on the internet? -- http://mail.python.org/mailman/listinfo/python-list

PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread aum
Hi all, I've been doing a fair bit of python gui programming on and off, jumping between different widget sets along the way, from anygui, to pythoncard, to tkinter/PMW, then to wxPython/wxGlade, and have now settled on a python gui API that seems to get barely a mention - PyFLTK. PyFLTK (http://

Re: Running autogenerated code in another python instance

2005-11-06 Thread Bengt Richter
On Thu, 03 Nov 2005 14:23:53 +1000, Paul Cochrane <[EMAIL PROTECTED]> wrote: >On Wed, 02 Nov 2005 06:33:28 +, Bengt Richter wrote: > >> On Wed, 2 Nov 2005 06:08:22 + (UTC), Paul Cochrane <[EMAIL PROTECTED]> >> wrote: >> >>>Hi all, >>> >>>I've got an application that I'm writing that auto

Re: Python doc problem example: gzip module (reprise)

2005-11-06 Thread Keith Thompson
Rick Wotnaz <[EMAIL PROTECTED]> writes: [snip] > I've managed to avoid reading Xah Lee's diatribes for the most > part. Since you included the *WHOLE THING* in your post, I had an > "opportunity" to see what he had to say, and for once I agree with > some of it. That's fine, but if you're going

Re: mod_python

2005-11-06 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Little <[EMAIL PROTECTED]> wrote: >I have created the following database but the following errors occur >when trying to execute the code. > >html source: > > >Click here to display information from Chocolate menu: > > >Press to view the display > >

Installing ATLAS and LAPACK

2005-11-06 Thread Darren L. Weber
The following is a first attempt to almost create a shell script for installation of ATLAS and LAPACK. It does not work right now and it is specific to a particular platform. It is posted here to archive it and throw into the public domain, maybe others will find it useful. It is at least a doc

Installing ATLAS and LAPACK

2005-11-06 Thread Darren L. Weber
The following is a first attempt to almost create a shell script for installation of ATLAS and LAPACK. It does not work right now and it is specific to a particular platform. It is posted here to archive it and throw into the public domain, maybe others will find it useful. It is at least a doc

Re: Using Which Version of Linux

2005-11-06 Thread Norman Silverstone
On Sun, 06 Nov 2005 12:39:54 -0800, Steve M wrote: > > Max wrote: > >> (Mark Shuttleworth, ... >> really loves Python - he gave me quite a lot of money for using it). > > Please elaborate. Mark Shuttleworth is a very wealthy man who is supporting the development of Ubuntu. His wealth came from

Re: Pylab and pyserial plot in real time

2005-11-06 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hiya, > > I've got a PIC microcontroller reading me humidity data via rs232, this > is in ASCII format. I can view this data easily using hyperterminal or > pyserial and convert it to its value (relative humidty with ord(input)) > > But what im trying to do is plot the

Re: Python doc problem example: gzip module (reprise)

2005-11-06 Thread Steven D'Aprano
On Sun, 06 Nov 2005 04:28:35 -0800, jmdeschamps wrote: > This actually brings us back to the jest of F. previous post, I didn't think it was very funny... Unless you meant the *gist* of Fredrik's post. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl XML::Simple and Data::Dumper - exists in Python?

2005-11-06 Thread George Sakkis
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Miguel Manso wrote: > > > Can you point me out to Python solutions for: > > > > 1) Perl's Data::Dumper > > > > It dumps any perl variable to the stdout in a "readable" way. > > >>> import pprint > >>> help(pprint) > > > 2) Perl's XML::Simple > > > > It

Re: Pylab and pyserial plot in real time

2005-11-06 Thread googlinggoogler
Yea I know the data is correct, all I do is sample my data with an ADC and then send it to the serial port. using hyper terminal or indeed pyserial presents the data as a ASCII charecters, the value of these Charecters is the converted to there equivalent decimal value using the ord() command. Bas

Re: Perl XML::Simple and Data::Dumper - exists in Python?

2005-11-06 Thread Fredrik Lundh
Miguel Manso wrote: > Can you point me out to Python solutions for: > > 1) Perl's Data::Dumper > > It dumps any perl variable to the stdout in a "readable" way. >>> import pprint >>> help(pprint) > 2) Perl's XML::Simple > > It maps a XML file into a Perl data structure. some alternatives:

Re: Learning multiple languages (question for general discussion)

2005-11-06 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > I can't imagine NOT getting enthusiastic and stimulated by reading Van > > Roy and Hariri's book -- it IS quite as good and readable as SICP. > > It's been on my want-to-read list for a long time. I have

Re: "how to think like a computer scientist"

2005-11-06 Thread Fredrik Lundh
"john boy" wrote: > I am using the book "how to think like a computer scientist" and > am finding the examples are not working with Python 2.4.2...I have > typed them exactly as they appear in the textcan someone > relate to this?...is this typical b/c 2.4.2 is a newer version? no. did you r

Re: Class Variable Access and Assignment

2005-11-06 Thread Bengt Richter
On Sun, 06 Nov 2005 12:23:02 -0500, Christopher Subich <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On Fri, 04 Nov 2005 10:28:52 -0500, Christopher Subich <[EMAIL PROTECTED]> >> wrote: > >>>is very much within the language specification. Indeed, the language >>>specification dictates th

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128)

2005-11-06 Thread Diez B. Roggisch
> I would've thought that the 'b' option meant I can write any binary > code I like to the file, > but that's not so? You can. But if you write a unicode-object (wich is an abstract data type with no byte representation), it has to be converted to a string - which you have to do either explicit.

Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' inposition 99: ordinal not in range(128)

2005-11-06 Thread Fredrik Lundh
Francach wrote: > I don't know what I'm doing wrong here. > I''m using Python 2.4 and py2exe. I get he following error: > > Traceback (most recent call last): > File "notegui.pyc", line 34, in OnClose > File "brain.pyc", line 61, in setNote > File "points.pyc", line 151, in setNote > File

"how to think like a computer scientist"

2005-11-06 Thread john boy
I am using the book "how to think like a computer scientist" and am finding the examples are not working with Python 2.4.2...I have typed them exactly as they appear in the textcan someone relate to this?...is this typical b/c 2.4.2 is a newer version?   -xray- Yahoo! FareChase - Search mul

Re: zipfile.py, fp.seek(-22,2) error

2005-11-06 Thread Waitman Gobble
ok, i figured it out. the file i was trying to read on the linux machine was 0b. lol. i guess the "invalid argument" error was throwing me off. -- http://mail.python.org/mailman/listinfo/python-list

Re: Modify HTML data

2005-11-06 Thread Swarna
Peter Hansen wrote: > Swarna wrote: > > Peter Hansen wrote: > >>Swarna wrote: > >>>I am using scp in python to copy a html file on remote server, to my > >>>local machine. Now, i need to update this html file in my local machine > >>>( by adding a new Hyperlink to the existing table od hyperlinks

Re: Validate string as UTF-8?

2005-11-06 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Tony Nelson wrote: > > > I'd like to have a fast way to validate large amounts of string data as > > being UTF-8. > > define "validate". All data conforms to the UTF-8 encoding format. I can stand if someone has mad

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 99: ordinal not in range(128)

2005-11-06 Thread Francach
Hi, I don't know what I'm doing wrong here. I''m using Python 2.4 and py2exe. I get he following error: Traceback (most recent call last): File "notegui.pyc", line 34, in OnClose File "brain.pyc", line 61, in setNote File "points.pyc", line 151, in setNote File "point.pyc", line 100, in w

Re: Using Which Version of Linux

2005-11-06 Thread Steve M
Max wrote: > (Mark Shuttleworth, ... > really loves Python - he gave me quite a lot of money for using it). Please elaborate. -- http://mail.python.org/mailman/listinfo/python-list

"how to think like a computer scientist"

2005-11-06 Thread john boy
Ok...I'm new to Python..and of course am already having troubles.   I have tried the following example from "how to think like a computer> scientist">> def newline():> print>> print "firstline"> newline()> print "secondline">> problem iswhenever I type -print "firstline"- and then hit enter

Re: Python gui

2005-11-06 Thread Peter Decker
On 6 Nov 2005 12:08:23 -0800, gsteff <[EMAIL PROTECTED]> wrote: > PyGTK is just easier to code with. The api is much nicer. That's why I think that Dabo's UI module is the best of all worlds. It wraps wxPython, so the controls look great on any platform, but provides a cleaner and more consisten

Re: Validate string as UTF-8?

2005-11-06 Thread Waitman Gobble
I have done this using a sytem call to the program "recode". Recode a file UTF-8 and do a diff on the original and recoded files. Not an elegant solution but did seem to function properly. Take care, Waitman Gobble -- http://mail.python.org/mailman/listinfo/python-list

Re: So, Which Version is Suitable for Beginners

2005-11-06 Thread Steve M
There is a new gratis VMWare player at http://www.vmware.com/download/player/ You can download an image http://www.vmware.com/vmtn/vm/browserapp.html that they call a Browser Appliance, but if I remember correctly it is Ubuntu. -- http://mail.python.org/mailman/listinfo/python-list

zipfile.py, fp.seek(-22,2) error

2005-11-06 Thread Waitman Gobble
Hello, I am new to Python. I am having trouble with zipfile.py. On a Linux machine with python 2.4.2 I have trouble opening a zipfile. Python is complaining about the bit where it does a seek(-22,2). Looks to me like zipfile.py is trying to come back 22 bytes from the end of file. # python Pytho

Windows service using the socket module

2005-11-06 Thread JDF
I am fairly new to python and seem to have gotten ahead of myself. I am trying to write a Windows service that will return the current number of Citrix sessions to a client. This service will run on my Citrix servers for usage tracking purposes. The service itself seems to function properly, it

Perl XML::Simple and Data::Dumper - exists in Python?

2005-11-06 Thread Miguel Manso
Hi there, I'm a Perl programmer trying to get into Python. I've been reading some documentation and I've choosed Python has being the "next step" to give. Can you point me out to Python solutions for: 1) Perl's Data::Dumper It dumps any perl variable to the stdout in a "readable" way. 2) Perl

Re: Validate string as UTF-8?

2005-11-06 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, david mugnai <[EMAIL PROTECTED]> wrote: > On Sun, 06 Nov 2005 18:58:50 +, Tony Nelson wrote: > > [snip] > > > Is there a general way to call GLib functions? > > ctypes? > http://starship.python.net/crew/theller/ctypes/ Umm. Might be easier to write an exte

Re: Modify HTML data

2005-11-06 Thread Peter Hansen
Swarna wrote: > Peter Hansen wrote: >>Swarna wrote: >>>I am using scp in python to copy a html file on remote server, to my >>>local machine. Now, i need to update this html file in my local machine >>>( by adding a new Hyperlink to the existing table od hyperlinks ) and >>>copy it back (overwritin

Re: Icon on wx.MDIParentFrame

2005-11-06 Thread Peter Hansen
LenS wrote: > Thanks > > I will keep an eye out for the book. I just downloaded wxGlade and > created a small file and looked at how it does it. That (copying someone else) is almost always the best approach anyway, even when one has decent documentation. Note that with wxPython you should hav

Re: Validate string as UTF-8?

2005-11-06 Thread Diez B. Roggisch
Tony Nelson wrote: > I'd like to have a fast way to validate large amounts of string data as > being UTF-8. > > I don't see a fast way to do it in Python, though: > > unicode(s,'utf-8').encode('utf-8) > > seems to notice at least some of the time (the unicode() part works but > the encode(

Re: Pylab and pyserial plot in real time

2005-11-06 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I've got a PIC microcontroller reading me humidity data via rs232, this > is in ASCII format. What do you mean when you say it's in ASCII format? ASCII defines a convention for representing control and printable characters. Do you mean that the readings you get are

Re: Python gui

2005-11-06 Thread gsteff
PyGTK is just easier to code with. The api is much nicer. However, yeah, the windows/mac appearance probably does make it a non-starter, unfortunately. As near as I can tell, the solution that currently has the most momentum is to just integrate the cheeseshop more tightly into python, so that w

Re: Validate string as UTF-8?

2005-11-06 Thread Fredrik Lundh
Tony Nelson wrote: > I'd like to have a fast way to validate large amounts of string data as > being UTF-8. define "validate". > I don't see a fast way to do it in Python, though: > > unicode(s,'utf-8').encode('utf-8) if "validate" means "make sure the byte stream doesn't use invalid sequen

Re: Validate string as UTF-8?

2005-11-06 Thread david mugnai
On Sun, 06 Nov 2005 18:58:50 +, Tony Nelson wrote: [snip] > Is there a general way to call GLib functions? ctypes? http://starship.python.net/crew/theller/ctypes/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning multiple languages (question for general discussion)

2005-11-06 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >>It's a great book - I cetainly owe it the better part of my thesis >>about multi level specification for functional languages. If you want >>to understand type-systems, its a great comprehensive read. > > > So do I really wan

Re: Using Which Version of Linux

2005-11-06 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > Similarly, I see RPMs by ones and twos all over the place, > and only a few places with DEBs. But the DEB repositories > are HUGE. Try rpmfind.net. It's not clear where the rpms reside, but it's not really important - it's a huge collection of RPMs.

Re: Can't instantiate class

2005-11-06 Thread Bengt Richter
On Sun, 06 Nov 2005 09:47:04 -0500, David Mitchell <[EMAIL PROTECTED]> wrote: >Thanks for your prompt reply. > >Ok, so If use your first suggestion (db = DataUtil.DataUtil() >), I get this error: > >AttributeError: 'module' object has no attribute 'DataUtil' > Have you looked to see what DataUtil

Re: Learning multiple languages (question for general discussion)

2005-11-06 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > It's a great book - I cetainly owe it the better part of my thesis > about multi level specification for functional languages. If you want > to understand type-systems, its a great comprehensive read. So do I really want to understand type systems?

Re: ? MDI depreciated

2005-11-06 Thread SPE - Stani's Python Editor
Hi Len, The preference of most users is quite platform related: - Mac users are the most pronounced, they like SDI (single document interface), where there is one frame for every document - Most linux users like something between MDI and SDI: a tabbed interface, like firefox, where there is one fr

Validate string as UTF-8?

2005-11-06 Thread Tony Nelson
I'd like to have a fast way to validate large amounts of string data as being UTF-8. I don't see a fast way to do it in Python, though: unicode(s,'utf-8').encode('utf-8) seems to notice at least some of the time (the unicode() part works but the encode() part bombs). I don't consider a RE

Re: ? MDI depreciated

2005-11-06 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "LenS" <[EMAIL PROTECTED]> wrote: > Hate to ask this dum question (since I've been hiding under a rock). > But if the MDI UI model is/was depreciated. What is the new UI model. > > Would love some links that explain in gerneral and specific terms. In article <[E

Re: ? MDI depreciated

2005-11-06 Thread Andrea Gavana
Hello Len, > Hate to ask this dum question (since I've been hiding under a rock). > But if the MDI UI model is/was depreciated. What is the new UI model. This much depends on which kind of application you have in mind. In my organization a lot of software that we use (basically for reservoir geo

Re: socket receive file does not match sent file

2005-11-06 Thread Jean-Paul Calderone
On 6 Nov 2005 09:13:03 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I wrote two simple socket program. >one for sending a file and the other for receiving the file. >but when I run it, a curious thing happened. >The received file was samller that the sent file. Your sender does not take

Re: modifying source at runtime - jython case

2005-11-06 Thread Alan Kennedy
[Jan Gregor] > Following try showed me that instances aren't affected by > modification in class definition. Is this more like what you mean? c:\>jython Jython 2.1 on java1.4.2_09 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> class a: ... def test(self): ...

Re: Python gui

2005-11-06 Thread Andrea Gavana
> No, and *I hope* that if another toolkit has to replace Tkinter (will never > happen?) will be PyGTK... :) This will only mean that people that now prefer wxPython over Tkinter will in future prefer wxPython over PyGTK ;-) Andrea. -- "Imagination Is The Only Weapon In The War Against Reality.

Re: ? MDI depreciated

2005-11-06 Thread Brendan
This is probably a question better suited for a wxPython or MSDN newsgroup. What OS are you referring to? What GUI toolkit are you using? Microsoft's office on Windows has moved to a model where every document has its own toolbar, menubar, and taskbar entry. Windows developers tend to mimic MS

Re: Python gui

2005-11-06 Thread Sybren Stuvel
Gian Mario Tagliaretti enlightened us with: > No, and *I hope* that if another toolkit has to replace Tkinter > (will never happen?) will be PyGTK... :) Why do you hope for PyGTK? I think one of the strengths of wxWidgets is that it uses the native platform's look. GTK looks very nice on my Gnome

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 6)

2005-11-06 Thread Cameron Laird
QOTW: "- don't use SAX unless your document is huge - don't use DOM unless someone is putting a gun to your head" - Istvan Albert "I wouldn't fret too much about a sharp remark from Fredrik Lundh. They're pretty much all that way. ;) It looks like you already did the right thing - read past the

Re: GMPY: divm() memory leak revisited

2005-11-06 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ... > > Unfortunately, I don't have any means of testing this theory. > > Yep -- I reproduced the memory leak you mentioned, and easily fixed it > (exactly as you suggest) in the current CVS version of gmpy (meant to be > "1

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Brendan
Thanks for the vote FB. The reason I'm using that method for assigning instance attributes is that the argument list for __init__ is LOOONG. (There are many constants, I only gave two for the examples). I wanted to avoid typing them out twice. -- http://mail.python.org/mailman/listinfo/python-l

Re: modifying source at runtime - jython case

2005-11-06 Thread Kent Johnson
Jan Gregor wrote: > my typical scenario is that my swing application is running, and i see > some error or chance for improvement - modify sources of app, stop and run > application again. > so task is to reload class defitions (from source files) and modify also > existing instances (their methods

Re: Can't instantiate class

2005-11-06 Thread Fredrik Lundh
David Mitchell wrote: > Ok, so If use your first suggestion (db = DataUtil.DataUtil() > ), I get this error: > > AttributeError: 'module' object has no attribute 'DataUtil' > > If I try importing the class directly (from DataUtil import DataUtil), > I get this error: > > ImportError: cannot import

Re: Learning multiple languages (question for general discussion)

2005-11-06 Thread Diez B. Roggisch
> Do you have any opinion of "Types and Programming Languages" by > Pierce? Autrijus Tang (the guy who started PUGS, the Perl 6 > implementation in Haskell) raves about it in an interview, and another > guy I know recommended it too, but I haven't actually looked at a copy > yet (stores I've looke

Re: mod_python

2005-11-06 Thread Steve Holden
Steve Holden wrote: [...] > > The second error message seems to imply that the database InventoryList > table doesn't have a column called "article". > > regards > Steve ^article^artist^ -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Francesco Bochicchio
Il Sun, 06 Nov 2005 08:33:17 -0800, Brendan ha scritto: > Hi all > > I'm new to Python (and programming in general), and I can't decide what > is the most 'pythonic' way to approach a problem. Your advice would be > appreciated. > > I have a bunch of 'scans', containing the data measured from o

Re: mod_python

2005-11-06 Thread Steve Holden
Little wrote: > I have created the following database but the following errors occur > when trying to execute the code. > > html source: > > > Click here to display information from Chocolate menu: > > > Press to view the display > > > > > Please provide data for ch

Re: Modify HTML data

2005-11-06 Thread Swarna
Peter Hansen wrote: > Swarna wrote: > > I am using scp in python to copy a html file on remote server, to my > > local machine. Now, i need to update this html file in my local machine > > ( by adding a new Hyperlink to the existing table od hyperlinks ) and > > copy it back (overwriting the old c

  1   2   >