Re: [Tutor] [ANN] new version of rur-ple (0.8.5)

2005-05-10 Thread Andre Roberge
On 5/10/05, Bob Gailer <[EMAIL PROTECTED]> wrote: > At 08:48 PM 5/9/2005, André Roberge wrote: [snip] > On http://rur-ple.sourceforge.net/en/errors.htm Reeborg > appears as Egrebor. I assume that's incorrect. > > You are indeed correct. Thank you for pointing this out. Just for a histori

Re: [Tutor] imbedding python into another program?

2005-08-04 Thread Andre Roberge
On 8/3/05, Jeff Peery <[EMAIL PROTECTED]> wrote: > Andre, thanks for the help with this. I put it to work yesterday and it > works perfectly. > > was wondering if it is possible to import modules without a users having to > type 'import whatever'. for example in my application I would like the

Re: [Tutor] Questions of Maths

2007-04-18 Thread Andre Roberge
On 4/18/07, Abu Ismail <[EMAIL PROTECTED]> wrote: > Hi, > > I am working on an implementation of an L-system in Python. I hate > using turtle module since it uses Tk and as my IDE also uses Tk I have > to close my editor before I can test the program. So I am implementing > the graphics using PIL.

Re: [Tutor] What's wrong with this?

2007-05-03 Thread Andre Roberge
Perhaps the following might be helpful: http://groups.google.com/group/comp.lang.python/browse_thread/thread/f1b60f4739591d6b/4417f807848b4b5d?lnk=gst&q=launching&rnum=4#4417f807848b4b5d (if the link does not work, google for "launching python program cross-platform" or go to http://aspn.activest

Re: [Tutor] Question regarding syntax

2007-07-11 Thread Andre Roberge
On 7/11/07, Eric Brunson <[EMAIL PROTECTED]> wrote: > Michael Klier wrote: > > Dave Kuhlman wrote: > > > >> On Wed, Jul 11, 2007 at 11:03:18AM -0400, John Morris wrote: > >> > >>> I'm editing some code from Mailman and seeing: > >>> > >>> legend = _("%(hostname)s Mailing Lists") > >>> > >>> > > > >

Re: [Tutor] Selecting a browser

2007-12-04 Thread Andre Roberge
Forwarded to the ghop-discussion list :-) Thanks Kent for the suggestion. André On Dec 4, 2007 11:13 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Tim Golden wrote: > > In addition, for those not following that particular > > story, the Google Highly Open thingy (GHOP) is seeing > > a bunch of

Re: [Tutor] Suppressing output in interactive mode

2008-01-11 Thread Andre Roberge
You may want to check here: http://mail.python.org/pipermail/edu-sig/2007-August/008154.html André On Jan 11, 2008 7:26 AM, Olivier Lefevre <[EMAIL PROTECTED]> wrote: > This is stupid but my python is rusty I can neither > remember nor find out anew how to enter an expression > that returns a val

Re: [Tutor] Suppressing output in interactive mode

2008-01-11 Thread Andre Roberge
On Jan 11, 2008 9:48 AM, Olivier Lefevre <[EMAIL PROTECTED]> wrote: > Thanks for both suggestions. The displayhook trick would > be OK if there was a way to retrieve what _would_ have > been printed last if the display had not been changed: > something like a modified '_'. As it stands, it's a bit

Re: [Tutor] Bad time to get into Python?

2008-02-04 Thread Andre Roberge
On Feb 4, 2008 1:26 PM, Eric Brunson <[EMAIL PROTECTED]> wrote: > > Dotan Cohen wrote: > > Like I mentioned earlier, I'm more interested in my learning being 3.x > compatible, not my scripts. If all I need to do is learn to print("") > instead of print"" then that's fine. > > > Basically, if you

[Tutor] Off-topic query for rur-ple users

