Re: OT (humor): 'import antigravity' in action!

2009-05-11 Thread Lawrence D'Oliveiro
In message , Shawn Milochik wrote: > I know you've probably all seen this 50 times, but just in case: > http://xkcd.com/353/ Ironically, that's no longer valid in Python 3.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: OT (humor): 'import antigravity' in action!

2009-05-11 Thread Chris Rebert
On Sun, May 10, 2009 at 11:58 PM, Lawrence D'Oliveiro wrote: > In message , Shawn > Milochik wrote: > >> I know you've probably all seen this 50 times, but just in case: >> http://xkcd.com/353/ > > Ironically, that's no longer valid in Python 3.0. But only by a pair of parens! Still beats the pan

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Lawrence D'Oliveiro
In message , Geoff Gardiner wrote: > How do I assure myself of the integrity of a Python installation > acquired using apt-get install on Debian and Ubuntu? apt-get install debsums man debsums -- http://mail.python.org/mailman/listinfo/python-list

HTTP HEAD and docxmlrpcserver

2009-05-11 Thread Christopher Mahan
I have a docxmlrpcserver install (kissws.com) that's returning HTTP code 501 when the client makes a HEAD request. Any idea as to whether that's by design? Thanks in advance. Chris Mahan chris.ma...@gmail.com gv (818) 671-1709 -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-11 Thread namekuseijin
On May 10, 7:18 pm, Carl Banks wrote: > On May 10, 12:40 pm, namekuseijin > wrote: > theoretical argument like, "everything reduces to a function so it > doesn't matter what syntax you use," yet people in the real world are > out there trying to find alternatives because functional languages' > s

Re: Learning C++ for Python Development

2009-05-11 Thread Nick Craig-Wood
joshua.pea...@gmail.com wrote: > I am a recovering C# web developer who has recently picked up Django > and I'm loving it. > > I would eventually like to get a job as a Django/Python developer. It > seems that many Python jobs require that you also be a C++ developer. > While I want to remai

Compiling Python on Windows : how to deal with modules ?

2009-05-11 Thread r2d3
Hi Pythoners, I am using Python embedded in my application (OSX,Windows) and I need to distribute Python as part of my application. On OSX, no problem, I got a self contained framework (with dynamic library and all the modules). On Windows, I manage to compile Python 2.6.2 with PCbuild\build.bat

Re: Learning C++ for Python Development

2009-05-11 Thread Gerhard Häring
joshua.pea...@gmail.com wrote: > I am a recovering C# web developer who has recently picked up Django > and I'm loving it. > > I would eventually like to get a job as a Django/Python developer. It > seems that many Python jobs require that you also be a C++ developer. I've seen the C++/Python com

cx_freeze - cannot get importer instance

2009-05-11 Thread w.p.
Hello! My application is frozen with cx_freeze. Everything is ok, but on one PC with Windows 2003 64bit i got cx_freeze fatal error "cannot get importer instance". I don't use zipimport in my python code and i don't know why i get this error :/ Any idea? How test this error? w.p. -- http://mail.p

Re: Q's on my first python script

2009-05-11 Thread Nick Craig-Wood
kj wrote: > > Below is my very firs python script. > > This was just a learning exercise; the script doesn't do anything > terribly exciting: for an argument of the form YYMMDD (year, month, > day) it prints out the corresponding string YYMMDDW, where W is a > one-letter abbreviation for th

Re: how GNU stow is complementary rather than alternative to distutils

2009-05-11 Thread Nick Craig-Wood
Zooko Wilcox-O'Hearn wrote: > On May 10, 2009, at 11:18 AM, Martin v. Löwis wrote: > > > If GNU stow solves all your problems, why do you want to use > > easy_install in the first place? > > That's a good question. The answer is that there are two separate > jobs: building executables an

Re: Wrapping comments

2009-05-11 Thread Nick Craig-Wood
Rhodri James wrote: > On Sun, 10 May 2009 08:32:23 +0100, Tobias Weber wrote: > > > In article , > > Arnaud Delobelle wrote: > > > >> A simple Alt-Q will reformat everything nicely. > > > > Now that's something. Thanks! > > > > (still not gonna use software that doesn't let me type # because

Re: Code - what could be done better?

