Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-13 Thread Brian van den Broek
Martin v. Löwis said unto the world upon 2005-03-10 20:55: Anthony Baxter wrote: On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.1 (release candidate 1). I'd like to encourage feedback on whether the Windows installer works for peo

[OT] Re: Python becoming less Lisp-like

2005-03-16 Thread Brian van den Broek
news.sydney.pipenetworks.com said unto the world upon 2005-03-16 05:57: trust the guy to do a good job. If you don't, then you can write it yourself which means you can do exactly how you want it which again makes the whole argument mute. Anyone else having images of mimes engaged in street figh

Re: newbie : modifying a string in python

2005-03-16 Thread Brian van den Broek
Leeds, Mark said unto the world upon 2005-03-16 14:46: I want to modify a string in the following way : for s in stks: s = s.strip() if ( s[-2:] == 'GR' ): s[-2:]= 'GF' so, if the last two characters are GR, I want to change them to GF ( there will be other if statem

replace from end of string?

2005-03-16 Thread Brian van den Broek
Hi all, in writing my response to Mark Leeds' recent question about replacing text at the end of a string, I was moved to wonder if it wouldn't it be handy if the replace method of string instances did one of the following: took a negative integer for count and interpreted that as replace the

Re: newbie:unique problem

2005-03-17 Thread Brian van den Broek
Leeds, Mark said unto the world upon 2005-03-17 14:08: I have a function uniqueList that is below : Def uniqueList(origList): nodups= {} for temp in origList: nodups[temp] = None returns nodups.keys() When used in the following context : industryList = uniqueList(jpb

Re: newbie:unique problem

2005-03-17 Thread Brian van den Broek
don't know how to change the function to handle this ? I have a feeling it's not that hard though ? Thanks. Doing the same thing Brian van den Brook did with sets (also for 2.4 only): def uniqueItems(oldlist,comppos=3): rv = {} for i in reversed(oldlist): rv[i[:comp

Re: newbie:unique problem

2005-03-18 Thread Brian van den Broek
Heiko Wundram said unto the world upon 2005-03-18 01:27: On Thursday 17 March 2005 23:31, Brian van den Broek wrote: Am I not right in thinking that with the dict approach there is no guarantee that the order from the original list will be preserved? Yup, absolutely right that the original

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Brian van den Broek
Raymond Hettinger said unto the world upon 2005-03-18 20:24: I would like to get everyone's thoughts on two new dictionary methods: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty def appen

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-03-19 07:19: Brian van den Broek wrote: Raymond Hettinger said unto the world upon 2005-03-18 20:24: I would like to get everyone's thoughts on two new dictionary methods: def appendlist(self, key, *values): try:

Re: Help on creating a HTML by python

2004-11-29 Thread Gert-Jan den Besten
sepgy writes: Can anyone help me to use a python to create an HTML photo gallery generator. When it's finished, it will be able find all the picture files (i.e. .jpg, .gif. .png files) in any given folder on the computer, automatically create smaller thumbnails for each image, and then generate a c

Re: hello all

2004-12-03 Thread Brian van den Broek
Ishwor Gurung said unto the world upon 2004-12-03 03:36: Hello all, I am just starting out on learning Python and joined this list. I have grabbed the Learning Perl book by Mark & David. This book really seems good so far.. the concepts are explained pretty nicely. :) I have a background a bit in

Re: window size in IDLE

2004-12-03 Thread Brian van den Broek
p.kosina said unto the world upon 2004-12-03 04:04: Can I somehow in config-main.cfg set how big shall (and where) open the IDLE window? Cause in my w98 it is always opening so that I can not see the bottom line Thank you Pavel Hi Pavel, I had the same issue with IDLE 1.03 running on Pytho

Re: How did you learn Python?

2004-12-03 Thread Brian van den Broek
Shawn Milo said unto the world upon 2004-12-03 09:54: I was just wondering what the best books were for learning Python. Which books are good for getting started, and which should be saved for later, or or not useful except as a reference for the learned? I have a decent programming background in V

Re: simple GUI question

2004-12-08 Thread Brian van den Broek
Roose said unto the world upon 2004-12-08 02:23: You want somthing like: root = Tkinter.Tk() root.withdraw() msg = tkMessageBox.showwarning("Ooops", "Some warning") Awesome thanks! Any chance you know about the font thing : ) Nah I'll stop being lazy and hack it... but for some reason Tkinter doe

Re: simple GUI question

2004-12-08 Thread Brian van den Broek
Brian van den Broek said unto the world upon 2004-12-08 03:16: Hi, I don't know Tkinter past a hour of playing, so I cannot show you how. I can, however, show you a good place to start looking: <http://www.google.com/search?num=50&hl=en&q=Tkinter+Python+font+widget&btnG=

Re: uptime for Win XP?

2004-12-12 Thread Brian van den Broek
Esmail Bonakdarian said unto the world upon 2004-12-12 20:45: Greg Krohn wrote: if you have win32all installed, you can get it from Python: >>> import win32api >>> print "Uptime:", win32api.GetTickCount(), "Milliseconds" Uptime: 148699875 Milliseconds Hi Greg! Thanks, that was usefull, esp sinc

lowering the case of strings in list -- WAS: (No subject)

2004-12-16 Thread Brian van den Broek
Mark Devine said unto the world upon 2004-12-16 10:49: Hi I'm brand new to python and I was wondering if anybody knew of a easy way to change every character in a list into its lower case form. The list is like so: commands = ['CLASS-MAP MATCH-ALL cmap1', 'MaTch Ip AnY', 'CLASS-map Match-Any cmap2'

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Brian van den Broek
Jeff Shannon said unto the world upon 2004-12-16 17:54: Amir Dekel wrote: 2. os.path.expanduser("~") always gives me "C:\\" instead of my homepath. I have tried to change my homepath in WinXP using set homepath(in command line), and alsaw using the "Environment Variables" in WinXP system propert

mailing list welcome welcome msg in wiki suggestion

2004-12-12 Thread Brian van den Broek
Hi all, There have been a few posts over the last month or so expressing a bit of exasperation with the "rising tide of newbie's". (Or, more accurately, the rising tide of questions from newbie's not trying to follow ESR's advice.) A month or so ago (in a thread found here: http://tinyurl.com/5

Re: NO REALLY

2004-12-15 Thread Brian van den Broek
Peter Hansen said unto the world upon 2004-12-15 17:39: Martijn Faassen wrote: Jive wrote: Isn't there a comp.lang.flame or something? I've doublechecked, but I didn't see any significant flaming in this article (and I'm generally not very tolerant of it). My PSU posting was certainly not intend

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Brian van den Broek
Doug Holton said unto the world upon 2004-12-20 18:45: Peter Hansen wrote: Doug Holton wrote: Peter Hansen wrote: "Virtually identical" indeed. :-) I gave such a short answer because the way you framed your "questions" and the context of your post made it clear you are a troll. Your reply here

Re: input record sepArator (equivalent of "$|" of perl)

2004-12-21 Thread Brian van den Broek
John Machin said unto the world upon 2004-12-21 18:20: Subtle distinction: A metER is a measuring device. A MetRE is a unit of distance. Not everyone agrees . I do, but then I think it ought be spelled 'colour', too. Best, Brian vdB -- http://mail.pyth

(Mac-specific) AppScript bug

2004-12-22 Thread George van den Driessche
(This is really for Hamish Sanderson, I think, but I can't find an e-mail address for him.) On OS X 10.3.7, with XCode 1.5 and all the latest AppScript packages installed, writing this: a = appscript.app( 'XCode.app' ) causes a crash in terminology.py: /System/Library/Frameworks/Python.framewo

Dubious Python WAS: Re: Lambda going out of fashion

2004-12-24 Thread Brian van den Broek
Fernando Perez said unto the world upon 2004-12-23 14:42: Alex Martelli wrote: I don't know what it IS about lambda that prompts so much dubious to absurd use, but that's what I observed. I don't know if that plays any role in Guido's current thinking, though -- I have no idea how much "dubious P

Re: Global variables and modules

2004-12-24 Thread Brian van den Broek
Alex Martelli said unto the world upon 2004-12-24 03:23: <[EMAIL PROTECTED]> wrote: If you really must, consider using a container object. The most suitable container object for these tasks is often a module. I.e., code, in test1: import test2 and then refer to test2.glbl throughout. I.e., forg

Python limericks (was Re: Text-to-speech)

2005-03-20 Thread Brian van den Broek
Steve Holden said unto the world upon 2005-03-20 16:18: Since it's PyCon week, I will offer a prize of $100 to the best (in my opinion) limerick about Python posted to this list (with a Cc: to [EMAIL PROTECTED]) before midday on Friday. The prize money will be my own, so there are no other rule

Re: Text-to-speech

2005-03-21 Thread Brian van den Broek
Paul McGuire said unto the world upon 2005-03-21 03:10: How about a clerihew instead of a limerick? Guido van Rossum Had an idea most awesome. When he lost track of his braces, Just replaced them with spaces. -- Paul McGuire Hi all, that's pretty good, Paul. However, I must insist that you both cea

Re: Beginner Question - Very Easy I'm Sure...

2005-03-24 Thread Brian van den Broek
Todd_Calhoun said unto the world upon 2005-03-24 16:13: I'm trying to generate a random number, and then concetate it to a word to create a password. I get the number and assign it to a variable: + word = "dog" import random rannum = random.randrange(100,999) str(rannu

Re: list-comprehension and map question (simple)

2005-03-27 Thread Brian van den Broek
Charles Hartman said unto the world upon 2005-03-27 09:51: I understand this toy example: lines = "this is a group\nof lines of\nwords" def getlength(w): return len(w) s = map(getlength, [word for ln in lines.split() for word in ln.splitlines()]) (now s is [4, 2, 1, 5, 2, 5, 2, 5]) My question i

Re: list-comprehension and map question (simple)

2005-03-27 Thread Brian van den Broek
Charles Hartman said unto the world upon 2005-03-27 13:35: On Mar 27, 2005, at 1:18 PM, Brian van den Broek wrote: >>> def some_arbitrary_function(y): ... return ( (y * 42) - 19 ) % 12 ... >>> [some_arbitrary_function(len(x)) for x in lines.split()] [5, 5, 11, 11, 5, 11, 5,

Re: list-comprehension and map question (simple)

2005-03-27 Thread Brian van den Broek
Brian van den Broek said unto the world upon 2005-03-27 14:12: Charles Hartman said unto the world upon 2005-03-27 13:35: On Mar 27, 2005, at 1:18 PM, Brian van den Broek wrote: >>> def some_arbitrary_function(y): ... return ( (y * 42) - 19 ) % 12 ... >>> [some_arbitrary_func

Re: String Splitter Brain Teaser

2005-03-27 Thread Brian van den Broek
James Stroud said unto the world upon 2005-03-27 17:39: Hello, I have strings represented as a combination of an alphabet (AGCT) and a an operator "/", that signifies degeneracy. I want to split these strings into lists of lists, where the degeneracies are members of the same list and non-degene

Re: String Splitter Brain Teaser

2005-03-27 Thread Brian van den Broek
Michael Spencer said unto the world upon 2005-03-27 20:04: James Stroud wrote: Hello, I have strings represented as a combination of an alphabet (AGCT) and a an operator "/", that signifies degeneracy. I want to split these strings into lists of lists, where the degeneracies are members of the s

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

cx_Oracle throws: ImportError: DLL load failed: This application has failed to start ...

2013-11-24 Thread Ruben van den Berg
I'm on Windows XP SP3, Python 2.7.1. On running import cx_Oracle I got the error ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. I then ran Dependency Walker on cx_Oracle.

Re: cx_Oracle throws: ImportError: DLL load failed: This application has failed to start ...

2013-11-25 Thread Ruben van den Berg
> > On Sun, 11/24/13, MRAB wrote: > > > > Subject: Re: cx_Oracle throws: ImportError: DLL load failed: This > application has failed to start ... > > To: python-list@python.org > > Date: Sunday, November 24, 2013, 7:17 PM > > > > On 24/11/201

Re: ^D vs ^Z as EOF and DOS dinosaurs talking (was: open() and EOFError)

2014-07-08 Thread Jan van den Broek
On 2014-07-08, Tim Chase wrote: > On 2014-07-09 01:49, Chris Angelico wrote: >> Have you ever used COPY CON to create a binary file? > > No, for that I used DEBUG.EXE (or DEBUG.COM on older versions of DOS) Both. -- Jan v/d Broek ba

subprocess.Popen under windows 7

2011-12-08 Thread Frank van den Boom
Hello, i have something like this under windows 7: print("try command...") arglist = [PATH_TO_7ZIP,"a", "-sfx", archive_name, "*", "-r", "-p",PASSWORD] p = subprocess.Popen(args=arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=srcdir) output, error

Re: subprocess.Popen under windows 7

2011-12-09 Thread Frank van den Boom
I didn't have Windows 7 right now, but that shouldn't happen with the code you've given; when trimming code for posting, you should check that the trimmed code still have the exact same problem. Here is the hole code: #!/usr/bin/env python # little script to backup recursive a folder with 7z

Re: subprocess.Popen under windows 7

2011-12-09 Thread Frank van den Boom
Thank you very much. Now I have written a little c++ programm which produces some ouput. And now it works fine. There is something wrong with 7zip.exe and the arglist with *. Tonight I will go on and hunt the error. It should be Python 2.7 #!/usr/bin/env python PATH_TO_EXE = "C:/Users/yoic

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

distutils, 'scripts' and Windows

2005-05-27 Thread George van den Driessche
Hi folks, I'm looking at packaging a project I'm working on using distutils. The project is for Windows and contains a COM server which needs registration, so the installer needs to be a little more complicated than usual. Looking at the options for the bdist_wininst command to distutils, I se

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

<    1   2   3   >