2006-01-28 Thread Andre Roberge
Please, accept my apologies to bring this slightly off-topic question. This is the only way I know to reach RUR-PLE users. How important is it to have a browser included within rur-ple itself? Would there be any objections in eliminating the browser, and using your favourite browser (firefox, et

[Tutor] ANN: Rur-ple lessons 0.36

2006-01-29 Thread Andre Roberge
Announcing RUR-PLE lessons 0.36 RUR-PLE stands for Roberge's Used Robot: a Python Learning Environment. This is the first official release of the lessons, separately from the application. The lessons are intended as a somewhat non-typical introduction to programming using Python, that has been u

Re: [Tutor] A row of cards, but they're all red

2006-01-30 Thread Andre Roberge
On 1/30/06, ->Terry<- <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- [snip] Try reducing your code to only the following: > > Here's the code: > - -- > #!/usr/bin/env python > suits = ["red ", "blue", "green", "yellow"] > ranks = ["ace", "two", "three", "f

[Tutor] ANN: Rur-ple 0.95 has been released

2006-01-30 Thread Andre Roberge
RUR-PLE 0.95 has been released. A link to the download page can be found at http://rur-ple.sourceforge.net (The site is slightly out of date, and there is no plan to update it in the future as it provides an excellent idea of what RUR-PLE is about.) This new version contains a few bug fixes and

Re: [Tutor] Todays Learning Python Question From a Newbie ;)

2006-02-02 Thread Andre Roberge
As I indicated in private email yesterday to Jon, there is indeed a hole in the computer stratey when the following three first moves are made: x:2 o:4 (first available "best move" for the computer) x:7 I also sketched a "solution", which I will rephrase here in a different way. The next "best m

Re: [Tutor] critique my wrapper

2006-02-02 Thread Andre Roberge
On 2/2/06, Christopher Spears <[EMAIL PROTECTED]> wrote: > This is a class I created that wraps a list. Could > someone please critique the class? > > class MyList: > def __init__(self, aList=None): > if aList is None: > self.mylist = [] >

Re: [Tutor] Documentation

2006-02-05 Thread Andre Roberge
On 2/5/06, Paul Kraus <[EMAIL PROTECTED]> wrote: > I have been working through a couple of books and learning alot. However I > can't seem to find any easy way to learn more about different methods and > commands. > > For instance what are all of the methods that can be applied to lists and what >

Re: [Tutor] Documentation

2006-02-05 Thread Andre Roberge
On 2/5/06, Paul Kraus <[EMAIL PROTECTED]> wrote: > > >>> help(Tkinter.Button.configure) > > > > Help on method configure in module Tkinter: > > > > configure(self, cnf=None, **kw) unbound Tkinter.Button method > > Configure resources of a widget. > > > > The values for resources are specifi

Re: [Tutor] IDE - Editors - Python

2006-02-06 Thread Andre Roberge
On 2/6/06, Tim Johnson <[EMAIL PROTECTED]> wrote: > * Paul Kraus <[EMAIL PROTECTED]> [060206 06:04]: > > Which editors does everyone use and why. Please keep the discussion to IDE's > > rather then any editors. I am well versed on Emacs and VI so anything beyond > > them would be appreciative. Why

Re: [Tutor] Sharing Variables Across Modules

2006-02-06 Thread Andre Roberge
On 2/6/06, Rich Shepard <[EMAIL PROTECTED]> wrote: >I'm developing a wxPython-based application. The UI is a notebook, with the > contents of each page in a separate module. In one module (modelPage.py), I > have defined the class modModel, which is an instance of a wx.Panel class. > Within mod

Re: [Tutor] Splitting long string into same len parts

2006-02-08 Thread Andre Roberge
On 2/8/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Wed, 8 Feb 2006, Victor Bouffier wrote: > > > Hi to all, > > > > I'd like to split a long string into equally long strings (len(str) = > > 3). I did the following using regexes: > > > > >>> n = 'xb1jyzqnd1eenkokqnhep6vp692qi9tmag3owzqw0sdq3zj

Re: [Tutor] nutshell review

2006-02-09 Thread Andre Roberge
On 2/9/06, nephish <[EMAIL PROTECTED]> wrote: > lo there, > i know this comes up from time to time. i am considering buying 'python > in a nutshell'. All the reviews i have read for it are very good. But it > only covers up to python 2.2. i use 2.3 at work, and tinker with 2.4 at > home. As good a

Re: [Tutor] cannonical matrix representation?

2006-02-10 Thread Andre Roberge
On 2/10/06, Mike Cheponis <[EMAIL PROTECTED]> wrote: > What's the best way to represent a matrix M with 4 dimensions, such as > M[x][y][z][t] where each element in the sparse matrix could be a simple > number, or could be an executable Python function snipped that returns a > value when that cel

