Re: [Tutor] Obtaining various combinations of a given word

2008-07-29 Thread Brendan
sai krishna gmail.com> writes: > > > Hi,everyone.My name is Sai krishna, and I'm new to Python as well as Programming.I wanted to print out all the combinations of a given word.I am doing it this way: > n='cat'def arrange(n):if len(n)==1: #length of word is 1    print nelif len(n)==2: # length

Re: [Tutor] Obtaining various combinations of a given word

2008-07-29 Thread John Fouhy
On 30/07/2008, sai krishna <[EMAIL PROTECTED]> wrote: > I wanted to print out all the combinations of a given word. A thought for you: Let's say you want to find permutations of the string 'abcd'. Some of those permutations will start with 'a' -- how many? Can you list all the permutations star

Re: [Tutor] Obtaining various combinations of a given word

2008-07-29 Thread Vivek Sant
Hi Sai krishna, I recently wrote a program that does something similar to what you want. If you are familiar with the game text-twist, I wrote up a "solver" that will untwist any word by generating all possible combinations and then checking against a dictionary. To be honest, I had a lit

Re: [Tutor] Obtaining various combinations of a given word

2008-07-29 Thread bob gailer
sai krishna wrote: Hi,everyone. My name is Sai krishna, and I'm new to Python as well as Programming. Welcome. I wanted to print out all the combinations of a given word. More precisely you want to print all the combination of the letters in a given word. I am doing it thi

Re: [Tutor] Python Desktop Application for a Case Study

2008-07-29 Thread Alan Gauld
"Michael Perscheid" <[EMAIL PROTECTED]> wrote I'm looking for a Python application with source code to analyse it with my small research project. The programm should have the following properties: Try Sourceforge. There is a drawing tool - think Visio - that is in Python, maybe that would do?

[Tutor] Obtaining various combinations of a given word

2008-07-29 Thread sai krishna
Hi,everyone. My name is Sai krishna, and I'm new to Python as well as Programming. I wanted to print out all the combinations of a given word. I am doing it this way: n='cat' def arrange(n): if len(n)==1: #length of word is 1 print n elif len(n)==2: # length of word is 2 print n[0]+n[1]

[Tutor] Python Desktop Application for a Case Study

2008-07-29 Thread Michael Perscheid
Hi list, I'm looking for a Python application with source code to analyse it with my small research project. The programm should have the following properties: - Using a GUI framework at best PyQt - Desktop application with small breaks. That means the software does nothing in that moments a

Re: [Tutor] Style help: long strings with formatting

2008-07-29 Thread Alan Gauld
"W W" <[EMAIL PROTECTED]> wrote output = "At an average weekly savings of $%.02f, your monthly savings will be $%.02f. \n Your annual savings will be $%.02f." % (diff, monthly_savings, annual_savings) print output. As you can see, it's very much longer than the 72 characters suggested in

Re: [Tutor] How to run a Python program under Windows.

2008-07-29 Thread Alan Gauld
"bob gailer" <[EMAIL PROTECTED]> wrote Best way for now is from the command prompt (like "c:\\python25\\python test.py") Since many newbies have no idea how to start a command prompt I'll add: go to Start->Run type CMD in the dialog and click OK A black window should appear, this is the

Re: [Tutor] Memroy Error - how to manage large data sets?

2008-07-29 Thread Alan Gauld
"kinuthiA muchanE" <[EMAIL PROTECTED]> wrote Umm, not instantly on my PC... 1 million took 5 minutes, I've no idea how long 100 million would take! I think the question is to calculate the sum of all even numbers in the Fibonacci series which do not exceed a million, not the millionth term.

[Tutor] Style help: long strings with formatting

2008-07-29 Thread W W
Hi, I've been dinking around, making a program that will find out how different factors affect what you *really* save on gas, and at the end I have it output some information, but I'm not sure what the right style for formatting is. output = "At an average weekly savings of $%.02f, your monthly

Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote OK, let's eliminate some variables and go back to getting the python script working. Remember, it does work. Not if it doesn't close down cleanly. In my book that's broken! I've used turtle many times and never seen this behaviour before. What does

Re: [Tutor] (no subject)

2008-07-29 Thread Tim Golden
Noufal Ibrahim wrote: Morgan Thorpe wrote: Hello. I'm am very new to the whole programming sence. Welcome. :) I am trying to catch on but as soon as i want to write a program i've been told to use like 'notepad' in windows XP and save it as a .py file i have gotten this far. Am i wrong so

