Re: Short and simple functions (was: Re: Dr. Dobb's Python-URL! - weekly Python news and links (May 22))

2006-05-22 Thread Peter Otten
Ben Finney wrote: > "Andy Salnikov" <[EMAIL PROTECTED]> writes: >> "Too many" is always opposite to "hard to make a mistake", at least >> in my mind. > > I parsed the assertion as: > > (It's hard to > (make a mistake > (by having > (too many > (short and simple)

New beginner to python for advice

2006-05-22 Thread Minlar Ginger
HIi all: I am a new beginner to python, would you like give me some advice on studying it? Welcome to list some book on python for me. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Short and simple functions (was: Re: Dr. Dobb's Python-URL! - weekly Python news and links (May 22))

2006-05-22 Thread Ben Finney
"Andy Salnikov" <[EMAIL PROTECTED]> writes: > "Peter Otten" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > QOTW: "It's hard to make a mistake by having too many short and simple > > functions. And much too easy to make them when you have too few ;-)" > > - Thomas Bartkus > > >

logging

2006-05-22 Thread Baurzhan Ismagulov
Hello all, I want that each module has its own logger. I've defined the following config file: [formatters] keys=f01 [handlers] keys=console [loggers] keys=root,l01 [formatter_f01] format=%(name)s: %(message)s [handler_console] class=StreamHandler args=[] formatter=f01 [logger_root] level=CR

Re: Dr. Dobb's Python-URL! - weekly Python news and links (May 22)

2006-05-22 Thread Peter Otten
Andy Salnikov wrote: >> QOTW: "It's hard to make a mistake by having too many short and simple >> functions. And much too easy to make them when you have too few ;-)" >> - Thomas Bartkus >> > And of course there is a mathematical proof of that provided > somewhere, isn't it? :) If there were a

Re: groupby

2006-05-22 Thread Paul McGuire
"Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > George Sakkis wrote: > > "The returned group is itself an iterator that shares the underlying > > iterable with groupby(). Because the source is shared, when the groupby > > object is advanced, the previous group is no longer vi

Re: groupby

2006-05-22 Thread Bryan
George Sakkis wrote: > Bryan wrote: > >> can some explain why in the 2nd example, m doesn't print the list [1, 1, 1] >> which i had expected? >> >> >> >>> for k, g in groupby([1, 1, 1, 2, 2, 3]): >> ... print k, list(g) >> ... >> 1 [1, 1, 1] >> 2 [2, 2] >> 3 [3] >> >> >> >>> m = list(groupby

Re: No math module??

2006-05-22 Thread Serge Orlov
WIdgeteye wrote: > I have been trying to run a python program and I get the following > error: > Traceback (most recent call last): > Fil e "", line 39, in ? That doesn't look like a python program, File "" means it's an embedded script. When a script is embedded it is responsibility of the calle

Re: groupby

2006-05-22 Thread George Sakkis
Bryan wrote: > can some explain why in the 2nd example, m doesn't print the list [1, 1, 1] > which i had expected? > > > >>> for k, g in groupby([1, 1, 1, 2, 2, 3]): > ... print k, list(g) > ... > 1 [1, 1, 1] > 2 [2, 2] > 3 [3] > > > >>> m = list(groupby([1, 1, 1, 2, 2, 3])) > >>> m > [(1,

Re: No math module??

2006-05-22 Thread WIdgeteye
On Tue, 23 May 2006 12:40:49 +1000, Ben Finney wrote: Ok this is weird. I checked: /usr/local/lib/python2.3/lib-dynload/math.so Just as you have on your system and it's there. So why in the heck isn't it loading with: import math This is strange. > WIdgeteye <[EMAIL PROTECTED]> writes

groupby

2006-05-22 Thread Bryan
can some explain why in the 2nd example, m doesn't print the list [1, 1, 1] which i had expected? >>> for k, g in groupby([1, 1, 1, 2, 2, 3]): ... print k, list(g) ... 1 [1, 1, 1] 2 [2, 2] 3 [3] >>> m = list(groupby([1, 1, 1, 2, 2, 3])) >>> m [(1, ), (2, ), (3, )] >>> list(m[0][1]) []

Re: module confict? gmpy and operator

2006-05-22 Thread Tim Peters
[EMAIL PROTECTED] > ##Holy Mother of Pearl! > ## > ##>>> for i in range(10): > ##for j in range(10): > ##print '%4d' % (gmpy.mpz(i)*gmpy.mpz(j)), > ##print > ## > ## > ## 0000000000 > ## 012

Re: No math module??

2006-05-22 Thread Ben Finney
WIdgeteye <[EMAIL PROTECTED]> writes: > ImportError: No module named math > [...] > I have been using python on my computer since it first came out and > this is the first time I have runinto this. I have Python 2.3.2 > installed on Slackware Linux. I installed it from source download > from the

Re: Too big of a list? and other problems

2006-05-22 Thread John Machin
On 23/05/2006 10:19 AM, Brian wrote: > First off, I am sorry for cluttering this group with my inept > questions, but I am stuck again despite a few hours of hair pulling. > > I have a function (below) that takes a list of html pages that have > images on them (not porn but boats). This function

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-22 Thread Robert Kern
Jim Lewis wrote: > Still problems :-( > > I have a directory c:\data\code\test\pyrex containing: > > build_and_install.bat: > "C:\program files\Python\python.exe" setup.py build_ext > --compiler=mingw32 > pause > But running run.py gives: "ImportError: No module named worldimport" > > Should wo

Re: Too big of a list? and other problems

2006-05-22 Thread Brian
Tim Chase wrote: > While I'm not sure if this is the issue, you might be having some > trouble with the greediness of the "*" repeater here. HTML like > > > > will yield a result of > > "images/1.jpeg"> > rather than the expected > > "images/1.jpeg" > > You can make it "stingy" (rat

Re: NEWB: reverse traversal of xml file

2006-05-22 Thread Serge Orlov
manstey wrote: > Hi, > > I have an xml file of about 140Mb like this: > > > > ... > 1 > > > ... > 2 > > > ... > 1 > > > > I want to traverse it from bottom to top and add another field to each > record 1 > which would give the highest value of wordpartWT

Re: Too big of a list? and other problems

2006-05-22 Thread Tim Chase
> pics = re.compile(r"images/.*\.jpeg") While I'm not sure if this is the issue, you might be having some trouble with the greediness of the "*" repeater here. HTML like will yield a result of "images/1.jpeg"> My first thought would be to install the BeautifulSoup parser, a

No math module??

2006-05-22 Thread WIdgeteye
I have been trying to run a python program and I get the following error: Traceback (most recent call last): File "", line 39, in ? File "/home/Larry/.blender/scripts/bzflag/__init__.py", line 22, in ? import BZfileRead File "/home/Larry/.blender/scripts/bzflag/BZfileRead.py", line 24, i

module confict? gmpy and operator

2006-05-22 Thread [EMAIL PROTECTED]
##Holy Mother of Pearl! ## ##>>> for i in range(10): ##for j in range(10): ##print '%4d' % (gmpy.mpz(i)*gmpy.mpz(j)), ##print ## ## ## 0000000000 ## 0123156729 ##

Re: Too big of a list? and other problems

2006-05-22 Thread Brian
Thank you for your insight. It appears that using .extend rather than .append solved the problem. Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Too big of a list? and other problems

2006-05-22 Thread Paul McGuire
"Brian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > First off, I am sorry for cluttering this group with my inept > questions, but I am stuck again despite a few hours of hair pulling. > Don't apologize for getting stuck, especially after you have made an honest effort at solving

Re: Too big of a list? and other problems

2006-05-22 Thread Ben Finney
"Brian" <[EMAIL PROTECTED]> writes: > First off, I am sorry for cluttering this group with my inept > questions Questions aren't a problem; we all come here to learn at some point. I will ask you, though, to learn effective quoting when you respond to someone's post (i.e. quote relevant material

Re: Too big of a list? and other problems

2006-05-22 Thread Terry Reedy
"Brian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > First off, I am sorry for cluttering this group with my inept > questions, but I am stuck again despite a few hours of hair pulling. > > I have a function (below) that takes a list of html pages that have > images on them (not

NEWB: reverse traversal of xml file

2006-05-22 Thread manstey
Hi, I have an xml file of about 140Mb like this: ... 1 ... 2 ... 1 I want to traverse it from bottom to top and add another field to each record 1 which would give the highest value of wordpartWTS for each record for each word so if wordparts for the

Re: global name not defined

2006-05-22 Thread Paul McGuire
"NetKev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You are probably right and I think I will do so but just for the sake > of my understanding of python...I noticed somthing. process_log takes > two arguments when called but it's definition has 3 and one of them is > "self". S

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-22 Thread Jim Lewis
Still problems :-( I have a directory c:\data\code\test\pyrex containing: build_and_install.bat: "C:\program files\Python\python.exe" setup.py build_ext --compiler=mingw32 pause setup.py: from distutils.core import setup from distutils.extension import Extension from Pyrex.Distutils import build

Too big of a list? and other problems

2006-05-22 Thread Brian
First off, I am sorry for cluttering this group with my inept questions, but I am stuck again despite a few hours of hair pulling. I have a function (below) that takes a list of html pages that have images on them (not porn but boats). This function then (supposedly) goes through and extracts the

Re: Software Needs Philosophers

2006-05-22 Thread Dan Mercer
"nikie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] : Xah Lee wrote: : : : I wonder where you get your historical "facts" form? (Monty Python : movies?) Let's just add a few fun facts: Yes, philosophy did flourish : in ancient greece, but liberty certainly didn't. Yes, Athens was (

Re: Running script in __main__ shows no output in IDLE

2006-05-22 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I just downloaded the most recent (2.4.3) Python and IDLE (1.1.3) to > Windows XP Professional. I'm new to the IDLE environment, so hopefully > someone can tell me what I'm missing here! Below is the code, which I'm > editing within IDLE, and attempting to test with the R

Re: global name not defined

2006-05-22 Thread NetKev
You are probably right and I think I will do so but just for the sake of my understanding of python...I noticed somthing. process_log takes two arguments when called but it's definition has 3 and one of them is "self". So I'm thinking if I modify my warn_Admin definition to include "self" and the

Re: Software Needs Philosophers

2006-05-22 Thread John Bokma
fupto: poster Dra¾en Gemiæ <[EMAIL PROTECTED]> wrote: > Timo Stamm wrote: >> Dra¾en Gemiæ schrieb: >> >>> Xah Lee wrote: >>> Software Needs Philosophers >>> >>> Welcome to my junk filters >> >> >> >> Thanks for informing each and every reader of the newsgroups >> comp.lang.per

Re: Software Needs Philosophers

2006-05-22 Thread Dražen Gemić
Timo Stamm wrote: > Dražen Gemić schrieb: > >> Xah Lee wrote: >> >>> Software Needs Philosophers >>> >> >> Welcome to my junk filters > > > > Thanks for informing each and every reader of the newsgroups > comp.lang.perl.misc, comp.lang.python, comp.lang.java.programmer, > comp.lang.lisp,

Re: Name conflict in class hierarchy

2006-05-22 Thread Scott David Daniels
bruno at modulix wrote: > Ralf Muschall wrote: >> Jeffrey Barish wrote: >> >> [overriding of base class member functions by subclass] >> In Python, a function not intended to be overriden should be either >> have a name starting with an underscore > > actually with *two* underscores. The sing

Re: global name not defined

2006-05-22 Thread Paul McGuire
"NetKev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I added a function 'warn_Admin' and defined it just before another > function 'process_log'. 'process_log' calls this warn_Admin' function. > However, when it gets called i get the following error every time: > --- > Traceback

Re: global name not defined

2006-05-22 Thread NetKev
google groups told me it had a "server error" the first time i posted this. Sorry for the dupe. Anyways the second one is more complete. Also, I made a mistake in my vocabulary. These are methods and not functions. -- http://mail.python.org/mailman/listinfo/python-list

global name not defined

2006-05-22 Thread NetKev
I added a function 'warn_Admin' and defined it just before another function 'process_log'. 'process_log' calls this warn_Admin' function. However, when it gets called i get the following error every time: --- Traceback (most recent call last): File "/usr/bin/denyhosts.py", line 202, in ? fi

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
"""I find it tiresome that Flash apologists believe technical advantages can overcome a need for open, community-driven, vendor-independent standards. """ :) -- http://mail.python.org/mailman/listinfo/python-list

Re: system(...) and unicode

2006-05-22 Thread andrew
The impression I got from the link I gave was that exec et al already had the appropriate unicode support; system seems to be the exception. Anyway, thanks for the info - that directory name is coming from a DOM call, and I'm pretty sure it's returning Unicode, so that makes sense. Andrew -- ht

Re: File attributes

2006-05-22 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I know how to "walk" a folder/directory using Python, but I'd like to > check the archive bit for each file. Can anyone make suggestions on > how I might do this? Thanks. > You must have Mark Hammond's win32 package installed, then you can (barely tested): import win3

Re: File attributes

2006-05-22 Thread Ben Cartwright
Ben Cartwright wrote: > [EMAIL PROTECTED] wrote: > > I know how to "walk" a folder/directory using Python, but I'd like to > > check the archive bit for each file. Can anyone make suggestions on > > how I might do this? Thanks. > > > Since the archive bit is Windows-specific, your first place to

Re: problem with my regex?

2006-05-22 Thread Brian
I sincerely appreciate your reply and the time you took to explain it. Thank you, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: File attributes

2006-05-22 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > I know how to "walk" a folder/directory using Python, but I'd like to > check the archive bit for each file. Can anyone make suggestions on > how I might do this? Thanks. Since the archive bit is Windows-specific, your first place to check is Mark Hammond's Python for

Re: system(...) and unicode

2006-05-22 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Hmmm. After reading > http://kofoto.rosdahl.net/trac/wiki/UnicodeInPython I tried: > > system(cmd.encode(getfilesystemencoding())) > > which works (nothing else changed). But that seems odd - is this a bug > (the asymmetry - I read files with os.listdir with n

Re: Python - Web Display Technology

2006-05-22 Thread Ben Finney
"SamFeltus" <[EMAIL PROTECTED]> writes: > I do find it interesting that Flash folks readily will acknowledge > that Flash has shortcomings, yet anti-Flash folks seem to have great > difficulty acknowledging Flash's positive features over HTML. Such > situations always make me suspicious Ludditism

global name not defined

2006-05-22 Thread NetKev
I added a function 'warn_Admin' and defined it just before another function 'process_log'. 'process_log' calls this warn_Admin' function. However, when it gets called i get the following error every time: --- Traceback (most recent call last): File "/usr/bin/denyhosts.py", line 202, in ? fi

File attributes

2006-05-22 Thread acatejr
I know how to "walk" a folder/directory using Python, but I'd like to check the archive bit for each file. Can anyone make suggestions on how I might do this? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: system(...) and unicode

2006-05-22 Thread andrew
Hmmm. After reading http://kofoto.rosdahl.net/trac/wiki/UnicodeInPython I tried: system(cmd.encode(getfilesystemencoding())) which works (nothing else changed). But that seems odd - is this a bug (the asymmetry - I read files with os.listdir with no explicit unicode handling, but need t

ANN: EasyExtend

2006-05-22 Thread Kay Schluehr
After fixing some more severe bugs last weekend I decided to go online with EasyExtend and its homepage yet. EasyExtend was my Python hobby-horse and fun project the last months. It was exactly the kind of programming from which I wanted to become surprised myself. EasyExtend is essentially a syst

Re: Software Needs Philosophers

2006-05-22 Thread Timo Stamm
Dražen Gemić schrieb: > Xah Lee wrote: >> Software Needs Philosophers >> > > Welcome to my junk filters Thanks for informing each and every reader of the newsgroups comp.lang.perl.misc, comp.lang.python, comp.lang.java.programmer, comp.lang.lisp, comp.lang.function about your junk filters

Re: Using metaclasses to inherit class variables

2006-05-22 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Fresh copies of class vars so the first one is the correct: ('foo', > 'bar', [], False) Ahh, yeah, then you definitely need the copy.copy call. import copy class ClassVars(type): > ... def __init__(cls, name, bases, dict): > ... for name, valu

Re: Running script in __main__ shows no output in IDLE

2006-05-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I just downloaded the most recent (2.4.3) Python and IDLE (1.1.3) to > Windows XP Professional. I'm new to the IDLE environment, so hopefully > someone can tell me what I'm missing here! Below is the code, which I'm > editing within IDLE, and attempting to test with th

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread Andrew Robert
Hey Bruno, Although I have not tested it, this appears to be it exactly. Some confusion though. > import struct > > class TriggerMessage(object): > def __init__(self,data): > """ > Unpacks the passed binary data based on the > MQTCM2 format dictated in >

Re: problem with my regex?

2006-05-22 Thread Bruno Desthuilliers
Brian a écrit : > I have a simple script below that is causing me some problems and I am > having a hard time tracking them down. Here is the code: > > import urllib > import re > > def getPicLinks(): > found = [] > try: > page = > urllib.urlopen("http://continuouswave.com/whaler

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
Sorry for not being clear. Fresh copies of class vars so the first one is the correct: ('foo', 'bar', [], False) >>> import copy >>> >>> class ClassVars(type): ... def __init__(cls, name, bases, dict): ... for name, value in type(cls).classVars.iteritems(): ... if name not

Re: PHP's openssl_sign() using M2Crypto?

2006-05-22 Thread KW
On 2006-05-22, [EMAIL PROTECTED] wrote: > Does this work?: > > key = M2Crypto.EVP.load_key(keyfile, lambda x: passphr) > key.sign_init() > key.sign_update(message) > signature = key.final() No, I get this: AttributeError: PKey instance has no attribute 'sign_init' Best regards, -- Konrad -- htt

problem with my regex?

2006-05-22 Thread Brian
I have a simple script below that is causing me some problems and I am having a hard time tracking them down. Here is the code: import urllib import re def getPicLinks(): found = [] try: page = urllib.urlopen("http://continuouswave.com/whaler/cetacea/";) except: print

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread Bruno Desthuilliers
Andrew Robert a écrit : > Hi Everyone, > > I am having a problem with a class and hope you can help. > > When I try to use the class listed below, I get the statement that self > is not defined. > > test=TriggerMessage(data) > var = test.decode(self.qname) > > I would have thought

Re: Software Needs Philosophers

2006-05-22 Thread Tim Churches
Xah Lee wrote: > Software Needs Philosophers > > by Steve Yegge, 2006-04-15. > > Software needs philosophers. > > People don't put much stock in philosophers these days. The popular > impression of philosophy is that it's just rhetoric, just frivolous > debating about stuff that can never proper

Re: Includeing Python in text files

2006-05-22 Thread Erik Max Francis
Paolo Pantaleo wrote: > I am working on this: > > I have a text file, containig certain section in the form >python code here > py?> > > I parse the text file and substitute the python code with its result > [redirecting sys.stdin to a StringIO]. It something like php or > embedded perl. >

Re: PEP 3102 for review and comment

2006-05-22 Thread Talin
Allowing keyword arguments without defaults may seem like a syntactical change, but in fact it's not. You can do this in Python now - any argument can be a 'keyword' argument, whether it has a default value or not. So for example: def func( a, b, c=0 ): pass func( a=1, b=2, c=3 ) In other wor

system(...) and unicode

2006-05-22 Thread andrew
Hi, I'm seeing the following error: ... system(cmd) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 57: ordinal not in range(128) and I think I vaguely understand what's going on - "cmd" is constructed to include a file name that is UTF-8 encoded (I think - it

Pydev release 1.0.7

2006-05-22 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.0.7 have been released Check http://www.fabioz.com/pydev for details on Pydev Extensions and http://pydev.sf.net for details on Pydev Release Highlights in Pydev Extensions: - - Mark Occurrences

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
Don't worry, you won't have to look if it makes you feel dirty... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - Web Display Technology

2006-05-22 Thread Roel Schroeven
Sybren Stuvel schreef: > SamFeltus enlightened us with: >> 1. Loss of back button >> Isn't this really a myth? > > No, it isn't a myth. Pressing the back button is the action second > most performed in a browser, clicking a link being the first. People > want to go back from where they came. I do

Re: ftplib.ftpcp(), undocumented function?

2006-05-22 Thread John J. Lee
[EMAIL PROTECTED] writes: > Hi all, > I found this function recently when I read the source code of ftplib > module, I almost omit it at all and have tried to write it myself for > FXP work. > It seems exist long long ago, but never appeared in any document, > anyone knows why? > Is its implement

freeze tool like perl2exe?

2006-05-22 Thread Jerry
I am looking for a freeze tool for Python that is similar to perl2exe in that I can "compile" a script on one platform that is built for another. Basically, I would like to be able to build a Python script for Solaris using my Windows workstation. Is there any tool that fits the bill? Thanks, Je

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
Nah, the world needs more Flashy WebSites, :) But I do renounce my uglier criticisms of HTML. I realize now it is just a completely different mindset, not a bad technology. Python is far easier than PHP IMO. Especially if there is minimal HTML, I mostly just want to get at a database and manipu

Re: Using metaclasses to inherit class variables

2006-05-22 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Oops! This isn't working. As the sequence I'm trying for is def set_classvars(**kwargs): > ... def __metaclass__(name, bases, classdict): > ... for name, value in kwargs.iteritems(): > ... if name not in classdict: > ...

Re: Python - Web Display Technology

2006-05-22 Thread Paul Rubin
"SamFeltus" <[EMAIL PROTECTED]> writes: > I am uncomfortable with the seperating of the code from the visual/time > element, as well as the lack of emphasis on the visual/time element. Maybe you should buy a camcorder and make movies, instead of doing web sites. > I am not a big Perl/PHP fan, I f

Re: Dr. Dobb's Python-URL! - weekly Python news and links (May 22)

2006-05-22 Thread Andy Salnikov
"Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > QOTW: "It's hard to make a mistake by having too many short and simple > functions. And much too easy to make them when you have too few ;-)" > - Thomas Bartkus > And of course there is a mathematical proof of that prov

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Russell E. Owen
+1 It does seem like a natural unificiation of the language -- one less exception to learn. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - Web Display Technology

2006-05-22 Thread Sybren Stuvel
SamFeltus enlightened us with: > 1. Loss of back button > Isn't this really a myth? No, it isn't a myth. Pressing the back button is the action second most performed in a browser, clicking a link being the first. People want to go back from where they came. > A page with a time dimension, be it F

Re: PEP 3102 for review and comment

2006-05-22 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, "Talin" <[EMAIL PROTECTED]> wrote: > (Note: PEPs in the 3xxx number range are intended for Python 3000, > however this particular PEP may be backported if there is support for > it.) > > PEP: 3102 > Title: Keyword-Only Arguments ... > Syntactically, the propos

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread Dennis Benzinger
wes weston schrieb: > Andrew Robert wrote: > >> wes weston wrote: >> >>> Andrew Robert wrote: >>> Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined.

Re: Option parser question - reading options from file as well as command line

2006-05-22 Thread Tim N. van der Leeuw
Andrew Robert wrote: > Hi Everyone. > > > I tried the following to get input into optionparser from either a file > or command line. > > Hi Andrew, I played around a bit more, not happy that the read_file method which I discovered earlier on the Values - object takes a property-file like input an

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread wes weston
Andrew Robert wrote: > wes weston wrote: >> Andrew Robert wrote: >>> Hi Everyone, >>> >>> I am having a problem with a class and hope you can help. >>> >>> When I try to use the class listed below, I get the statement that self >>> is not defined. >>> >>> test=TriggerMessage(data) >> self i

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
This has all been very helpful. I've been struggling for awhile on which direction to go with computer programming. I realize the problem with HTML and the P language family is that although it makes sense to me, it doesn't really resonate with my perspective. Flash definitely does. I finally r

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread Andrew Robert
wes weston wrote: > Andrew Robert wrote: >> Hi Everyone, >> >> I am having a problem with a class and hope you can help. >> >> When I try to use the class listed below, I get the statement that self >> is not defined. >> >> test=TriggerMessage(data) > > self is not known here; only inside

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread wes weston
Andrew Robert wrote: > Hi Everyone, > > I am having a problem with a class and hope you can help. > > When I try to use the class listed below, I get the statement that self > is not defined. > > test=TriggerMessage(data) self is not known here; only inside the class. > var = tes

manual http request

2006-05-22 Thread Steve Young
Hi, I was wondering if there's a way to mimic a web pages' form and just manually send the http request and get the html response without having to go through a browser. For example, lets say i wanted to make a search on google of the key word "cars" but i want to be able to get the results of

Class probkem - getting msg that self not defined

2006-05-22 Thread Andrew Robert
Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) var = test.decode(self.qname) I would have thought that self would have carried forward when I

Re: Software Needs Philosophers

2006-05-22 Thread Carl J. Van Arsdall
vjg wrote: > nikie wrote: > >> (BTW: Have you ever considered the possibility that philosophers might >> not be interested in tab-versus-spaces-debates in the first place? >> Maybe they have more interesting matters to discuss. Just like the rest >> of us.) >> > > Debate? There's no valid d

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
Oops! This isn't working. As the sequence I'm trying for is >>> def set_classvars(**kwargs): ... def __metaclass__(name, bases, classdict): ... for name, value in kwargs.iteritems(): ... if name not in classdict: ... classdict[name] = value ...

Re: performance difference between OSx and Windows

2006-05-22 Thread Scott David Daniels
Brian wrote: > As one additional question, can someone point me in the direction of a > resource that would explain how I could use Python to tell me what core > is actually handling the process? I am not even sure if something like > this exists, but it would be an interesting feature to explore.

Re: Software Needs Philosophers

2006-05-22 Thread vjg
nikie wrote: > > (BTW: Have you ever considered the possibility that philosophers might > not be interested in tab-versus-spaces-debates in the first place? > Maybe they have more interesting matters to discuss. Just like the rest > of us.) Debate? There's no valid dabate. Tabs bad. Spaces good.

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
Much better. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP's openssl_sign() using M2Crypto?

2006-05-22 Thread heikki
KW wrote: > The openssl module in PHP basicly does this (C code): > EVP_SignInit(&md_ctx, EVP_sha1()); > EVP_SignUpdate(&md_ctx, data, data_len); > EVP_SignFinal(&md_ctx, sigbuf, &siglen, pkey); > > Looks like some magic is used to get pkey, I think that's what I'm missing. > See php_openssl_

MAC Laptop right click/drag mouse button TKinter

2006-05-22 Thread spohle
hi, i programmed a small app with TK and use TK. some of the functions are called with events like rightDrag and rightClick on an item on the canvas. that works fine on a pc. on my mac laptop i only have the one button, so im used to use CTRL+ Mouse Button. that doesn't work with TK. any ideas ho

COM Server crashing when returning large arrays

2006-05-22 Thread Alastair Alexander
Hi ... I'm using pythoncom to create a python COM server application that needs to be able to return large arrays to COM client apps. For example, I need to be able to return an array to Excel that is 500 by 10, with each element of the array holding a 32 byte string. If I run the code for smal

Re: Python - Web Display Technology

2006-05-22 Thread Edward Elliott
SamFeltus wrote: > 1. Loss of back button > Isn't this really a myth? A page with a time dimension, be it Flash, > HTML/JS or whatever, breaks the back button. A page without a time > dimension doesn't break the back button. Should we now and forever > more give up the time dimension to avoid b

Re: Using metaclasses to inherit class variables

2006-05-22 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > OK no question. I'm only posting b/c it may be something another newbie > will want to google in the future. Now that I've worked thru the > process this turns out to be fairly easy. > > However, if there are better ways please let me know. > > Module = ClassVars.py >

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Edward Elliott
bruno at modulix wrote: > Edward Elliott wrote: >> You mean like this: >> >> s = "foo" + "bar" >> s = 'foo' + 'bar' >> s = 'foo' 'bar' >> s = '%s%s' % ('foo', 'bar') [snip] > The real mantra is actually : > "There should be one-- and preferably only one --obvious way to do it" > > Please note th

Re: Python - Web Display Technology

2006-05-22 Thread dingbat
SamFeltus wrote: > Here is a visual argument, > http://samfeltus.com/swf/contact_globes.swf Here's a text-based argument. If I search Golge for "gardener, Athens, GA" then Google's spiders won't have recorded your contact page. So I don't find you as a local gardener, so I don't hire you for my

Re: Python - Web Display Technology

2006-05-22 Thread Blair P. Houghton
Sybren Stuvel wrote: > Heiko Wundram enlightened us with: > > And: the web is a platform to offer _information_. Not to offer > > shiny graphics/sound [...] > > Many would disagree... > > Not me, but I know a lot of people that would. I would. Most people would, once they realize that shiny/flas

[ANN] pglib 0.1

2006-05-22 Thread Manlio Perillo
I'm pleasant to announce the first public release of pglib. pglib is an implementation of the PostgreSQL protocol, version 3.0. It is written in Twisted, and aims to be a complete replacement for libpq. In the current version the extended query sub protocol is not supported. The project can be f

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
OK no question. I'm only posting b/c it may be something another newbie will want to google in the future. Now that I've worked thru the process this turns out to be fairly easy. However, if there are better ways please let me know. Module = ClassVars.py import copy class ClassVars(type): c

Re: Python - Web Display Technology

2006-05-22 Thread Paul Rubin
"SamFeltus" <[EMAIL PROTECTED]> writes: > As for the blind issue,that makes no sense to me. Is the suggestion > that we should give up using images in web sites since some people > can't see them. Might as well throw out the use of the img tag while > we are at it? Img tags should always have al

Re: string.count issue (i'm stupid?)

2006-05-22 Thread BartlebyScrivener
We were doing something like this last week thestring = "a_a_a_a_" >>> for x in range(len(thestring)): ... try: ... thestring.count("_a_", x, x + 3) ... except ValueError: ... pass -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with writing a simple module

2006-05-22 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > ello there. i am having a problem getting a module to work right. > > i wrote a class that is going to be used in a few different scripts in > the same directory. > > it looks like this: > > #!/usr/bin/python This is not needed for a module. (snip code) > the file is

  1   2   >