Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread alex23
On Aug 21, 11:36 pm, Jonathan Fine jf...@pytex.org wrote: It might seem odd to use 'apply' as a decorator, but it can make sense. Yes, it's an idiom I've used myself for property declarations, but one I find myself using less often: class ColourThing(object): @apply def rgb():

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread alex23
Jonathan Gardner jgard...@jonathangardner.net wrote: This is brilliant. I am going to use this more often. I've all but given up on property() since defining get_foo, get_bar, etc... has been a pain and polluted the namespace. Unfortunately I can't remember who I first learned it from - it was

Re: 2.6 windows install

2009-08-20 Thread alex23
Tim Arnold tim.arn...@sas.com wrote: Any ideas on what I'm missing here? Most likely the required configuration of the local environments. Did you install Python to the network device from your XP box? That would explain why you can run it: the required registry settings environment variables

Re: How do I convert an iterator over bytes into a str?

2009-08-19 Thread alex23
markscottwright markscottwri...@gmail.com wrote: Thanks Jan (and all other responders).  I suppose I shouldn't be surprised - it's a known wart (http://wiki.python.org/moin/ PythonWarts), but it just looks so darn wrong. Don't forget that it's exceptionally easy to create your own mechanism

Re: how to overload operator (a x b)?

2009-08-08 Thread alex23
Diez B. Roggisch de...@nospam.web.de wrote: Not really. I didn't get the chaining, and Peter is right that for that there is no real overloading. I'm sorry, I don't really get why overloading lt gt isn't an answer to the OP's question... His terminology may not have been correct but I'm not

Re: Python docs disappointing - group effort to hire writers?

2009-08-08 Thread alex23
Paul Rubin http://phr...@nospam.invalid wrote: Stephen, Alex, etc.: have you actually used the php.net doc system? Don't knock it til you've tried it.  IMO it is superior to Python's system.   I've tried it, a lot. Is it okay for me to keep criticising it now, or would you like some time to

Re: how to kill subprocess when Python process is killed?

2009-08-07 Thread alex23
On Aug 7, 3:42 pm, mark.v.we...@gmail.com mark.v.we...@gmail.com wrote: When I kill the main process (cntl-C) the subprocess keeps running. How do I kill the subprocess too? The subprocess is likey to run a long time. You can register functions to run when the Python process ends by using the

Re: how to overload operator (a x b)?

2009-08-07 Thread alex23
On Aug 7, 10:50 pm, Benjamin Kaplan benjamin.kap...@case.edu wrote: That isn't an operator at all. Python does not support compound comparisons like that. You have to do a b and b c. You know, it costs nothing to open up a python interpreter and check your certainty: x = 10 1 x 20 True

Re: unicode() vs. s.decode()

2009-08-07 Thread alex23
Thorsten Kampe thors...@thorstenkampe.de wrote: Bollocks. No one will even notice whether a code sequence runs 2.7 or 5.7 seconds. That's completely artificial benchmarking. But that's not what you first claimed: I don't think any measurable speed increase will be noticeable between those

Re: Python docs disappointing - group effort to hire writers?

2009-08-07 Thread alex23
Paul Rubin http://phr...@nospam.invalid wrote: Such evaluation would only do them good.  The official docs are full of errors and omissions, which is why we have this thread going on here in the newsgroup. And there is a process for reporting and correcting such errors and omissions, which is

Re: Extracting matrix from a text file

2009-08-07 Thread alex23
On Aug 8, 2:19 am, bbarb...@inescporto.pt wrote: I am new in python, and I am running it on Mac with Smultron editor. I   need to read a textfile that includes numbers (in a matrix form),   indexes, and strings, like this: Marsyas-kea distance matrix for MIREX 2007 Audio Similarity Exchange

Re: PEP 8 exegetics: conditional imports?

2009-08-07 Thread alex23
On Aug 8, 2:50 am, kj no.em...@please.post wrote: Conditional imports make sense to me, as in the following example[...] And yet, quoth PEP 8:     - Imports are always put at the top of the file, just after any module       comments and docstrings, and before module globals and constants.

Re: Extracting matrix from a text file

2009-08-07 Thread alex23
MRAB pyt...@mrabarnett.plus.com wrote: Or:          columns = line.split(' ')[1 : ] Even better, well spotted. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug or feature: double strings as one

2009-08-07 Thread alex23
kj no.em...@please.post wrote: Feature, as others have pointed out, though I fail to see the need for it, given that Python's general syntax for string (as opposed to string literal) concatenation is already so convenient.  I.e., I fail to see why x = (first part of a very long string      

Re: unicode() vs. s.decode()

2009-08-07 Thread alex23
garabik-news-2005...@kassiopeia.juls.savba.sk wrote: I am not sure I understood that. Must be my English :-) I just parsed it as blah blah blah I won't admit I'm wrong and didn't miss anything substantive. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python docs disappointing - group effort to hire writers?

