Re: [Tutor] Creating a Choose Your Own Adventure Game :p:

2013-06-11 Thread Paradox
>On 06/12/2013 12:24 PM, DragonDon wrote: >http://cosmopolitangeek.wordpress.com Dragon Don, I will check this out but I wonder if you have ever heard of git or mercurial? Putting code for small projects up on github or bitbucket is very simple and ma

[Tutor] Creating a Choose Your Own Adventure Game

2013-06-11 Thread DragonDon
Greetings all! I've been studying Python for just over a month and got onto the idea of creating a 'choose your own adventure' type of game. learnpythonthehardway.org had some influence in that :) If possible, I would love some feedback on it. Right now it's at v2 and I'm currently working on v3

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-11 Thread Steven D'Aprano
On 12/06/13 03:53, Jim Mooney wrote: But I do like the idea of using plain old words, like "bad" as a switch, instead of some inscrutable program-switch ;') I don't. Trust me on this, you will regret it. As the Zen of Python says, "Explicit is better than implicit". It may seem like a good i

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-11 Thread eryksun
On Tue, Jun 11, 2013 at 2:33 PM, Jim Mooney wrote: > On 11 June 2013 01:07, Alan Gauld wrote: > >> First you are effectively creating an entire Tkinter app >> inside popup() each time. > > I partially mis-spoke myself. The error was not caused Just by > creating the app every time, but very oddly

Re: [Tutor] producing PDF files

2013-06-11 Thread Francois Dion
http://www.xhtml2pdf.com/ Started life as pisa. Very easy to work with. Francois -- www.pyptug.org - raspberry-python.blogspot.com - @f_dion On Tue, Jun 11, 2013 at 5:53 AM, Khalid Al-Ghamdi wrote: > Hi, > > Do you know of a python module for converting text files to PDF format? > > thanks

Re: [Tutor] producing PDF files

2013-06-11 Thread Oscar Benjamin
On 11 June 2013 10:53, Khalid Al-Ghamdi wrote: > > Do you know of a python module for converting text files to PDF format? > Why does it have to be a Python module? What do you mean by converting a text file to a pdf file? If I just wanted to create a pdf file containing some verbatim text I wou

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-11 Thread Jim Mooney
On 11 June 2013 01:07, Alan Gauld wrote: > First you are effectively creating an entire Tkinter app > inside popup() each time. I partially mis-spoke myself. The error was not caused Just by creating the app every time, but very oddly, by the Combination of recreating the app and using triple qu

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-11 Thread Jim Mooney
>> First you are effectively creating an entire Tkinter app >> inside popup() each time. Actually, that was the source of the error. When I put the app creation above the function, the dots no longer appeared. As to why, I'm not even going to try to figure that out ;') -- Jim Today is the day th

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-11 Thread Jim Mooney
On 11 June 2013 01:07, Alan Gauld wrote: > > First you are effectively creating an entire Tkinter app > inside popup() each time. That's a pretty heavyweight way > to generate a messagebox. Have you used the Tkinter > standard message dialogs? > Argh - dumb error. Thanks for pointing that out and

Re: [Tutor] On a looping input, subsequent inputs are hidden

2013-06-11 Thread eryksun
On Tue, Jun 11, 2013 at 2:17 AM, Jim Mooney wrote: > > But the Second and subsequent inputs, in Windows, hide the input with > dots, while the first shows the input, and I can't figure out why. I > don't change a thing between the first and subsequent calls to input > except changing the input mes

Re: [Tutor] three numbers for one

2013-06-11 Thread eryksun
On Tue, Jun 11, 2013 at 10:21 AM, Oscar Benjamin wrote: > What exactly are these? I tried looking for the HALFWIDTH DIGIT ZERO > that you mentioned but I can't find it: CJK typesetting uses the FULLWIDTH block for the ASCII range 0x21-0x7E: >>> '\N{FULLWIDTH DIGIT ONE}\N{FULLWIDTH DIGIT ZERO

Re: [Tutor] sqlite question

2013-06-11 Thread Todd Matsumoto
I think you are missing the fetch call. The cursor only executed your query, but hasn't fetched any thing out. On Tue, Jun 11, 2013 at 12:20 PM, Khalid Al-Ghamdi wrote: > Hi, > > I have a dictionary with keys as employee badges and values as their > names. Both key and value are strings. > > I w

Re: [Tutor] producing PDF files

2013-06-11 Thread Asokan Pichai
On Tue, Jun 11, 2013 at 3:23 PM, Khalid Al-Ghamdi wrote: > Hi, > > Do you know of a python module for converting text files to PDF format? > > thanks > Reportlab http://www.reportlab.com/software/opensource/ sphinx http://sphinx-doc.org/ is a great choice too. Asokan Pichai "Expecting the worl

[Tutor] sqlite question

2013-06-11 Thread Khalid Al-Ghamdi
Hi, I have a dictionary with keys as employee badges and values as their names. Both key and value are strings. I want to read the badges from a sql select and use that to look up the names in the dictionary. But since the result is a tuple, it doesnt' work. how can i overcome this? 1. >>>

Re: [Tutor] producing PDF files

2013-06-11 Thread Todd Matsumoto
I don't know how good it is, but OpenERP's report.pyPdf module is what I've been using to do this. As quoted from the pdf.py module: "A pure-Python PDF library with very minimal capabilities. It was designed to be able to split and merge PDF files by page, and that's about all it can do. It may

[Tutor] producing PDF files

2013-06-11 Thread Khalid Al-Ghamdi
Hi, Do you know of a python module for converting text files to PDF format? thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Regarding python function arguments

2013-06-11 Thread Todd Matsumoto
One way you can do that is by using default arguments. def my_func (arg1=False, arg2=False, arg3=False): # Check the arguments. On Tue, Jun 11, 2013 at 10:54 AM, Arijit Ukil wrote: > i am writing following python function: > > def my_func (arg1, arg2, arg3): > > however, I am not always go

Re: [Tutor] Regarding python function arguments

2013-06-11 Thread Asokan Pichai
On Tue, Jun 11, 2013 at 2:24 PM, Arijit Ukil wrote: > i am writing following python function: > > def my_func (arg1, arg2, arg3): > however, I am not always going to pass all the arguments. sometimes only > arg1 is passed, sometimes arg1 and arg2 are passed; sometimes arg1, arg2, > arg3 are pas

[Tutor] Regarding python function arguments

2013-06-11 Thread Arijit Ukil
i am writing following python function: def my_func (arg1, arg2, arg3): however, I am not always going to pass all the arguments. sometimes only arg1 is passed, sometimes arg1 and arg2 are passed; sometimes arg1, arg2, arg3 are passed. How can i manage this? Regards, Arijit Ukil Tata Consultan