Python script isn't producing text in data file
I have a Python script that runs with no errors but it doesn't produce the output it should in a text file. I can't figure out why. Is this the correct forum to post this in or can someone suggest a more appropriate forum? The script selects all files from the day before the script is run. So if today is December 10th the script will select all log files from December 9th. The script reads all files from the day before and summarizes the information in the log files. It writes out a text file with the summary information. What should show up in the text file is information that is in this zip file: http://theoffice.la/m/SummaryExample.zip In the script line 11 it states what directory to look for the input log files. The input log file name will need to be changed to yesterdays date for the script to read it. This is an example of an input log file: http://theoffice.la/m/2014-12-05Test.zip This is the Python Script that I'm having trouble with: http://theoffice.la/m/CGPLogSummaryTest.py If I haven't provided enough information please let me know. Thank you, Docfxit -- https://mail.python.org/mailman/listinfo/python-list
Re: Python script isn't producing text in data file
On Wednesday, December 10, 2014 3:05:07 PM UTC-8, Docfxit wrote: > I have a Python script that runs with no errors but it doesn't produce the > output it should in a text file. I can't figure out why. Is this the correct > forum to post this in or can someone suggest a more appropriate forum? > > The script selects all files from the day before the script is run. So if > today is December 10th the script will select all log files from December 9th. > > The script reads all files from the day before and summarizes the information > in the log files. It writes out a text file with the summary information. > > What should show up in the text file is information that is in this zip file: > http://theoffice.la/m/SummaryExample.zip > > In the script line 11 it states what directory to look for the input log > files. > The input log file name will need to be changed to yesterdays date for the > script to read it. > This is an example of an input log file: > http://theoffice.la/m/2014-12-05Test.zip > > This is the Python Script that I'm having trouble with: > http://theoffice.la/m/CGPLogSummaryTest.py > > I'm running this with Python 3.2.2 In Windows 7 Pro > If I haven't provided enough information please let me know. > > Thank you, > > Docfxit Edited for clarity. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python script isn't producing text in data file
On Wednesday, December 10, 2014 5:45:14 PM UTC-8, Chris Angelico wrote: > On Thu, Dec 11, 2014 at 12:32 PM, wrote: > > On Wednesday, December 10, 2014 3:11:28 PM UTC-8, Chris Angelico wrote: > >> On Thu, Dec 11, 2014 at 10:04 AM, Docfxit wrote: > >> > This is the Python Script that I'm having trouble with: > >> > http://theoffice.la/m/CGPLogSummaryTest.py > >> > > >> > If I haven't provided enough information please let me know. > >> > >> It'd be better to include the code in the body of your email. You > >> never know when your hosting might go down and the code be > >> unavailable like right now. :) > >> > >> ChrisA > > > > Also, I'm weary about clicking links to random pages. I like to think that > > I can trust my computer to not let me get pwned by simply downloading and > > opening up a ZIP, but with Windows's history of exploits, I don't trust it. > > > > Agreed. There are ways around some of those problems (eg using wget to > fetch something, and then looking at it in a text editor - it's hard > to get pwned through a text editor... though I won't say impossible), > but there are other issues too, and all in all, it's just best to > include the text in-line. > > ChrisA I am happy to paste it into a post. The reason I didn't is because it's very large. The Python script is 1239 lines long. The example summary is 105 lines long. The input log is 6810 lines long. Are you sure you want me to post all of that here? Or would you like me to post it on a pastebin? Thanks, Docfxit -- https://mail.python.org/mailman/listinfo/python-list
Re: Python script isn't producing text in data file
On Wednesday, December 10, 2014 6:47:17 PM UTC-8, Steven D'Aprano wrote: > On Wed, 10 Dec 2014 15:04:52 -0800, Docfxit wrote: > > > This is the Python Script that I'm having trouble with: > > http://theoffice.la/m/CGPLogSummaryTest.py > > Link is broken: > Steven I'm very sorry. I didn't mean to post that file. It should be this link: http://theoffice.la/m/CGPLogSummaryTest.zip But I am happy to put it any place anyone would like. Thank you, Docfxit -- https://mail.python.org/mailman/listinfo/python-list
Re: Python script isn't producing text in data file
On Wednesday, December 10, 2014 7:55:17 PM UTC-8, Ben Finney wrote: > Docfxit writes: > > > I am happy to paste it into a post. The reason I didn't is because > > it's very large. The Python script is 1239 lines long. > > That's too long to direct us toward, no matter where you put it. > > Your task, then, is to construct a *much* smaller and simpler example > that still demonstrates the behaviour you want explained. > > Once you have that, one of two things will be true: > > * It will be small and clear enough that we can discuss it here > usefully. Or > > * You will have understood the problem well enough to solve it yourself. > > Please, construct a Short, Self-Contained, Complete Example > http://sscce.org/> of code that exhibits the behaviour. > > -- > \ "When cryptography is outlawed, bayl bhgynjf jvyy unir | > `\ cevinpl." --Anonymous | > _o__) | > Ben Finney Thank you all for the encouragement to make it smaller. I don't know enough about Python to figure out how to isolate where the problem is happening. Maybe it would be best If I could get some help in getting a debugger working so I can try to work through the script one line at a time. I have started to install a debugger but I can't get it working. I'm working in Win7 Pro. I'm trying to get Winpdb working. I have an error when I run the debugger. It says winpdb is missing. winpdb.py is located in: -same version C:\Python27\Lib\site-packages C:\winpdb-winpdb winpdb is located in: C:\winpdb-winpdb Is winpdb supposed to be in c:\python27? If it is, how is it supposed to get there? (Some install?) Thanks, Docfxit -- https://mail.python.org/mailman/listinfo/python-list
Re: Python script isn't producing text in data file
On Thursday, December 11, 2014 1:32:02 AM UTC-8, Peter Otten wrote: > Docfxit wrote: > > > I don't know enough about Python to figure out how to isolate where the > > problem is happening. > > Can you get hold of the person who wrote the script? No. I tried. They are not answering their email. Thanks for the suggestion, Docfxit -- https://mail.python.org/mailman/listinfo/python-list