2009-08-07 Thread alex23
Kee Nethery k...@kagi.com wrote: I'm looking forward to the acceleration of improvements to the   official docs based upon easy to provide user feedback. Glad to see   that the bug tracking system is going to not be the primary means for   documentation changes. I'm not sure what you see as

Re: Python docs disappointing - group effort to hire writers?

2009-08-07 Thread alex23
David Robinow drobi...@gmail.com wrote:  When one believes that development is controlled by a cabal which is jealous of outsiders and actively prevents improvements to the docs, any change, even if only in perception, helps to weaken the hold of the evil forces holding back the success of

Re: Is feedparser deprecated?

2009-08-07 Thread alex23
John Nagle na...@animats.com wrote:    Feedparser requires SGMLlib, which has been removed from Python 3.0. Feedparser hasn't been updated since 2007. Does this mean Feedparser is dead? Wouldn't you be better served asking this on the feedparser bug tracker?

Re: PEP 8 exegetics: conditional imports?

2009-08-07 Thread alex23
Peter Otten __pete...@web.de wrote: This criterion is unlikely to be met for the examples you give above. time is a built-in module, and gzip a thin wrapper around zlib which is also built-in. This is something I was _utterly_ unaware of. Is there a list of what modules are built-in readily

Re: Python docs disappointing - group effort to hire writers?

2009-08-06 Thread alex23
Kee Nethery wrote: As I struggle through trying to figure out how to make python do   simple stuff for me, I frequently generate samples. If some volunteer   here would point me towards the documentation that would tell me how I   can alter the existing Python docs to include sample code, I'd

Re: Help with regex

2009-08-06 Thread alex23
On Aug 7, 1:35 am, Robert Dailey rcdai...@gmail.com wrote: I'm creating a python script that is going to try to search a text file for any text that matches my regular expression. The thing it is looking for is: FILEVERSION 1,45,10082,3 Would it be easier to do it without regex? The

Re: Python docs disappointing - group effort to hire writers?

2009-08-06 Thread alex23
Paul Rubin http://phr...@nospam.invalid wrote: The PHP docs as I remember are sort of regular (non-publically editable) doc pages, each of which has a public discussion thread where people can post questions and answers about the topic of that doc page.  I thought it worked really well.  The

Re: trouble with complex numbers

2009-08-05 Thread alex23
On Aug 5, 4:28 pm, Dr. Phillip M. Feldman pfeld...@verizon.net wrote: When I try to compute the phase of a complex number, I get an error message: [...] Any advice will be appreciated. 1. What version of Python are you using, and on what platform? 2. What you snipped is necessary to help

Re: intricated functions: how to share a variable

2009-08-05 Thread alex23
TP tribulati...@paralleles.invalid wrote: Then, as advised Diez, perhaps the best solution is to have true global variables by using a class and defining the variable a as a member self.a of the class. By doing like this, a will be known everywhere. Or, as Bearophile suggested, you could use

Re: trouble with complex numbers

2009-08-05 Thread alex23
Piet van Oostrum p...@cs.uu.nl wrote: That should be z += 0j Pardon my ignorance, but could anyone explain the rationale behind using 'j' to indicate the imaginary number (as opposed to the more intuitive 'i')? (Not that I've had much call to use complex numbers but I'm curious) --

