Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: Python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python': 0.09; 'subject:python': 0.11; 'suggest': 0.11; '"python': 0.16; '...]': 0.16; 'already,': 0.16; 'fits': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'log.': 0.16; 'message- id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'subject:Query': 0.16; 'subject:log': 0.16; 'subject:windows': 0.16; 'tjg': 0.16; 'wrote:': 0.17; 'specify': 0.17; 'tim': 0.18; '>>>': 0.18; 'input': 0.18; 'windows': 0.19; "haven't": 0.23; 'command': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'wondering': 0.26; 'question': 0.27; "doesn't": 0.28; 'all.': 0.28; 'run': 0.28; 'post': 0.28; 'piece': 0.29; 'query': 0.30; 'code': 0.31; 'url:python': 0.32; 'could': 0.32; 'received:192.168.100': 0.33; 'to:addr:python-list': 0.33; 'tutorial': 0.33; 'or,': 0.34; 'something': 0.35; 'there': 0.35; 'wanted': 0.36; 'url:org': 0.36; '12,': 0.36; 'subject:with': 0.36; 'ok,': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'short': 0.39; 'where': 0.40; 'skip:" 10': 0.40; 'received:192.168': 0.40; 'your': 0.60; "you've": 0.61; 'free': 0.61; 'here:': 0.62; 'back': 0.62; 'email addr:gmail.com': 0.63; 'here': 0.65; 'started.': 0.65; 'from:addr:mail': 0.71; 'prompt': 0.78; '2013': 0.84; 'url:tutorial': 0.93 Date: Mon, 14 Jan 2013 09:07:06 +0000 From: Tim Golden User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Python-list@python.org Subject: Re: Query windows event log with python References: <8e37e86b-2f07-494e-a913-f7d2fb6ba9a4@googlegroups.com> <2ba544a0-4a19-4c1e-bae3-c916ce83a84e@googlegroups.com> In-Reply-To: <2ba544a0-4a19-4c1e-bae3-c916ce83a84e@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358154430 news.xs4all.nl 6973 [2001:888:2000:d::a6]:46848 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36776 On 13/01/2013 05:55, robey.lawrence@gmail.com wrote: > On Saturday, January 12, 2013 8:34:01 PM UTC+11, Tim Golden wrote: >> On 12/01/2013 06:09, email.address@gmail.com wrote: >> >>> I am looking to write a short program to query the windows event >> >>> log. >> >>> >> >>> It needs to ask the user for input for The event type (Critical, >> >>> Error, and Information), and the user needs to be able to specify >>> a >> >>> date since when they want to view results. >> >>> >> >>> I found this piece of code to start from, >> >> >> >> [... snip ...] >> >> >> >> Well it looks like you have everything you need. Was there a >> specific >> >> question you wanted to ask? >> >> >> >> TJG > > yes, I would like to run it in Command prompt and ask the user at the > time what type and date of Event they would like to view. so i was > wondering where in the code I could put something like > "var=raw_input" Ok, so your query isn't so much with accessing the event log as with writing Python code at all. If you haven't already, could I suggest the Python tutorial here: http://docs.python.org/2/tutorial/ or, if that one doesn't suit, just search for "Python tutorial" to find something which fits your brain. Feel free to post back here with questions once you've got started. TJG