[Tutor] Should I use python for parsing text

2007-03-11 Thread Jay Mutter III
I am using an intel iMac with OS -X 10.4.8. It has Python 2.3.5. My issue is that I have a lot of text ( about 500 pages at the moment) that I need to parse so that I can eliminate info I don't need, break the remainder into fields and put in a database/spreadsheet. See example next: A.-C.

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread Jaggo
Hey, I'm a rather new programmer, but it seems to me the digital to roman should be coded: While Digital_Input > 0: If Digital_Input > 1000 then: Roman = + M, Digital_Input = - 1000 elif Digital_Input > 900 then: Roman = + C, Digital_Input = - 900 ... Now if someone could please clarify [or forwar

Re: [Tutor] Should I use python for parsing text

2007-03-11 Thread Alan Gauld
"Jay Mutter III" <[EMAIL PROTECTED]> wrote > See example next: > A.-C. Manufacturing Company. (See Sebastian, A. A., > and Capes, assignors.) >... >Aaron, Solomon E., Boston, Mass. Pliers. No. 1,329,155 ; >Jan. 27 ; v. 270 ; p. 554. > > For instance, I would like to go to end of line and if last

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread Alan Gauld
"Jaggo" <[EMAIL PROTECTED]> wrote > [Come to that, if someone could point me to a *simple* gui which > I can use in python, keep in mind I did learn a little VB, > I should be grateful as well.] Tkinter is the standard Python GUI (IDLE is built using it). Many prefer wxPython, but it's an extr

[Tutor] problems to install python 2.5

2007-03-11 Thread Tsila Hassine
Hello all I downloaded Python 2.5 (final release) from python.org. I am trying to install it on my Mac 0s 10.4 the current working version i have of python is 2.3 (also built as a framework) It goes through the "./configure" part ok, but the "make install" produces the following errors : Mo

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Tsila Hassine
I also tried that build as well - it says that installation completed succesfully - and when i try to launch IDLE - it won't open... On 3/11/07, Kent Johnson <[EMAIL PROTECTED]> wrote: Tsila Hassine wrote: > Hello all > > I downloaded Python 2.5 (final release) from python.org. I am trying to >

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Andre Roberge
On 3/11/07, Tsila Hassine <[EMAIL PROTECTED]> wrote: > I also tried that build as well - it says that installation completed > succesfully - and when i try to launch IDLE - it won't open... > Could it be that the 2.3 version is still around and that you are trying to launch the 2.3 version of IDLE

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Tsila Hassine
2.3 is still around indeed, but i launched the IDLE from the python 2.5folder, so i don't think that was the problem. on teh other hand - i discovered that when i type "python2.5" in teh terminal window it launches indeed the python 2.5, but when running a script from the command line it goes to

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Kent Johnson
Tsila Hassine wrote: > Hello all > > I downloaded Python 2.5 (final release) from python.org. I am trying to > install it on my Mac 0s 10.4 > > the current working version i have of python is 2.3 (also built as a > framework) > > > It goes through the "./configure" part ok, but the "make instal

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Clay Wiedemann
Did you download the MacPython 2.5 distribution? You should find an "Update shell profile.command" file, which you can run. I believe once you do that, you will be set up so that IDLE will launch and you will default to version 2.5. On 3/11/07, Tsila Hassine <[EMAIL PROTECTED]> wrote: > Hello all

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Tsila Hassine
yes I did download that, and it went " sorry can't update zshell" (and yes I have zshell) so i didn't know how to deal with that any ideas ? (but then i guess its a completely different problem then ...) thanks! T. On 3/11/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: Did you download the

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Clay Wiedemann
No ideas there. I wish I could help, but I am new at this. I did stop using IDLE though in favor of iPython. I don't know if an end-around would solve all the problems you have been encountering though. http://ipython.scipy.org/moin/ -c On 3/11/07, Tsila Hassine <[EMAIL PROTECTED]> wrote: > yes

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread John Fouhy
On 12/03/07, Jaggo <[EMAIL PROTECTED]> wrote: > Hey, > I'm a rather new programmer, but it seems to me the digital to roman should > be coded: > While Digital_Input > 0: > If Digital_Input > 1000 then: Roman = + M, Digital_Input = - 1000 > elif Digital_Input > 900 then: Roman = + C, Digital_Input =