Re: trouble with complex numbers

2009-08-05 Thread alex23
On Aug 6, 1:18 am, Scott David Daniels scott.dani...@acm.org wrote: I think it explained in the complex math area, but basically EE types use j, math types use i for exactly the same thing.  Since i is so frequently and index in CS, and there is another strong convention, why not let the EE

Re: Subclassing Python's dict

2009-08-05 Thread alex23
Xavier Ho wrote: You should subclass collections.UserDict, and not the default dict class. Refer to the collections module. Xavier, why do you think that is the correct approach? The docs say The need for this class has been largely supplanted by the ability to subclass directly from dict (a

Re: Python docs disappointing - group effort to hire writers?

2009-08-04 Thread alex23
On Aug 4, 3:55 pm, David Lyon david.l...@preisshare.net wrote: It isn't totally about the writers... Peoples egos are also at stake - it seems. Citation please. If Fred X wrote Doc Y.. they don't want their name taken off.. So they generally speaking don't want the docs changed. Ditto. If

Re: Compiling regex inside function?

2009-08-03 Thread alex23
Anthra Norell anthra.nor...@bluewin.ch wrote: def entries (l):         r = re.compile ('([0-9]+) entr(y|ies)')         match = r.search (l)         if match: return match.group (1) So the question is: does r get regex-compiled once at py-compile time or repeatedly at entries() run time?

Re: Help understanding the decisions *behind* python?

2009-08-03 Thread alex23
John Nagle na...@animats.com wrote: Every function returned a tuple as an argument. This had a nice symmetry; function outputs and function inputs had the same form.   Mesa was the first language to break through the single return value syntax problem.     Python doesn't go that far. I

Re: no-clobber dicts?

2009-08-03 Thread alex23
Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: I also have a series of unit tests for it if you're interested in them. That's several times today that kj has asked a question and you've responded with ready-to-go code. If this was Stackoverflow, I'd accuse you of

Re: Generate a new object each time a name is imported

2009-08-02 Thread alex23
On Aug 3, 4:07 am, Terry Reedy tjre...@udel.edu wrote: Peter Otten wrote: Steven D'Aprano wrote: [...] Fantastic question, answer explanation, guys. Well done. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does underscore has any special built-in meaningin Python ?

2009-07-29 Thread alex23
On Jul 30, 3:59 am, dandi kain dandi.k...@gmail.com wrote: What is the functionality of __ or _ , leading or trailing an object , class ot function ? Is it just a naming convention to note special functions and objects , or it really mean someting to Python ? I think everyone else has covered

Re: Confessions of a Python fanboy

2009-07-29 Thread alex23
On Jul 30, 1:06 pm, r rt8...@gmail.com wrote: 1.) No need to use () to call a function with no arguments. Python -- obj.m2().m3() --ugly   Ruby -- obj.m1.m2.m3  -- sweeet! Man, i must admit i really like this, and your code will look so much cleaner. How do you distinguish between calling a

Re: IDLE Config Problems

2009-07-29 Thread alex23
On Jul 30, 6:55 am, Russ Davis russ.da...@njpines.state.nj.us wrote: I am just getting started with Python and have installed v. 2.5.4   Idle version 1.2.4  I can't seem to get the idle to display text.  It seems as if the install went fine.  I start up the idle and the screen is blank.  No

Re: Ideas for problem with chat server application!

2009-07-22 Thread alex23
On Jul 22, 6:27 pm, David Adamo Jr. dtgead...@yahoo.com wrote: Suggestions are highly appreciated. I haven't used it but I've heard good things about FireDaemon, which can run any script or program as a Windows service. Apparently the Lite version is free:

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

2009-07-16 Thread alex23
On Jul 16, 9:00 pm, akhil1988 akhilan...@gmail.com wrote: I have switched to python 3.1 , but now I am getting some syntax errors in the code: Python 3.x was a major release that endeavoured to clean up a number of lingering issues with the language, the upshot being that it isn't entirely

Re: turtle dump

