Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > i hope someone here can help me. > > basically, me and my friend have a summer project. > > in this project, we need something that would basically function as a > blender. we know we'll need to buy a motor that spins, but what we're > having trouble with is figurin

Re: ANN: gozerbot 0.7 released

2007-07-08 Thread bthate
here is the about: gozerbot is a Python IRC and Jabber bot Requirements * a shell * python 2.4 or higher * if you want to remotely install plugins: the gnupg module * if you want mysql support: the py-MySQLdb module * if you want jabber support: the xmpppy module Why gozerbot

Re: ANN: gozerbot 0.7 released

2007-07-08 Thread bthate
On 9 jul, 07:25, Ben Finney <[EMAIL PROTECTED]> wrote: > bthate <[EMAIL PROTECTED]> writes: > > it time for a new gozerbot release ! we made a 0.7 release of > > gozerbot. > > When announcing a new release, please include a brief "What is > gozerbot?" explanation section so that readers can know wh

Re: Where is the syntax for the dict() constructor ?! (OT)

2007-07-08 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Would we do that with esteeth? Ok Steve you've got me - my dictionary goes from estate to esteem to ester... The US spelling of "esthete" may have a bearing... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: unify els database

2007-07-08 Thread luca72
Many thanks I will try with Jython Regards Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread John Nagle
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >>>Which implies that even in ADA, runtime type errors are in fact >>>expected - else there would be no handler for such a case. >> >>Well, yes, runtime errors occur - in statically typed languages as >>well. That's essentially t

Re: socket: connection reset by server before client gets response

2007-07-08 Thread Hendrik van Rooyen
"ahlongxp" <[EMAIL PROTECTED]> wrote: > > > Try to wait a while in the server thread, after sending the > > message before closing the connection, to give the message > > time to get transmitted. > > > > time.sleep(0.5) should do it... > > > > - Hendrik > > OMG, it works. > I can't believe the

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread John Nagle
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >>>Which implies that even in ADA, runtime type errors are in fact >>>expected - else there would be no handler for such a case. >> >>Well, yes, runtime errors occur - in statically typed languages as >>well. That's essentially t

Re: ANN: gozerbot 0.7 released

2007-07-08 Thread Ben Finney
bthate <[EMAIL PROTECTED]> writes: > it time for a new gozerbot release ! we made a 0.7 release of > gozerbot. When announcing a new release, please include a brief "What is gozerbot?" explanation section so that readers can know whether the announcement is of interest. -- \ "Pinky, are

A clean way to program an interface

2007-07-08 Thread rh0dium
Hi all, I got this new radio scanner (toy!!) this weekend and I can access it via a serial cable. I want to write a interface around it but I am looking for some suggestions. I thought at first I would simply class the Scanner and write the various methods as attibutes similar to below.. But the

Re: How to override PyGridTableBase.SetColLabelValue()?

2007-07-08 Thread Frank Millman
On Jul 9, 5:27 am, [EMAIL PROTECTED] wrote: > Dear all, > > the doc is missing, and > i failed to find the solution on google search. > anyone know how to override > the function SetColLabel() inside the class PyGridTableBase or the > class GridTableBase? > > my code, > #===

Re: How to override PyGridTableBase.SetColLabelValue()?

2007-07-08 Thread ajaksu
On Jul 9, 12:27 am, [EMAIL PROTECTED] wrote: > Dear all, > > the doc is missing, and i failed to find the solution on google search. > anyone know how to override the function SetColLabel() inside > the class PyGridTableBase or the class GridTableBase? Some docs to back up the old code that follow

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread Carlos Guerrero
One "generic" way is using your parallel port for outputting voltages that would control Relays [2] that would be conected to the motor. Parapin [1] is the easiest way i know to work with parallel ports but its for C++, the python binding is still being developed [2]. [1] http://parapin.sourcefo

Re: What is the most efficient way to test for False in a list?

