Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote In addition to Kents comments about dictionaruy access I think there may be another problem in your logic. > The first loop is supposed to populate G with > a random range of 4 integers 10 to 109 > in random keys 1-19 that have a zero (except keY 6 and keY

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Alan Gauld
"brindly sujith" <[EMAIL PROTECTED]> wrote > i am developing a GUI application in python(tkinter) > > i want to know how to make the python program as a application ie i > want to > make it executable If you are on Windows it should be executable already, just double click on the main file in W

[Tutor] how to enable overrideredirect

2008-01-30 Thread brindly sujith
from Tkinter import * import tkMessageBox import tkFileDialog,os def quit(): if tkMessageBox.askokcancel("Quit","DO u really want to quit"): root.destroy() def fiopen(): file1 = tkFileDialog.askopenfile(parent=root,mode='rb',title='Choose a file') os.system

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Luke Paireepinart
Alan Gauld wrote: > "brindly sujith" <[EMAIL PROTECTED]> wrote > > >> i am developing a GUI application in python(tkinter) >> >> i want to know how to make the python program as a application ie i >> want to >> make it executable >> > > If you are on Windows it should be executable alread

[Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Dick Moores
This is probably a totally naïve and silly idea, but I thought I'd run it by the Tutors anyway. Years ago I learned a bit of Visual Basic (VB6, IIRC) at a community college. Months ago I downloaded the free Visual Basic 2005 Express (), but di

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Thorsten Kampe
* Luke Paireepinart (Wed, 30 Jan 2008 03:59:59 -0600) > I think he meant " i want to make the application [into an] > executable" I.E. he wants an .exe file on Windows. > In this case, you can use py2exe, and there's another alternative I > can't remember. The better alternative is "Pyinstaller"..

Re: [Tutor] how to enable overrideredirect

2008-01-30 Thread Kent Johnson
brindly sujith wrote: > while executing this program > > initially a window will openafter that the buttons 'select' > and 'exit' is not working... It works for me as written on Mac OSX with Python 2.5.1. What platform are you running on? How are you running the program? If you are running

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Kent Johnson
Dick Moores wrote: > But I was wondering if it was possible to write > Python code in Iron Python and use it somehow in > Visual Basic 2005 Express. VB seemed a very easy > way to create a GUI, but of course I prefer Python for the code. > > So, possible/impossible/impractical/foolish/Pythonic

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 29, 2008 9:26 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Try > if keY == 6 or keY == 11 or tablE[keY-1][6] != 0: > tablE[5][6] = 0 > tablE[10][6] = 0 > > etc. > > Kent > > PS what's with the strange capitalization of variable names? It's a test snippet. I use unusu

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 29, 2008 9:26 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > if keY == 6 or keY == 11 or tablE.values()[keY-1][6] != 0: > > tablE.values()[5][6] = 0 > > tablE.values()[10][6] = 0 > > This is not the right way to access the values of a dict. tablE.values(

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Dick Moores
At 04:02 AM 1/30/2008, Kent Johnson wrote: >Dick Moores wrote: > >>But I was wondering if it was possible to write Python code in Iron >>Python and use it somehow in Visual Basic 2005 Express. VB seemed a >>very easy way to create a GUI, but of course I prefer Python for the code. >>So, possible/

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Dick Moores
At 05:26 AM 1/30/2008, Kent Johnson wrote: >Dick Moores wrote: > But I was wondering if it was possible to write Python code in Iron Python and use it somehow in Visual Basic 2005 Express. > >You might have better luck asking on an IronPython list. I don't >know if we have any IronPython

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 8:24 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > Now that you mention it, I do seem to remember that the order of > > a list is indeterminate. > > No; the order of a dict is indeterminate, and consequently the order of > lists derived from dicts with keys(), val

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread Kent Johnson
bhaaluu wrote: > On Jan 30, 2008 8:24 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: >> bhaaluu wrote: >>> Now that you mention it, I do seem to remember that the order of >>> a list is indeterminate. >> No; the order of a dict is indeterminate, and consequently the order of >> lists derived from dict

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Michael Langford
On the command line type "which python" Then at the top of your script put: #!/usr/bin/python or whatever path the which command outputted. Then run chmod on the program: chmod ugo+x script.py then the following will work: ./script.py If you actually want to build an executable that doesn't

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread Kent Johnson
bhaaluu wrote: > Now that you mention it, I do seem to remember that the order of > a list is indeterminate. No; the order of a dict is indeterminate, and consequently the order of lists derived from dicts with keys(), values(), etc. is indeterminate. The order of a list is determined by how you

Re: [Tutor] how to make python program as executable

2008-01-30 Thread Michael Langford
What platform? The mechanism is different for each major OS. On Jan 30, 2008 2:25 AM, brindly sujith <[EMAIL PROTECTED]> wrote: > hi > > i am developing a GUI application in python(tkinter) > > i want to know how to make the python program as a application ie i want to > make it executable > >

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Kent Johnson
Dick Moores wrote: >>> But I was wondering if it was possible to write Python code in Iron >>> Python and use it somehow in Visual Basic 2005 Express. You might have better luck asking on an IronPython list. I don't know if we have any IronPython gurus here. Kent __

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 9:22 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > This is implementation dependent. >[snip] > > > if travelTable.values()[roomNum-1][0] != 0: > > Again, the use of travelTable.values() is pointless, inefficient (it > creates a new list every time you call it) and indetermin

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 3:35 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > In addition to Kents comments about dictionaruy > access I think there may be another problem in > your logic. > > > "bhaaluu" <[EMAIL PROTECTED]> wrote > > > The first loop is supposed to populate G with > > a random range of 4 integ

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread Kent Johnson
bhaaluu wrote: > # distribute positive numbers 10 to 109 > # place in last element of 4 random lists > # nothing is placed in list 6 or 11 > cnt=0 > while cnt <= 3: > a = range(1,20) > room = random.choice(a) room = random.randint(1, 19) is simpler. > if room != 6 and room != 11 and

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bob gailer
bhaaluu wrote: > # N S E W U D T > travelTable=[[0,2,0,0,0,0,0],# ROOM 1 > [1,3,3,0,0,0,0],# ROOM 2 It is good to finally see that you are building an adventure game. Consider creating a instance of a Room class for each room and saving them in a collection such a

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 12:46 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > > # distribute positive numbers 10 to 109 > > # place in last element of 4 random lists > > # nothing is placed in list 6 or 11 > > cnt=0 > > while cnt <= 3: > > a = range(1,20) > > room = random.choice(a

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > But I was wondering if it was possible to write > Python code in Iron Python and use it somehow in > Visual Basic 2005 Express. VB seemed a very easy > way to create a GUI, but of course I prefer Python for the code. It should be possible but I've no

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 2:24 PM, bob gailer <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > # N S E W U D T > > travelTable=[[0,2,0,0,0,0,0],# ROOM 1 > > [1,3,3,0,0,0,0],# ROOM 2 > It is good to finally see that you are building an adventure game. > > Consider creating a in

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Dick Moores
At 11:46 AM 1/30/2008, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > But I was wondering if it was possible to write > > Python code in Iron Python and use it somehow in > > Visual Basic 2005 Express. VB seemed a very easy > > way to create a GUI, but of course I prefer Python f

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
I got Bob's code running! Here it is for all nineteen rooms: #!/usr/bin/python # 2008-01-30 # bob gailer [Tutor] import random class Room: roomNo = 0 def __init__(self, destinations, updatable=True): Room.roomNo += 1 self.roomNo = Room.roomNo self.destinations = destinations # store

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Luke Paireepinart
> > Alan, could you explain what you mean by "the intermediate code thing"? He's referring to CLR. The .NET framework compiles all of its programs into a Common Language Runtime, so at the lower level, there's no(t much?) difference between the different languages, and thus they can interface w

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 10:13 PM, Tiger12506 <[EMAIL PROTECTED]> wrote: > If you're looking for examples - I like the zork games... > > http://www.csd.uwo.ca/Infocom/download.html > I've already looked at the Infocom site and didn't find anything that helped me understand Text Adventure Games like Hartne

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote >>But the whole idea of the intermediate code thing is >>that you can intermix languages. > > Alan, could you explain what you mean by "the intermediate code > thing"? .NET works like Java in that it doesn't compile into machine language object code direc

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Dick Moores
At 02:32 PM 1/30/2008, Luke Paireepinart wrote: >>Alan, could you explain what you mean by "the intermediate code thing"? >He's referring to CLR. The .NET framework compiles all of its >programs into a Common Language Runtime, so at the lower level, >there's no(t much?) difference between the d

Re: [Tutor] Iron Python and Visual Basic 2005 Express

2008-01-30 Thread Dick Moores
At 03:03 PM 1/30/2008, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > >>But the whole idea of the intermediate code thing is > >>that you can intermix languages. > > > > Alan, could you explain what you mean by "the intermediate code > > thing"? > >.NET works like Java in that it d

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread Kent Johnson
bhaaluu wrote: > References: > http://www.csd.uwo.ca/Infocom/ > http://www.atariarchives.org/adventure/ > http://en.wikipedia.org/wiki/Tim_Hartnell > http://www.renpy.org/wiki/renpy/Home_Page > > Believe me, I've looked at a LOT of stuff trying to get a > handle on Adventure Games. 8^D I'm surpri

Re: [Tutor] results not quite 100 percent yet

2008-01-30 Thread bhaaluu
On Jan 30, 2008 11:25 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > References: > > http://www.csd.uwo.ca/Infocom/ > > http://www.atariarchives.org/adventure/ > > http://en.wikipedia.org/wiki/Tim_Hartnell > > http://www.renpy.org/wiki/renpy/Home_Page > > > > Believe me, I've look

[Tutor] appending to a list

2008-01-30 Thread David Bear
I want to return a tuple from a function. I want to append the second element of that tupple to a list. For example mylist = [] def somefunc(): return(3.14, 'some string') somenum, mylist.append(??) somefunc() obviously, the syntax doesn't work. This should be easy, but I've never seen exampl

Re: [Tutor] appending to a list

2008-01-30 Thread Bill Campbell
On Wed, Jan 30, 2008, David Bear wrote: >I want to return a tuple from a function. I want to append the second >element of that tupple to a list. For example > >mylist = [] >def somefunc(): > return(3.14, 'some string') > >somenum, mylist.append(??) somefunc() > >obviously, the syntax doesn't wor

[Tutor] how to use freeze for making executable python file in linux

2008-01-30 Thread brindly sujith
can i use freeze to make my python program in to executable in linux if yes...plz tell me how to use freeze whether i need to install something or its default in python ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tuto