2009-07-16 Thread alex23
On Jul 16, 9:18 pm, superpollo u...@example.net wrote: lol. ;-) the title was indeed supposed to stir a bit of curiosity upon the reader... Which isn't really useful when trying to obtain assistance... you want certainty, not curiosity. in fact i was looking for a *platform independent* way

Re: turtle dump

2009-07-16 Thread alex23
On Jul 16, 10:11 pm, superpollo u...@example.net wrote: actually i am still using 2.3.4, which means that... screen = turtle.Screen() ... is not possible Ah, sorry about that. My belief that turtle was a new module was based on a line from

Re: turtle dump

2009-07-16 Thread alex23
Help on method postscript: postscript(self, *args, **kw) method of turtle.ScrolledCanvas instance is spectacularly useless. This is from interactive help. The help in iPython says the same, but also mentions that it's a dynamically generated function, so it may not be picking up the

Re: one more question

2009-07-15 Thread alex23
amr...@iisermohali.ac.in wrote: I tried but its not coming. How much are you prepared to pay for help with this? Or are you just asking us to do all the work for you? -- http://mail.python.org/mailman/listinfo/python-list

Re: one more question

2009-07-15 Thread alex23
On Jul 15, 4:50 pm, alex23 wuwe...@gmail.com wrote: amr...@iisermohali.ac.in wrote: I tried but its not coming. How much are you prepared to pay for help with this? Or are you just asking us to do all the work for you? Or to be a _little_ less blunt: if you want people here to _assist_ you

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread alex23
On Jul 16, 10:41 am, alex23 wuwe...@gmail.com wrote: It's recommended that you search through the list for similar questions before posting. Of course, it's even MORE important that one actually ensures they're responding to the _same_ question before pointing at an answer... This older post

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread alex23
On Jul 16, 10:07 am, pdlem...@earthlink.net wrote: The WConio console module produces different colors, sometimes quite different, when run from Windows command line vs from Python interpreter .  A good foregnd/backgnd combination under one may be unreadable under the other  : ( I'm using

Re: one more question

2009-07-15 Thread alex23
On Jul 15, 5:51 pm, koranthala koranth...@gmail.com wrote:    I am not saying that what you said was wrong, only that I felt that she got tense looking up regular expressions. So a python reply which basically does the basic checking without going to re etc might be more helpful for her to

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread alex23
On Jul 16, 12:56 pm, Asun Friere afri...@yahoo.co.uk wrote: As you note there, this will work when running the vanilla shell (ie running  it from the command line), but not (potentially) in other interactive environments (IronPython being the example you give). Actually, that was IPython,

Re: does python have a generic object pool like commons-pool in Java

2009-07-15 Thread alex23
John, The environments in which I've been asked to develop webs apps using Python have all utilised mod_wsgi. Do you have any experience with mod_wsgi vs mod_fcgi, and if so, can you comment on any relevant performance / capability / ease-of-use differences? Cheers, alex23 -- http

Re: one more question

2009-07-15 Thread alex23
On Jul 16, 2:29 pm, koranthala koranth...@gmail.com wrote: It is not that I do want to do the work for them. It is just that I was in the same position just 6 months back. My first pieces of code were very poor - full of errors and quite horrible indeed. I was even afraid to post it anywhere.

Re: explode()

2009-07-14 Thread alex23
Fred Atkinson fatkin...@mishmash.com wrote:         I wish the Python site was as well written as the PHP site. On the PHP site, I can look up a command and they show not only the docs on that command but a list of all other commands associated with it.   Hey Fred, My problem is the complete

Re: How to use Python to interface with Web pages?

2009-07-08 Thread alex23
then 'test' == 'action' in terms of your requirements. Hope this helps. - alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: Remoting over SSH

2009-07-07 Thread alex23
On Jul 8, 12:46 am, Hussein B hubaghd...@gmail.com wrote: I want to perform commands on a remote server over SSH. What do I need? Take a look at pexpect: http://pexpect.sourceforge.net/pexpect.html -- http://mail.python.org/mailman/listinfo/python-list

Re: A Bug By Any Other Name ...

2009-07-06 Thread alex23
On Jul 6, 5:56 pm, Tim Golden m...@timgolden.me.uk wrote: Gabriel Genellina wrote: In this case, a note in the documentation warning about the potential confusion would be fine. The difficulty here is knowing where to put such a warning. You obviously can't put it against the ++ operator

Re: Basic question from pure beginner

2009-07-02 Thread alex23
Dennis Lee Bieber wlfr...@ix.netcom.com wrote:         There is also the getpass module to play with! I don't think I've ever seen getpass, so thanks for pointing that out. Unfortunately, it wouldn't have helped the OP understand why his original code wasn't working ;) --