2007-07-08 Thread Daniel
On Mon, 09 Jul 2007 06:21:31 +0300, Simon Forman <[EMAIL PROTECTED]> wrote: > > On Jul 8, 7:43 pm, lex <[EMAIL PROTECTED]> wrote: >> Of course there is the always the iteration method: >> >> list = [1, True, True, False, False, True] >> status = True >> for each in list: >> status = status a

How to override PyGridTableBase.SetColLabelValue()?

2007-07-08 Thread fckuen
Dear all, the doc is missing, and i failed to find the solution on google search. anyone know how to override the function SetColLabel() inside the class PyGridTableBase or the class GridTableBase? my code, #=== class MegaTable(wx.grid.PyGridTableBase): def

Re: What is the most efficient way to test for False in a list?

2007-07-08 Thread Simon Forman
On Jul 8, 7:43 pm, lex <[EMAIL PROTECTED]> wrote: > Of course there is the always the iteration method: > > list = [1, True, True, False, False, True] > status = True > for each in list: > status = status and each > > but what is your best way to test for for False in a list? False in list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > Which implies that even in ADA, runtime type errors are in fact > > expected - else there would be no handler for such a case. > > Well, yes, runtime errors occur - in statically typed languages as > well. That's essentially the halting-problem.

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread Carsten Haese
On Sun, 2007-07-08 at 19:18 -0700, [EMAIL PROTECTED] wrote: > On Jul 8, 5:37 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > On Sun, 2007-07-08 at 17:06 -0700, [EMAIL PROTECTED] wrote: > > > i hope someone here can help me. > > > > > basically, me and my friend have a summer project. > > > > > in

Re: How to Machine A python script execute Machine B python script?

2007-07-08 Thread half . italian
On Jul 8, 6:45 pm, johnny <[EMAIL PROTECTED]> wrote: > Anyone know how I can make Machine A python script execute a python > script on Machine B ? xmlrpc will work. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the most efficient way to test for False in a list?

2007-07-08 Thread Carsten Haese
On Sun, 2007-07-08 at 18:32 -0700, Evan Klitzke wrote: > On 7/8/07, lex <[EMAIL PROTECTED]> wrote: > > Of course there is the always the iteration method: > > > > list = [1, True, True, False, False, True] > > status = True > > for each in list: > > status = status and each > > > > but what is

Re: How to Machine A python script execute Machine B python script?

2007-07-08 Thread Jay Loden
If you're running on a UNIX platform, one option would be to use SSH to execute the command remotely. Otherwise, you could also use a client/server setup to have the two scripts communicate across the network and trigger actions etc. It may also be possible to remotely execute an application on

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread socialanxiety
On Jul 8, 5:37 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Sun, 2007-07-08 at 17:06 -0700, [EMAIL PROTECTED] wrote: > > i hope someone here can help me. > > > basically, me and my friend have a summer project. > > > in this project, we need something that would basically function as a > > ble

How to Machine A python script execute Machine B python script?

2007-07-08 Thread johnny
Anyone know how I can make Machine A python script execute a python script on Machine B ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread [EMAIL PROTECTED]
First you'll need a computer interface to your robot. Lego Mindstorm, for example, comes with ways to program the onboard CPU. Other standard robotic toolkits will also come with some kind of interface, which may or may not have Python bindings. Cheers, -T On Jul 9, 10:06 am, [EMAIL PROTECTED] wr

Tool for finding external dependencies

2007-07-08 Thread Rob Cakebread
Hi, I need to find external dependencies for modules (not Python standard library imports). Currently I use pylint and manually scan the output, which is very nice, or use pylint's --ext-import-graph option to create a .dot file and extract the info from it, but either way can take a very long ti

Re: What is the most efficient way to test for False in a list?