Re: [Tutor] (no subject)

2008-07-29 Thread W W
Another thing you might want to check, since you're using Windows: Open up windows explorer, go the "tools" menu, "folder options", then click the "view" tab, and then make sure the option "hide extensions for known filetypes" is unchecked. If it's not, uncheck it, and click OK. Then go and make s

[Tutor] How to run a Python program under Windows.

2008-07-29 Thread bob gailer
Morgan Thorpe wrote: Hello. Hi. I'm am very new to the whole programming sence. Welcome. I am trying to catch on but as soon as i want to write a program i've been told to use like 'notepad' in windows XP and save it as a .py file i have gotten this far. Am i wrong so far? No. There ar

Re: [Tutor] (no subject)

2008-07-29 Thread S Python
Hi Morgan, Have you installed Python on your computer? If you are using Microsoft Windows, you can download and install Python from here: http://python.org/download/releases/2.5.2/ and select "python-2.5.2.msi". Once it's installed, you should have a directory on your machine called "C:\python25

Re: [Tutor] (no subject)

2008-07-29 Thread Noufal Ibrahim
Morgan Thorpe wrote: Hello. I'm am very new to the whole programming sence. Welcome. :) I am trying to catch on but as soon as i want to write a program i've been told to use like 'notepad' in windows XP and save it as a .py file i have gotten this far. Am i wrong so far? It's fine so fa

[Tutor] (no subject)

2008-07-29 Thread Morgan Thorpe
Hello. I'm am very new to the whole programming sence. I am trying to catch on but as soon as i want to write a program i've been told to use like 'notepad' in windows XP and save it as a .py file i have gotten this far. Am i wrong so far? If i am right why is it that i can't run it in anyway bes

[Tutor] Memory Error problem solved

2008-07-29 Thread Karthik Swaminathan
d to calculate the > > total as you go without saving the values > > > > I got curious so wrote the following function: > > >>> def fibtot(N): > ... f0,f1,tot = 0,1,1 > ... for n in range(N): > ... f = f0 + f1 > ... f0,f1 = f1,f > ... i

Re: [Tutor] Memroy Error - how to manage large data sets?

2008-07-29 Thread kinuthiA muchanE
On Tue, 2008-07-29 at 12:00 +0200, [EMAIL PROTECTED] wrote: > Message: 2 > Date: Tue, 29 Jul 2008 08:44:40 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Tutor Digest, Vol 53, Issue 99 > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; forma

Re: [Tutor] Memory error - how to manage large data sets?

2008-07-29 Thread Chris Fuller
The original post was a little ambiguous: "I need to find the sum of all numbers at even positions in the Fibonacci series upto 2 million." But the project euler page (http://projecteuler.net/index.php?section=problems&id=2) is clear: "Find the sum of all the even-valued terms in the sequence

Re: [Tutor] newbie graphing question

2008-07-29 Thread Peter Petto
Title: Re: [Tutor] newbie graphing question Thanks so much to everyone who helped me with my gui/drawing request. I appreciate the responses from Alan, bhaluu, James, and Pierre, and am exploring all the suggestions I received. At the moment, I have my immediate needs satisfied with Tkinter -- e

Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Kent Johnson
On Mon, Jul 28, 2008 at 4:44 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > Win XP, Python 2.51 > > The script is at It calls the > Windows console to show the printed data. > > I've successfully used PyInstaller to make an .exe for this. For informed > u

Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Dick Moores
At 12:38 AM 7/29/2008, Alan Gauld wrote: "Dick Moores" <[EMAIL PROTECTED]> wrote Very odd, I assume the python script when executed normally doesn't exhibit such odd behaviour? When I try to stop the script from running not by a Ctrl+Q on the console window, but on the Turtle window, the on

Re: [Tutor] Tutor Digest, Vol 53, Issue 99

2008-07-29 Thread Alan Gauld
"kinuthiA muchanE" <[EMAIL PROTECTED]> wrote I have realised that when you need to work with large numbers, lists are slow and tend to gobble up bytes. The lists are not particularly slow (obviously if you want to traverse them they take longer for more members) and they don't take up much mo

Re: [Tutor] Turtle problem: how to exit the .exe?

2008-07-29 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote Very odd, I assume the python script when executed normally doesn't exhibit such odd behaviour? When I try to stop the script from running not by a Ctrl+Q on the console window, but on the Turtle window, the only way is to use the Task Manager. OK,