Re: curses/urwid simple menu

2007-07-27 Thread Lee Harr
> SGVsbG8uIENvdWxkIHlvdSBoZWxwIG1lLi4uSSBuZWVkIHRvIGNyZWF0ZSBhcHBsaWNhdGlvbiB3 > aXRoIHVyd2lkIG9yIGN1cnNlcwpzdXBwb3J0LiBIYXZlIHlvdSBnb3QgYSBwcmV0dHkgc2ltcGxl > IGV4YW1wbGUgd2l0aCBpdD8KCgotLSAKUG96ZHJhd2lhbSBMZXN6ZWsgTWm2Ck5vdGhpbmcgaXMg > c2VjdXJlLCBwYXJhbm9pYSBpcyB5b3VyIGZyaWVuZC4K >>> s = >>>

Re: Modul (%) in python not like in C?

2007-09-09 Thread Lee Harr
>> Python will always yield a number x = m%n such that 0 <= x < n, but >> Turbo C will always yield a number such that if x = m%n -x = -m%n. That >> is, since 111 % 10 = 1, -111 % 10 = -1. The two values will always >> differ by n (as used above). Maybe it is an order-of-operations thing...

Re: How can I import functions from another python file

2007-04-09 Thread Lee Harr
On 2007-04-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > i have 2 python files in *different directory* , how can I import > python functions from 1 python file to another? > > i get this error: > import task > ImportError: No module named task/ > The directory that module is in must b

Re: pdf to text

2007-01-25 Thread Lee Harr
> Perhaps I'm just using pdftotext wrong? Here's how I was using it: > > sout = os.popen('pdftotext "%s" - ' %f) If you are having trouble with popen (not unlikely) how about just writing to a temporary file and reading the text from there? I've used pdftotext several times in the past f

Pythonic way to add method alias in subclass

2007-12-15 Thread Lee Harr
I thought of several ways to add another name for a method in a subclass ... #alias.py class Foo(object): def nod(self): print "nodding" class Bar(Foo): def __init__(self): self.agree = self.nod class Bar2(Foo): agree = Foo.nod class Bar3(Foo): def agree(self):

error on windows with commands.getstatusoutput

