Re: can this be implemented?

2007-06-02 Thread greenflame
On Jun 2, 5:05 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Jun 2, 6:54 pm, greenflame <[EMAIL PROTECTED]> wrote: > > > First I should start with some introductory comments. > > > When I first learned about programming, I started with BASIC, QBASIC > > to

can this be implemented?

2007-06-02 Thread greenflame
First I should start with some introductory comments. When I first learned about programming, I started with BASIC, QBASIC to be more accurate. While I was at that stage, I learned about the INPUT command. I used it abundantly. Ok so now for the actual issue. I would like to implement something

Re: function that modifies a string

2006-07-09 Thread greenflame
Jason wrote: > > You cannot do what you are trying to do directly. Strings are > immutable objects. Once a string is created, that string cannot be > modified. When you operate on a string, you produce a different > string. Functions which operate on a string should return their value: > > >>>

function that modifies a string

2006-07-09 Thread greenflame
I want to make a function that does the following. I will call it thefunc for short. >>> s = "Char" >>> thefunc(s) >>> s '||Char>>' I tried the following def thefunc(s): s = "||" + s + ">>" The problem is that if I look at the string after I apply the function to it, it is not modified. I r

Re: reordering elements of a list

2006-06-05 Thread greenflame
Thanks all for your help! -- http://mail.python.org/mailman/listinfo/python-list

Re: reordering elements of a list

2006-06-03 Thread greenflame
Thank you all for your replies. The only thing is I do not understand how the code is working. The following are more particular questions. Travis: Iam sorry, but I do not know what list comprehension is. Roberto: I do not understand the first half of the last line of your code. Also thank you for

reordering elements of a list

2006-06-03 Thread greenflame
I am trying to reorder elements of a list and I am stuck as to what might be the best way to approach this. I have a (main) list of elements and another (ordering) list (which is may shorter, but not longer than the main list) which contains the order in which I want the elements of the main list

Re: Making a second window with Tkinter

2006-06-03 Thread greenflame
What you said about why my code is wrong is still a bit fuzzy but it worked! -- http://mail.python.org/mailman/listinfo/python-list

Re: how to erase a variable

2006-06-03 Thread greenflame
Ok thanks all! -- http://mail.python.org/mailman/listinfo/python-list

how to erase a variable

2006-06-02 Thread greenflame
Is there a way to get rid of a variable as though it never existed? I know this sounds very basic but I have not come across any such methods. Also is the fact that I will have a bunch of extra variables just haning around because my use for them is over a bad thing? I will likely have on the order

Re: Making a second window with Tkinter

2006-06-02 Thread greenflame
Ok so I played with your script. Here is a script that more closely mimics what I would like to do except that the way I make the variable deckstr will be different. The only thing I am confused about is that it opens the second window in the beginning and when I click on the button, it does nothin

Making a second window with Tkinter

2006-06-02 Thread greenflame
I have a script that will make a window that shows the text I want using Tkinter. What I need to do is to make another window popup above the current window showing other text. I tryed: --- from Tkinter imprt * root = Tk() L = Label(root, text="Blah") L.grid(row=0, column=0) # Other lab

Re: shuffling elements of a list

2006-05-30 Thread greenflame
Thank you all for all of your help. Also I got the shuffle function to work. Do not worry I will be back soon with more shuffling! However, I do not quite understand this DSU that you mention, although it looks useful. -- http://mail.python.org/mailman/listinfo/python-list

Re: shuffling elements of a list

2006-05-30 Thread greenflame
Zhang Fan wrote: > On 30 May 2006 20:18:19 -0700, greenflame <[EMAIL PROTECTED]> wrote: > > Second of all, I would like to have > > other methods of shuffling, prefererably riffle shuffling and just > > plain randomly arranging the elements of the list. > > The ran

shuffling elements of a list

2006-05-30 Thread greenflame
I would like to make a function that takes a list, more specificaly a list of strings, and shuffles its elements, like a pile of cards. The following is a script I tryed to make that implements pile shuffling. -- testdeck = list('qwertyuiop') def pileshuffle(DECK, NUMPILES): """Split