2007-07-08 Thread Evan Klitzke
On 7/8/07, lex <[EMAIL PROTECTED]> wrote: > Of course there is the always the iteration method: > > list = [1, True, True, False, False, True] > status = True > for each in list: > status = status and each > > but what is your best way to test for for False in a list? In general, you can just

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread mshiltonj
On Jul 8, 8:29 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 8, 2:11 pm, mshiltonj <[EMAIL PROTECTED]> wrote: > I have some comments on the Pythonicity of your suggestions. Same > assumption, object attr is a unique key of some sort. How to create > the dict of objects, and how to retriev

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread half . italian
On Jul 8, 5:06 pm, [EMAIL PROTECTED] wrote: > i hope someone here can help me. > > basically, me and my friend have a summer project. > > in this project, we need something that would basically function as a > blender. we know we'll need to buy a motor that spins, but what we're > having trouble wi

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Maybe we just have different styles, and I naturally tend to write in > smaller scopes than you do. It's easy to make errors even in very small scopes. -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.makefile() buggy?

2007-07-08 Thread Paul McGuire
On Jul 8, 8:54 am, Steve Holden <[EMAIL PROTECTED]> wrote: > That's a pretty pejorative subject line for someone who's been > programming Python [guessing by the date of your first post] for about a > month. > > Perhaps "Incomprehensible behavior from socket.makefile()", or "I have > written a bugg

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread Carsten Haese
On Sun, 2007-07-08 at 17:06 -0700, [EMAIL PROTECTED] wrote: > i hope someone here can help me. > > basically, me and my friend have a summer project. > > in this project, we need something that would basically function as a > blender. we know we'll need to buy a motor that spins, but what we're >

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread Steve Holden
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> As far as I can see, the only difference is that the list comp variable >> isn't explicitly created with a statement of the form "name = value". Why >> is that a problem? > > I don't know that listcomp vars are worse problem than o

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread Paul McGuire
On Jul 8, 2:11 pm, mshiltonj <[EMAIL PROTECTED]> wrote: > On Jul 8, 2:18 pm, [EMAIL PROTECTED] wrote: > > > Hello all, > > > Imaybe someone can help me with this question. > > Is there a direct way of accessing an object instance, if all I know > > is the value of one of its attributes? > > The obj

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread socialanxiety
On Jul 8, 5:14 pm, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > i hope someone here can help me. > > > basically, me and my friend have a summer project. > > > in this project, we need something that would basically function as a > > blender. we know we'll need to buy a moto

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread John Nagle
[EMAIL PROTECTED] wrote: > i hope someone here can help me. > > basically, me and my friend have a summer project. > > in this project, we need something that would basically function as a > blender. we know we'll need to buy a motor that spins, but what we're > having trouble with is figuring ou

Re: python extra

2007-07-08 Thread Neal Becker
Danyelle Gragsone wrote: > Nope.. not a one.. > > > On 7/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> On Jul 8, 12:59?pm, Neal Becker <[EMAIL PROTECTED]> wrote: >> > Just a little python humor: >> > >> > http://www.amazon.com/Vitamin-Shoppe-Python-Extra-tablets/dp/B00012NJ... >> >> Aren

Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread socialanxiety
i hope someone here can help me. basically, me and my friend have a summer project. in this project, we need something that would basically function as a blender. we know we'll need to buy a motor that spins, but what we're having trouble with is figuring out how to program it. we want to be able

Re: What is the most efficient way to test for False in a list?

2007-07-08 Thread Paul Rubin
lex <[EMAIL PROTECTED]> writes: > list = [1, True, True, False, False, True] > status = True > for each in list: > status = status and each > > but what is your best way to test for for False in a list? status = all(list) -- http://mail.python.org/mailman/listinfo/python-list

What is the most efficient way to test for False in a list?

2007-07-08 Thread lex
Of course there is the always the iteration method: list = [1, True, True, False, False, True] status = True for each in list: status = status and each but what is your best way to test for for False in a list? -- http://mail.python.org/mailman/listinfo/python-list

ANN: gozerbot 0.7 released

2007-07-08 Thread bthate
it time for a new gozerbot release ! we made a 0.7 release of gozerbot. new in gozerbot 0.7: * we have a new developer on the team .. Wijnand 'tehmaze' Modderman he contributed most of the new work in this release. copyright on tehmaze's work is BSD * new plugins: rest, lag, nickserv, sna

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > As far as I can see, the only difference is that the list comp variable > isn't explicitly created with a statement of the form "name = value". Why > is that a problem? I don't know that listcomp vars are worse problem than other vars; however there is