Re: Accessing windows structures through ctypes.

2009-07-02 Thread alex23
On Jul 2, 3:42 pm, Rajat rajat.dud...@gmail.com wrote: Using ctypes can I access the windows structures like: PROCESS_INFORMATION_BLOCK, Process Environment Block(PEB), PEB_LDR_DATA, etc? ctypes.wintypes lists all of the Windows structures included with the module. You should be able to use

Re: Basic question from pure beginner

2009-07-01 Thread alex23
On Jul 1, 3:38 pm, sato.ph...@gmail.com sato.ph...@gmail.com wrote: I have been able to make the module quit after entering a password three times, but can't get it to quit right away after the correct one is entered.   Not with the code you pasted, you haven't. There's a missing colon on line

Re: Using Python to set desktop background image under Windows XP

2009-07-01 Thread alex23
On Jul 2, 8:02 am, ELLINGHAUS, LANCE lance.ellingh...@hp.com wrote: Does anyone have any code that would allow setting the desktop background image under Windows XP? It's amazing what typing python windows desktop into Google will find you: http://snippets.dzone.com/posts/show/3348 Any other

Re: Getting input the scanf way

2009-07-01 Thread alex23
On Jul 1, 6:33 pm, Mr.SpOOn mr.spoo...@gmail.com wrote: I need to do some kind of interactive command line program. I mean: I run the program, it asks me for input, I type something and then I get the output or other questions. I'm not sure what is the right way to achieve this. While the

Re: Open Source RSS Reader in Python?

2009-07-01 Thread alex23
On Jul 2, 9:18 am, Alex alex.lavoro.pro...@gmail.com wrote: I am looking for an open source RSS reader (desktop, not online) written in Python but in vain. I am not looking for a package but a fully functional software. Google: python open source (rss OR feeds) reader Any clue ? It's

Re: Basic question from pure beginner

2009-07-01 Thread alex23
On Jul 2, 3:47 am, Scott David Daniels scott.dani...@acm.org wrote: And even simpler:      PASSWORD = qwerty      MAXRETRY = 3      for attempt in range(MAXRETRY):          if raw_input('Enter your password: ') == PASSWORD:              print 'Password confirmed'              break # this

Re: handeling very large dictionaries

2009-06-28 Thread alex23
On Jun 29, 9:13 am, mclovin hanoo...@gmail.com wrote: Is there something like it that is more flexible? Have you seen the stdlib module 'shelve'? http://docs.python.org/library/shelve.html It creates a persistent file-based dictionary, which can hold any type of object as long as it can be

Re: pep 8 constants

2009-06-28 Thread alex23
Eric S. Johansson e...@harvee.org wrote: no, I know the value if convention when editors can't tell you anything about the name in question.  I would like to see more support for disabled programmers like myself and the thousands of programmers injured every year and forced to leave the

Re: object reincarnation

2009-06-11 Thread alex23
On Jun 11, 5:34 am, Manavan manava...@gmail.com wrote: Since the real world objects often needs to be deleted even if they have some reference from some other object [...] From this it sounds like you're trying to implement some form of weak referencing. Are you familiar with weakref? A weak

Re: TypeError: int argument required

