From daniel at danielveazey.com Wed Jun 9 05:09:38 2010 From: daniel at danielveazey.com (Daniel Veazey) Date: Tue, 08 Jun 2010 22:09:38 -0500 Subject: [PyAR2] Writing to a text file Message-ID: <1276052978.1466.36.camel@daniel-desktop> Hi, I'm totally new. I wrote a short program to find combinations on a bike lock that have adjacent double digits. The lock has 4 digits, and each digit can have a value of 1-6. So 1442 would have adjacent double digits, and 1424 would not. Here is the program: http://pastebin.com/SzGCwMR9 The problem I'm having is that when I run the program in a Linux terminal, by the time all the combinations have been printed, the first half of the combinations have run out of the top of the terminal's window. So what I'd like to do is instead of just printing the numbers on the screen, write them to a text file. Is there a way to do this? Does it have something to do with stdout? Thanks, Daniel Veazey danielveazey.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From derek.k.horton at gmail.com Wed Jun 9 06:41:23 2010 From: derek.k.horton at gmail.com (Derek Horton) Date: Tue, 8 Jun 2010 23:41:23 -0500 Subject: [PyAR2] Writing to a text file In-Reply-To: <1276052978.1466.36.camel@daniel-desktop> References: <1276052978.1466.36.camel@daniel-desktop> Message-ID: Since you are using linux there are a couple of things you can do. First, you could redirect the output (stdout) of your script to a file and then use an editor to view the file. python script.py > results.txt Now open the results.txt file in your favorite editor. Or you could pipe the output into less which will allow you to page through the output of your script by hitting the space bar. python script.py | less HTH Later, Derek On Tue, Jun 8, 2010 at 10:09 PM, Daniel Veazey wrote: > Hi, I'm totally new. I wrote a short program to find combinations on a > bike lock that have adjacent double digits. The lock has 4 digits, and each > digit can have a value of 1-6. So 1442 would have adjacent double digits, > and 1424 would not. Here is the program: > > http://pastebin.com/SzGCwMR9 > > The problem I'm having is that when I run the program in a Linux terminal, > by the time all the combinations have been printed, the first half of the > combinations have run out of the top of the terminal's window. > > So what I'd like to do is instead of just printing the numbers on the > screen, write them to a text file. Is there a way to do this? Does it have > something to do with stdout? > > Thanks, > > Daniel Veazey > danielveazey.com > > _______________________________________________ > PyAR2 mailing list > PyAR2 at python.org > http://mail.python.org/mailman/listinfo/pyar2 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel at danielveazey.com Wed Jun 9 06:44:35 2010 From: daniel at danielveazey.com (Daniel Veazey) Date: Tue, 08 Jun 2010 23:44:35 -0500 Subject: [PyAR2] Writing to a text file In-Reply-To: References: <1276052978.1466.36.camel@daniel-desktop> Message-ID: <1276058675.1466.56.camel@daniel-desktop> Cool, thanks. The python script.py > results.txt did the trick. :) On Tue, 2010-06-08 at 23:41 -0500, Derek Horton wrote: > Since you are using linux there are a couple of things you can do. > First, you could redirect the output (stdout) of your script to a file > and then use an editor to view the file. > python script.py > results.txt > Now open the results.txt file in your favorite editor. > > Or you could pipe the output into less which will allow you to page > through the output of your script by hitting the space bar. > python script.py | less > > HTH > > Later, > Derek > > > On Tue, Jun 8, 2010 at 10:09 PM, Daniel Veazey > wrote: > > Hi, I'm totally new. I wrote a short program to find > combinations on a bike lock that have adjacent double digits. > The lock has 4 digits, and each digit can have a value of 1-6. > So 1442 would have adjacent double digits, and 1424 would not. > Here is the program: > > http://pastebin.com/SzGCwMR9 > > The problem I'm having is that when I run the program in a > Linux terminal, by the time all the combinations have been > printed, the first half of the combinations have run out of > the top of the terminal's window. > > So what I'd like to do is instead of just printing the numbers > on the screen, write them to a text file. Is there a way to do > this? Does it have something to do with stdout? > > Thanks, > > Daniel Veazey > danielveazey.com > > > _______________________________________________ > PyAR2 mailing list > PyAR2 at python.org > http://mail.python.org/mailman/listinfo/pyar2 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pyar2 at cowsgomoo.org Wed Jun 9 15:14:39 2010 From: pyar2 at cowsgomoo.org (Coltrey Mather) Date: Wed, 9 Jun 2010 08:14:39 -0500 Subject: [PyAR2] Writing to a text file In-Reply-To: References: <1276052978.1466.36.camel@daniel-desktop> Message-ID: redirecting stdout and piplines also works on windows/dos c:\python25\python.exe script.py > results.txt c:\python25\python.exe script.py | more Since this is supposed to by a Pythonic place...you can do file i/o in your script http://docs.python.org/library/stdtypes.html#file-objects basically, f = open('results.txt', 'w') # note that this will overwrite any data in results.txt f.write('a line full of stuff\n') f.close() On Tue, Jun 8, 2010 at 23:41, Derek Horton wrote: > Since you are using linux there are a couple of things you can do. First, > you could redirect the output (stdout) of your script to a file and then use > an editor to view the file. > python script.py > results.txt > Now open the results.txt file in your favorite editor. > > Or you could pipe the output into less which will allow you to page through > the output of your script by hitting the space bar. > python script.py | less > > HTH > > Later, > Derek > > On Tue, Jun 8, 2010 at 10:09 PM, Daniel Veazey wrote: > >> Hi, I'm totally new. I wrote a short program to find combinations on a >> bike lock that have adjacent double digits. The lock has 4 digits, and each >> digit can have a value of 1-6. So 1442 would have adjacent double digits, >> and 1424 would not. Here is the program: >> >> http://pastebin.com/SzGCwMR9 >> >> The problem I'm having is that when I run the program in a Linux terminal, >> by the time all the combinations have been printed, the first half of the >> combinations have run out of the top of the terminal's window. >> >> So what I'd like to do is instead of just printing the numbers on the >> screen, write them to a text file. Is there a way to do this? Does it have >> something to do with stdout? >> >> Thanks, >> >> Daniel Veazey >> danielveazey.com >> >> _______________________________________________ >> PyAR2 mailing list >> PyAR2 at python.org >> http://mail.python.org/mailman/listinfo/pyar2 >> >> > > _______________________________________________ > PyAR2 mailing list > PyAR2 at python.org > http://mail.python.org/mailman/listinfo/pyar2 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gslindstrom at gmail.com Sun Jun 27 15:50:11 2010 From: gslindstrom at gmail.com (Greg Lindstrom) Date: Sun, 27 Jun 2010 08:50:11 -0500 Subject: [PyAR2] pyArkansas 2010 Message-ID: It's time to start thinking about pyArkansas 2010. pyOhio is th end of next month (I'm going to give a talk, btw) and pyTexas is in August (and I hope to go there as well). We'll need to pick a date and I'll contact Dr. Hu at UCA to see if they will host us again this year. I"ll also get in touch with Chad Russel at the Chamber of Commerce to see if they'd like to help us out. We need to make sure we thank both of these guys for all of their support. Do we want to have the same basic setup as the last two years; class focused presentations? Or should we have more open space where people sign up to speak on what they are doing with Python? Are there other things we want to do? Last year Chad offered "the big room" at the Chamber for Saturday evening. Do we want to do something then/there? I'd still really like a web site for us? Anyone want to step up and take that on? We have some limited $$ for it. And as far as money, the largest expense by far we have is bringing in speakers. If we bring someone in, what topics would you like to see addresses? Last year we brought Jacob Kaplan-Moss to speak on the Django Web Framework and Gloria Jacobs spoke on Advanced Python topics. Each speaker costs us air fare, hotel and food as well as a small ($300.00) fee we give for their time. I have a couple ideas but would like yours, first. I'd like to send out 2 fliers to Arkansas schools this year; one at the start of the school year and another 2-weeks before the conference. Does anyone have information on the EAST program in the schools. IIRC, it focuses on technology issues and may be worth looking into. I will be extremely busy at work this fall as we have just been bought out and have many new clients to get up and running, so I'd like help with any of the following: - Program Chair - I'll take the overall lead again this year - Promotion/Advertising - Get the word out. Also get a flier made up. - Fund Raising - One we get a budget we need to raise the money to make it happen - Swag/Giveaways - Round up stuff that we can give away. Last year we had at least 5 Colleges/Universities represented; that's pretty cool. Let's try to get more this year. Let me know what you want the conference to be (and how you will help make it so!). Thanks, --greg -------------- next part -------------- An HTML attachment was scrubbed... URL: