Re: set update in 2.5

2007-01-29 Thread Duncan Smith
Peter Otten wrote: > Duncan Smith wrote: > > >> In moving from 2.4 to 2.5 I find that some of my unit tests are now >>failing. I've worked out that the problem relates to the set update >>method. In 2.4 I could update a set with an iterable type derived from >>dict as the argument. I now f

Re: The reliability of python threads

2007-01-29 Thread Aahz
In article <[EMAIL PROTECTED]>, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> >> My response is that you're asking the wrong questions here. Our database >> server locked up hard Sunday morning, and we still have no idea why (the >> machine itself, not just the database app). I t

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 16:24:18 +0100, Laszlo Nagy wrote: > NoName írta: >> Hmmm.. >> In the Perl example password generates after user hit ENTER not >> continously like in Python you wrote... :) >> >> i want see various ways to generate passwords even if they some >> indirect like using BASE64 >>

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 08:38:13 -0800, Szabolcs Nagy wrote: >>> why use xrange? range is faster and simpler for small ranges That is not true. >>> import timeit >>> timeit.Timer("range(50)", "").repeat() [2.8599629402160645, 2.8296849727630615, 2.8609859943389893] >>> timeit.Timer("xrange(50)", "")

error messages containing unicode

2007-01-29 Thread Jim
Hello, I'm trying to write exception-handling code that is OK in the presence of unicode error messages. I seem to have gotten all mixed up and I'd appreciate any un-mixing that anyone can give me. I'm used to writing code like this. class myException(Exception): pass fn='README'

Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Hampton Din
still a stupid troll. -- http://mail.python.org/mailman/listinfo/python-list

Convert raw data to XML

2007-01-29 Thread elrondrules
Hi I am running a HTTP server which receives post from a process. In my do_POST method am receiving raw data. I know that this raw data has a valid XML content and I need to convert this into an XML file. Are there any routines to do this.. if not how to write one.. For example the raw data is

creating a dictionary