2008-12-28 Thread Lee Harr
My application is trying to start twistd in a cross-platform way. Unfortunately, it works fine on my linux system, but I do not have windows, and I am trying to debug this remotely on a system I never use :o( Anyhow, here is the error I am getting: cmd = '%s -y %s -l %s' % (conf.twistd, conf.t

RE: error on windows with commands.getstatusoutput

2008-12-28 Thread Lee Harr
>> cmd = '%s -y %s -l %s' % (conf.twistd, conf.tztac, conf.twistdlog) >> status, output = commands.getstatusoutput(cmd) > The commands module is Unix only. See its documentation : > http://docs.python.org/library/commands.html Ah. Doh! I was going back and forth between all of the different wa

RE: error on windows with commands.getstatusoutput

2008-12-31 Thread Lee Harr
> Anyhow, I've replaced it with this: > > > from subprocess import Popen, PIPE, STDOUT > p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, > stderr=STDOUT, close_fds=True) > output, unused = p.communicate() > status = p.returncode > > > Does that look more

[ANN] TZMud 0.8

2009-01-04 Thread Lee Harr
TZMud is a Python MUD server. http://tzmud.googlecode.com/ A MUD is a text-based virtual environment accessed via telnet, or with a specialised MUD client. TZMud development is still in early stages, focusing on API and server stability. TZMud uses several high-quality Python libraries to facil

[ANN] TZMud 0.7

2008-11-15 Thread Lee Harr
TZMud is a Python MUD server. http://tzmud.googlecode.com/ A MUD is a text-based virtual environment accessed via telnet, or with a specialised MUD client. TZMud development is still in early stages, focusing on API and server stability. TZMud uses several high-quality Python libraries to fa

ANN: TZMud-0.5, a Python MUD server

2008-08-25 Thread Lee Harr
TZMud is a Python MUD server. http://tzmud.googlecode.com/ A MUD is a text-based virtual environment accessed via telnet, or with a specialized MUD client. TZMud development is still in early stages, focusing on API and server stability. TZMud uses several high-quality Python libraries to facil

decorator and API

2008-09-17 Thread Lee Harr
I have a class with certain methods from which I want to select one at random, with weighting. The way I have done it is this import random def weight(value): def set_weight(method): method.weight = value return method return set_weight class A(object): def a

[ANNC] pybotwar-0.7

2009-11-29 Thread Lee Harr
pybotwar is a fun and educational game where players write computer programs to control simulated robots. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation. It can be run in text-only mode -- useful for longer tournaments -- or use pyqt or pygame for a graphical

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-12 Thread Lee Harr
> And my original problem still there : fouled up keys in interactive > terminal. When you first had this problem, was python3 installed from source, or was it from the Ubuntu repository? (ie, did you install using apt-get or synaptic or did you just start out building from source?) I have pyt

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-13 Thread Lee Harr
>> When you first had this problem, was python3 installed from >> source, or was it from the Ubuntu repository? > Over a month ago I downloaded the tarball Python-3.1.1 from > the python website.  Then the Synaptic Package Manager did not > contain this ( latest ) version. There is already pytho

Re: some turtle questions

2010-01-27 Thread Lee Harr
> I am trying to think of things to do with the turtle module > 1) is there a way to determine the current screen pixel color? This would not use the included turtle module, but you could use the turtle module from the pygsear collection: http://www.nongnu.org/pygsear/ It requires pygame, but

[ANNC] acromania-0.5

2009-11-15 Thread Lee Harr
Acromania is a word game of acronyms. This program is a computer moderator for networked games of acromania. It can connect to a channel on IRC, or start a standalone server which can be accessed much like a MUD. http://acromania.googlecode.com/ Acromania uses Twisted and SQLite. Optionally, i

[ANNC] pynguin-0.1 (python-based turtle graphics application)

2010-02-28 Thread Lee Harr
pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This is the in

[ANNC] pynguin-0.2 (python turtle graphics application)

2010-03-07 Thread Lee Harr
Pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This release c

Some PyCon videos won't play

2010-03-13 Thread Lee Harr
I am having a great time watching videos from PyCon. Thanks to everyone who presented, and to those who did such a great job putting the videos up at: http://pycon.blip.tv/ My trouble is that, although most of the videos play perfectly, there are a few that refuse to play at all. Like: Python 10

[ANNC] pynguin-0.4 (python turtle graphics application)

2010-03-14 Thread Lee Harr
Pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This release c

Re: C-style static variables in Python?

2010-04-05 Thread Lee Harr
> Another approach would be to stuff the static values in the function's > __dict__. That's how I did it when I wanted something similar. I created this decorator: def static(**kw):     '''     Used to create a decorator function that will add an     attribute to a function and initialize it.

[ANNC] pynguin-0.7 (python turtle graphics application)

2010-04-11 Thread Lee Harr
Pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This release c

[ANNC] pynguin-0.8 python turtle graphics application

2010-06-08 Thread Lee Harr
Pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This release c

[ANNC] pynguin-0.9 (python turtle graphics application)

2010-07-15 Thread Lee Harr
Pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This release h

Re: segfault with small pyqt script

2010-08-12 Thread Lee Harr
> I'm desperate. I'm having a real application, which fails rather often > when finishing it. I'm not sure, whether any serious problem could be > hidden behind it > > The script is a pyqt script, which segfaults most of the time on my > ubuntu 10.4 linux 64 bit and I'm having trouble to understan

[ANNC] acromania-0.4

2009-07-01 Thread Lee Harr
Acromania is a word game of acronyms. This program is a computer moderator for networked games of acromania. It can connect to a channel on IRC, or start a standalone server which can be accessed much like a MUD. http://acromania.googlecode.com/ Acromania uses Twisted and SQLite. Optionally, i

[ANNC] pybotwar-0.3

2009-08-03 Thread Lee Harr
pybotwar is a fun and educational game where players create computer programs to control simulated robots to compete in a battle arena. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation, and uses pygame and pygsear for the visualization. pybotwar is released und

[ANNC] pybotwar-0.4

2009-08-04 Thread Lee Harr
pybotwar is a fun and educational game where players create computer programs to control simulated robots to compete in a battle arena. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation, and uses pygame and pygsear for the visualization. pybotwar is released und

[ANNC] pybotwar-0.5

2009-08-09 Thread Lee Harr
pybotwar is a fun and educational game where players create computer programs to control simulated robots to compete in a battle arena. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation, and uses pygame and pygsear for the visualization. pybotwar is released und

[ANNC] pybotwar-0.6

2009-09-08 Thread Lee Harr
pybotwar is a fun and educational game where players create computer programs to control simulated robots to compete in a battle arena. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation, and uses either pygame and pygsear or PyQt4 for the visualization. pybotwar

pyqt on portable python?

2010-09-23 Thread Lee Harr
Is it possible / easy to use PyQt with portable python? I've done some googling and found one message that said this is coming in the next version, but I can't find anything on portablepython.com that mentions it. Has anyone done this before? Have any better information on how to set it up, or

[ANNC] TZMud 0.9 : A Python MUD server

2010-10-17 Thread Lee Harr
TZMud is a Python MUD server. http://tzmud.googlecode.com/ A MUD is a text-based virtual environment accessed via telnet, or with a specialised MUD client. TZMud development is still in early stages, focusing on API and server stability. TZMud uses several high-quality Python libraries to facil

<    1   2