Re: [Tutor] problems to install python 2.5

2007-03-11 Thread Kent Johnson
Tsila Hassine wrote: > yes I did download that, and it went " sorry can't update zshell" (and > yes I > have zshell) so i didn't know how to deal with that any ideas ? (but > then i guess its a completely different problem then ...) All that program does is make sure that the bin directory in

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread Kent Johnson
John Fouhy wrote: > On 12/03/07, Jaggo <[EMAIL PROTECTED]> wrote: >> Hey, >> I'm a rather new programmer, but it seems to me the digital to roman should >> be coded: >> While Digital_Input > 0: >> If Digital_Input > 1000 then: Roman = + M, Digital_Input = - 1000 >> elif Digital_Input > 900 then: Ro

Re: [Tutor] The whole Roman to Dec and vice versa issue

2007-03-11 Thread John Fouhy
On 12/03/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > [note that this code will not produce strings like 'IV' for 4. OTOH, > > as I recall, the Romans didn't do that consistently either..] > It seems to me that isn't so different from deciding to use 'Q' for 250. > Maybe you can change the dict

[Tutor] how to send command line args to py script

2007-03-11 Thread shawn bright
lo there all, i was wondering how to make a python script accept command line arguments. i mean, i have used python scripts from the command line in linux and passed something to it and it knows what to do. like in a function, if i want to do something like this def add_two_numbers(a, b): x

[Tutor] Roman Numeral - To - Digital Converter

2007-03-11 Thread Alan Gilfoy
Roman Numeral - To - Digital Converter So far, I'm coming along OK with the code that runs the conversions, assuming the user gives me a proper input. (A string of capital letters I, V, X, L, C, D, M) However, not every input someone gives the function is goign to be properly formatted like

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread Gordon
This is my first time replying to the list, so excuse me if this goes out wrong. Anyhow, you're looking for sys.agrv. sys.agrv is a list of the arguments, with sys.agrv[0] being the script name. Code: ## import sys #sys.argv is part of the sys module def add_two_numbers(a, b): x =

[Tutor] String-manipulation question

2007-03-11 Thread Alan Gilfoy
#start of triple-letter processing block if len(roman_input) > 2 and roman_input[0] + roman_input[1] + roman_input[2] == "MMM": digital_result += 3000 roman_input = #something to remove those "M"'s from the string continue -- My question here boils down to, "Is there a way to rem

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread shawn bright
Well, for your first response, its great, thanks a lot. shawn On 3/11/07, Gordon <[EMAIL PROTECTED]> wrote: > This is my first time replying to the list, so excuse me if this goes > out wrong. > > Anyhow, you're looking for sys.agrv. sys.agrv is a list of the > arguments, with sys.agrv[0] being t

Re: [Tutor] Roman Numeral - To - Digital Converter

2007-03-11 Thread Luke Paireepinart
Alan Gilfoy wrote: > Roman Numeral - To - Digital Converter > > So far, I'm coming along OK with the code that runs the conversions, > assuming the user gives me a proper input. (A string of capital > letters I, V, X, L, C, D, M) > > However, not every input someone gives the function is goign

Re: [Tutor] String-manipulation question

2007-03-11 Thread John Fouhy
On 12/03/07, Alan Gilfoy <[EMAIL PROTECTED]> wrote: > My question here boils down to, "Is there a way to remove certain > characters from a string?" There are several ways, depending on what exactly you want to achieve. In this case, it looks like you're after "string slicing". The tutorial cov

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread Dave Kuhlman
On Sun, Mar 11, 2007 at 09:07:41PM -0500, shawn bright wrote: > Well, for your first response, its great, > thanks a lot. > shawn And, when you needs to process command line arguments and flags and options become more complicated, be sure to look at modules getopt and optparse in the standard libr

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread shawn bright
OK, will do. Looks like my future will involve more of this kind of thing. thanks shawn On 3/11/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > On Sun, Mar 11, 2007 at 09:07:41PM -0500, shawn bright wrote: > > Well, for your first response, its great, > > thanks a lot. > > shawn > > And, when you n