2009-06-11 Thread alex23
On Jun 12, 1:56 pm, lucius lucius.fo...@gmail.com wrote:  w, h, absX, absY = result.group(3), result.group(4), result.group (5), result.group(6) w = 100 h = 200 absX = 10.0 absY = 20.0 Are you sure those values are ints floats? I would expect your regexp would be returning strings...

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread alex23
On Jun 10, 3:24 pm, John Yeung gallium.arsen...@gmail.com wrote: Alex, did you bother to read what I quoted?  Paul McGuire suggested an alternative in case the OP was choosing integers in a roundabout way. I was merely pointing out that Paul's solution can be more simply achieved using a

Re: random number including 1 - i.e. [0,1]

2009-06-09 Thread alex23
On Jun 10, 11:32 am, John Yeung gallium.arsen...@gmail.com wrote: On Jun 9, 8:39 pm, Paul McGuire pt...@austin.rr.com wrote: Are you trying to generate a number in the range [0,n] by multiplying a random function that returns [0,1] * n?  If so, then you want to do this using:

Re: Start the interactive shell within an application

2009-06-09 Thread alex23
. - alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: .pth files and figuring out valid paths..

2009-06-09 Thread alex23
On Jun 10, 8:00 am, rh0dium steven.kl...@gmail.com wrote: Apparently there is a problem with the if statement??? Try restructuring the if as a ternary condition: import os, site; smsc = os.environ.get(TECHROOT, /home/tech); smsc = smsc if os.path.isdir(smsc) else /home/tech; site.addsitedir

Re: Is there any module for sea tides?

2009-06-01 Thread alex23
alejandro aleksanda...@brisiovonet.hr wrote: I found some in C but could not find in Python The best I could find was a reference to some in-house code used by the US National Oceanoic Atmospheric Association: http://tinyurl.com/mct9zz You might be able to contact the email address at

Re: try except inside exec

2009-05-31 Thread alex23
exec. Hope this helps, alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling and transporting modules/libraries in python

2009-05-31 Thread alex23
device. You might also want to look into one of the portable Python set ups. This way you can have a fully portable environment that you control completely: Portable Python: http://www.portablepython.com/ Movable Python: http://www.voidspace.org.uk/python/movpy/ Hope this helps. alex23

Re: What text editor is everyone using for Python

2009-05-26 Thread alex23
On May 26, 3:01 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: I dislike Gnome's user-interface, and I find gedit slightly too underpowered and dumbed down for my taste. (Although it has a couple of nice features.) Gedit is also nicely extensible:

Re: How can i use Spread Sheet as Data Store

2009-05-19 Thread alex23
On May 19, 11:57 pm, D'Arcy J.M. Cain da...@druid.net wrote: I hear you but I'm not so sure that that is an absolute.  There are many applications that allow you to have your password emailed to you. For something with low risk that's perfectly acceptable. Having -any- password stored in

Re: strip char from list of strings

2009-05-19 Thread alex23
On May 20, 12:55 am, Laurent Luce laurentluc...@yahoo.com wrote: I had a simple loop stripping each string but I was looking for something concise and efficient. I like the following answer: x = [s.rstrip('\n') for s in x] Your initial requirement stated that you needed this to happen in-

Re: How to convert a list of strings to a tuple of floats?

2009-05-18 Thread alex23
On May 18, 5:51 pm, boblat...@googlemail.com boblat...@googlemail.com wrote: ['1.1', '2.2', '3.3'] - (1.1, 2.2, 3.3) Currently I'm disassembling the list by hand, like this:     fields = line.split('; ')     for x in range(len(fields)):         fields[x] = float(fields[x])     ftuple =

Re: http://orbited.org/ - anybody using it?

2009-05-17 Thread alex23
On May 18, 9:14 am, Aljosa Mohorovic aljosa.mohoro...@gmail.com wrote: can anybody comment onhttp://orbited.org/? is it an active project? does it work? I have no idea about your second question but looking at PyPI,the module was last updated on the 9th of this much, so I'd say it's very much

Re: x.abc vs x['abc']

2009-05-15 Thread alex23
On May 14, 5:49 am, Gunter Henriksen gunterhenrik...@gmail.com wrote: Presuming it is very common to have objects created on the fly using some sort of external data definitions, is there an obvious common standard way to take a dict object and create an object whose attribute names are the

Re: OS X: How to play .wav file w/Python?

