Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feed.xsnews.nl!border-2.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; '(except': 0.05; 'next,': 0.07; 'subject:help': 0.07; 'counting': 0.09; 'matplotlib': 0.09; 'subject:python': 0.11; 'library': 0.15; 'dec': 0.15; 'file,': 0.15; 'properly': 0.15; "(it's": 0.16; 'anyways,': 0.16; 'csv': 0.16; 'fits': 0.16; 'iteration': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'subject:need': 0.17; 'solution.': 0.18; 'variable': 0.20; "i'd": 0.22; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'creating': 0.26; '[1]': 0.27; '[2]': 0.27; 'decide': 0.28; 'install': 0.29; 'maybe': 0.29; 'url:python': 0.32; 'file': 0.32; 'print': 0.32; 'handle': 0.33; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'that,': 0.34; 'next': 0.35; 'created': 0.36; 'url:org': 0.36; 'modules': 0.36; 'url:library': 0.36; 'subject:with': 0.36; 'subject: (': 0.36; 'level': 0.37; 'quite': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:docs': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'easily': 0.39; 'think': 0.40; 'your': 0.60; 'content- disposition:inline': 0.60; 'most': 0.61; 'you.': 0.61; 'first': 0.61; 'kind': 0.61; 'back': 0.62; 'thomas': 0.62; 'email addr:gmail.com': 0.63; 'results': 0.65; 'stuck': 0.65; 'increase': 0.72; 'configparser': 0.84; 'ini': 0.84; 'received:10.94': 0.84; 'url:configparser': 0.84; 'url:counter': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-mainz.de; i=@uni-mainz.de; q=dns/txt; s=ironport; t=1355833238; x=1387369238; h=date:from:to:subject:message-id:references:mime-version: content-transfer-encoding:in-reply-to; bh=JH/P648VnVUTYNUjYXV89miT8shsLLje1p0SLHAy/Fs=; b=A10jAjivGyrZNw9QgCz9QqepQdIG7FoEEhh6JccbT7vbzEqzQVsOHoNG z2cggvUCkHluM1KuBWt+ThnS8GhIrgssEdb16tg0TQkmtgm30ygWMAxjv 2KTuS04ZEEI7WOokukChU0YweFo5RIZW2wMa21GpFTLz4kpxPBTjFwWRg o=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtEMADld0FAKXgZY/2dsb2JhbABEg0iCc4hyrw5zgh4BAQUjDwFWCxgCAiYCAhQNHAoWExuHZgMTCKVagkCGcQ2JVYEiij5pgRqCFjJhA5Q0gVUBgRyKG4URgnSCIQ Date: Tue, 18 Dec 2012 13:20:25 +0100 From: Thomas Bach To: Subject: Re: I need help with graphs in python (2.7.3.1) References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.68.250.225] 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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355833240 news.xs4all.nl 6959 [2001:888:2000:d::a6]:38778 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35051 Hi, Most of the tasks you have to do can be achieved quite easily with the standard library (except the plotting). On Tue, Dec 18, 2012 at 03:29:49AM -0800, hevymetl07@gmail.com wrote: > These are some steps I need to do first before creating the graph: > - Get the name of a CSV file from an ini file, Have a look at the ConfigParser module[1], > - Next, read a line from this CSV file, well, the csv module[2] apparently is a good choice for that, > - Increase a variable depending on the Log level (information, > - warning, error, critical), you maybe want to use collections.counter for that[3]. Anyways, I think matplotlib can handle the counting for you… > - Read the next line, this is just iteration over the csv instance you created with your file > - Then I need to print these results in a Graph. I use matplotlib for this purpose, have a look at their gallery[4] to decide what kind of plot best fits your needs. I'd recommend to install ipython and start playing around with the modules I just told you. If you are stuck somewhere read the documentation properly (it's actually all in there) and come back again if you cannot come up with a solution. Hope this helps, Thomas Bach. Footnotes: [1] http://docs.python.org/2/library/configparser.html [2] http://docs.python.org/2/library/csv.html [3] http://docs.python.org/2/library/collections.html#collections.Counter [4] http://matplotlib.org/gallery.html