[Tutor] Random module error

2008-05-15 Thread Guess?!?
Hello All, I am importing module "random" and it is giving me this error below AttributeError: 'module' object has no attribute 'randrange' What could be the reason for this? When I chk API ..random module has a function randrange .. >>> from TurtleWorld import * Traceback (most recent call

Re: [Tutor] looking for ways to get diff between two txt files

2008-05-15 Thread Kent Johnson
On Thu, May 15, 2008 at 1:58 AM, Kamal <[EMAIL PROTECTED]> wrote: > Hi, > > I would really appreciate if someone help to find a way to calculate > delta (diff) between two similar text files. This example would be pretty easy to modify to do what you want: http://personalpages.tds.net/~kent37/blog

Re: [Tutor] Iterate through dictionary values and remove item

2008-05-15 Thread bob gailer
GTXY20 wrote: Hello all, I have dictionary like the following: d={(1,23A):[a,b,c,d], (1,24A):[b,c,d], (2,23A):[a,b], (2,24A):[a,b,c,d]} I would like to iterate through the dictionary such that if it finds the value 'a' in the values of the key that it would remove the value 'b' from the value

Re: [Tutor] Iterate through dictionary values and remove item

2008-05-15 Thread Kent Johnson
On Thu, May 15, 2008 at 2:40 AM, GTXY20 <[EMAIL PROTECTED]> wrote: > Hello all, > > I have dictionary like the following: > > d={(1,23A):[a,b,c,d], (1,24A):[b,c,d], (2,23A):[a,b], (2,24A):[a,b,c,d]} > > I would like to iterate through the dictionary such that if it finds > the value 'a' in the val

Re: [Tutor] Random module error

2008-05-15 Thread Kent Johnson
On Thu, May 15, 2008 at 3:00 AM, Guess?!? <[EMAIL PROTECTED]> wrote: > Hello All, > > I am importing module "random" and it is giving me this error > below AttributeError: 'module' object has no attribute 'randrange' You have named your program random.py. The import finds your program rather than

[Tutor] Freeze utility

2008-05-15 Thread Diego Trazzi
Can you recommended any good freeze utility for python to create linux standalone executables, other than the freeze.py ? this script doen't seems to include my .gif images... Thank you. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mai

[Tutor] (no subject)

2008-05-15 Thread root
hi ,i am working to replace three lines in a httpd.conf file using regular expression.i am able to change only one among them but while replacing other i am not geeting good idea to replace all the three lines just in a single script ,,my script is like #!usr/bin/python import sys import os impo

Re: [Tutor] (no subject)

2008-05-15 Thread Kent Johnson
On Thu, May 15, 2008 at 11:22 AM, root <[EMAIL PROTECTED]> wrote: > hi ,i am working to replace three lines in a httpd.conf file using > regular expression You don't need regex for this, you are replacing plain strings. I would read the entire file, change the strings and write it out again. For

Re: [Tutor] Iterate through dictionary values and remove item

2008-05-15 Thread GTXY20
Hi Kent and Bob, Bob sorry about the previous code snippet (was late) - I had previously been trying to accomplish with the following: for k,v in d.items(): u=k[0] b=k[1] if 'a' in v: for k,v in d.items(): if k[0] == u: for vals in v:

Re: [Tutor] Iterate through dictionary values and remove item

2008-05-15 Thread Kent Johnson
On Thu, May 15, 2008 at 12:58 PM, GTXY20 <[EMAIL PROTECTED]> wrote: > I suspect that I need > to get a better handle on the difference between items() and iteritems() and > what situations would call for them respectively. items() returns a list, iteritems() returns an iterator. If you don't actua

[Tutor] Open a directory in the default file manager

2008-05-15 Thread Tim Michelsen
Hello, is there any function/module that allows me to open a directory in the default file manager of a operating system? Here I a piece of code how to open a URL in the default webbrowser: http://www.python.org/doc/lib/module-webbrowser.html import webbrowser myurl = 'http://www.python.org'

[Tutor] Guido van Robot help

2008-05-15 Thread Gillian
Hi, Would anyone be able to offer assistance re: using Guido van Robot to perform pattern recognition (as in it "sees" a particular pattern (like a 3x5 grid depiction of the letter "A") and responds accordingly)? In my example, Guido recognizes a specific letter by placing down an appropriate amou

Re: [Tutor] Random module error

2008-05-15 Thread Guess?!?
Hello Kent, I dont have any program with name random.py. I am using swampy API ( http://allendowney.com/swampy/install.html) As instructed by author, I do following steps 1> unzip/extract the folder into Python directory 2> go to the swampy directory 3> and invoke python command to start interpre

Re: [Tutor] Random module error

2008-05-15 Thread christopher . henk
Your original post showed this traceback: Traceback (most recent call last): File "", line 1, in File "C:\Python25\swampy.1.1\TurtleWorld.py", line 1, in from World import * File "C:\Python25\swampy.1.1\World.py", line 29, in import random File "C:\Python25\random.py", line 4, in

Re: [Tutor] Random module error

2008-05-15 Thread Guess?!?
Got it fixed ...Thanks Kent and Chris. I might have created a prog and named it random and later deleted it but pyc was still sitting at the bottom I purged it and I am back on learning curve ... ~G On Thu, May 15, 2008 at 1:18 PM, <[EMAIL PROTECTED]> wrote: > > Your original post showe