2009-05-11 Thread Bruno Desthuilliers
Florian Wollenschein a écrit : Hi all, here's the main code of thc, my txt to html converter. Since I'm a beginner it is far, far, faaar away from perfect or even good :-) What could be done better? (snip code) 1/ decouple the text => html conversion part from your (or any other) GUI 2

Germany will provide project-specific aid to pakistan

2009-05-11 Thread smattehulah
Germany will provide project-specific aid to the tune of 115 million euro to Pakistan for next two years. for more details visit www.empiresnews.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tutorial or example use for python-graph library

2009-05-11 Thread Paul Moore
On May 8, 4:03 pm, Scott David Daniels wrote: > Paul Moore wrote: > > I have just discovered the python-graph library. I've been interested > > in graph algorithms for a long time, so I'd like to give this a try. > > But there seems to be very little in the way of examples, or tutorial > > documen

Re: Tutorial or example use for python-graph library

2009-05-11 Thread Paul Moore
On May 8, 3:19 pm, "(e.g. emre)" wrote: > you might want to check networkx as well, it is considerably well > documented:http://networkx.lanl.gov/ Interesting, I hadn't seen that before. I'll certainly check it out! Thanks, Paul -- http://mail.python.org/mailman/listinfo/python-list

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

2009-05-11 Thread GKalman
alex23 wrote: > > GKalman 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

Re: unicode bit me

2009-05-11 Thread anuraguni...@yahoo.com
On May 11, 10:47 am, Terry Reedy wrote: > anuraguni...@yahoo.com wrote: > > so unicode(obj) calls __unicode__ on that object > > It will look for the existence of type(ob).__unicode__ ... > >  > and if it isn't there __repr__ is used > > According to the below, type(ob).__str__ is tried first. > >

Re: [Python-Dev] how GNU stow is complementary rather than alternative to distutils

2009-05-11 Thread Giuseppe Ottaviano
Talking of stow, I take advantage of this thread to do some shameless advertising :) Recently I uploaded to PyPI a software of mine, BPT [1], which does the same symlinking trick of stow, but it is written in Python (and with a simple api) and, more importantly, it allows with another trick

Re: Decorating methods - where do my arguments go?

