Re: [Newbie] How do I get better at Python programming?

2005-03-28 Thread Brian van den Broek
Anon said unto the world upon 2005-03-29 00:07: I've gotten off to a good start for programming using Python (my first programming language). I can do the basics (different kinds of loops, variables, functions), but I'm not too good with classes yet. I've written some really small programs jus

Re: Little Q: how to print a variable's name, not its value?

2005-03-28 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-03-29 01:06: No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two vars, along with their names. I could easily do t

Re: instance vs class attributes

2005-03-29 Thread Brian van den Broek
James Stroud said unto the world upon 2005-03-29 20:37: Sarir said: Here are my questions: 3) Should private data be written as self._x instead of self.x? This is a long standing debate. The usual answer is "we are all grownups here", meaning that self.x is preferred. However, I personally like

testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-02 Thread Brian van den Broek
Hi all, I'm just starting to employ unit testing (I'm using doctest), and I am uncertain how to handle writing tests where the behaviour being tested is dependant on whether certain file paths point to actual files. I have a class which takes, in its __init__, a list of file paths to process. The

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-04 Thread Brian van den Broek
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi all, I'm just starting to employ unit testing (I'm using doctest), and I am uncertain how to handle writing tests where the behaviour being tested is dependant on whether certain

Re: testing -- what to do for testing code with behaviour dependant upon which files exist?

2005-04-04 Thread Brian van den Broek
Jeremy Bowers said unto the world upon 2005-04-04 17:26: On Mon, 04 Apr 2005 17:02:20 -0400, Brian van den Broek wrote: Jeremy suggested using a directory name akin to "C:\onlyanidiotwouldhavethisdirecotrynameonadrive". That is what I had settled on before I posted. Somehow it feels u

Re: Super Newbie Question

2005-04-04 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-04-04 19:39: I want the "engine" to read the file, write its contents to another temporary file (for now it just writes the contents; later it will format it before writing the contents) and then deletes the *contents* of the temporary file after pri

Re: Change between Python 2.3 and 2.4 under WinXP

2005-04-05 Thread Brian van den Broek
rbt said unto the world upon 2005-04-05 08:39: Martin v. Löwis wrote: Of course, it is not all that clear what the OP actually wanted. For all we know, he wanted to "alternate quickly (with batch file or similary) between python23 and python24"... Maybe off-topic for this thread, but I noticed tha

Re: Doubt regarding sorting functions

2005-04-10 Thread Brian van den Broek
praba kar said unto the world upon 2005-04-11 00:50: Dear All, I am new to Python. I am in need of some sorting functions (eg) numerical sorting functions and alphapetical sorting functions. I have searched through net But I cannot find any regarding this so If anyone know regarding thi

Re: variables exist

2005-04-11 Thread Brian van den Broek
Fredrik Lundh said unto the world upon 2005-04-11 10:14: "fabian" wrote: how testing if a variable exists in python as isset in php?? try: variable except NameError: print "variable not set" but that is really lousy Python; better make sure you always assign to all variables, and use None

[OT] Re: Programming Language for Systems Administrator