Re: python extra

2007-07-08 Thread Danyelle Gragsone
Nope.. not a one.. On 7/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Jul 8, 12:59?pm, Neal Becker <[EMAIL PROTECTED]> wrote: > > Just a little python humor: > > > > http://www.amazon.com/Vitamin-Shoppe-Python-Extra-tablets/dp/B00012NJ... > > Aren't there any female Python programmers?

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread Steven D'Aprano
On Sun, 08 Jul 2007 08:49:26 -0400, Steve Holden wrote: > Paul Rubin wrote: >> Steve Holden <[EMAIL PROTECTED]> writes: Python even leaks the index variable of list comprehensions (I've mostly stopped using them because of this), though that's a recognized wart and is due to be fixe

Re: __unicode__ method for exception object

2007-07-08 Thread Manlio Perillo
Il Sun, 08 Jul 2007 10:02:01 +1000, Ben Finney ha scritto: > Manlio Perillo <[EMAIL PROTECTED]> writes: > >> I have just noticed that exception objects does not handle well Unicode >> arguments. > > This error is unrelated to the fact that you created an exception > object. > No, it is related

Re: "Empty" text

2007-07-08 Thread Marc 'BlackJack' Rintsch
On Sun, 08 Jul 2007 22:23:20 +0200, Jan Danielsson wrote: >The problem is that this generates the following code: > > > Description > > > > > >Firefox is very unhappy about the textarea not having separate > openi

Re: allow scripts to use .pth files?

2007-07-08 Thread John Machin
On Jul 8, 10:53 pm, samwyse <[EMAIL PROTECTED]> wrote: > On Jul 3, 9:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote: > > > Suppose I have a directory `scripts`. > > I'd like the scripts to have access to a package > > that is not "installed", i.e., it is not on sys.path. > > On this list, various peop

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Wildemar Wildenburger
David Kastrup wrote: > Twisted <[EMAIL PROTECTED]> writes: > >> Judging by the existence of the newsgroup comp.emacs, emacs is >> indeed considered by some to be a quite valuable antique. Otherwise >> why on earth would it have an apparently fairly active newsgroup a >> full seven years into the

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread sturlamolden
On Jun 20, 8:53 pm, Stephen R Laniel <[EMAIL PROTECTED]> wrote: > Reading [1], I wonder: why isn't the compiler making better > use of (purely optional) type labeling? Why not make a compiler > directive so that > > a) it will check the types of all my arguments and return >values, If that is

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread David Kastrup
Twisted <[EMAIL PROTECTED]> writes: > On Jul 8, 4:28 am, Adriano Varoli Piazza <[EMAIL PROTECTED]> wrote: >> b) If you do want to keep an antediluvian copy of emacs -probably >> versioned in the negative numbers, for all you've said- please do. Do >> be so kind as to send a copy, since it might be

Re: Changing the user-agent in urllib

2007-07-08 Thread Inigo Serna
On Sun, Jul 08, 2007 at 12:21:38PM -0700, James Matthews wrote: > Is there anyway of changing the user-agent in urllib without sub classing > it? Yes, >>> import urllib >>> urllib.URLopener.version = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT >>> 5.0; T312461)' Regards, I�igo Serna -- http

"Empty" text

2007-07-08 Thread Jan Danielsson
Hello all, I'm using mod_python+ElementTree to build XHTML pages. But I stumbled across this problem: def foo(req, desc = None): ... tr = ET.SubElement(tbl, "tr") th = ET.SubElement(tr, "th") th.text = "Description" td = ET.SubElement(tr, "td") ta = ET.

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Matthias Buelow
Twisted wrote: > I, for one, have a strong preference for interfaces that let me see > what the hell I'm doing and make it easy to find commands, navigate > the interface, navigate the help, and so forth, while making me resort > to reaching for that help as infrequently as reasonably achievable.

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Twisted
On Jul 8, 12:18 pm, Bjorn Borud <[EMAIL PROTECTED]> wrote: > uh, I think the point here is that some think it might be an idea to > force *their* idea of the ideal interface upon others, refusing to > understand that people might have their own preferences. I, for one, have a strong preference for

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Twisted
On Jul 8, 4:28 am, Adriano Varoli Piazza <[EMAIL PROTECTED]> wrote: > b) If you do want to keep an antediluvian copy of emacs -probably > versioned in the negative numbers, for all you've said- please do. Do > be so kind as to send a copy, since it might be quite valuable as an > antique. Judging