2009-05-11 Thread Michele Simionato
On May 8, 5:33 pm, Mikael Olofsson wrote: >  >>> class test_decorator(object): > ...     def __init__(self,func): > ...         self._func = func > ...     def __call__(self, *args): > ...         print 'Decorator:', args > ...         self._func(*args) Or you could use the decorator module (htt

Re: Why there is a parameter named "self" for classmethod function?

2009-05-11 Thread Bruno Desthuilliers
Terry Reedy a écrit : Kurt Symanzik wrote: But you might consider decorating the method as a static method instead since in your example you are not using the parameter at all. A static method would not require a parameter. @staticmethod def print_hello(): print "hello" Functions th

Skipping unit tests

2009-05-11 Thread Ulrich Eckhardt
Hi! We have a few tests for some module here. These tests are under development and applied to older versions (with less features) of the module, too. That means that if I have module version 42, tests A and B can not possibly work. I don't want to have test failures but I also don't want to fork

win32 How to make sure a file is completely written?

2009-05-11 Thread justind
Hello, I'm using http://code.activestate.com/recipes/156178/ to watch a folder in windows. It's working perfectly, but sometimes when I try to open the file immediately after receiving the event, it's not ready to be opened--if I try to open it with PIL I get "IOError: cannot identify image file"

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread ma
You have to wait until IO is ready. In Unix, we accomplish this with fcntl and the default signal SIGIO, I am not sure how you would do this in Windows. On Mon, May 11, 2009 at 9:51 AM, justind wrote: > Hello, > > I'm using http://code.activestate.com/recipes/156178/ to watch a > folder in windo

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread Tim Golden
justind wrote: Hello, I'm using http://code.activestate.com/recipes/156178/ to watch a folder in windows. Wow, that takes me back. There's a bit more info (and a different technique) here if you're interested: http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html Bu

Re: Decorating methods - where do my arguments go?

2009-05-11 Thread Mikael Olofsson
Peter Otten wrote: You have to turn your decorator into a descriptor by providing a __get__() method. A primitive example: class test_decorator(object): def __init__(self,func): self._func = func def __call__(self, *args): print 'Decorator:', args self._func(self

Re: Decorating methods - where do my arguments go?

2009-05-11 Thread Mikael Olofsson
George Sakkis wrote: Yes, just return an actual function from the decorator instead of a callable object: def test_decorator2(func): def wrapper(*args): print 'Decorator2:', args func(*args) return wrapper class cls(object): @test_decorator def meth(self,*args):

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread justind
On May 11, 10:03 am, Tim Golden wrote: > justind wrote: > > Hello, > > > I'm usinghttp://code.activestate.com/recipes/156178/to watch a > > folder in windows. > > Wow, that takes me back. There's a bit more info (and a different > technique) here if you're interested: > >  http://timgolden.me.uk/p

Re: mod_python and xml.dom.minidom

2009-05-11 Thread dpapathanasiou
> His problem is therefore likely to be something completely different. You are correct. As per the earlier advice, I switched from mod_python to mod_wsgi but I still see the same error: [Mon May 11 10:30:21 2009] [notice] Apache/2.2.11 (Unix) mod_wsgi/2.4 Python/2.5.2 configured -- resuming no

Can I get a value's name

2009-05-11 Thread jalanb3
Context for this question arises from some recent code. In particular the "replace_line" method, which takes in a regexp to look for, and a replacement for when it matches. It is supposed to work for single lines only (we add ^ and $ to the regexp), so arguments which have '\n' in them are not

Re: [Python-Dev] .pth files are evil

2009-05-11 Thread P.J. Eby
At 04:42 PM 5/9/2009 +0200, Martin v. Löwis wrote: >> If you always use --single-version-externally-managed with easy_install, >> it will stop editing .pth files on installation. > > It's --multi-version (-m) that does that. > --single-version-externally-managed is a "setup.py install" option. >

Re: Complete frustration

2009-05-11 Thread norseman
hellcats wrote: I have Python2.5 installed on Windows XP. Whenever I double click on a something.pyw file, IDLE launches and opens something.pyw in the editor. I would prefer to actually *RUN* the program, not edit it. If I want to edit it then I'll choose the "Edit with IDLE" context menu. So I

Re: Wrapping comments

2009-05-11 Thread norseman
Tobias Weber wrote: Hi, the guideline (PEP 8) is hard wrap to 7x characters. The reason given is that soft wrap makes code illegible. So what if you hard wrap code but let comments and docstrings soft-wrap? Otherwise it's hugely annoying to edit them. Say you remove the first three words of

Re: unicode bit me

2009-05-11 Thread norseman
Steven D'Aprano wrote: On Fri, 08 May 2009 14:22:32 -0400, Terry Reedy wrote: Scott David Daniels wrote: It would be a bit easier if people would bother to mention their Python version, as we regularly get questions from people running 2.3, 2.4, 2.5, 2.6, 2.7a, 3.0, and 3.1b. They run comput

Re: stand alone exec

2009-05-11 Thread Pascal Chambon
Hello It sounds indeed like a runtime library problem... You should run a dependancy finder (like dependency walker - http://www.dependencywalker.com/) on your executable, and thus see what might be lacking on other systems. I know that on *nix systems there are tools to see more precisely wha

Re: Decorating methods - where do my arguments go?

2009-05-11 Thread Duncan Booth
Mikael Olofsson wrote: > George Sakkis decorator function solution seems to work equally well for > functions and methods. However, I prefer the cleaner encapsulation given > by a class. Based on those observations, I think I will use the > following approach: > > >>> class test_decorator(o

Re: What's the use of the else in try/except/else?

2009-05-11 Thread kj
In Scott David Daniels writes: >kj wrote: >> ... I can't come with an example in which the same couldn't be >> accomplished with >> >> try: >> # do something >> # do something else >> except ...: >> # handle exception >> >> The only significant difference I can come up with is th

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Aahz
In article , Geoff Gardiner wrote: >Aahz wrote: >> >> What directory are you running this from? What happens if you switch to >> running "python Lib/test/regrtest.py"? Taking a closer look, this looks >> more like a plain import error. > >I couldn't do quite that because there's no Lib, but in

Re: OOP & Abstract Classes

2009-05-11 Thread Mike Driscoll
On May 11, 9:53 am, "Adam Gaskins" wrote: > Hi all, > > -- Non critical info-- > I am a fairly seasoned PHP developer (don't shoot, I'm changing teams!:) who > is admittedly behind the curve with OOP. Like most who learned PHP, I > started doing web app backend stuff, but I have moved to full blow

Re: OOP & Abstract Classes

2009-05-11 Thread Ulrich Eckhardt
Adam Gaskins wrote: > Long story short, I'm tired of doing things in such a hackish manner > and want to write applications that are cross platform (I'd like to > get our production dept on linux eventually) and truely object > oriented. Adam, there is one notion here that I seriously dislike: yo

Re: mod_python and xml.dom.minidom

2009-05-11 Thread dpapathanasiou
For the record, and in case anyone else runs into this particular problem, here's how resolved it. My original xml_utils.py was written this way: from xml.dom import minidom def parse_item_attribute (item, attribute_name): item_doc = minidom.parseString(item) ... That version worked und

Re: OOP & Abstract Classes

2009-05-11 Thread Marco Mariani
Mike Driscoll wrote: I've never used (or heard of) the Abstract type...and the guy who wrote the FAQ was being a jerk. Who, Peter Norvig? (from wikipedia) Peter Norvig is an American computer scientist. He is currently the Director of Research (formerly Director of Search Quality) at Google

Re: Decorating methods - where do my arguments go?

2009-05-11 Thread Mikael Olofsson
Duncan Booth wrote: The __get__ method should be returning a new object, NOT modifying the state of the decorator. As written it will break badly and unexpectedly in a variety of situations: [snip good examples of things going bad] Ouch! So, does that mean that George's solution based on a

Re: How to debug this import problem?

2009-05-11 Thread Iwan
Mmm, we solved half of the cause of this one. Test runs are kicked off via setuptools's test command. But this happens programmatically, and successively in one process. But setuptools's test command clears all modules imported during a test run from sys.modules - hence it is intended that module

Writing text to a Word Document

2009-05-11 Thread gazathome
Hi everyone, I am trying to write several attributes from a database table and using the code below I can write the values however it is only overwriting on the first line. I am new to the win32com bit and I would like to know what is the recommended reference to loop down the page and add multip

Re: list comprehension question

2009-05-11 Thread J Kenneth King
Steven D'Aprano writes: > On Thu, 07 May 2009 13:28:10 -0400, J Kenneth King wrote: > >> Steven D'Aprano writes: >> >>> On Wed, 06 May 2009 09:48:51 -0400, J Kenneth King wrote: >>> Emile van Sebille writes: > On 5/5/2009 9:15 AM J Kenneth King said... > >> List comprehe

Re: Decorating methods - where do my arguments go?

2009-05-11 Thread Peter Otten
Mikael Olofsson wrote: > Duncan Booth wrote: > >> The __get__ method should be returning a new object, NOT modifying the >> state of the decorator. As written it will break badly and unexpectedly >> in a variety of situations: >> >> [snip good examples of things going bad] > > Ouch! So, does th

Re: OOP & Abstract Classes

2009-05-11 Thread Adam Gaskins
Any idea why I didn't see this reply on my ng? I only see the reply from Marco. Can't help but wonder if there is more that is not getting through here. Would someone mind forwarding me any other replies? FWIW I'm using news.east.cox.net. Thanks, -Adam > Mike Driscoll wrote: > >> I've never u

Re: Can I get a value's name

2009-05-11 Thread Scott David Daniels
jalanb3 wrote: ... Given a variable name I can use locals() to get the value Is there a way to do it the other way round Given the value, can I get the variable name ? (1) Yes you can in some cases. (2) You should not, things do not inherently have a name. With that prelude: de

sqlite single transaction without foreign key or triggers

2009-05-11 Thread gert
I am trying to do this in a single transaction, the 3 separate statements work fine, but i am screwed if they are not executed together. ### db.execute('BEGIN') # db.execute('UPDATE users SET uid=? WHERE uid=?',(v['uid'],s.UID)) db.execute('UPDATE sessions SET uid=? WHERE si

creating classes with mix-ins

2009-05-11 Thread samwyse
I'm writing a class that derives it's functionality from mix-ins. Here's the code: def boilerplate(what): # This used to be a decorator, but all of the ##what = f.__name__ # function bodies turned out to be 'pass'. 'Validate the user, then call the appropriate plug-in.'

Re: Can I get a value's name

2009-05-11 Thread John O'Hagan
On Mon, 11 May 2009, jalanb3 wrote: [...] > > def replace_line(pattern,replacement): > errors = '\n' in pattern and [ 'pattern' ] or [] > errors += '\n' in replacement and [ 'replacement' ] or [] > values = [ locals()[e] for e in errors ] > # etc, etc, and eventually: > print

Re: OOP & Abstract Classes

2009-05-11 Thread Nick Craig-Wood
Adam Gaskins wrote: > I am a fairly seasoned PHP developer (don't shoot, I'm changing teams!:) who > is admittedly behind the curve with OOP. Like most who learned PHP, I > started doing web app backend stuff, but I have moved to full blown windows > apps in the last 6 months using Winbinde

Re: Wrapping comments

2009-05-11 Thread MRAB
norseman wrote: Tobias Weber wrote: Hi, the guideline (PEP 8) is hard wrap to 7x characters. The reason given is that soft wrap makes code illegible. So what if you hard wrap code but let comments and docstrings soft-wrap? Otherwise it's hugely annoying to edit them. Say you remove the first

Re: OOP & Abstract Classes

2009-05-11 Thread Peter Otten
Adam Gaskins wrote: > So I was beginning to learn OOP for PHP, and it seemed to me that abstract > classes were just right for my application. In my application I must > communicate with several peices of test equipment that communicate via > RS-232. Most use SCPI instructions, some do not and req

Re: Wrapping comments

2009-05-11 Thread Simon Brunning
2009/5/10 Tobias Weber : > (still not gonna use software that doesn't let me type # because it's > alt+3 on a UK layout; having to re-learn or configure that is just sick) To use Aquamacs with a UK keyboard, you want to select Options, Option Key, Meta & British. Things just work then. -- Cheers

Using Pygame with Python

2009-05-11 Thread cripplemeal
Hi. I would just like to know which of the versions of python and pygame would be best to download for use together. I am a windows xp user. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing text to a Word Document

2009-05-11 Thread Mike Driscoll
On May 11, 11:27 am, gazath...@gmail.com wrote: > Hi everyone, > > I am trying to write several attributes from a database table and > using the code below I can write the values however it is only > overwriting on the first line. > > I am new to the win32com bit and I would like to know what is th

Re: Using Pygame with Python

2009-05-11 Thread Mike Driscoll
On May 11, 2:54 pm, cripplem...@gmail.com wrote: > Hi. I would just like to know which of the versions of python and > pygame would be best to download for use together. I am a windows xp > user. Look at the pygame website to see what the newest version of Python it supports and go with that unles

how to consume .NET webservice

2009-05-11 Thread bav
question from a python newbie; how can i consume in python language, a .NET web service, passing a string array as parameter in some easy steps? best regards -- http://mail.python.org/mailman/listinfo/python-list

Re: how to consume .NET webservice

2009-05-11 Thread namekuseijin
bav escreveu: question from a python newbie; how can i consume in python language, a .NET web service, passing a string array as parameter in some easy steps? Unless Microsoft extended the standard in any way, then it should be just as you consume any web service, I guess. ;) -- a game

Re: how to consume .NET webservice

2009-05-11 Thread Mike Driscoll
On May 11, 3:09 pm, "bav" wrote: > question from a python newbie; > >   how can i consume in python language, a .NET web service, passing >   a string array as parameter in some easy steps? > > best regards You're being pretty vague here. Try using Google first...I got plenty of hits with "python

Re: OOP & Abstract Classes

2009-05-11 Thread Adam Gaskins
Wow, thanks Nick! This is just what I was looking for! Thanks to Peter as well. And as for your suggestion that I probably shouldn't mess with things I don't understand and learn the basics first... well, that is probably sound advice, but I figured out years ago that I learn things best by a)

Fill Javascript form

2009-05-11 Thread Matteo
Hi everybody, I have to fill a web form to authenticate and connect to the internet. I thought it would have been easy to make a script to do that automatically on startup. Unfortunately, it turned out that the form is written in JavaScript, and urllib2 therefore fails to even fetch the form. The

How to replace constructor with factory method

2009-05-11 Thread rogeeff
Hi, Just wonder if it's possible in Python. what I want is to tweak an existing Python class A with no constructor, so that A() results in fuctory method call? so o = A() instead being equivalent to: s = object() A.__init__(s) o = s becomes: o = my_factory_function( A ) Thanks, Gennadiy --

issue with twisted and reactor. Can't stop reactor

2009-05-11 Thread Gabriel
Hello all!, I'm trying to implement a simple one way communication using twisted. Sender: > send message > close connection Receiver: > receive > do something > wait for other message I'm testing with this simple examples: Sender: [code] class SenderClient(protocol.Protocol): def __init__(

Your Favorite Python Book

2009-05-11 Thread Sam Tregar
Greetings. I'm working on learning Python and I'm looking for good books to read. I'm almost done with Dive into Python and I liked it a lot. I found Programming Python a little dry the last time I looked at it, but I'm more motivated now so I might return to it. What's your favorite? Why? -sa

Re: Your Favorite Python Book

2009-05-11 Thread Shawn Milochik
It depends on what you want to do. If you still want to beef up on general knowledge, maybe skim through "The Python Cookbook" or something reference-like. If you feel ready to start doing something with Python, look into one of the recent titles that applies Python for a specific purpose. Example

Re: Fill Javascript form

2009-05-11 Thread Shawn Milochik
How is the form "written in JavaScript"? Is it dynamically generated? In any case, can you just send a POST request if you know the values required? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace constructor with factory method

2009-05-11 Thread Chris Rebert
On Mon, May 11, 2009 at 1:39 PM, wrote: > Hi, > > Just wonder if it's possible in Python. > > what I want is to tweak an existing Python class A with no > constructor, so that A() results in fuctory method call? > > so o = A() instead being equivalent to: > > s = object() > A.__init__(s) > o = s

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread Rob Williscroft
gert wrote in news:d7591495-4661-4243-ad7e-f142d8244e88 @e24g2000vbe.googlegroups.com in comp.lang.python: > I am trying to do this in a single transaction, the 3 separate > statements work fine, but i am screwed if they are not executed > together. Well you're in luck, Python DBAPI 2 connections

[silly] Re: issue with twisted and reactor. Can't stop reactor

2009-05-11 Thread Tim Harig
On 2009-05-11, Gabriel wrote: > Subject: issue with twisted and reactor. Can't stop reactor Not having written anything using twisted I cannot help you much with your code; but, I cannot resist commenting about your subject line: I suspect that if are having an issue with your reactor after bein

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Geoff Gardiner
Aahz wrote: > ... That seems to demonstrate that regrtest.py is indeed a good mechanism for > finding out whether it's a b0rked install! > I agree that regrtest.py looks a good mechanism. It just appears that `apt-get install python` on Debian and Ubuntu brings no tests with it. @Lawrence D'Ol

Re: Nimrod programming language

2009-05-11 Thread rumpf_a
On 10 Mai, 07:36, k...@fiber-space.de wrote: > On 8 Mai, 17:48, Andreas Rumpf wrote: > > > Dear Python-users, > > > I invented a new programming language called "Nimrod" that combines > > Python's readability with C's performance. Please check it > > out:http://force7.de/nimrod/ > > Any feedback

Re: creating classes with mix-ins

2009-05-11 Thread samwyse
On May 11, 1:16 pm, samwyse wrote: > I'm writing a class that derives it's functionality from mix-ins. While waiting, I gave a try at using class decorators. Here's what I came up with: def add_methods(*m_list, **kwds): def wrapper(klass): for m_name in m_list: def templ

Re: Your Favorite Python Book

2009-05-11 Thread Chris Rebert
On Mon, May 11, 2009 at 1:44 PM, Sam Tregar wrote: > Greetings.  I'm working on learning Python and I'm looking for good books to > read.  I'm almost done with Dive into Python and I liked it a lot. I found > Programming Python a little dry the last time I looked at it, but I'm more > motivated no

Re: How to replace constructor with factory method

2009-05-11 Thread Luis Zarrabeitia
On Monday 11 May 2009 04:39:41 pm roge...@gmail.com wrote: > so o = A() instead being equivalent to: > > s = object() > A.__init__(s) > o = s Actually, it would be more like this: s = A.__new__(A) if isinstance(s,A): A.__init__(s) o = s > o = my_factory_function( A ) You could tweak: *) A'

Re: Nimrod programming language

2009-05-11 Thread rumpf_a
On 10 Mai, 10:40, Paul Rubin wrote: > Andreas Rumpf writes: > > I invented a new programming language called "Nimrod" that combines > > Python's readability with C's performance. Please check it out: > >http://force7.de/nimrod/Any feedback is appreciated. > > Looks n

Re: There may be a much better way to manage artillery.

2009-05-11 Thread Tobiah
On Mon, 11 May 2009 00:48:25 +0100, Rhodri James wrote: > On Mon, 11 May 2009 00:06:34 +0100, Tobiah wrote: > > [Snippety snip] > >> I wanted the bullets to be responsible for destroying themselves, but a >> little Googling brought me to points about dangling references and how >> an object is

Re: Your Favorite Python Book

2009-05-11 Thread python
Sam, In no specific order (I brought them all): Wesley Chun's "Core Python Programming" David Mertz's "Text Processing in Python" (older, but excellent) Mark Lutz's "Learning Python" All highly recommended. Best of luck on your Python journey! Regards, Malcolm -- http://mail.python.org/mailma

Re: issue with twisted and reactor. Can't stop reactor

2009-05-11 Thread Jean-Paul Calderone
On Mon, 11 May 2009 17:40:57 -0300, Gabriel wrote: Hello all!, I'm trying to implement a simple one way communication using twisted. [snip] When I call send the first time it works fine, when I call send a second time the sender hangs. [snip] None of the reactors in Twisted are restartable.

Re: Nimrod programming language

2009-05-11 Thread rumpf_a
> One question I ask myself upon seeing a new language is if it is possible > to program amb (amb=ambiguous) operator in it. This page gives a very > nice, "code first" explanation of amb and how it is supposed to work: > > http://www.randomhacks.net/articles/2005/10/11/amb-operator > Hm. I am not

Re: how to consume .NET webservice

2009-05-11 Thread Diez B. Roggisch
namekuseijin schrieb: bav escreveu: question from a python newbie; how can i consume in python language, a .NET web service, passing a string array as parameter in some easy steps? Unless Microsoft extended the standard in any way, then it should be just as you consume any web service, I

Re: Nimrod programming language

2009-05-11 Thread Mensanator
On May 11, 4:55 pm, rump...@web.de wrote: > On 10 Mai, 10:40, Paul Rubin wrote:> Andreas > Rumpf writes: > > > I invented a new programming language called "Nimrod" that combines > > > Python's readability with C's performance. Please check it out: > > >http://force

Re: There may be a much better way to manage artillery.

2009-05-11 Thread Rhodri James
On Mon, 11 May 2009 22:59:43 +0100, Tobiah wrote: On Mon, 11 May 2009 00:48:25 +0100, Rhodri James wrote: On Mon, 11 May 2009 00:06:34 +0100, Tobiah wrote: [Snippety snip] I wanted the bullets to be responsible for destroying themselves, but a little Googling brought me to points about da

Re: issue with twisted and reactor. Can't stop reactor

2009-05-11 Thread Gabriel
Jean-Paul Calderone escribió: > None of the reactors in Twisted are restartable. You can run and stop them > once. After you've stopped a reactor, you cannot run it again. This is > the > cause of your problem. > > Jean-Paul I see. Is it possible to do what I want using twisted? or I should f

Re: Wrapping comments

2009-05-11 Thread Rhodri James
On Mon, 11 May 2009 08:39:48 +0100, Tobias Weber wrote: In article , "Rhodri James" wrote: What on earth are you talking about? '#' has its own key on a UK layout Not on Apple keyboards, and the emacs release in question is Mac only. My commiserations. That was a bad design decision o

Re: MacPython 3.0.1 installation problem, no /usr/local/bin/python*

2009-05-11 Thread Raoul Gough
Ned Deily writes: > In article > , > Benjamin Kaplan wrote: >> On Sat, May 9, 2009 at 4:30 AM, Raoul Gough >> wrote: [snip] >> > So did something go wrong with the installer, or is it all >> > supposed to work somehow differently? >> >> Because Python 3 breaks compatibility with Python 2, th

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread gert
On 11 mei, 23:07, Rob Williscroft wrote: > gert wrote in news:d7591495-4661-4243-ad7e-f142d8244e88 > @e24g2000vbe.googlegroups.com in comp.lang.python: > > > I am trying to do this in a single transaction, the 3 separate > > statements work fine, but i am screwed if they are not executed > > toget

Re: Your Favorite Python Book

2009-05-11 Thread Shawn Milochik
On Mon, May 11, 2009 at 5:52 PM, wrote: > Sam, > > In no specific order (I brought them all): > > Wesley Chun's "Core Python Programming" > David Mertz's "Text Processing in Python" (older, but excellent) > Mark Lutz's "Learning Python" > > All highly recommended. > > Best of luck on your Python

Re: Nimrod programming language

2009-05-11 Thread Paul Rubin
rump...@web.de writes: > I am dissatisfied with Python's (or Java's) Unicode handling: > 1) IO overhead to convert UTF-8 (defacto standard on UNIX) into > UTF-16. So use UTF-8 internally. You can still iterate through strings efficiently. Random access would take a performance hit. When that's

