Re: [Tutor] Carriage return

2009-10-12 Thread Alan Gauld
"Vineet Kothari" wrote I see that python IDLE add ^M as carriage return while programming in windows machine. Thats just the Windows line ending. If you want to use the same file on both Windowscand Linux then you will need to either get used to it or run the DOS2Unix tool (and UNIX2DOS goin

[Tutor] Automaton/transitional grammar query

2009-10-12 Thread kevin parks
I posted about this a couple weeks back, but then got horribly ill and dropped the ball so i was hoping to revisit. I am not sure if this is and example of Finite Automaton or a Finite State Machine or perhaps it is related to a transition table or markov process. I think some one here told

Re: [Tutor] for loop issue

2009-10-12 Thread Stefan Lesicnik
> Thanks for the tip on enumerate, escaped me. Much like Kent's simply > using a temporary var escaped me despite having done similar things > often... never reply on a tiring Friday. On the bright side this > blunder with indexes, iterators, and lengths has made me more aware of > other contexts f

Re: [Tutor] Carriage return

2009-10-12 Thread Dave Angel
Alan Gauld wrote: "Vineet Kothari" wrote I see that python IDLE add ^M as carriage return while programming in windows machine. Thats just the Windows line ending. If you want to use the same file on both Windowscand Linux then you will need to either get used to it or run the DOS2Unix tool

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread Dave Angel
kevin parks wrote: I posted about this a couple weeks back, but then got horribly ill and dropped the ball so i was hoping to revisit. I am not sure if this is and example of Finite Automaton or a Finite State Machine or perhaps it is related to a transition table or markov process. I think

[Tutor] python help needed

2009-10-12 Thread mazher ahmad
i wana make ToC/headings for any PDF documents ,PDFminer solves the my problem if ToC are given.i came across many files where there is no Toc. Does any one know ,how to extract ToC/headings from such files. thanx

Re: [Tutor] Carriage return

2009-10-12 Thread Kent Johnson
On Sun, Oct 11, 2009 at 11:38 PM, Wayne wrote: > That's not an issue with IDLE so much as windows/linux. IIRC, Linux only > uses a newline, while windows uses a CRLF. There's the dos2unix util: > http://linuxcommand.org/man_pages/dos2unix1.html > that may help. There is also a crlf.py script dis

[Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread Dotan Cohen
I have a simple PHP web application with a form, which enter the information entered into the form into a database. However, I will be several weeks without internet access so I now have two choices: 1) Run the script locally on my Kubuntu box 2) Port it to Python and make a real app out of it. I

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread Kent Johnson
On Mon, Oct 12, 2009 at 5:01 AM, kevin parks wrote: > First, as i mentioned I would like to know what, precisely, this kind of > process is called so that i can look it up. It looks like a simple cellular automaton where a cell's neighborhood includes only the cell itself. You might be interested

Re: [Tutor] python help needed

2009-10-12 Thread Kent Johnson
On Mon, Oct 12, 2009 at 2:15 AM, mazher ahmad wrote: > i wana make ToC/headings for any PDF documents ,PDFminer solves the my > problem if ToC  are given.i came across many files where there > is no Toc. > Does any one know ,how to extract ToC/headings from such files. I guess you will have to co

Re: [Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread Rüdiger Wolf
On Mon, 12 Oct 2009 14:17 +0200, "Dotan Cohen" wrote: > I prefer the second route, but I want to know if this seems reasonable > in Python: > 1) GUI with several input areas which are analogous to the HTML > Select, Input=Text, and Textarea fields. > 2) insert the data collected into an sqlite dat

[Tutor] complete neophyte question here

2009-10-12 Thread Jason Willis
I've recently been going through "Python Programming, for the Absolute Beginner" Second Edition, By Michael Dawson I'm running python 2.5.4 on a windows xp home machine. So my question boils down to this: At the end of one of his chapters there is a challenge to write a program that flips a "co

Re: [Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread John
On Monday 12 October 2009 05:17:16 am Dotan Cohen wrote: > I have a simple PHP web application with a form, which enter the > information entered into the form into a database. However, I will be > several weeks without internet access so I now have two choices: > > 1) Run the script locally on my

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread kevin parks
> You might be interested in Steven Wolfram's book, "A New Kind of > Science" and the many examples on his web site: > http://www.wolframscience.com/ See Wikipedia as well. This is a very > rich area. Thanks. That was just the kind of reference I was looking for. Fantastic. I am sure i wont

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread kevin parks
On Oct 12, 2009, at 8:02 PM, Dave Angel wrote: Often, when a combination of existing stdlib collection types gets too confusing, it's time to consider classes and objects. Not necessarily to make the program "object oriented," but to make the program data structure understandable. That