Re: Validating XML in Windows

2007-07-08 Thread numeralblue
On Jul 8, 10:01 am, Omari Norman <[EMAIL PROTECTED]> wrote: > My app needs to validate XML. That's easy enough in Unix. What is the > best way to do it in Windows? > > The most obvious choice would of course be PyXML. However, apparently it > is no longer maintained: > > http://sourceforge.net/proj

Changing the user-agent in urllib

2007-07-08 Thread James Matthews
Is there anyway of changing the user-agent in urllib without sub classing it? -- http://www.goldwatches.com/watches.asp?Brand=14 http://www.jewelerslounge.com -- http://mail.python.org/mailman/listinfo/python-list

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread mshiltonj
On Jul 8, 2:18 pm, [EMAIL PROTECTED] wrote: > Hello all, > > Imaybe someone can help me with this question. > Is there a direct way of accessing an object instance, if all I know > is the value of one of its attributes? > The object is part of a list of objects, and I would like to pick the > objec

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread Stargaming
[EMAIL PROTECTED] wrote: > Hello all, > > Imaybe someone can help me with this question. > Is there a direct way of accessing an object instance, if all I know > is the value of one of its attributes? > The object is part of a list of objects, and I would like to pick the > object directly by usin

Re: Pretty Printing Like Tidy for HTML

2007-07-08 Thread bsneddon
On Jul 8, 1:53 pm, bsneddon <[EMAIL PROTECTED]> wrote: > On Jul 8, 10:59 am, [EMAIL PROTECTED] (John J. Lee) wrote: > > > > > David <[EMAIL PROTECTED]> writes: > > > Is there a pretty printing utility for Python, something like Tidy for > > > HTML? > > > > That will change: > > > > xp=self.

Re: In search of python idiom for accessing arbitrary fields at run time

2007-07-08 Thread mshiltonj
On Jul 8, 2:31 pm, "OKB (not okblacke)" <[EMAIL PROTECTED]> wrote: > mshiltonj wrote: > > In python, I'm doing something like this: > > > def three_fields(self, field1, field2, field3): > > for field in (field1, field2, field3): > > value = eval('self.' + field) # this is the one

Re: In search of python idiom for accessing arbitrary fields at run time

2007-07-08 Thread OKB (not okblacke)
mshiltonj wrote: > In python, I'm doing something like this: > > def three_fields(self, field1, field2, field3): > for field in (field1, field2, field3): > value = eval('self.' + field) # this is the one I'm > interested in > [...] > > This seems to do what I expect

Re: In search of python idiom for accessing arbitrary fields at run time

2007-07-08 Thread Jean-Paul Calderone
On Sun, 08 Jul 2007 18:21:41 -, mshiltonj <[EMAIL PROTECTED]> wrote: >I'm trying to find the preferred python idiom for access arbitrary >fields of objects at run time. > It's not an idiom, it's a built-in function: getattr. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: python extra

2007-07-08 Thread [EMAIL PROTECTED]
On Jul 8, 12:59?pm, Neal Becker <[EMAIL PROTECTED]> wrote: > Just a little python humor: > > http://www.amazon.com/Vitamin-Shoppe-Python-Extra-tablets/dp/B00012NJ... Aren't there any female Python programmers? -- http://mail.python.org/mailman/listinfo/python-list

In search of python idiom for accessing arbitrary fields at run time

2007-07-08 Thread mshiltonj
I'm trying to find the preferred python idiom for access arbitrary fields of objects at run time. For example, say I have an object the business code will do *something* with three arbitrary fields at a given time, but I don't know what the three fields are at run time. In perl, I'd do something