2009-05-11 Thread alex23
On May 12, 11:55 am, kj so...@987jk.com.invalid wrote: import pygame.mixer pygame.mixer.init() pygame.mixer.Sound(bell.wav).play print done What am I doing wrong? Your first mistake is not pasting here the traceback you received. That always makes it easier to assist with problems like

Re: OOP Abstract Classes

2009-05-11 Thread alex23
On May 12, 1:22 am, Mike Driscoll kyoso...@gmail.com wrote: I've never used (or heard of) the Abstract type...and the guy who wrote the FAQ was being a jerk. It looks like he was just throwing in an undefined variable name just to make his Python program break while taking a pot shot at people

Re: Importing from a module which contains more than one Class...

2009-05-10 Thread alex23
GKalman kalma...@msn.com wrote: from MyClass import * from MyOtherClass import *     # error msg: no such module! As I mentioned above,  the code for MyClass MyOtherClass is in the same file . This program only works with a single Class in a file. That is when the File name is the SAME as

Re: free chart lib for Python?

2009-05-07 Thread alex23
On May 8, 12:27 pm, oyster lepto.pyt...@gmail.com wrote: is there such a thing with many kinds of chart, i.e. pie-chart, line-chart, ..? The best place to look is PyPI, there are several possible candidates there: http://pypi.python.org/pypi?%3Aaction=searchterm=chartssubmit=search I've

Re: list comprehension question

2009-05-06 Thread alex23
On May 6, 2:10 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: It's precisely the indentation and colons (plus newlines) that makes nested for-loops easier to read than list-comps with multiple fors. You can get back *nearly* all the readability by splitting the list comp

Re: list comprehension question

2009-05-05 Thread alex23
On May 6, 4:01 am, J. Cliff Dyer j...@sdf.lonestar.org wrote: The way you have to bounce your eyes back and forth in the comprehension makes it hard to read the logic.  With the loop, on the other hand it is blatantly obvious which way the nesting occurs. [ item for j in a if len(j)==2 for

Re: for with decimal values?

2009-05-03 Thread alex23
On May 4, 11:41 am, Esmail ebo...@hotmail.com wrote: All this discussion makes me wonder if it would be a good idea for Python to have this feature (batteries included and all) - it would have its uses, no? Well, sometimes more discussion == less consensus :) But it's really easy to roll your

Re: import and package confusion

2009-05-01 Thread alex23
On May 1, 4:24 pm, Arnaud Delobelle arno...@googlemail.com wrote: It's a challenge to do it in a list comprehension, but here it is! data 'AAABCDD' field_sizes [3, 5, 9, 2] [data[i:j] for j in [0] for s in field_sizes for i, j in [(j, j+s)]] ['AAA', 'B', 'C',

Re: import and package confusion

2009-04-30 Thread alex23
On Apr 30, 1:10 pm, Dale Amon a...@vnl.com wrote: I do not really see any other way to do what I want. If there is a way to get rid of the exec in the sample code I have used, I would love to know... but I can't see how to import something where part of the name comes from user command line

Re: import and package confusion

2009-04-30 Thread alex23
On Apr 30, 5:33 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: (doesn't work as written, because [...] Man, I don't get Python... I can write a program that runs properly on the first try but every time I post untested code to c.l.p I regret it... Thanks, Gabriel :) --

Re: command prompt history filtered by initial letters

2009-04-30 Thread alex23
On May 1, 8:01 am, limit todd.les...@gmail.com wrote: How do I get this command history filter working on the centos install? I see that ctrl-r allows history search. That is the workaround. If you can, try installing using iPython instead: http://ipython.scipy.org/ Along with a wealth of

Re: Web framework for embedded system

2009-04-29 Thread alex23
On Apr 30, 3:32 am, Thomas Heller thel...@python.net wrote: I'm very happy to see that these frameworks deliver ~10 pages per second (cherrypy) or ~3.5 pages per second (webpy) out of the box on a system that is 50 times slower than a typical desktop PC.  Of course these were very short pages.

Re: AtrributeDict

