Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 10:20 PM, Steven D'Aprano wrote: > On Sun, 21 Mar 2010 09:10:52 am Luke Paireepinart wrote: > > On Sat, Mar 20, 2010 at 4:50 PM, Ken G. > wrote: > > > Thanks for the info. I already adopted a program from another > > > person and it works like a charm. As for your ques

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Steven D'Aprano
On Sun, 21 Mar 2010 09:10:52 am Luke Paireepinart wrote: > On Sat, Mar 20, 2010 at 4:50 PM, Ken G. wrote: > > Thanks for the info. I already adopted a program from another > > person and it works like a charm. As for your question, I had no > > idea of if I had duplicate or more as there was

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks for letting me know. Corrective actions taken. Ken Luke Paireepinart wrote: On Sat, Mar 20, 2010 at 4:50 PM, Ken G. > wrote: Thanks for the info. I already adopted a program from another person and it works like a charm. As for your question

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 4:50 PM, Ken G. wrote: > Thanks for the info. I already adopted a program from another person and > it works like a charm. As for your question, I had no idea of if I had > duplicate or more as there was some 570 line items. I whittled it down to > 370 line entries.

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks for the info. I already adopted a program from another person and it works like a charm. As for your question, I had no idea of if I had duplicate or more as there was some 570 line items. I whittled it down to 370 line entries. Whew. Ken Luke Paireepinart wrote: On Sat, Mar 20

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Luke Paireepinart
On Sat, Mar 20, 2010 at 11:34 AM, Ken G. wrote: > What is a method I can use to find duplicated entry within a sorted numeric > file? > I was trying to read a file reading two lines at once but apparently, I can > only read one line at a time. Can the same file be opened and read two > times wit

Re: [Tutor] Tutorial executable from python script.

2010-03-20 Thread Karim Liateni
Hello Alan, In fact, I want to be sure the users can run it on every machine in our network. Especially, I want to be able to run it on Solaris 5.8 with python 1.5 (Unix machine). I wanted to know if I could make some custom executable like in C when you want to build a executable with a stat

Re: [Tutor] Efficiency and speed

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 05:47:45 am James Reynolds wrote: > This is a monte-carlo simulation. > > The simulation measures the expiration of something and those > somethings fall into bins that are not evenly dispersed. These bins > are stored in the nx list mentioned previously. > > So let's say you h

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
Thanks! You gave me something to do for the rest of the afternoon. Ken Steven D'Aprano wrote: On Sun, 21 Mar 2010 03:34:01 am Ken G. wrote: What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at once but apparentl

Re: [Tutor] Efficiency and speed

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 03:41:11 am James Reynolds wrote: > I've still been working towards learning the language, albeit slowly > and I've been working on a project that is somewhat intense on the > numerical calculation end of things. > > Running 10,000 trials takes about 1.5 seconds and running 100

Re: [Tutor] Finding duplicates entry in file

2010-03-20 Thread Steven D'Aprano
On Sun, 21 Mar 2010 03:34:01 am Ken G. wrote: > What is a method I can use to find duplicated entry within a sorted > numeric file? > > I was trying to read a file reading two lines at once but apparently, > I can only read one line at a time. f = open("myfile") while True: first = f.readline(

[Tutor] Finding duplicates entry in file

2010-03-20 Thread Ken G.
What is a method I can use to find duplicated entry within a sorted numeric file? I was trying to read a file reading two lines at once but apparently, I can only read one line at a time. Can the same file be opened and read two times within a program? For example, a file has: 1 2 2 3 4 4

Re: [Tutor] Efficiency and speed

2010-03-20 Thread Dave Angel
(Please don't top-post. It ruins the context for anyone else trying to follow it. Post your remarks at the end, or immediately after whatever you're commenting on.) James Reynolds wrote: Here's another idea I had. I thought this would be slower than then the previous algorithm because it has