Re: [Tutor] complete neophyte question here

2009-10-12 Thread Alan Gauld
"Jason Willis" wrote So my question boils down to this: At the end of one of his chapters there is a challenge to write a program that flips a "coin" 100 times then outputs the number of heads or tails it hit. I wrote this: < ... snipped code > I honestly don't know how code works a

Re: [Tutor] complete neophyte question here

2009-10-12 Thread Wayne
On Mon, Oct 12, 2009 at 8:33 AM, Jason Willis wrote: > I honestly don't know how code works and would appreciate someone > explaining it to me? > > Using logic, I shouldn't be able to write the program due to my limited > skills so i don't know how to explain HOW i wrote it because it just sort

Re: [Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread Alan Gauld
"John" wrote 1) GUI with several input areas which are analogous to the HTML Select, Input=Text, and Textarea fields. 2) insert the data collected into an sqlite database 3) Retrieve and display data from the database using predefined queries. I am familiar with the SQL language, some PHP and

Re: [Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread Wayne
On Mon, Oct 12, 2009 at 7:17 AM, Dotan Cohen wrote: > I have a simple PHP web application with a form, which enter the > information entered into the form into a database. However, I will be > several weeks without internet access so I now have two choices: > > 1) Run the script locally on my Kub

Re: [Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread Alan Gauld
"Rüdiger Wolf" wrote 1) GUI with several input areas which are analogous to the HTML Select, Input=Text, and Textarea fields. 3) Retrieve and display data from the database using predefined queries. EasyGUI makes it simple to add GUI to python app. http://easygui.sourceforge.net/ EasyGui m

Re: [Tutor] complete neophyte question here

2009-10-12 Thread Lie Ryan
Jason Willis wrote: > I've recently been going through "Python Programming, for the Absolute > Beginner" Second Edition, By Michael Dawson > > I'm running python 2.5.4 on a windows xp home machine. > > So my question boils down to this: > > At the end of one of his chapters there is a challenge

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread Kent Johnson
On Mon, Oct 12, 2009 at 10:09 AM, kevin parks wrote: >> > I don't understand why you want to flatten outlist; when I run your >> > program I get one number per line, not one generation per line as you >> > show above. > > > That's odd. Anyway in my program I am printing the list twice. The first >

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread Dave Angel
kevin parks wrote: On Oct 12, 2009, at 8:02 PM, Dave Angel wrote: Often, when a combination of existing stdlib collection types gets too confusing, it's time to consider classes and objects. Not necessarily to make the program "object oriented," but to make the program data structure unders

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread Alan Gauld
"kevin parks" wrote I been using that flatten function since 1970. Prolly pilfered from Tim Peters or Effbot. Are you sure about that date? If you did get it from Tim or F/ it certainly wouldn't have been in Python back then! :-) Alan G

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread Kent Johnson
On Mon, Oct 12, 2009 at 10:47 AM, Kent Johnson wrote: > On Mon, Oct 12, 2009 at 10:09 AM, kevin parks wrote: >> Yeah i don't mean an infinite loop, but more like a perpetual dance back and >> forth between to items >> that point to each other. I think I need to be careful when i define the >> ru

[Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Victor Binns
Please, I need help. I installed python on my gateway windows vista laptop computer. This is with the latest version of python (Python 2.6.3 Windows installer) Python 2.6.3 Windows installer I have some python code files I placed on my desktop and tried placing it in a folder containing py

Re: [Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Amos Anderson
You probably have the true extension hidden. Try this... 1. Start->Control Panel->Appearance and Personalization->Folder Options2. Click the View tab 3. Uncheck Hide Extensions for Known File Types 4. Hit apply. Now check the file. You probably will notice the .txt extension is still there. You c

Re: [Tutor] New to python: some advises for image processing tool

2009-10-12 Thread Nicola De Quattro
Hi all I'm starting with my project (rather slowly...) and I want to give you a little update (and do some trivial questions). I've started to write something about input image loading and rotation. My goal is that, from graphical interface, the user will be able to rotate an image at steps (

Re: [Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Dave Angel
Victor Binns wrote: Please, I need help. I installed python on my gateway windows vista laptop computer. This is with the latest version of python (Python 2.6.3 Windows installer) Python 2.6.3 Windows installer It's not the latest, but no problem. It's probably a good choice. I have s

[Tutor] Switching to other version of Python

2009-10-12 Thread Corey Richardson
My school has python 2.4. I have python 2.6, and I find it perfectly wonderful. However, I am contemplating the switch, and am wondering, what is your personal opinion on why or why not to use 3.x? Thanks for the help in advance, ~Corey <>___ Tutor ma

Re: [Tutor] Switching to other version of Python

2009-10-12 Thread Wayne
On Mon, Oct 12, 2009 at 3:34 PM, Corey Richardson wrote: > My school has python 2.4. I have python 2.6, and I find it perfectly > wonderful. However, I am contemplating the switch, and am wondering, what is > your personal opinion on why or why not to use 3.x? Few 3rd party modules have been po

Re: [Tutor] Porting PHP web app to Python GUI

2009-10-12 Thread Dotan Cohen
Thanks, all, I have subscribed to the Dabo list and I will almost certainly bug both lists in the near future. Thank you! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Katt
Hello all, In my search for ways to change the color of text printed to the screen I came across discussions about curses. Some documentation indicate it as a module that will translate commands to control screen output. Is this right? Also, why do they call it curses? Thanks in advance,

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Steve Willoughby
On Mon, Oct 12, 2009 at 02:57:01PM -0700, Katt wrote: > In my search for ways to change the color of text printed to the screen I > came across discussions about curses. > > Some documentation indicate it as a module that will translate commands to > control screen output. Is this right? Also,

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Luke Paireepinart
Not sure what curses means but that module only works on Unix. It does do what you want though. On 10/12/09, Katt wrote: > Hello all, > > In my search for ways to change the color of text printed to the screen I > came across discussions about curses. > > Some documentation indicate it as a modul

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Mark K. Zanfardino
Curses is a pun on the term "cursor optimization". It is a library of functions that manage an application's display on character-cell terminals (e.g., VT100). On Mon, 2009-10-12 at 17:13 -0500, Luke Paireepinart wrote: > Not sure what curses means but that module only works on Unix. It does > do

Re: [Tutor] First line of a python program

2009-10-12 Thread Katt
Hello all, Numerous times I see the following as the first line of a python program: #! /usr/bin/python What is this for or do for the program? Thanks in advance, Katt ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] First line of a python program

2009-10-12 Thread Mark K. Zanfardino
>From http://en.wikipedia.org/wiki/Shebang_(Unix): In computing, a shebang (also called a hashbang, hashpling, pound bang, or crunchbang) refers to the characters "#!" when they are the first two characters in a text file. In a Unix-like operating system, the program loader takes the presence of

Re: [Tutor] First line of a python program

2009-10-12 Thread Steve Willoughby
On Mon, Oct 12, 2009 at 02:49:34PM -0700, Katt wrote: > Hello all, > > Numerous times I see the following as the first line of a python program: > > #! /usr/bin/python As far as Python is concerned, it is a comment. Anything from the # character to the end of the line is a comment. If you want

Re: [Tutor] First line of a python program

2009-10-12 Thread Markus Flatscher
The short answer is, it's a shebang: http://en.wikipedia.org/wiki/Shebang_(Unix) Let us know if this clarifies anything. M. On Mon, 12 Oct 2009 14:49:34 -0700 "Katt" wrote: >Hello all, > >Numerous times I see the following as the first line of a python program: > >#! /usr/bin/python > >What is

Re: [Tutor] Switching to other version of Python

2009-10-12 Thread Alan Gauld
"Corey Richardson" wrote My school has python 2.4. I have python 2.6, and I find it perfectly wonderful. However, I am contemplating the switch, and am wondering, what is your personal opinion on why or why not to use 3.x? Thanks for the help in advance, Well your Python 3 programs won't

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Alan Gauld
"Katt" wrote Some documentation indicate it as a module that will translate commands to control screen output. Is this right? Also, why do they call it curses? Thats right, it provides a way to draw GUI like "windows" on the screen using graphics characters if they are available or plain

Re: [Tutor] What is Curses and why do they call it that.

2009-10-12 Thread Bill Campbell
On Tue, Oct 13, 2009, Alan Gauld wrote: > > "Katt" wrote > >> Some documentation indicate it as a module that will translate commands >> to control screen output. Is this right? Also, why do they call it >> curses? > > Thats right, it provides a way to draw GUI like "windows" on the screen >