Re: Nimrod programming language

2009-05-11 Thread Tomasz Rola
On Mon, 11 May 2009, rump...@web.de wrote: > > One question I ask myself upon seeing a new language is if it is possible > > to program amb (amb=ambiguous) operator in it. This page gives a very > > nice, "code first" explanation of amb and how it is supposed to work: > > > > http://www.randomhack

Re: how to consume .NET webservice

2009-05-11 Thread namekuseijin
Diez B. Roggisch wrote: namekuseijin schrieb: bav escreveu: question from a python newbie; how can i consume in python language, a .NET web service, passing a string array as parameter in some easy steps? Unless Microsoft extended the standard in any way, then it should be just as you c

Re: Re: Complete frustration

2009-05-11 Thread Dave Angel
norseman wrote: hellcats wrote: I have Python2.5 installed on Windows XP. Whenever I double click on a something.pyw file, IDLE launches and opens something.pyw in the editor. I would prefer to actually *RUN* the program, not edit it. If I want to edit it then I'll choose the "Edit with IDLE"

Re: Nimrod programming language

2009-05-11 Thread Lawrence D'Oliveiro
In message <57f4c81a-3537-49fa-a5f6- a0cc0d43d...@o14g2000vbo.googlegroups.com>, rump...@web.de wrote: > I am dissatisfied with Python's (or Java's) Unicode handling: > 1) IO overhead to convert UTF-8 (defacto standard on UNIX) into > UTF-16. Are you sure they're using UTF-16? I would use UCS-2 o