Re: [Tutor] sys.argv

2006-02-13 Thread Andre Roberge
On 2/13/06, János Juhász <[EMAIL PROTECTED]> wrote: > Hi, > > I want to pass args to my python script on XP. > This code > print 'argv[0] %s' % sys.argv[0] > print 'argv[1] %s' % sys.argv[1] > print 'argv[2] %s' % sys.argv[2] > > shows this: > argv[0] D:\devel\home\devel\python\db\xlsxml.py > argv[

Re: [Tutor] map vs. list comprehension

2006-02-14 Thread Andre Roberge
On 2/14/06, Michael Broe <[EMAIL PROTECTED]> wrote: > I read somewhere that the function 'map' might one day be deprecated > in favor of list comprehensions. > > But I can't see a way to do this in a list comprehension: > > >>> map (pow, [2, 2, 2, 2], [1, 2, 3, 4]) > [2, 4, 8, 16] >>> [2**i for i

Re: [Tutor] Problem wxPython

2006-02-17 Thread Andre Roberge
On 2/17/06, Prabhakar K <[EMAIL PROTECTED]> wrote: > Hai to all, > > I installed ActivePython-2.4.1-247-win32-ix86 and > wxPython2.6-win32-ansi-2.6.2.1-py2 in my system. When i Run > a wxPython example.. geeting an Errors > [snip] > File "F:\python\wx.py", line 1, in ? > from wxPython

Re: [Tutor] How can a function know where it was called from

2006-03-02 Thread Andre Roberge
On 3/2/06, Ben Vinger <[EMAIL PROTECTED]> wrote: > > Hello > > I want myfunction in the pseudocode below return something different if it > was called from indexfunction. > How about adding a parameter to myfunction itself: def indexfunction(): blah myfunction(fromindexfunction=True) d

[Tutor] Opening .py files in firefox

2006-03-19 Thread Andre Roberge
Hi everyone- This is not strictly speaking a Python question but it's probably something that other pythonistas have encountered and, hopefully solved :-) When I click on a link to a ".py" file (either remotely or on my computer) using firefox, it gives me two options: running the script with the

Re: [Tutor] Opening .py files in firefox

2006-03-19 Thread Andre Roberge
On 3/19/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > computer) using firefox, it gives me two options: running the script > > with the default Python app, or saving the file. What I would like is > > to display the file as text in the browser. > > Open Tools->Folder Options in Windows explorer >

Re: [Tutor] Python & MP3

2006-03-21 Thread Andre Roberge
On 3/21/06, Johanna <[EMAIL PROTECTED]> wrote: > Hallo > This is my first post, so hallo to everyone. Im just a newbee with python so > I hope my msg will make some sense. > > Is it possible to work with MP3 in python? > Pygame (http://www.pygame.org/docs/ref/music.html) apparently works with mp3

Re: [Tutor] Opening .py files in firefox

2006-03-21 Thread Andre Roberge
** Copy of a reply sent only to Alan Gauld by mistake. On 3/20/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > If the browser tries to execute the script you will need to go to > > the file types setting in the browser and set .py to plain-text. > > > > This is what I need to do ... but, after looki

Re: [Tutor] Simple way for i18n ?

2006-03-22 Thread Andre Roberge
On 3/22/06, francois schnell <[EMAIL PROTECTED]> wrote: > > Hello all, > > I wish to translate a Python script from English to French. I've read the > offical documentation (python.org doc) but I must admit that I'm lost now > ... > I've found some simple explanations here but I can't make it work:

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Andre Roberge
On 4/8/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Desktop to the executable). The problem is, only *one* person at a time > > should run the program. [snip] > > The usual way of doing this is simply to create an empty file > when the program starts and delete it when the program closes > In pyt

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Andre Roberge
On 4/13/06, Matthew Singletary <[EMAIL PROTECTED]> wrote: > > first, A disclaimer: > This isn't directly homework but is related to an assignment of mine > > I'm building a genetic algorithm to solve the queen placement problem, the > complicated stuff I can do on my own, but I'm not getting one pa

[Tutor] unit testing raw_input()