2009-04-29 Thread alex23
On Apr 30, 9:09 am, Дамјан Георгиевски gdam...@gmail.com wrote: I've needed an attribute accessible dict, so I created this. Are there any obviously stupid shortcomings? class AttrDict(dict):    def __getattr__(self, name):        try:            return self[name]        except KeyError,

Re: Web framework for embedded system

2009-04-28 Thread alex23
On Apr 28, 5:43 pm, Thomas Heller thel...@python.net wrote: I'm looking for a lightweight web-framework for an embedded system. [...] Does this sound sensible at all? Any suggestions? I'd highly recommend taking a look at CherryPy: http://www.cherrypy.org/ The developers describe it as a HTTP

Re: Presentation software for Python code

2009-04-24 Thread alex23
On Apr 24, 4:23 pm, Michael Hoffman 4g4trz...@sneakemail.com wrote: That looks like it would be perfect. Unfortunately it doesn't seem to work on my Windows laptop: I don't understand this. OpenGL Extensions Viewer says I have OpenGL 1.5 and the glGenBuffers function. That's a shame, if you

Re: Presentation software for Python code

2009-04-23 Thread alex23
On Apr 24, 3:52 am, Michael Hoffman 4g4trz...@sneakemail.com wrote: Does anyone here have software they would suggest for making a presentation that includes Python code? Other than that it would probably be mainly bullet points. I'm willing to consider TeX- and HTML-based approaches. How do

Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread alex23
On Apr 23, 2:13 am, Mike Driscoll kyoso...@gmail.com wrote: Technically speaking, Silverlight can be run with IronPython...which works on Windows and Linux (through Mono), but not Mac (as far as I know). It looks like MS provide a Mac version as well:

Re: the correct way to install python packages as non root user in non default path

2009-04-20 Thread alex23
On Apr 21, 8:32 am, News123 news...@free.fr wrote: I'm having an Ubuntu host, but want to (experimentally) install some modules, which are newer than the Ubuntu ones (distros lag always a little behind and some tools need newer versions.) What would be a clean way to do this? I think

Re: The Python standard library and PEP8

2009-04-20 Thread alex23
On Apr 21, 1:18 pm, Tim Wintle tim.win...@teamrubber.com wrote: There was some suggestion about introducing synonyms that followed PEP8 and introducing deprecation warnings as you suggested, but I can't remember the outcome. I'd suggest checking the dev archives. What about the possibility of

Re: Any adv. in importing a module and some objects in the same module, into the same file?

2009-04-19 Thread alex23
On Apr 17, 7:19 pm, Visco Shaun visc...@gmail.com wrote: What is the use of second import as the first import will be enough(AFAIK) to access anything intended by the second import? Is there any kind of advantage? While Piet's explanation is correct for the logging module, you'll also see

Re: Too early implementation

2009-04-18 Thread alex23
On Apr 18, 9:48 pm, Filip Gruszczyński grusz...@gmail.com wrote: With Python you rarely are sorry, because you can do everything so quickly. And yet, at some point you see, that flaws in design get so annoying, that you need to do something about them. Usually at that point it's a bit

Re: howto submit documentation bugs on python V3 web-site ?

2009-04-17 Thread alex23
On Apr 17, 4:36 pm, Andreas Otto aotto1...@onlinehome.de wrote: Hi,   is an email or something else available ? http://docs.python.org/3.0/bugs.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Question to python C API

2009-04-17 Thread alex23
On Apr 17, 4:22 pm, Andreas Otto aotto1...@onlinehome.de wrote:         Question 1: Why you wall it Pyrex package ? From the first paragraph on the Cython site: Cython is based on the well-known Pyrex, but supports more cutting edge functionality and optimizations. python ./setup.py install

Re: script question

2009-04-17 Thread alex23
On Apr 17, 5:00 pm, Stefano stef...@vulcanos.it wrote: How can i execute my func in the code ? import myscript for i in range(1,n):     myscript.func?? for i in range(1,n): getattr(myscript, 'func%d' % i)() -- http://mail.python.org/mailman/listinfo/python-list

<    5   6   7   8   9   10   11   12   13   14   >