Re: How do I test the integrity of a Python installation in Debian and Ubuntu

2009-05-11 Thread Lawrence D'Oliveiro
In message , Geoff Gardiner wrote: > @Lawrence D'Oliveiro: > ... I see that you published my unobfuscated e-mail address on USENET for all to see. I obfuscated it for a reason, to keep the spammers away. I'm assuming this was a momentary lapse of judgement, for which I expect an apology. Othe

Re: OOP & Abstract Classes

2009-05-11 Thread Terry Reedy
Adam Gaskins wrote: Wow, thanks Nick! This is just what I was looking for! I agree that Nick's semi-abstract class is what you need. After doing some subclasses, you may discover that there is more common code that you can factor out and push to the base class. You may also find it convenien

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

2009-05-11 Thread kj
Hi. I'm trying to learn how to play a .wav file in OS X with Python. I tried the following, which ran without errors, but produced nothing audible (even though the file bell.wav plays perfectly well otherwise, e.g. view the Finder's Preview): import pygame.mixer pygame.mixer.init() pygame.mixer.

Re: creating classes with mix-ins

2009-05-11 Thread Carl Banks
On May 11, 11:16 am, samwyse wrote: > I'm writing a class that derives it's functionality from mix-ins. > Here's the code: > >     def boilerplate(what):   # This used to be a decorator, but all of > the >         ##what = f.__name__  # function bodies turned out to be > 'pass'. >         'Validat

Unable to install Pywin32 for Python 2.6.2

2009-05-11 Thread David Lees
I have no problem installing Python 2.6.2 for windows under XP SP3 and IDLE and the command line versions work fine. When I run the pywin32 installer downloaded from sourceforge (pywin32-212.win32-py2.6.exe) I get the following error message: Traceback (most recent call last): File "", line

  1   2   >