Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread eryksun
On Fri, Aug 10, 2012 at 6:10 PM, Martin A. Brown wrote: > > : values = {'a':'d', 'b':'e', 'c':'f', 'd':'g', 'e':'h', 'f':'i', 'g':'j', > : 'h':'k', 'i':'l', 'j':'m', 'k':'n', 'l':'o', 'm':'p', 'n':'q', 'o':'r', > : 'p':'s', 'q':'t', 'r':'u', 's':'v', 't':'w', 'u':'x', 'v':'y', 'w':'z', > : 'x'

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Wayne Werner
On Fri, 10 Aug 2012, Dave Angel wrote: On 08/10/2012 03:53 PM, Joel Goldstick wrote: The clue was actually in his code. See his shebang line -- he's using Python 3. So the error is on the data that the user inputs. The other clue, that I noticed, was that his innermost error was on line 1,

Re: [Tutor] Multipage Tiff to PDF

2012-08-10 Thread Steven D'Aprano
On 11/08/12 06:05, Stuart van Zee wrote: I need to write a simple app that will convert a folder of multi-page tiff files to PDFs. I was hoping to be able to write a simple, one button Tkinter app to do this because the people who need to run this job a few times a day are basically unskilled. M

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Martin A. Brown
Hello, : #!/usr/bin/env python3 : : import random : values = {'a':'d', 'b':'e', 'c':'f', 'd':'g', 'e':'h', 'f':'i', 'g':'j', : 'h':'k', 'i':'l', 'j':'m', 'k':'n', 'l':'o', 'm':'p', 'n':'q', 'o':'r', : 'p':'s', 'q':'t', 'r':'u', 's':'v', 't':'w', 'u':'x', 'v':'y', 'w':'z', : 'x':'a', 'y':'

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Bod Soutar
>> > OK, I have put it back into Python 2.7, and now I get: > > Traceback (most recent call last): > File "crypto.py", line 27, in > encrypt() > File "crypto.py", line 7, in encrypt > textInputE.list() > AttributeError: 'str' object has no attribute 'list' Would it be a strange conclu

Re: [Tutor] The exec command and namespaces

2012-08-10 Thread Jerry Hill
On Fri, Aug 10, 2012 at 4:44 PM, Jaidev Deshpande wrote: > Hi, > > Supposed I have a string containing a python script and I exec that script. > > Is there a way to keep track of the variables that this exec() command > creates? Sure. You can provide the dictionaries that exec will use for glob

[Tutor] The exec command and namespaces

2012-08-10 Thread Jaidev Deshpande
Hi, Supposed I have a string containing a python script and I exec that script. Is there a way to keep track of the variables that this exec() command creates? Say, >>> s = 'for i in range(10):\n\tprint i\n\n' >>> exec(s) 0 1 2 3 4 5 6 7 8 9 Is there a way to ascertain that the variable 'i' wa

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Dave Angel
On 08/10/2012 04:02 PM, Selby Rowley Cannon wrote: > OK, I have put it back into Python 2.7, and now I get: > Traceback (most recent call last): > File "crypto.py", line 27, in > encrypt() > File "crypto.py", line 7, in encrypt > textInputE.list() > AttributeError: 'str' object has n

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Dave Angel
On 08/10/2012 03:53 PM, Joel Goldstick wrote: > On Fri, Aug 10, 2012 at 3:33 PM, Selby Rowley Cannon > wrote: >>> >> #!/usr/bin/env python3 >> >> import random >> values = {'a':'d', 'b':'e', 'c':'f', 'd':'g', 'e':'h', 'f':'i', 'g':'j', >> 'h':'k', 'i':'l', 'j':'m', 'k':'n', 'l':'o', 'm':'p', 'n':

[Tutor] Multipage Tiff to PDF

2012-08-10 Thread Stuart van Zee
I need to write a simple app that will convert a folder of multi-page tiff files to PDFs.  I was hoping to be able to write a simple, one button Tkinter app to do this because the people who need to run this job a few times a day are basically unskilled.  My initial idea was to use PIL, but as f

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Selby Rowley Cannon
On 10/08/12 20:53, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 3:33 PM, Selby Rowley Cannon wrote: On 10/08/12 20:07, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon wrote: On 10/08/12 18:17, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Ca

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Joel Goldstick
On Fri, Aug 10, 2012 at 3:33 PM, Selby Rowley Cannon wrote: > On 10/08/12 20:07, Joel Goldstick wrote: >> >> On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon >> wrote: >>> >>> On 10/08/12 18:17, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Cannon wrote:

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Dave Angel
On 08/10/2012 03:33 PM, Selby Rowley Cannon wrote: > On 10/08/12 20:07, Joel Goldstick wrote: >> On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon >> wrote: >>> On 10/08/12 18:17, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Cannon wrote: > I have written a

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Selby Rowley Cannon
On 10/08/12 20:07, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon wrote: On 10/08/12 18:17, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Cannon wrote: I have written a small application to encrypt some text. The script looks fine to me, but

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Joel Goldstick
On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon wrote: > On 10/08/12 18:17, Joel Goldstick wrote: >> >> On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Cannon >> wrote: >>> >>> I have written a small application to encrypt some text. The script looks >>> fine to me, but it won't run and I can'

Re: [Tutor] Recursive optimization function, binary tree

2012-08-10 Thread Steven D'Aprano
On 10/08/12 21:44, Roman Vashkevich wrote: Alright, this may sound like a dumb stupid question. I am testing a recursive optimization function that builds a binary tree. I started a hand simulation but the amount of manual work grows exponentially with the amount of function frames. Is there a g

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Joel Goldstick
On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Cannon wrote: > I have written a small application to encrypt some text. The script looks > fine to me, but it won't run and I can't figure out why. I have attached it, > if anyone knows why it doesn't work please let me know! > What do you mean 'it wo

[Tutor] Script won't run for no apparent reason

2012-08-10 Thread Selby Rowley Cannon
I have written a small application to encrypt some text. The script looks fine to me, but it won't run and I can't figure out why. I have attached it, if anyone knows why it doesn't work please let me know! #!/usr/bin/env python3 import random values = {'a':'d', 'b':'e', 'c':'f', 'd':'g', 'e':'h

Re: [Tutor] help--- opening csv in different functions

2012-08-10 Thread Alan Gauld
On 10/08/12 11:02, leon zaat wrote: I am trying to fill a file. I assume you mean create a file? Or overwrite an existing one? Or append to an existing one. There isn't really a concept of filling a file, they just keep getting bigger until you ruin out of space. (There are some filesystems th

Re: [Tutor] Confusion with Python, Bash and Command Prompt

2012-08-10 Thread William R. Wing (Bill Wing)
On Aug 10, 2012, at 12:20 AM, Steven D'Aprano wrote: > [byte] > That is not Python's doing. That is the shell, and so it depends > entirely on your choice of operating system and shell. It works on Unix, > Linux and probably Mac OS, but not on Windows. > Yes, it definitely does work on Mac O

Re: [Tutor] Recursive optimization function, binary tree

2012-08-10 Thread bob gailer
On 8/10/2012 7:44 AM, Roman Vashkevich wrote: Alright, this may sound like a dumb stupid question. I am testing a recursive optimization function that builds a binary tree. I started a hand simulation but the amount of manual work grows exponentially with the amount of function frames. Is there

[Tutor] Recursive optimization function, binary tree

2012-08-10 Thread Roman Vashkevich
Alright, this may sound like a dumb stupid question. I am testing a recursive optimization function that builds a binary tree. I started a hand simulation but the amount of manual work grows exponentially with the amount of function frames. Is there a graphical testing tool for such a task? RV _

Re: [Tutor] help--- opening csv in different functions

2012-08-10 Thread Dave Angel
On 08/10/2012 06:02 AM, leon zaat wrote: > I am trying to fill a file. > When i am start the leading fuction the file schould be overwriting the , > probarly, existing csv file. > Accoording from keys from different keys in my sql files, information is > collected and written in a other function

[Tutor] help--- opening csv in different functions

2012-08-10 Thread leon zaat
I am trying to fill a file. When i am start the leading fuction the file schould be overwriting the , probarly, existing csv file. Accoording from keys from different keys in my sql files, information is collected and written in a other function. I tried something like this class BAGExtractP

Re: [Tutor] Confusion with Python, Bash and Command Prompt

2012-08-10 Thread Steven D'Aprano
On 10/08/12 15:35, Modulok wrote: ... My Question: Is it true that doing that is as same as doing #!/usr/bin/env python on Unix? Because I think that the matter of shebang is limited to Bash and Windows don't have a bash, it has a Command Prompt. And I don't think such thing happens in Windows.