Re: OO on python real life tutorial?

2006-09-01 Thread Diez B. Roggisch
filippo schrieb: > thanks Fredrik and Claudio, > > probably structured coding paradigm is what I need. Claudio, could you > explain better your sentence below? > > Claudio Grondi ha scritto: >> Python/Tk for it in order to avoid programming in wxPython if not really >> necessary (wxPython has its

Re: disgrating a list

2006-09-01 Thread Diez B. Roggisch
jwaixs schrieb: > Diez B. Roggisch wrote: >> Why do you wrap a in a list? Just >> >> c = a + [b] >> >> will do it. > > Yes I know, but the problem is I don't know if 'a' is a list or not. I > could make a type check, but I don't w

Weekly Python Patch/Bug Summary

2006-09-01 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 412 open ( +5) / 3397 closed ( +4) / 3809 total ( +9) Bugs: 900 open (+12) / 6149 closed ( +4) / 7049 total (+16) RFE : 233 open ( +1) / 236 closed ( +0) / 469 total ( +1) New / Reopened Patches __ set liter

Re: Find the best price on gas in your local area for FREE....

2006-09-02 Thread Diez B. Roggisch
Sybren Stuvel schrieb: > [EMAIL PROTECTED] enlightened us with: >> Visit the web site below to see where you can buy the cheapest gas >> in your local area. Just punch in your zip code and all the work is >> done for you. No Cost! Absolutely FREE info. > > Ehm... maybe you'd like to get your h

Re: Setting "value" of an int-derived class

2006-09-02 Thread Diez B. Roggisch
Ken Schutte schrieb: > Lets say I want an integer class that lets you attach arbitrary > attributes. I can simply do: > > class foo(int): pass > > x = foo(5) > x.text = "okay" > print x, x.text # prints "5 okay" > > So, that's good. But, how can I change the value of x from 5 to > somethin

Re: Program to backtrack function calls in source code?

2006-09-02 Thread Diez B. Roggisch
a dynamic language like python. Lots of code (and very valuable one) in python lives from the fact that e.g. a = getattr(b, some_computed_name) works. So, ultimately you will always encounter situations where a simple name-replace won't catch all possible access/modification spots. So, a lan

Re: Libraries in python

2006-09-02 Thread Diez B. Roggisch
> That's my $0.02 on Python packaging and library dependencies. In my > opinion it's one of the few things that Java got right that Python > didn't. Yeah, sure. Hunting down a subtle class loading bug because of e.g. different xml-api versions in your classpath in just a few hours is a thing jav

Re: methods and functions, instances and classes

2006-09-04 Thread Diez B. Roggisch
David Isaac wrote: > When I create an instance of a class, > are the class's functions *copied* to create the methods? > Or are method calls actually calls of the class's functions? On the class functions. You can make every instance have it's own methods, though - but only explicitly. Diez --

Re: Unicode characters

2006-09-04 Thread Diez B. Roggisch
Paul Johnston wrote: > Hi > I have a string which I convert into a list then read through it > printing its glyph and numeric representation > > #-*- coding: utf-8 -*- > > thestring = "abcd" > thelist = list(thestring) > > for c in thelist: > print c, > print ord(c) > > Works fine fo

Re: threading support in python

2006-09-04 Thread Diez B. Roggisch
Sybren Stuvel wrote: > km enlightened us with: >> Is there any PEP to introduce true threading features into python's >> next version as in java? i mean without having GIL. > > What is GIL? Except for the Dutch word for SCREAM that is... the global interpreter lock, that prevents python from con

Re: Check XML Without any DTD or schema.

2006-09-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I'm newbee. I try to check syntax any XML file. I don't have any dtd or > shema file to this xml. > Is this possible that I check syntax in any xml file in python. There are two forms of checking xml-documents: - well-formedness, which means that the document adheres t

Re: are there any lib for receive hotmail ?

2006-09-05 Thread Diez B. Roggisch
叮叮当当 wrote: > poplib cannot receive hotmail. Not true: http://www.macworld.com/news/2002/06/18/hotmail/index.php You need to pay for that, but they do offer pop. And receiving hotmail (or any outher webmail) using scraping techniques is a daunting task, to say the least - you should forget abo

Re: [ANN] IronPython 1.0 released today!

2006-09-06 Thread Diez B. Roggisch
Chris wrote: > Jim Hugunin wrote: >> I'm extremely happy to announce that we have released IronPython 1.0 >> today! >> http://www.codeplex.com/IronPython > > > > I'm no code guru but it sounds interesting. So can I import numpy, > scipy, matplotlib, wxpython etc like I do now with CPython and

Re: help with unicode email parse

2006-09-07 Thread Diez B. Roggisch
neoedmund schrieb: > i want to get the subject from email and construct a filename with the > subject. > but tried a lot, always got error like this: > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 4: > ordinal not in range(128) > > > msg = email.message_from_string(

Re: 4 Simple Questions About Python/IDLE

2006-09-07 Thread Diez B. Roggisch
Omar schrieb: > thanks. > > i have saved and double clicked as suggested. when I save and double > click a simple "hello program", the b&w python shell briefly comes up, > then disappears. is this how it should work? Yes. because when your program terminates, the sh

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Diez B. Roggisch
Francach schrieb: > Hi, > > I'm trying to use the Beautiful Soup package to parse through the > "bookmarks.html" file which Firefox exports all your bookmarks into. > I've been struggling with the documentation trying to figure out how to > extract all the urls. Has anybody got a couple of longer

Re: Random image downloader for newsgroups (first script)

2006-09-07 Thread Diez B. Roggisch
Kim schrieb: > SERVER = "news.server.co.uk" #Insert news server here > GROUP = "alt.binaries.pictures.blah" #newsgroup will go here Just why do I imagine there will be an adult newsgroup in the end? SCNR, Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread Diez B. Roggisch
waylan schrieb: > Diez B. Roggisch wrote: >> suppose it is well-formed, most probably even xml. > > Maybe not. Otherwise, why would there be a script like this one[1]? > Anyway, I found that and other scripts that work with firefox > bookmarks.html files with a quick search

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Diez B. Roggisch
Duncan Booth schrieb: > [EMAIL PROTECTED] (Lawrence Oluyede) wrote: > >> Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: >>> Does IronPython runs Twisted? >> I really don't think so. They don't have many needed modules, like >> select :-) >> > > So? IronPython has a select module although it does

Re: Looking for a regexp generator based on a set of known string representative of a string set

2006-09-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello > > I am looking for python code that takes as input a list of strings > (most similar, > but not necessarily, and rather short: say not longer than 50 chars) > and that computes and outputs the python regular expression that > matches > these string values (not

Re: cx_Oracle question

2006-09-08 Thread Diez B. Roggisch
Richard Schulman schrieb: > I'm having trouble getting started using Python's cx_Oracle binding to > Oracle XE. In forthcoming programs, I need to set variables within sql > statements based on values read in from flat files. But I don't seem > to be able to get even the following stripped-down tes

Re: cx_Oracle question

2006-09-08 Thread Diez B. Roggisch
> cursor.execute("""select mean_eng_txt from mean > where mean_id=:arg_1""",{"arg_1"=arg_1}) Needs quotes of course. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode / cx_Oracle problem

2006-09-09 Thread Diez B. Roggisch
Richard Schulman schrieb: > Sorry to be back at the goodly well so soon, but... > > ...when I execute the following -- variable mean_eng_txt being > utf-16LE and its datatype nvarchar2(79) in Oracle: > > cursor.execute("""INSERT INTO mean (mean_id,mean_eng_txt) > VALUES (:id,:mean)""",id=id

Re: newbie: datastructure `dictionary' question

2006-09-09 Thread Diez B. Roggisch
jason schrieb: > Hello, > > I am completely new to python and I have question that I unfortunately > could not find in the various documentation online. My best guess is > that the answer should be quitte easy but I have just enterd the learning > phase so that means a hightend chance for stupidit

Weekly Python Patch/Bug Summary

2006-09-08 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 413 open ( +1) / 3407 closed (+10) / 3820 total (+11) Bugs: 897 open ( -3) / 6167 closed (+18) / 7064 total (+15) RFE : 234 open ( +1) / 238 closed ( +2) / 472 total ( +3) New / Reopened Patches __ Fix decim

Re: Unicode / cx_Oracle problem

2006-09-10 Thread Diez B. Roggisch
Richard Schulman schrieb: >>> cursor.execute("""INSERT INTO mean (mean_id,mean_eng_txt) >>> VALUES (:id,:mean)""",id=id,mean=mean) >>> ... >>> "cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data >>> type unicode" >>> >>> But when I try putting a codecs.BOM_UTF16_LE in variou

Re: Unicode / cx_Oracle problem

2006-09-10 Thread Diez B. Roggisch
> Value of the variable 'id' is u'\ufeff' > Value of the variable 'mean' is u'(' So they both are unicode objects - as I presumed. > It's very hard to figure out what to do on the basis of complexities > on the order of > > http://download-east.oracle.com/docs/cd/B25329_01/doc/appdev.102/b251

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread Diez B. Roggisch
metaperl schrieb: > --> python -i class = "algebra" > File "", line 1 > class = "algebra" > ^ > SyntaxError: invalid syntax > > > Why isn' t the parser smart enough to see that class followed by an > identifier is used for class definition but class followed by equals is >

Re: How to write UNIX daemons in Python?

2006-09-13 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi all. I've just finished to write an FTP daemon in Python. > To do things well I'd like to write an 'insteller' to permit the end > user to 'deeply' install the package inside the system. In details I > would like that installer is able to do the following operations:

Re: Are Python's reserved words reserved in places they dont need tobe?

2006-09-13 Thread Diez B. Roggisch
should use a better editor. In general, that is true for the 21st century. But under certain circumstances, one might be forced to use a vi over a limited b/w terminal to fix that goddamn bug on the live system. Even though you don't care about the pesky details, it boils down to introducing an

Re: Are Python's reserved words reserved in places they dont need tobe?

2006-09-13 Thread Diez B. Roggisch
>> In general, that is true for the 21st century. But under certain >> circumstances, one might be forced to use a vi over a limited b/w >> terminal to fix that goddamn bug on the live system. > > AFAIR, even those terminals had a form of highlighting. And personnaly

Re: socket question

2006-09-13 Thread Diez B. Roggisch
hg wrote: > Hi, > > I am not sure whether this is a python-related question. > > If I have device A than sends XX bytes to device B, and device B does a > recv(XX) using the default timeout, what could make device B wake-up > with less than XX bytes received ? There exis

Re: Limitate speed of a socket-based data transferring

2006-09-14 Thread Diez B. Roggisch
billie schrieb: > Hi all. I'm writing a TCP-based application that I will use to trasfer > binary files through the network. This piece of code represents how do > I get a file from a remote peer and save it on my local hard drive: > > file_obj = open('downloaded.ext', 'wb') > while 1: > buf =

Re: Outbound port on sockets

2006-09-14 Thread Diez B. Roggisch
bmearns schrieb: > Is it possible to specify which port to use as the outbound port on a > connection? I have the IP address and port number for the computer I'm > trying to connect to (not listening for), but it's expecting my > connection on a certain port. > > Specifically, I'm trying to write

Re: Outbound port on sockets

2006-09-14 Thread Diez B. Roggisch
bmearns schrieb: > Passive mode is implemented, the client isn't trying to use it. > Besides, that doesn't really help me anyway, all it means is that I > have to resolve port forwarding for the server, instead of for the > client. > > I think what this basically comes down to is that either with

Weekly Python Patch/Bug Summary

2006-09-14 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 416 open ( +3) / 3408 closed ( +1) / 3824 total ( +4) Bugs: 898 open ( +1) / 6180 closed (+13) / 7078 total (+14) RFE : 234 open ( +0) / 238 closed ( +0) / 472 total ( +0) New / Reopened Patches __ email par

Re: Outbound port on sockets

2006-09-15 Thread Diez B. Roggisch
Bryan Olson schrieb: > Diez B. Roggisch wrote: >> bmearns schrieb: >>> Is it possible to specify which port to use as the outbound port on a >>> connection? > [...] >>> Specifically, I'm trying to write an FTP host, and I'm trying to >>>

Re: high level, fast XML package for Python?

2006-09-15 Thread Diez B. Roggisch
Gleb Rybkin wrote: > I searched online, but couldn't really find a standard package for > working with Python and XML -- everybody seems to suggest different > ones. > > Is there a standard xml package for Python? Preferably high-level, fast > and that can parse in-file, not in-memory since I ha

Re: fail to indent in inner loop

2006-09-15 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I've started learning python. I was typing from a tutorial, > and I fail to indent on an inner loop. > I got an error and all my previous typed lines are gone. > is there a way to prevent this. > i don't mind editing the last line, but to lose all the previous lines > ar

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Diez B. Roggisch
SpreadTooThin schrieb: > I have some code... > > import array > > a = array.array('d') > f = open('file.raw') > a.fromfile(f, 10) > > now I need to convert them into floats (32 bit...) what do i do? I guess module struct is your friend. Something like this: struct.pack("f" * len(a), *a) Di

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Diez B. Roggisch
Marc 'BlackJack' Rintsch schrieb: > In <[EMAIL PROTECTED]>, SpreadTooThin > wrote: > >> I have some code... >> >> import array >> >> a = array.array('d') >> f = open('file.raw') >> a.fromfile(f, 10) >>

Re: how do you convert and array of doubles into floats?

2006-09-15 Thread Diez B. Roggisch
>> AFAIK d and f are synonym for arrays, as python doesn't distinguish >> between these two on a type-level. And double it is in the end. > > No `array.array` is really about "C compiler types". You get C doubles in > form of Python's `float` type if you read from the `array.array` but it's > st

Re: Python blogging software

2006-09-17 Thread Diez B. Roggisch
> Fair enough. I shouldn't have said "lousy performance of the > framework itself" when I should have included the application. If the > application's page computations are so lengthy, then they too need > speeding up. > > We've got a situation where some big sites (Slashdot, Wikipedia) have >

Re: incompatible exit values between python 2.4 and 2.5

2006-09-18 Thread Diez B. Roggisch
> 1) is this change of behaviour documented somewhere and did I miss > that, or has this not been documented (yet) > 2) Is there a build-in way to set the exit value for Python in case an > exception is raised that is uncaught and causes python to terminate? (I > have now implemented something usin

Re: Interact with system command prompt

2006-09-18 Thread Diez B. Roggisch
billie wrote: > Hi all. I would like to know if there's some python framework able to > interact with system command prompt (cmd.exe or /bin/sh, depending on > the system) from python. > I need something that supports key/path auto completion by pressing TAB > button and the possibility to use int

Re: Interact with system command prompt

2006-09-18 Thread Diez B. Roggisch
billie wrote: > Uhm... It seems that IPython got some problems: > http://ipython.scipy.org/doc/manual/node12.html > > In details: > >>Note that this does not make IPython a full-fledged system shell. In >>particular, it has >no job control, so if you type Ctrl-Z (under Unix), >>you'll suspend py

Re: Could not build MySQLdb on PowerMac (PPC)

2006-09-18 Thread Diez B. Roggisch
Ted Zeng schrieb: > Hi, > > I am new to Python. I am trying to build MySQLdb for my PowerPC > PowerMac. > I just downloaded the source last week and tried to build it. > But I got the error messages as follow. I checked and there is no such > files as > mysql_config > mysql.h > my_config.h > ...

Re: Python programs always open source?

2006-09-19 Thread Diez B. Roggisch
Ben Finney schrieb: > Leif K-Brooks <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > So long as you're not distributing some or all of Python itself, > or a derivative work, the license for Python has no legal effect > on what license you choose for your own work. > >> I was rep

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Diez B. Roggisch
>> >> I think '__metaclass__ = whatever' affects only the creation of >> classes that >> would otherwise be old-style classes? > > Wrong. > > If you set __metaclass__ = type, every class in that module will be > new-style. > > If you set __metaclass__ = MyClass, and MyClass inherits from , eve

Re: why a main() function?

2006-09-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Others have already told you the most important things. > > There is another secondary advantage: the code inside a function runs > faster (something related is true for C programs too). Usually this > isn't important, but for certain programs they can go 20%+ faster.

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread Diez B. Roggisch
Ilias Lazaridis wrote: > Ilias Lazaridis wrote: >> I understand that I can use __metaclass__ to create a class which >> modifies the behaviour of another class. >> >> How can I add this metaclass to *all* classes in the system? >> >> (In ruby I would alter the "Class" class) > > I got confused fr

Re: Installing 2.5 with 2.4?

2006-09-19 Thread Diez B. Roggisch
John Salerno wrote: > Hi all. Just curious, before I do it myself, about the best way to > install 2.5 if it's the only version I want to use. Should I uninstall > 2.4 first? Does 2.5 replace 2.4? I doubt the latter, but if I install > 2.5, does that mean I need to reinstall all the extensions I h

Re: why a main() function?

2006-09-19 Thread Diez B. Roggisch
Fredrik Lundh wrote: > "Diez B. Roggisch" wrote: > >>> There is another secondary advantage: the code inside a function runs >>> faster (something related is true for C programs too). Usually this >>> isn't important, but for certain programs they

Re: Curious issue with simple code

2006-09-19 Thread Diez B. Roggisch
codefire wrote: > Hi, > > I have some simple code - which works...kind of..here's the code: > > [code] > import os > > def print_tree(start_dir): > for f in os.listdir(start_dir): > fp = os.path.join(start_dir, f) > print fp > if os.path.isfile(fp): # will return fal

Re: byte count unicode string

2006-09-20 Thread Diez B. Roggisch
MonkeeSage schrieb: > John Machin wrote: >> The answer is, "You can't", and the rationale would have to be that >> nobody thought of a use case for counting the length of the UTF-8 form >> but not creating the UTF-8 form. What is your use case? > > Playing DA here, what if you need to send the by

Re: byte count unicode string

2006-09-20 Thread Diez B. Roggisch
willie wrote: > John Machin: > > >You are confusing the hell out of yourself. You say that your web app > >deals only with UTF-8 strings. Where do you get "the unicode string" > >from??? If name is a utf-8 string, as your comment says, then len(name) > >is all you need!!! > > > # I'll go ah

Re: Python regular expression question!

2006-09-20 Thread Hallvard B Furuseth
"unexpected" <[EMAIL PROTECTED]> writes: > I'm trying to do a whole word pattern match for the term 'MULTX-' > > Currently, my regular expression syntax is: > > re.search(('^')+(keyword+'\\b') \b matches the beginning/end of a wor

Re: Is it possible to change a picture resolution with Python?

2006-09-20 Thread Diez B. Roggisch
> Thank you for your reply. > But the above code increases size only , but not DPI resolutions( > vertical nad horizontal).I need a higher vertical and horisontal > resolutions. > Any idea how to do that? The DPI is nothing an image contains by itself - it depends on the resolution of the render

Weekly Python Patch/Bug Summary

2006-09-20 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 419 open ( +3) / 3410 closed ( +2) / 3829 total ( +5) Bugs: 910 open (+12) / 6185 closed ( +5) / 7095 total (+17) RFE : 235 open ( +1) / 238 closed ( +0) / 473 total ( +1) New / Reopened Patches __ Practical

Re: Python and CORBA

2006-09-21 Thread Diez B. Roggisch
rodmc wrote: > Thanks to everyone for their help. I had tried OmniORB and while the > base library worked ok, the Python bit OmniORBpy seems to dislike > working... Perhaps there is something wrong with my settings. Omniorb is very actively developed, try and post your problems on the mailing lis

Weekly Python Patch/Bug Summary ** REVISED **

2006-09-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 420 open ( +4) / 3410 closed ( +2) / 3830 total ( +6) Bugs: 915 open (+17) / 6186 closed ( +6) / 7101 total (+23) RFE : 235 open ( +1) / 238 closed ( +0) / 473 total ( +1) New / Reopened Patches __ Practical

Re: XML parser that sorts elements?

2006-09-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi everyone, > > I am a total newbie to XML parsing. I've written a couple of toy > examples under the instruction of tutorials available on the web. > > The problem I want to solve is this. I have an XML snippet (in a > string) that looks like this: > > > hello

Re: Python and checked exceptions

2006-09-23 Thread Diez B. Roggisch
>> This might be of practical interest for some and theoretical interest >> for others - in particular those who know checked ex as a language >> feature of Java. > > The trouble with having to declare every possible exception that a > function might throw is that it rapidly turns into a complete

Re: IDLE - Customizing output format

2006-09-24 Thread Diez B. Roggisch
>> And I am wondering at your continual surprise when the rest of the world >> fails to share your perceptions. Doesn't this carry *any* information? > > not the rest of the world, but the rest of the python community. > > That's a big difference. > > So it looks that I have to code to change th

Re: Daemonizing python

2006-09-24 Thread Diez B. Roggisch
NinjaZombie schrieb: > Hi! > > I was wondering if it is possible to turn the current python proccess into > a unix daemon, but not doing it like this: > python myscript.py & > but from code programaticaly. There is a good daemonization recipe on activstate: http://aspn.activestate.com/ASPN/Coo

Re: Daemonizing python

2006-09-25 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> There is a good daemonization recipe on activstate: >> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 > > That is worth reading, including the long comment thread. Yeah,

Re: Newbie question: PyQt & Form::init()

2006-09-25 Thread Diez B. Roggisch
Sven Ehret wrote: > Hello List, > > I am trying to learn Python and followed the tutorial at > http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I am > now trying to do my own project, but I am having problems with > initialization of my form. > > I want to automatically fill

Re: Newbie question: PyQt & Form::init()

2006-09-25 Thread Diez B. Roggisch
Sven Ehret wrote: > Diez B. Roggisch wrote: > >> Sven Ehret wrote: >> >>> Hello List, >>> >>> I am trying to learn Python and followed the tutorial at >>> http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I >>&g

Re: installation of python-dev

2006-09-25 Thread Diez B. Roggisch
Fredrik Lundh wrote: > Dominik M�ller wrote: > >> I am running Python2.4.3; I need to install Python-dev (or does anybody >> know an easier way to get distutils.core ? that's what I actually >> need...). > > umm. distutils is part of the standard library, so it should be part of > the core inst

Re: Python API to OS X Address Book?

2006-09-25 Thread Diez B. Roggisch
Brendon Towle wrote: > Essentially, I'm looking for a Python equivalent to the ObjectiveC stuff > that can be found at: > > http://developer.apple.com/documentation/UserExperience/Conceptual/AddressBook/index.html > > Google got me that far, but was not particularly helpful past that. > > Any

Re: Is there a regular expression for finding email address ?

2006-09-25 Thread Diez B. Roggisch
Lad schrieb: > Did anyone try to find out a regular expression for finding an email > address in a text? > Thank you for the reply Entering your subject line into google as it is, using the first result found, you can get one. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: R.S.I. solutions?

2006-09-25 Thread Diez B. Roggisch
Paddy schrieb: > All this keyboarding has finally caught up with me and I'm getting > aches in my fingers. > last weekend I did the round of the usual UK High Street shops - PC > World, Currys and Comet. I finally got a new Microsoft 4000 ergonomic > keyboard, but all the ergonomic Mice and trackba

Re: R.S.I. solutions?

2006-09-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Diez> I bought a TouchStream keyboard and could recommend it - but > Diez> unfortunately they are out of business. > > Is this what you're referring to? > > http://www.fingerworks.com/ST_product.html Yup. Diez -- http://mail.python.org/mailman/listinfo/

Re: does anybody earn a living programming in python?

2006-09-26 Thread Diez B. Roggisch
> well, if you're only watching mtv, it's easy to think that there's > obviously not much demand for country singers, blues musicians, British > hard rock bands, or melodic death metal acts. These days its even hard to get the idea that there is a demand of boy bands, rnb, euro trash or any oth

Re: Surprise using the 'is' operator

2006-09-26 Thread Diez B. Roggisch
codefire wrote: > I thought the 'is' operator was used to identify identical objects, > whereas the '==' operator checked equality. Well, I got a surprise > here: > > IDLE 1.1.3 >>>> a = 10 >>>> b = a >>>> a is b >

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > GOOGLE IS NOT OUR SUBJECT ANY MORE. > > MY GOAL IS NOT MAKING SEARCH ON GOOGLE: > MY GOAL IS MAKING A SEARCH ON > www.onelook.com, for example """ Can you send me the list of words in the index? May I extract it from your site? No, sorry. If you're thinking about wri

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Diez B. Roggisch
> > SQL databases like MySQL are _designed_ for efficiency. Efficiency with respect to what? That statement is plain wrong. They are designed for a pretty general case of data storage efficiency, in the domain of relational algebra. And for a lot of use-cases, they offer a good ratio of ease-of-u

Re: Verify an e-mail-adress - syntax and dns

2006-09-26 Thread Diez B. Roggisch
> Besides, what is so special with electronic forms that we have to go > through all kind of tricks to make sure the user doesn't make mistakes > when regular paper forms just assume the user will be careful when he > fills it? Must be some kind of IQ draining field emited by all the > computers wh

Re: Printing a percent sign

2006-09-26 Thread Diez B. Roggisch
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John > Machin wrote: > >> 1. Reasoning: How do you get a literal "'" into an SQL string constant? >> How do you get a literal "\" into a Python string constant? How do you >> get a literal "$" into some *x shell command lines? Do you de

Re: How to apply text changes to HTML, keeping it intact if inside "a" tags

2006-09-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > I have HTML input to which I apply some changes. > > Feature 1: > === > I want to tranform all the text, but if the text is inside > an "a href" tag, I want to leave the text as it is. > > The HTML is not necessarily well-formed, so > I would like to do

Re: best way to get data into a new instance?

2006-09-28 Thread Diez B. Roggisch
John Salerno schrieb: > Let's pretend I'm creating an Employee class, which I will later > subclass for more specific jobs. Each instance will have stuff like a > name, title, degrees held, etc. etc. > > So I'm wondering, is the best way to get all this information into the > object to just hav

Re: vector and particle effects

2006-09-28 Thread Diez B. Roggisch
Jay schrieb: > I'd like to experiment a little bit with vector graphics in python. > When I say 'vector graphics' I don't mean regular old svg-style. I > mean vector game style as in simulation of vector beam drawn graphics. > If you still don't know what I'm talking about, see Grid Wars 2 > (http

Re: Recursive descent algorithm able to parse Python?

2006-09-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I'm a compiler newbie and curious if Python grammar is able to > be parsed by a recursive descent parser or if it requires > a more powerful algorithm. I might be mistaken, but isn't recursive descent one of the more powerful parsing techniques - for the price of non-

Re: Recursive descent algorithm able to parse Python?

2006-09-29 Thread Diez B. Roggisch
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > >> [EMAIL PROTECTED] schrieb: >>> I'm a compiler newbie and curious if Python grammar is able to >>> be parsed by a recursive descent parser or if it requires &g

Re: File I/O

2006-09-29 Thread Diez B. Roggisch
Kirt wrote: > > jimburton wrote: >> Kirt wrote: >> > Hi! I need some help in file I/O >> > >> > I have an xml file.. >> [snip] >> See http://diveintopython.org/xml_processing/ > > i dont wanna parse the xml file.. If you play soccer, do you insist on playing with a baseball bat? The game is ca

Re: File I/O

2006-09-29 Thread Diez B. Roggisch
jimburton wrote: > > Diez B. Roggisch wrote: >> Kirt wrote: >> >> > >> > jimburton wrote: >> >> Kirt wrote: >> >> > Hi! I need some help in file I/O >> >> > >> >> > I have an xml file.. >> >

Re: retry in exception

2006-09-29 Thread Diez B. Roggisch
rybody knows Ruby through and through... > > In ruby, the equivalent to try...except is begin...rescue. In the > rescue section you can ask it to retry the begin section. So, for > example: > > b=0 > begin > puts 1/b > rescue > b=1 > retry # <- this

Re: DAT file compilation

2006-09-29 Thread Diez B. Roggisch
Jay schrieb: > Is there a way through python that I can take a few graphics and/or > sounds and combine them into a single .dat file? If so, how? And how > can I access the data in the .dat file from inside the python script? Use a zip-file. See the zipfile-module. Diez -- http://mail.python.o

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread Diez B. Roggisch
daniel schrieb: > I use a simple program to illustrate the problem: > > import logging > > def foo() : > raise ValueError("foo") > > if __name__ == "__main__" : > try : > foo() > except ValueError : > logging.exception("caught here") -- seems re-raise the > exception

Re: _gtk

2006-09-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello, > Where to I download module: _gtk is google dead today? google: python module gtk download windows something like the fifth link. Diez -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2006-09-30 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 422 open ( +2) / 3415 closed ( +5) / 3837 total ( +7) Bugs: 933 open (+18) / 6212 closed (+26) / 7145 total (+44) RFE : 237 open ( +2) / 239 closed ( +1) / 476 total ( +3) New / Reopened Patches __ platform.

Re: Overriding builtin getattr method

2006-10-03 Thread Diez B. Roggisch
>> I have data stored in the database which has special characters >> like <, > etc. >> Case 1: Whenever I wanted to present the output to a browser >> I need to escape these special characters into the browser >> equivalent like < > etc.( for example by using the cgi module) >> Case 2:

Re: Problem with ez_setup on a "non-networked" machine

2006-10-03 Thread Diez B. Roggisch
alex23 schrieb: > Hey everyone, > > I'm trying to install setuptools on a work PC behind an NTLM firewall. > I've tried to use APS as recommended but am still unable to have > anything other than IE talk through firewall. But as I can downloaded > eggs manually, I'm not overly concerned at this po

Re: Strange sorting error message

2006-10-03 Thread Diez B. Roggisch
Dustan schrieb: > I'm hiding some of the details here, because I don't want to say what > I'm actually doing. > I have a special-purpose class with a __cmp__ method all set up and > ready to go for sorting. Then I have a special class that is based on > the builtin type list (though I didn't actua

Re: Running scripts in a sandbox

2006-10-03 Thread Diez B. Roggisch
Samuel schrieb: > Hi, > > I currently have two files: > > core.py > Runs the application, provides APIs to plugins > > untrusted-plugin.py > Executes code using the API from core.py > > I would like to run the code of untrusted-plugin.py in a sandbox, but > still provide it with some hooks

Re: sax barfs on unicode filenames

2006-10-04 Thread Diez B. Roggisch
Edward K. Ream wrote: > Hi. Presumably this is a easy question, but anyone who understands the > sax docs thinks completely differently than I do :-) > > > > Following the usual cookbook examples, my app parses an open file as > follows:: > > > > parser = xml.sax.make_parser() > > parser.s

Re: How to ask sax for the file encoding

2006-10-04 Thread Diez B. Roggisch
Edward K. Ream wrote: >>> Can anyone tell me how the content handler can determine the encoding of >>> the file? Can sax provide this info? > >> there is no encoding on the "inside" of an XML document; it's all >> Unicode. > > True, but sax is reading the file, so sax is producing the unicode,

Re: Decimal() instead of float?

2006-11-17 Thread Michael B. Trausch
like, any error gets massively compounded before a final result is evident. Thus, the numbers must be exact. That's why I originally asked if Decimal() can be used instead. Since it cannot, that's fine, I will just use Decimal(), assuming that it supports everything that I will need t

Re: Decimal() instead of float?

2006-11-17 Thread Michael B. Trausch
0 = 11 without any more floating point? It is a whole number. Perhaps you should not make assumptions; I am sure that you have heard what they do at some point before. While *some* of the error doesn't propagate as expected (which is actually a problem in itself—equations no longer make

Re: Which one is better for me , SIP or SWIG ?

2006-11-18 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi all, > > I am going to generate a python wrapper of a C library, and I am > wondering which one is a better tool for me, SIP or SWIG ? > > SWIG supports many scripting languages such as python, ruby, and perl, > while SIP is specific to python, so I think maybe S

<    8   9   10   11   12   13   14   15   16   17   >