2006-04-18 Thread Andre Roberge
Hi all- Suppose I had a function like the following: def y_n(prompt="Answer yes or no"): while True: answer = raw_input(prompt) if answer in ['y', 'Y', 'yes']: print "You said yes!" break elif answer in ['n', 'N', 'no']: print "You s

[Tutor] [Summary] Re: unit testing raw_input()

2006-04-19 Thread Andre Roberge
Thank you Michael, Danny and Alan for your suggestions. I've included below my summary of the three very different suggestions, my brief analysis of them, and my conclusion. Anyone is free and welcome to comment! On 4/18/06, Andre Roberge <[EMAIL PROTECTED]> wrote: > Hi all- >

[Tutor] Avoiding the use of files to store intermediate results

2006-04-24 Thread Andre Roberge
I wrote a small wxPython based app to test code snippets. (google for "python lightning compiler" if you want to see the full code). In the basic mode, I redirect the standard input and output and execute the code taken from the editor window so that the result appears in the output window. Here

Re: [Tutor] Avoiding the use of files to store intermediate results

2006-04-25 Thread Andre Roberge
On 4/25/06, Hugo González Monteverde <[EMAIL PROTECTED]> wrote: > Remember duck typing. An object just needs to look like a file in order > to be used like one. > > Guido's time machine has already forseen your problem. Take a look at > the StringIO module. It allows you to use a string where you

Re: [Tutor] web intefaces?

2006-05-09 Thread Andre Roberge
On 5/9/06, Christian Wyglendowski <[EMAIL PROTECTED]> wrote: [on creating a web app...] > > If you do go with CherryPy, check out this recipe I submitted to the > online Python Cookbook: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442481 > > It was written for CherryPy 2.1 but should

[Tutor] help requested: port not free, under Windows XP

2006-05-24 Thread Andre Roberge
[message re-sent; original seemed not to have been received, according to the archives. Apologies if this is not the case.]Hi all-===Preliminaries===I wrote a new app (Crunchy Frog) which is meant to transform "boring" traditional python tutorial into truly interactive experiences.  It is still at

[Tutor] help requested: port not free, under Windows XP

2006-05-24 Thread Andre Roberge
Hi all-===Preliminaries===I wrote a new app (Crunchy Frog) which is meant to transform "boring" traditional python tutorial into truly interactive experiences.  It is still at an alpha stage but is promising imo; for those interested, you can find it at: https://sourceforge.net/project/showfiles.ph

Re: [Tutor] help requested: port not free, under Windows XP

2006-05-25 Thread Andre Roberge
On 5/25/06, Richard Harding <[EMAIL PROTECTED]> wrote: Andre Roberge wrote:> ===Now the question===> Someone on edu-sig tried to get it working on her computer running> Windows XP home edition (just like mine, where it works fine!).> However, she gets an error message about >

Re: [Tutor] Reference a variable from a string whose value is the name of the variable

2006-06-05 Thread Andre Roberge
I'm not sure if it's exactly what you need, but here's something that may come close.On 6/5/06, Peter Jessop <[EMAIL PROTECTED] > wrote:The best way to explain my problem is with an examplef0_n = "field0" f0_v ="value0"f1_n="field1"f1_v="value1"...f100_n = "field100"f100_v = "value100"Ok, I'm going

Re: [Tutor] Reference a variable from a string whose value is the name of the variable

2006-06-05 Thread Andre Roberge
On 6/5/06, Peter Jessop <[EMAIL PROTECTED]> wrote: Thanks AndreI realise now I did not make it too clear.Basically the variable names are predictable but the values aren't.I assumed that.  I just recreated the list as you gave it because it was easy :-) Maybe I should have expressed it like thisf0_

Re: [Tutor] An Introduction and a question