2007-01-29 Thread mark
i have few variables and i want to create a dictionary with these variables such that the keys are the variable names and the corresponding values are the variable values.how do i do this easily? for ex: var1='mark' var2=['1','2','3'] my_dict = create_my_dictionary(var1, var2) and my_dict is {'va

Re: error messages containing unicode

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 18:01:56 -0800, Jim wrote: > Hello, > > I'm trying to write exception-handling code that is OK in the > presence > of unicode error messages. I seem to have gotten all mixed up and > I'd > appreciate any un-mixing that anyone can give me. [snip] >>> class MyException(Exce

Re: Convert raw data to XML

2007-01-29 Thread Justin Ezequiel
On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote: > For example the raw data is as follows > > SomeText Description>PassorFail > > without spaces or new lines. I need this to be written into an XML > file as > > > > > > > SomeText >

Secret Technology of THERMATE and 911 Crime

2007-01-29 Thread thermate
Excellent Technology, and photos: http://stj911.org/jones/focus_on_goal.html As scientists, we look at the evidence, perform experiments, and apply the Scientific Method. The Greek method was to look at the evidence (superficially) and then try to explain things through logic and debate. The G

Python 2.5 Tkinter not configured

2007-01-29 Thread Jim
I compiled Python 2.5 from python.org and I get an error message when I try to import the Tkinter module. Python reports that there is no such module. It says my Python isn't configured for Tkinter. How do I configure it? I'm using GCC 4.1.1 to compile the tarball. Thanks for any help with this. J

Re: Getting the output from a console command while it's been generated!

2007-01-29 Thread Gabriel Genellina
En Sun, 28 Jan 2007 23:54:03 -0300, Raúl Gómez C. <[EMAIL PROTECTED]> escribió: > I can't use the subprocess module because my app needs to be compatible > with > Python 2.3 so, is there another approach to this problem??? Any variant of popen; see the popen2 module (but read the last notes o

Re: sending a class as an argument

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 01:24:23 -0300, manstey <[EMAIL PROTECTED]> escribió: > > Our class has its attributes set as classes, as in > > MyClass.Phone.Value='34562346' > MyClass.Phone.Private=True > > Inside the MyClass definition we have a function like this: > > def MyFunc(self,clsProperty): >if

Re: interactive prompt in IDLE

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 10:16:32 -0300, Jan Kanis <[EMAIL PROTECTED]> escribió: > Hello everyone, > > I'm trying to change the interactive python prompt. According to the docs > this is done by changing sys.ps1 and sys.ps2 . That works fine when > running python interactively from a command line, bu

Re: Convert raw data to XML

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 23:42:07 -0300, <[EMAIL PROTECTED]> escribió: > For example the raw data is as follows > > SomeText Description>PassorFail > > without spaces or new lines. I need this to be written into an XML > file as > [same content but nicely indented] Is the file supposed to be processe

Re: Off-Topic Posts

2007-01-29 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Jan 27, 1:31 pm, Jim Klein <[EMAIL PROTECTED]> wrote: >> I'm not one of the conquered races, I'm Swiss. We are the bankers to >> the conquerers. :-) > > Exactly, Honorable J Klein, (although my reference was a general one, > you have entered the thread, so I will pic

Re: deepcopy alternative?

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 20:17:11 -0300, <"none <"@bag.python.org> escribió: > I have a very complex data structure which is basically a class object > containing (sometimes many) other class objects, What are "class objects"? instances of a given class, or a class itself? > function references, > in

Re: The reliability of python threads

2007-01-29 Thread Steve Holden
Carl J. Van Arsdall wrote: > Aahz wrote: >> [snip] >> >> My response is that you're asking the wrong questions here. Our database >> server locked up hard Sunday morning, and we still have no idea why (the >> machine itself, not just the database app). I think it's more important >> to focus on w

Re: log parser design question

2007-01-29 Thread avidfan
On 28 Jan 2007 21:20:47 -0800, "Paul McGuire" <[EMAIL PROTECTED]> wrote: >On Jan 27, 10:43 pm, avidfan <[EMAIL PROTECTED]> wrote: >> I need to parse a log file using python and I need some advice/wisdom >> on the best way to go about it: >> >> The log file entries will consist of something like th

Re: Random passwords generation (Python vs Perl) =)

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 01:58:39 -0300, NoName <[EMAIL PROTECTED]> escribió: > Perl: > @char=("A".."Z","a".."z",0..9); > do{print join("",@char[map{rand @char}(1..8)])}while(<>); > > !!generate passwords untill U press ctrl-z > > > > Python (from CookBook): > > from random import choice > import strin

Re: creating a dictionary

2007-01-29 Thread Gabriel Genellina
En Mon, 29 Jan 2007 23:45:40 -0300, mark <[EMAIL PROTECTED]> escribió: > i have few variables and i want to create a dictionary with these > variables > such that the keys are the variable names and the corresponding values > are the variable values.how do i do this easily? > for ex: > var1='mar

Re: pdf to text

2007-01-29 Thread Steve Holden
tubby wrote: > Dieter Deyke wrote: >>> sout = os.popen('pdftotext "%s" - ' %f) > >> Your program above should read: >> >>sout = os.popen('pdftotext "%s" - ' % (f,)) > > What is the significance of doing it this way? It's actually just nit-picking - as long as you know f is never going to

Re: Ip address

2007-01-29 Thread Steve Holden
Toby A Inkster wrote: > Steve Holden wrote: > >> There is absolutely no need to know the IP address of "your router" to >> communicate with Internet devices. Either your IP layer is configured to >> know the addresses of one or more routers, or it has discovered those >> address by dynamic mean

parent-child object design question

2007-01-29 Thread manstey
Hi, I am having trouble designing my classes. I have two classes. The first one wraps around an old-style class called oref Class CacheClass(object): def __init__(self, obj): self.__data = obj def __getattr__(self, attr): return getattr(self.__data, attr) The second cl

emulate a serial port in windows (create a virtual 'com' port)

2007-01-29 Thread Pom
Hello how can I emulate a serial port in windows? I want to intercept data sent to a 'com'port by a proprietary program. It sends statistics to a serial display, and I want that data in my python program (that display isn't needed). Is this possible? I've seen this kind of serial ports bei

Re: List Behavior when inserting new items

2007-01-29 Thread André Malo
* Paul McGuire wrote: >> py>def __init__(self, arg = []): >> py>self.__list = arg > > Please don't perpetuate this bad habit!!! "arg=[]" is evaluated at > compile time, not runtime, and will give all default-inited llists the > same underlying list. While this actually might be bad

Re: parent-child object design question

2007-01-29 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > I have two classes. The first one wraps around an old-style class > called oref > > Class CacheClass(object): > def __init__(self, obj): > self.__data = obj > def __getattr__(self, attr): > return getattr(self.__data, attr) I presume

Help me understand this

2007-01-29 Thread ArdPy
Hi, Pls tell me whats going on in the code snippet below: >>> n = 10 >>> statstr = "N = ",n >>> type(statstr) #case1 >>> print statstr ('N = ', 10) >>> print "N = ",n #case 2 N = 10 In the first case the result is printed as a tuple

Re: Data structure and algorithms

2007-01-29 Thread Beej
On Jan 29, 1:50 pm, "azrael" <[EMAIL PROTECTED]> wrote: > thanks guys. i see that there is no way then to go back to C to > satisfy my prof and get a grade Seconding what Dennis says below, it is totally possible to use Python for this. I didn't mean to discourage you from using Python--I just w

Re: Data structure and algorithms

2007-01-29 Thread Beej
On Jan 29, 10:15 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > The instructor learned his lesson: no more assignments > done in "any language I can understand" Without naming names, there was a person at my university who gained a certain amount of notoriety by implementing a file system fo

Re: Help me understand this

2007-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2007 23:05:37 -0800, ArdPy wrote: > Hi, > > Pls tell me whats going on in the code snippet below: > n = 10 statstr = "N = ",n type(statstr) #case1 > print statstr > ('N = ', 10) print "N = ",n

<    1   2