accessing an object instance by only having one of its attribute values

2007-07-08 Thread feli . hp
Hello all, Imaybe someone can help me with this question. Is there a direct way of accessing an object instance, if all I know is the value of one of its attributes? The object is part of a list of objects, and I would like to pick the object directly by using this attribute value, instead of goin

Is there anyone familiar with pybloom (bloom filter in python)?

2007-07-08 Thread Xell Zhang
Hello, I found pybloom module from http://www.imperialviolet.org/pybloom.html and tried to use it for my crawler:) I want to use it to store the URLs which have been crawled. But when I insert a URL string I always get a warning and wrong result... My testing code is quite simple: from pybloom i

Re: Pretty Printing Like Tidy for HTML

2007-07-08 Thread bsneddon
On Jul 8, 10:59 am, [EMAIL PROTECTED] (John J. Lee) wrote: > David <[EMAIL PROTECTED]> writes: > > Is there a pretty printing utility for Python, something like Tidy for > > HTML? > > > That will change: > > > xp=self.uleft[0]+percentx*(self.xwidth) > > > To: > > > xp = self.uleft[0

Re: Learning Basics

2007-07-08 Thread Dan Bishop
On Jul 8, 12:10 pm, Brad <[EMAIL PROTECTED]> wrote: > So I've been studying python for a few months (it is my first foray > into computer programming) and decided to write my own little simple > journaling program. It's all pretty basic stuff but I decided that I'd > learn more from it if more expe

python extra

2007-07-08 Thread Neal Becker
Just a little python humor: http://www.amazon.com/Vitamin-Shoppe-Python-Extra-tablets/dp/B00012NJAK/ref=sr_1_14/103-7715091-4822251?ie=UTF8&s=hpc&qid=1183917462&sr=1-14 -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating XML in Windows

2007-07-08 Thread bsneddon
On Jul 8, 12:22 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Omari Norman wrote: > > My app needs to validate XML. That's easy enough in Unix. What is the > > best way to do it in Windows? > > > The most obvious choice would of course be PyXML. However, apparently it > > is no longer maintained:

Learning Basics

2007-07-08 Thread Brad
So I've been studying python for a few months (it is my first foray into computer programming) and decided to write my own little simple journaling program. It's all pretty basic stuff but I decided that I'd learn more from it if more experienced programmers could offer some thoughts on how I could

Re: xmlrpclib hangs execution

2007-07-08 Thread Arno Stienen
Arno Stienen wrote: > I'll now try this to fool the client into thinking the server 'should' > keep the connection open: > > http://www.velocityreviews.com/forums/t329401-re-xmlrpc-httplib-and-ssl-http-11-xmlrpc-client.html > Just to conclude. Above actually worked and solved my problems with

Re: Validating XML in Windows

2007-07-08 Thread Stefan Behnel
Omari Norman wrote: > My app needs to validate XML. That's easy enough in Unix. What is the > best way to do it in Windows? > > The most obvious choice would of course be PyXML. However, apparently it > is no longer maintained: > > http://sourceforge.net/project/showfiles.php?group_id=6473 > > s

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Bjorn Borud
[Twisted <[EMAIL PROTECTED]>] | | Translation: since perfection is unattainable, we shouldn't even try, | and just foist upon our poor users whatever awkward and hard-to-learn | interface pops into our heads first? uh, I think the point here is that some think it might be an idea to force *their*

Validating XML in Windows

2007-07-08 Thread Omari Norman
My app needs to validate XML. That's easy enough in Unix. What is the best way to do it in Windows? The most obvious choice would of course be PyXML. However, apparently it is no longer maintained: http://sourceforge.net/project/showfiles.php?group_id=6473 so there are no Windows binaries that w

Re: Pretty Printing Like Tidy for HTML

2007-07-08 Thread John J. Lee
David <[EMAIL PROTECTED]> writes: > Is there a pretty printing utility for Python, something like Tidy for > HTML? > > That will change: > > xp=self.uleft[0]+percentx*(self.xwidth) > > To: > > xp = self.uleft[0] + percentx * (self.xwidth) > > And other formatting issues. Googled a

Re: Re-raising exceptions with modified message

2007-07-08 Thread Christoph Zwerschke
samwyse wrote: > def test(code): > try: > code() > except Exception, e: > try: > raise e.__class__, str(e) + ", sorry!" > except TypeError: > raise SorryFactory(e)() Ok, you're suggestig the naive approach if it works and the factory approach I came up with last as a f

Re: Re-raising exceptions with modified message

2007-07-08 Thread Christoph Zwerschke
Did you run this? With Py < 2.5 I get a syntax error, and with Py 2.5 I get: new.__class__ = old.__class__ TypeError: __class__ must be set to a class -- Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.makefile() buggy?

2007-07-08 Thread Steve Holden
That's a pretty pejorative subject line for someone who's been programming Python [guessing by the date of your first post] for about a month. Perhaps "Incomprehensible behavior from socket.makefile()", or "I have written a buggy network application"? That would at least show that you are consider

Re: Where is the syntax for the dict() constructor ?!

2007-07-08 Thread Steve Holden
Hendrik van Rooyen wrote: > "John Machin" <[EMAIL PROTECTED]> wrote: > > 8< nice explanation of quoting problems - > >> (2) A field containing an odd number of " characters (or more >> generally, not meeting whatever quoting convention might be expected >> in the underlyi

Re: socket: connection reset by server before client gets response

2007-07-08 Thread ahlongxp
> Try to wait a while in the server thread, after sending the > message before closing the connection, to give the message > time to get transmitted. > > time.sleep(0.5) should do it... > > - Hendrik OMG, it works. I can't believe the problem can be solved so easily. Thanks very much. -- http:

Re: allow scripts to use .pth files?

2007-07-08 Thread samwyse
On Jul 3, 9:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote: > Suppose I have a directory `scripts`. > I'd like the scripts to have access to a package > that is not "installed", i.e., it is not on sys.path. > On this list, various people have described a variety > of tricks they use, but nobody has pr

Re: httplib module

2007-07-08 Thread Steve Holden
Boris Ozegovic wrote: > Steve Holden wrote: > Why do I get double new lines when geting data from server? Example: >> How? It's customary to include details when you've solved your own >> problem in case someone else gets the same issue. > > Ok. In do_GET I had this two lines: > > for li

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Lew
Twisted wrote: > On Jul 7, 6:12 pm, Lew <[EMAIL PROTECTED]> wrote: >> Twisted wrote: >> Edward Dodge wrote: So -- what magical computer app illuminates the entire room and shows you how to use everything at the flip of a switch? This brilliant discovery would put Sam's, O'Reilly, th

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: >>> Python even leaks the index variable of list comprehensions (I've >>> mostly stopped using them because of this), though that's a >>> recognized wart and is due to be fixed. >>> >> Wow, you really take non-pollution of the namespace s

Re: what is wrong with that r"\"

2007-07-08 Thread samwyse
On Jul 4, 7:15 am, Matthieu TC <[EMAIL PROTECTED]> wrote: > May I suggest giving the possibility to use any delimiter for a raw string? > just like in Vi or ruby. > > Vi: > %s_a_b_g is valid and so is %s/a/b/g > > Ruby: > %q{dj'\ks'a\'"} or %q-dj'\ks'a\'"- > > So as long as your regex does

socket.makefile() buggy?

2007-07-08 Thread ahlongxp
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both windows and linux. so I guess there is a problem with makefile(). # Echo server program import socket H

Re: optparse commandline

2007-07-08 Thread Steven D'Aprano
On Sun, 08 Jul 2007 09:59:29 +, vvikram wrote: > > I want to call some function from my program and just pass it a > commandline. It should parse the commandline and return back a list of > parsed arguments (just like the sys.argv list) > > Example: > foo.parse_cmdline("/usr/bin/foorun -v -d

Re: Expandable 2D Dictionaries?

2007-07-08 Thread genro
On Jul 6, 5:43 pm, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I am interested in creating an expandable (dynamic) 2D dictionary. For > example: > > myvar["cat"]["paw"] = "Some String" > > The above example assumes "myvar" is declared. In order for this to > work, I have to know ahead of tim

optparse commandline

2007-07-08 Thread vvikram
I want to call some function from my program and just pass it a commandline. It should parse the commandline and return back a list of parsed arguments (just like the sys.argv list) Example: foo.parse_cmdline("/usr/bin/foorun -v -d -h") ==> ['/usr/bin/foorun', '-v', '-d','-h'] Any suggestions on

Re: socket: connection reset by server before client gets response

2007-07-08 Thread Hendrik van Rooyen
"ahlongxp" <[EMAIL PROTECTED]> wrote: > me again. > > "Connection reset by peer" happens about one in fifth. > I'm using python 2.5.1 and ubuntu 7.04. > Try to wait a while in the server thread, after sending the message before closing the connection, to give the message time to get transmi

Re: Where is the syntax for the dict() constructor ?!

2007-07-08 Thread Hendrik van Rooyen
"John Machin" <[EMAIL PROTECTED]> wrote: 8< nice explanation of quoting problems - > (2) A field containing an odd number of " characters (or more > generally, not meeting whatever quoting convention might be expected > in the underlying data) should be treated with suspi

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Adriano Varoli Piazza
Twisted wrote: [...] BASTA. Basta, cazzo (unprintable, Italian). Stop it. It wasn't funny 10 messages into your subthread, and it's even less fun now. It's obvious you're trolling, but nevertheless, in the undescribably improbable case you _are_ being serious: a) Notepad is over there: --->* b) If

Re: Timing a python program run

2007-07-08 Thread i3dmaster
simplest way is just put a timer on start and another on the end, then calc the elapse. You can also take a look timeit module too which provides similar but more powerful functions... -Jim On Jul 7, 2007, at 12:21 PM, David wrote: > Hi, > > In matlab, I'd calculate the time for a script nam

Re: what is wrong with that r"\"

2007-07-08 Thread jimxu
Yeah, that's a good point... On Jul 8, 2007, at 1:48 AM, Tim Roberts wrote: > i3dmaster <[EMAIL PROTECTED]> wrote: >> >> Then you can use other chars as the delimiter, [EMAIL PROTECTED]@b@ or >> r!a!b!, >> etc... The import thing is so long as the interpreter doesn't get >> confused on the data

Re: __unicode__ method for exception object

2007-07-08 Thread Lawrence Oluyede
Ben Finney <[EMAIL PROTECTED]> wrote: > Your terminal has been detected as using the 'ascii' encoding, so > while that's true no attempt to output non-ASCII characters will work. > > You'll need to change whatever settings are on your terminal emulator > so that it is using an encoding (such as 'u

Re: socket: connection reset by server before client gets response

2007-07-08 Thread ahlongxp
> So, umm, what exactly are you trying to accomplish? > It looks like what is happening is the server only accepts 99 bytes. It > then does the send and the close. yes. What I want is that, server sends response to client and closes connection when it feels recieving enough information, and mak

Re: Unicode problem

2007-07-08 Thread [EMAIL PROTECTED]
> > What software did you use to make that so? The Python codec certainly > never would do such a thing. > > Are you sure it was latin-1 and \x27, and not windows-1252 and \x92? > > Regards, > Martin you're right...the source of text are html pages and obviously webmasters have poor knowledge o

Re: httplib module

2007-07-08 Thread Boris Ozegovic
Steve Holden wrote: >>> Why do I get double new lines when geting data from server? Example: > How? It's customary to include details when you've solved your own > problem in case someone else gets the same issue. Ok. In do_GET I had this two lines: for line in file: print line As you c

Re: socket: connection reset by server before client gets response

2007-07-08 Thread Frank Swarbrick
ahlongxp wrote: >> Post the code. > ok. > here is the code: > > # Echo server program > import socket > > HOST = '' # Symbolic name meaning the local host > PORT = 50007 # Arbitrary non-privileged port > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.setsoc

  1   2   >