2005-04-12 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-04-12 08:11: I actually like the Windows cmd language (it's an acquired taste), but I have read it is going away in Windows Longhorn (WH). That's an argument for writing more complicated scripts in Python. WH is supposed to get a much better shell, c

Re: variables exist

2005-04-12 Thread Brian van den Broek
Richard Brodie said unto the world upon 2005-04-12 04:56: "Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I'm a hobbyist and still learning, but the claim the try/except is "lousy Python" surprise me a bit. I think it wasn't

Re: nested tuple slice

2005-04-12 Thread Brian van den Broek
dimitri pater said unto the world upon 2005-04-12 17:49: hello! I want to change a nested tuple like: tuple = (('goat', 90, 100), ('cat', 80, 80), ('platypus', 60, 800)) into: tuple = (('goat', 90), ('cat', 80), ('platypus', 60)) in other words, slice the first elements of every index Any ideas on

pydoc preference for triple double over triple single quotes -- any reason?

2005-04-16 Thread Brian van den Broek
Hi all, I'm posting partly so my problem and solution might be more easily found by google, and partly out of mere curiosity. I've just spent a frustrating bit of time figuring out why pydoc didn't extract a description from my module docstrings. Even though I had a well formed docstring (one l

Re: pydoc preference for triple double over triple single quotes -- anyreason?

2005-04-17 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-04-16 16:41: Brian van den Broek wrote: Hi all, I'm posting partly so my problem and solution might be more easily found by google, and partly out of mere curiosity. I've just spent a frustrating bit of time figuring out why pydoc didn&#

Re: pydoc preference for triple double over triple single quotes-- anyreason?

2005-04-17 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-04-17 16:17: Brian van den Broek wrote: Kent Johnson said unto the world upon 2005-04-16 16:41: Brian van den Broek wrote: I've just spent a frustrating bit of time figuring out why pydoc didn't extract a description from my module docstr

Re: pydoc preference for triple double over triple single quotes--anyreason?

2005-04-18 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-04-18 08:20: The puzzle for me was that if I enter my module name in the "Search for" box, it shows up in the list of results, as expected. But whether the results list entry for my module incorporates the description form my module's docstring or inst

Re: building a small calculator

2005-04-20 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-04-20 08:41: Sorry. This is my first day using Python. Is there an equivelent to the goto command? I want to find some way to take the user back to the main menu. When I first started learning Python some long time after having done some BASIC, I fo

Re: Private class?

2005-04-21 Thread Brian van den Broek
codecraig said unto the world upon 2005-04-21 09:13: Hi, First, I come from a Java background. ...so that is what I am thinking. However, i guess my issue is how to make EventBus a singleton or prevent it from being instaniated and making it's methods statically accessible. thanks. I don't come

Re: New line

2005-04-21 Thread Brian van den Broek
ionic said unto the world upon 2005-04-21 16:34: Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. How do i type several lines without executing after each line? Cheers A bit more precision in your question

Re: Dictionary question.

2005-04-21 Thread Brian van den Broek
hawkesed said unto the world upon 2005-04-21 20:28: Actually, I think I got it now. Here is what I did: for num in alist: ... if adict.has_key(num): ... x = adict.get(num) ... x = x + 1 ... adict.update({num:x}) ... else: ... adict.updat

Re: time.strftime in 2.4.1 claims data out of range when not

2005-04-22 Thread Brian van den Broek
Sheila King said unto the world upon 2005-04-22 02:45: I have a web app that has been running just fine for several months under Python 2.2.2. We are preparing to upgrade the server to run Python 2.4.1. However, part of my web app is throwing an error on this code (that has previously worked wit

Re: Overiding error message when using a python program

2005-04-22 Thread Brian van den Broek
Sion Arrowsmith said unto the world upon 2005-04-22 13:00: Brian van den Broek <[EMAIL PROTECTED]> wrote: you've not included the part of your code which acts on the user's input. I think you'll find the answer to the question of where the code that acts on the user

Re: puzzled about class attribute resolution and mangling

2005-12-11 Thread Brian van den Broek
James Stroud said unto the world upon 2005-12-09 20:39: > Brian van den Broek wrote: > >>Hi all, >> >>I've the following code snippet that puzzles me: >> >>class Base(object): >>__v, u = "Base v", "Base u" >>def

Re: newbie-name mangling?

2005-12-13 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-13 15:05: > I'm reading van Rossum's tutorial. Mostly it is well written and > examples are given. However sometimes I get lost in a text, when it > doesn't give any examples and no clues. There are several examples of > this in chapter 9 about cla

Re: newbie-one more example of difficulty in van Rossum's tutorial

2005-12-13 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-13 15:44: > This is from 9.6 (Private variables). I quote > > - "Notice that code passed to exec, eval() or evalfile() does not > consider the classname of the invoking class to be the current class; > this is similar to the effect of the global s

Re: Still Loving Python

2005-12-14 Thread Brian van den Broek
Peter Decker said unto the world upon 2005-12-14 07:03: > On 12/13/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > > >>>Why this need to have everyone do things the way you do? >> >>Whatever makes you think I have this need? I said I hated them. I'm >>pretty sure I didn't say everyone should have to

Re: Any good Python forums?

2005-12-15 Thread Brian van den Broek
SeNTry said unto the world upon 2005-12-15 10:25: > Hello, > > Are there any good active python forums online? Especially any forum that > has an uber-noob section! > It is not a forum, but if you are looking for a newbie-tailored venue, the python tutor list

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-15 07:50: > obvious). It is just like there are language on this planet that reads > from right to left horizontally, as well as top to bottom, then right > to left. And you are trying to tell them that English way is the "right > way" or the obvi

debian and python--any potential pitfalls?

2005-12-18 Thread Brian van den Broek
Hi all, I know that this is something for which I could (keep) STFW, but I'm mostly ignorant of the subject area and under a bit of a deadline. So I hope people won't mind if I truncate my search and ask here. I've tried solo and failed a few times to install various Linux distros on Intel x86

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-19 02:27: > Steve Holden wrote: > >>Kevin Yuan wrote: >> >>>How to remove duplicated elements in a list? eg. >>>[1,2,3,1,2,3,1,2,1,2,1,3] -> [1,2,3]? >>>Thanks!! >>> >> >> >>> list(set([1,2,3,1,2,3,1,2,1,2,1,3])) >>[1, 2, 3] >> > > Would this ha

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Brian van den Broek
Alex Martelli said unto the world upon 2005-12-19 10:48: > Brian van den Broek <[EMAIL PROTECTED]> wrote: >... > >>>>>orig_list = [3,1,2,3,1,2,3,1,2,1,2,1,3] >>>>>new_list = list(set(orig_list)) >>>>>new_list.sort(cmp=

Re: debian and python--any potential pitfalls?

2005-12-19 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-19 00:36: > Brian van den Broek wrote: >>I've tried solo and failed a few times to install various Linux >>distros on Intel x86 laptops. (The software modem was always the >>sticking point.) A recent acquaintance h

Re: Please i need a hand with writing a simple task.

2005-12-19 Thread Brian van den Broek
Marian said unto the world upon 2005-12-19 10:58: > Can you pleae help me with this task. I have really hard time with > my textbook desolving this problem. The Task: Write a program that > will create a text file, print the contents of the text file as you > create the file. Read the contents of

Re: Guido at Google

2005-12-22 Thread Brian van den Broek
Graham Fawcett said unto the world upon 2005-12-22 08:18: > Steve Holden wrote: > >>>Nicola Musatti wrote: >>>Of course, I'm going on vacation next week and there was talk >>>about a one-way ticket to Mexico. The real question is will they let me >>>*back* in? :-) >>> >> >>I would be careful comi

Re: Modifying values in a list

2005-12-29 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 29/12/05 10:43 AM: > The following code: > > numbers = [1, 2, 3] > for value in numbers: > value *= 2 > print numbers > > results in the following output: > [1, 2, 3] > > The intent of the code was to produce this output: > [2, 4, 6] > > What is

Re: Extending Python with C++

2005-12-29 Thread Brian van den Broek
jeremito said unto the world upon 29/12/05 11:39 AM: > I am learning how to extend Pythong with C++. I have will be writing > some code in C++ and want/need Python to interact with it. I am not > having success following the online documentation from > http://docs.python.org/ext/ext.html. I have

Re: Extending Python with C++

2005-12-29 Thread Brian van den Broek
Brian van den Broek said unto the world upon 29/12/05 12:03 PM: > jeremito said unto the world upon 29/12/05 11:39 AM: > >>I am learning how to extend Pythong with C++. I have will be writing >>some code in C++ and want/need Python to interact with it. I am not >>havi

Re: Global Variables in OOP and Python

2005-12-30 Thread Brian van den Broek
Gary Herron said unto the world upon 30/12/05 08:03 PM: > newbie wrote: > > >>Hello, >> >>I have questions about global variables in OOP (in general) and Python >>(in specific). I understand (I think) that global variables are >>generally not a good idea. However, if there are variables that nee

Re: Bug ??

2006-01-02 Thread Brian van den Broek
Eddy Ilg said unto the world upon 02/01/06 05:43 PM: > Hi, > > I have a class and I am trying to set the instance varirable 'variables' > (also tried different names). The variable gets initialized by > default-value parameter of the constructor. When I change the variable and > call the construct

Re: OT: Degrees as barriers to entry [was Re: - E04 - Leadership! Google, Guido van Rossum, PSF]

2006-01-03 Thread Brian van den Broek
Steven D'Aprano said unto the world upon 03/01/06 07:33 PM: > On Tue, 03 Jan 2006 08:27:39 -0800, Alex Martelli wrote: > > >>Or some even more stringent qualification, such as the state's Bar exam >>for lawyers -- you may not be able to sit for that exam w/o the >>appropriate degree, but the degr

Re: What's wrong with this code snippet?

2006-01-04 Thread Brian van den Broek
Karlo Lozovina said unto the world upon 04/01/06 04:19 PM: > Here is it: > > --- > class Human: > def __init__(self, eye_one, eye_two): > self.eye_one = eye_one > self.eye_two = eye_two > > class Population: > def __init__(self): > self.house = [] >

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-08 Thread Brian van den Broek
Gerard Brunick said unto the world upon 08/01/06 01:27 PM: > My way is ugly. These has to be a better way. > > Thanks, > Gerard If you'd posted your way, I might well have seen if I could do it in a nicer fashion. But, since for all I know, my best efforts would result in the approach you alre

Re: How can I create a dict that sets a flag if it's been modified

2006-01-12 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 12/01/06 03:15 AM: > I can think of several messy ways of making a dict that sets a flag if > it's been altered, but I have a hunch that experienced python > programmers would probably have an easier (well maybe more Pythonic) > way of doing this. > > It'

Re: How can I create a dict that sets a flag if it's been modified

2006-01-12 Thread Brian van den Broek
Brian van den Broek said unto the world upon 12/01/06 03:42 AM: > [EMAIL PROTECTED] said unto the world upon 12/01/06 03:15 AM: > >>I can think of several messy ways of making a dict that sets a flag if >>it's been altered, but I have a hunch that experienced python >&

Re: New Python.org website ?

2006-01-19 Thread Brian van den Broek
Steve Holden said unto the world upon 11/01/06 04:44 AM: > http://beta.python.org A few minor points about the design: The "Using Python for . . ." for section on the right is expectation violating in several ways: 1) Each two lines have 3 separate links, but all go to the same place. Much bet

Re: OT: Sarcasm and irony

2006-10-10 Thread Brian van den Broek
bryan rasmussen said unto the world upon 10/10/06 08:25 AM: > As was noted in my original statement the weak form of irony such as > understood by Danes and I suppose by Americans as well, since that is > what Steve was originally complaining about, is descended from the > concept of Dramatic Ir

Re: Python 411.

2006-06-13 Thread Brian van den Broek
Mike T said unto the world upon 13/06/06 10:46 AM: > What exactly is 411 in this context? A reference to higher education > perhaps? Or perhaps part of the American constitution? What exactly? > Also for that matter what is 101? > > Cheers, > Mike > Hi Mike, 411 is the number one dials in Nor

Re: pprint: "...thank small children who sleep at night."

2006-09-19 Thread Brian van den Broek
Brian L. Troutwine said unto the world upon 19/09/06 05:30 PM: > The heading comment to pprint reads: > > # This is a simple little module I wrote to make life easier. I > didn't > # see anything quite like it in the library, though I may have > overlooked > # something. I wrote this when I w

Re: question about scope

2006-02-17 Thread Brian van den Broek
John Salerno said unto the world upon 16/02/06 09:18 AM: > "Name references search at most four scopes: local, then enclosing > functions (if any), then global, then built-in." > > I understand what global and built-in are, and I thought I understood > the concept of local too, but when I got

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Brian van den Broek
DannyB said unto the world upon 21/02/06 06:14 PM: > I'm just learning Python. I've created a simple coin flipper program - > here is the code: > > [source] > #Coin flipper > import random > > heads = 0 > tails = 0 > counter = 0 > > coin = random.randrange(2) > > while (counter < 100): > i

Re: Launch file in Notepad

2005-05-12 Thread Brian van den Broek
George said unto the world upon 2005-05-12 09:41: > Newbie question: > > I'm trying to lauch Notepad from Python to open a textfile: > > import os > b1="c:\test.txt" > os.system('notepad.exe ' + b1) > > However, the t of test is escaped by the \, resulting in Notepad trying > to open "c: est.tx

Re: Launch file in Notepad

2005-05-12 Thread Brian van den Broek
Fredrik Lundh said unto the world upon 2005-05-12 13:52: > Brian van den Broek wrote: > > >>>I'm trying to lauch Notepad from Python to open a textfile: >>> >>>import os >>>b1="c:\test.txt" >>>os.system('notepad.exe '

Re: Case Sensitive, Multiline Comments

2005-05-27 Thread Brian van den Broek
Duncan Booth said unto the world upon 2005-05-27 04:24: > There are arguments that, especially for beginners, case sensitivity > introduces an extra level of complexity, but the cost of losing this > complexity would be to make Python a poor relation amongst programming > languages. Well, t

Re: prime number

2005-05-30 Thread Brian van den Broek
lostinpython said unto the world upon 2005-05-30 02:50: > It is a homework assignment from a book but not for a class. I'm > trying to teach my self some basic programming before I have to take it > in college. If I show enough understanding of the subject, my advisor > will let me forgo Intro. t

Re: OO approach to decision sequence?

2005-06-18 Thread Brian van den Broek
Chinook said unto the world upon 18/06/2005 02:17: > OO approach to decision sequence? > - > > In a recent thread (Cause for using objects?), Chris Smith replied with (in > part): > > >> If your table of photo data has several types of photos, and you find >>

Re: Python documentation problem

2005-06-18 Thread Brian van den Broek
Xah Lee said unto the world upon 18/06/2005 03:49: > Python documentation, > http://python.org/doc/2.4.1/lib/typesfunctions.html > > - > 2.3.10.3 Functions > > Function objects are created by function definitions. The only > operation on a function object is to call it: func(argu

Re: Python documentation problem

2005-06-18 Thread Brian van den Broek
Xah Lee said unto the world upon 18/06/2005 04:11: > i wanted to find out if Python supports eval. e.g. > > somecode='3+4' > print eval(somecode) # prints 7 > > in the 14 hundred pages of python doc, where am i supposed to find this > info? > > Xah > [EMAIL PROTECTED] > ∑ http://xahlee.org/ >

Re: example: 40286 -> 68204

2007-06-03 Thread Brian van den Broek
Shihpin said unto the world upon 06/03/2007 08:23 PM: > Hi all, > > Is there a fuction that reverse the digits of a number? > > Many thanks, > > Shihpin Lin > This does it: def reversed_int(i): > ... return int(''.join(reversed(str(i > ... reversed_int(12345) > 54321

Re: running a random function

2007-06-07 Thread Brian van den Broek
David Bear said unto the world upon 06/07/2007 11:56 AM: > I would like to write some code that would randomly select a function from a > list of functions and call it. I was looking in the globals names space and > randomly selecting items that were of type function.. but I didn't see a > way of a

Re: PChess 0.9

2007-05-07 Thread Brian van den Broek
majeed rana said unto the world upon 05/07/2007 01:13 AM: > I want pchess 0.9 > I want a mansion and a yacht. Unlike you, google can't help me. Brian vdB -- http://mail.python.org/mailman/listinfo/python-list

Re: TIFF to PDF

2007-05-21 Thread Brian van den Broek
Gabriel Genellina said unto the world upon 05/21/2007 07:01 AM: > En Mon, 21 May 2007 07:42:21 -0300, revuesbio <[EMAIL PROTECTED]> > escribió: > >> os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf >> C:\test.TIF') > > \ is used as a escape character in strings. > Use eith

Re: TIFF to PDF

2007-05-21 Thread Brian van den Broek
Gabriel Genellina said unto the world upon 05/21/2007 10:12 AM: > En Mon, 21 May 2007 10:53:08 -0300, Brian van den Broek > <[EMAIL PROTECTED]> escribió: > >> Gabriel Genellina said unto the world upon 05/21/2007 07:01 AM: >>> En Mon, 21 May 2007 07:42:21 -030

Re: Inheritance

2007-05-22 Thread Brian van den Broek
HMS Surprise said unto the world upon 05/22/2007 02:40 PM: > I am trying to understand the 'if' statement and the exec statement in > the code below. I would like to add several common routines to this > class and then inherit it into a class in another file. This other > class would need to access

Re: Can I reference 1 instance of an object by more names ?

2007-05-22 Thread Brian van den Broek
Stef Mientki said unto the world upon 05/22/2007 07:44 PM: > hello, > > I'm trying to build a simple functional simulator for JAL (a Pascal-like > language for PICs). > My first action is to translate the JAL code into Python code. > The reason for this approach is that it simplifies the simulato

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Brian van den Broek
Wildemar Wildenburger said unto the world upon 05/23/2007 08:43 AM: > Bruno Desthuilliers wrote: >> here's an example using a property: >> >> class cpu_ports(object): >> def __init__(self, value=0): >> self._d = value >> @apply >> def value(): >> def fset(self, value): >

Re: Properties/Decorators [WAS: Can I reference 1 instance of an object by more names ? rephrase]

2007-05-23 Thread Brian van den Broek
Peter Otten said unto the world upon 05/23/2007 01:32 PM: > Brian van den Broek wrote: >> Help on built-in function apply in module __builtin__: >> >> But: >> >> >>> [x for x in dir('__builtin__') if 'apply' in x] >> [

Re: webbrowser module bug?

2007-05-25 Thread Brian van den Broek
Ron Adam said unto the world upon 05/25/2007 12:28 PM: > [EMAIL PROTECTED] wrote: >> On May 24, 5:03 pm, Ron Adam <[EMAIL PROTECTED]> wrote: >>> Is anyone else having problems with the webbrowser module? >>> >>> Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) >>> [GCC 4.1.2 (Ubuntu 4.1.2-0u

Re: c[:]()

2007-05-30 Thread Brian van den Broek
Warren Stringer said unto the world upon 05/30/2007 05:31 PM: > Hmmm, this is for neither programmer nor computer; this is for a user. If I > wanted to write code for the benefit for the computer, I'd still be flipping > switches on a PDP-8. ;-) > > This is inconsistent: > > why does c[:][0]() w

Re: tuples, index method, Python's design

2007-04-13 Thread Brian van den Broek
Antoon Pardon said unto the world upon 04/13/2007 02:46 AM: > On 2007-04-12, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> So much fuss over such a little thing... yes it would be nice if tuples >> grew an index method, but it isn't hard to work around the lack. > > Yes it is a little thing. Bu

doctests for interactive functions

2007-02-08 Thread Brian van den Broek
Hi all, I have a module of classes for getting input from the user that satisfies various constraints. For instance, one class is created with a menu of option, presents them to the user, and rejects any input other than a menu option; another ensures that the user's input is interpretable as

Re: doctests for interactive functions

2007-02-08 Thread Brian van den Broek
Ben Finney said unto the world upon 02/08/2007 03:03 PM: > Brian van den Broek <[EMAIL PROTECTED]> writes: > >> Since the classes are for getting input interactively, a >> straightforward use of doctest is not going to work. (The tests >> won't run automaticall

Re: doctests for interactive functions

2007-02-08 Thread Brian van den Broek
Neil Cerutti said unto the world upon 02/08/2007 02:25 PM: > On 2007-02-08, Brian van den Broek <[EMAIL PROTECTED]> wrote: >> All classes take an optional argument input_function that >> determines how the class instance gets its input. If this is >> not provided, it def

Re: Python Newbie

2007-02-08 Thread Brian van den Broek
spazziam said unto the world upon 02/08/2007 04:18 PM: > SyntaxError: invalid syntax > File "C:\Python23\vdrop2\final py\vdrop2.py", line 123 > def INIT_HIGHS(): > ^ > SyntaxError: invalid syntax > > Why would this come up? > Hi, Most likely, a previous line contains an unfinished s

Re: doctests for interactive functions

2007-02-09 Thread Brian van den Broek
Neil Cerutti said unto the world upon 02/09/2007 08:52 AM: > On 2007-02-08, Brian van den Broek <[EMAIL PROTECTED]> wrote: >> Can I run the rough structure of my code past you to see if it >> is in the vicinity of what you mean? (I have removed some >> details for s

Re: PYTHONPATH

2006-04-23 Thread Brian van den Broek
bruno at modulix said unto the world upon 20/04/06 08:38 AM: >>Can anyone help me to make my path persistant? > > > Just like any other environnement variable on your system. With most > distros, it will be something like adding the line: > > export PYTHONPATH="/a/possible/path;/another/one;/

Re: PYTHONPATH

2006-04-23 Thread Brian van den Broek
Edward Elliott said unto the world upon 23/04/06 04:28 PM: > Brian van den Broek wrote: > >>The suggestions above appear not to work for me: >> >>[EMAIL PROTECTED]:~$ cat /etc/profile | grep 'export PYTHONPATH' >>export PYTHONPATH="~/PythonFiles&quo

Re: PYTHONPATH

2006-04-24 Thread Brian van den Broek
Edward Elliott said unto the world upon 23/04/06 07:56 PM: > Brian van den Broek wrote: >>Only somewhat, as if I open a brand new shell: >> >>[EMAIL PROTECTED]:~$ python >> >>> from sys import path >> >>> path[0:3] >>['', 

RESOLVED Re: PYTHONPATH

2006-04-24 Thread Brian van den Broek
> either in /etc/profile (will be system-wide default) or ~/.bash_profile > (will be user-specific). and Edward Elliott said unto the world upon 23/04/06 07:56 PM: > Brian van den Broek wrote: >>So, it seems that I currently have to invoke '. .bash_profile' >>ma

Re: OOP / language design question

2006-04-26 Thread Brian van den Broek
Bruno Desthuilliers said unto the world upon 25/04/06 06:52 PM: > Duncan Booth a écrit : > >>bruno at modulix wrote: >> >> >> >>>class Base(object): >>> def __init__(self, arg1): >>> self.attr1 = arg1 >>> self.dothis() >>> >>> def dothis(self): >>> return self.attr1 >>> >>>class Derived(Base

<    1   2