2006-06-09 Thread Andre Roberge
On 6/9/06, Michael Sullivan <[EMAIL PROTECTED]> wrote: > My name is Michael Sullivan. I am a 26 year-old college student in > Oklahoma. My wife and I have a small (three PCs) computer network that > we operate out of our home. We have our own domain (as one could tell > by examining my email addr

Re: [Tutor] Need info regd Singleton class implementation

2006-06-15 Thread Andre Roberge
On 6/15/06, Akanksha Govil <[EMAIL PROTECTED]> wrote: > hi, > > I need to implement a singleton class in python. > Please give me some refernce sites which can help me with the same. The online Python Cookbook is a good reference site. Here's the result from a search: http://aspn.activestate.com/

Re: [Tutor] local day names in ascii

2006-06-19 Thread Andre Roberge
May I suggest you look at this http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/251871 including the comments. (The last comment in particular looks intriguing...) André On 6/19/06, frank h. <[EMAIL PROTECTED]> wrote: > Hello List, > i am trying to convert local Swedish daynames to ASCII

[Tutor] Fwd: local day names in ascii

2006-06-19 Thread Andre Roberge
Message forwarded to the list for information. André -- Forwarded message -- From: frank h. <[EMAIL PROTECTED]> Date: Jun 19, 2006 11:06 AM Subject: Re: [Tutor] local day names in ascii To: Andre Roberge <[EMAIL PROTECTED]> André, thank you so much for this spot-on

[Tutor] [ANN] RUR-PLE version 0.9.9

2006-06-22 Thread Andre Roberge
Roberge's Used Robot: a Python Learning Environment Version 0.9.9 of RUR-PLE has been released. It can be found at: https://sourceforge.net/project/showfiles.php?group_id=125834 RUR-PLE should work properly on all major platforms (Mac, Linux and Windows) in 3 different languages (English, French

Re: [Tutor] Python Programming Books

2006-07-14 Thread Andre Roberge
On 7/14/06, Terry Carroll <[EMAIL PROTECTED]> wrote: > On Thu, 13 Jul 2006, Grady Henry wrote: > > > I have three books on Python programming, "Learning Python" by O'Reilly, > > "Beginning Python" by Hetland, and "Python in a Nutshell" by O'Reilly. > > Are these good (recommended) books? Any other

Re: [Tutor] Python Programming Books

2006-07-14 Thread Andre Roberge
On 7/14/06, wesley chun <[EMAIL PROTECTED]> wrote: > while it would be a conflict-of-interest for me to give *my* opinion > of the book, it appears to be pretty well-received (mostly by > word-of-mouth) based on comments i've seen so far. :-) > I don't know about others, but I think it might be of

Re: [Tutor] File like object for Windows registry

2006-08-03 Thread Andre Roberge
On 8/3/06, Henry Finucane <[EMAIL PROTECTED]> wrote: > On 8/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello! > > > > My app should run on debian and windows platforms. For storing the > > configuration data, I use the ConfigParser module. > > > > What I find difficult is to determine

Re: [Tutor] Is there Python code for accessing an object's reference count?

2006-10-03 Thread Andre Roberge
On 10/3/06, Dick Moores <[EMAIL PROTECTED]> wrote: > Is there Python code for accessing an object's reference count? See sys.getrefcount. André Roberge > > And does it matter to Python what this count is, other than whether > it is zero or greater than zero (for garbage collection)? > > Thanks, >

Re: [Tutor] Use Python to learn kids (9 yr) to program

2006-11-29 Thread Andre Roberge
HI- I think Python is a great choice. You may want to have a look, as a first step, at rur-ple. Then, as a next step (although it might be a bit steep), you may want to have a look at livewires . This will provide a good intr

Re: [Tutor] Use Python to learn kids (9 yr) to program

2006-11-29 Thread Andre Roberge
no OOP support. Rur-ple uses standard Python and has OOP support. André -- Senthil -- *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Andre Roberge *Sent:* Wednesday, November 29, 2006 8:26 PM *To:* [EMAIL PROTECTED] *Cc:* bp *Subject:* Re: [Tuto

Re: [Tutor] how to know if a file exists

2007-01-03 Thread Andre Roberge
On 1/4/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: shawn bright wrote: > hello there, > i am writing an app for linux. what command would be easiest to test > and see if a certain file exist ? > i was going to do something like this > try: > file = open('/path/to/file', 'rb') > retu

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Andre Roberge
On 3/11/07, Tsila Hassine <[EMAIL PROTECTED]> wrote: > I also tried that build as well - it says that installation completed > succesfully - and when i try to launch IDLE - it won't open... > Could it be that the 2.3 version is still around and that you are trying to launch the 2.3 version of IDLE