Re: [Tutor] extract meaningful data from garbage

2010-01-02 Thread Shashwat Anand
here are the examples : http://codepad.org/wF8APZV3 sorry i missed it to post earlier On Sun, Jan 3, 2010 at 11:28 AM, Shashwat Anand wrote: > I need to extract some meaningful data from grabages. > Here are four examples. I need to get date, company name and address from > these. > For date i us

[Tutor] extract meaningful data from garbage

2010-01-02 Thread Shashwat Anand
I need to extract some meaningful data from grabages. Here are four examples. I need to get date, company name and address from these. For date i used regex but I'm unable to find any definite pattern for address and company name the format is more or less : garbage id - date garbage company name g

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Alan Gauld
"Ken G." wrote > Wow, I looked and looked. I can print out my program listing but can > not print the resulted data produced by the program. Printing is always difficult in a modern OS because your program and Python cannot be sure of what kind of device it is going to print on. Unix traditi

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Ken G.
Rich Lovely wrote: 2010/1/2 Ken G. : Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via Geany IDE? I already wro

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Robert Berman
Thank to everyone who contributed to this thread. I did have the horrible feeling this would probably end up as either total brute force or brute force perhaps with a twist. It was in the hopes of finding a twist I requested comments and suggestions from people whose opinions and suggestions are al

Re: [Tutor] Printing data to a printer...

2010-01-02 Thread Rich Lovely
2010/1/2 Ken G. : > Wow, I looked and looked.  I can print out my program listing but can not > print the resulted data produced by the program. > > How do I print out on my USB printer the data output of my Python program I > ran in my Ubuntu terminal via Geany IDE? > I already wrote several progr

[Tutor] Printing data to a printer...

2010-01-02 Thread Ken G.
Wow, I looked and looked. I can print out my program listing but can not print the resulted data produced by the program. How do I print out on my USB printer the data output of my Python program I ran in my Ubuntu terminal via Geany IDE? I already wrote several programs using raw_input, fil

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Rich Lovely
2010/1/2 Robert Berman : > Hi, > > I am trying to build an algorithm or methodology which will let me tell > if a decimal has a repeating sequence of digits and if it does have that > attribute, what is the sequence of digits. For example, 1/3.0 = > 0.3..By eyeballing we know it has a repea

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Lie Ryan
On 1/2/2010 1:01 PM, Robert Berman wrote: Hi, I am trying to build an algorithm or methodology which will let me tell if a decimal has a repeating sequence of digits and if it does have that attribute, what is the sequence of digits. For example, 1/3.0 = 0.3..By eyeballing we know it has

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Eike Welk
Hello Robert! On Saturday 02 January 2010, Robert Berman wrote: > Hi, > > I am trying to build an algorithm or methodology which will let me > tell if a decimal has a repeating sequence of digits If you are starting from fractions, I think you have to find the prime factors of the denominator. I

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Kent Johnson
On Fri, Jan 1, 2010 at 9:01 PM, Robert Berman wrote: > Hi, > > I am trying to build an algorithm or methodology which will let me tell > if a decimal has a repeating sequence of digits and if it does have that > attribute, what is the sequence of digits. For example, 1/3.0 = > 0.3..By eyeb

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Dave Angel
Robert Berman wrote: Hi, I am trying to build an algorithm or methodology which will let me tell if a decimal has a repeating sequence of digits and if it does have that attribute, what is the sequence of digits. For example, 1/3.0 = 0.3..By eyeballing we know it has a repeating sequence

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Richard D. Moores
On Sat, Jan 2, 2010 at 02:33, Shashwat Anand wrote: > > What you are searching for is sheer bruteforce however if I'm guessing it > right then you are solving Project Euler and you are thinking in wrong > direction. Well, going with brute force, I'm amazed at how long some strings of repeating

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Shashwat Anand
What you are searching for is sheer bruteforce however if I'm guessing it right then you are solving Project Euler and you are thinking in wrong direction. On Sat, Jan 2, 2010 at 3:52 PM, spir wrote: > Robert Berman dixit: > > > Hi, > > > > I am trying to build an algorithm or methodology which

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread spir
Robert Berman dixit: > Hi, > > I am trying to build an algorithm or methodology which will let me tell > if a decimal has a repeating sequence of digits and if it does have that > attribute, what is the sequence of digits. For example, 1/3.0 = > 0.3..By eyeballing we know it has a repeati

Re: [Tutor] find() doesnt work as expected

2010-01-02 Thread spir
MK dixit: > At first, happy new year to all of you. > > I am trying to write a little script which uses one file > as input and looks if the string from this file are in target file. And > if not prints out that line/string so that i know which strings must > be added to complete the target file.

Re: [Tutor] find() doesnt work as expected

2010-01-02 Thread Alan Gauld
"MK" wrote I tried this but it gives nothing out: Try putting some debug print statements in - for example print the option filenames to prove you got them ok, print progress markers like adfter opening the files Then print a message for each string found.. for a in infi: found = ftck