Re: Advice on how to get started with 2D-plotting ?
Am 06.09.2011 20:27, schrieb Fred Pacquier: Hi, I'm a Python long-timer, but I've never had to use tools like Matplotlib& others before. Now, for my work, I would need to learn the basics fast, for a one-time quick-n-dirty job. This involves a graphic comparison of RFC1918 IP subnets allocation across several networks. maybe networkx http://pypi.python.org/pypi/networkx/1.5 http://networkx.lanl.gov/ is a better solution for your problem or http://pypi.python.org/pypi/graphcanvas/4.0.0 The idea is to draw parallel lines, with segments (subnets) coloured green, yellow or red depending on the conflicts between the networks. What would be the simplest/fastest way of getting this done ? (the graphic parts, the IP stuff I know how to handle) Alternately, if someone knows of a ready-made and accessible tool that does just that, I'm all ears :-) TIA, fp hth Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: database questions ala newbie pythonist
chris wrote: ... This works fine using the literals 0 (For Delstatus) and 1190 (for ProductID) But when I try to use a variable such as: ### ... varA = '0' varB = '1190' mycursor.execute('Update Categories Set DelStatus = ' varA 'Where ProductID = ' varB) use string formatting expressions (which are easier to handle than string concatenation) : 'UPDATE Categories SET DelStatus=%d WHERE ProductID=%s;' % (varA,'1190') or maybe "UPDATE Categories SET DelStatus='%d' WHERE ProductID='%d';" % (0,varB) if your DB wants your int's as string ### I get errors. Please excuse my ignorance in what is probably obvious to most others within this newsgroup. What I am trying to do is to update my database from a 2 field .CSV file I figured I could load the CSV file into a dictionary and parse each row running a query using the values from varA and VarB from the key value pairs. happy pythoning Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing a Web Robot in Python
[EMAIL PROTECTED] schrieb: > I'm working on writing a web robot (for searching web pages) in Python > so I've been browsing around the web looking for data about building > web robots. > > I'm surprised to find that I didn't find much data. Seems like robots > would be kind of a common thing to build. I know there is this: "The > Web Robots Pages" (http://www.robotstxt.org/wc/robots.html) but that > doesn't have a lot of data and seems pretty out of date. > > I checked amazon.com for books on building web robots and I didn't find > very much. Seems kind of weird that I don't find much data on this > subject. Anybody know some good places to go to get information on > building a web robots? maybe one of the following packages will fullfill your needs http://www.idyll.org/~t/www-tools/twill/ http://wwwsearch.sourceforge.net/mechanize/ http://python.org/pypi/mechanoid happy pythoning herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: matplotlib: howto redraw figure automatically, without stop in show()/draw()?
dmitrey wrote: > Hi all, > here is a question already mentioned below, and I'm also interested in > that one very much. > unfortunatly, I can't write anything to matplotlib mailing lists > because I constantly get server internal error (500) > Does anyone knows the answer? maybe this is what you want ? http://matplotlib.sourceforge.net/faq.html#DYNAMIC happy pythoning herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: calling Postgresql stored procedure
Alchemist schrieb: > I am using Python 2.4 and Postgresql 8.2 database server. > > On the database I have created a stored function, example, > CREATE OR REPLACE FUNCTION calculateaverage() > > I created a new python script and would like to call my database > stored function. > > How can I call a database stored function/procedure in python? > with : SELECT calculateaverage() FROM ... WHERE ... ; happy pythoning Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Databases with python
Anthony Irwin wrote: > Hi All, > > I am interested in playing with python some more and am looking at > writing an app with data stored in a database. I have experience with > mysql but thought that their may be other better databases that can be > more easily distributed with the program does anyone have any > suggestions here? with SQLObject ( http://www.sqlobject.org/ ) or SQLAlchemy ( http://www.sqlalchemy.org/ ) you can use any of the supported (sqlite, mysql, postgresql, firebird) databases in an object oriented way without worrying about the details of the database you use. sqlite ( http://www.sqlite.org/ ) is a database which stores its data directly into a file, while all other databases require a server to be installed prior to using it, so if you want to distribute your application it might be the easiest way to use sqlite as your database. Python 2.5 and newer has sqlite already included, thus it seems the database of choice. > I only use linux myself but I can foresee some windows people wanting to > use what I create and if I am going to support windows then I might as > well support mac too. (this is to say that the database should support > the 3 main platforms in use) > > Also is wxpython the best cross platform gui library it seems to be the > best I have seen so far. Happy pythoning Herbert ps: if you want to create a web-application i can recommend TurboGears ( http://www.turbogears.org/ ) -- http://mail.python.org/mailman/listinfo/python-list
Re: HTML to dictionary
Tina I schrieb: > Hi everyone, > > I have a small, probably trivial even, problem. I have the following HTML: >> >> METAR: >> >> ENBR 270920Z 0KT FEW018 02/M01 Q1004 NOSIG >> ... BeautifulSoup is really fun to work with ;-) > I have played around with BeautifulSoup but I'm stuck at stripping off > the tags and chop it up to what I need to put in the dict. If someone > can offer some hints or example to get me going I would greatly > appreciate it. > > Thanks! > Tina #!/usr/bin/python # -*- coding: utf-8 -*- from BeautifulSoup import BeautifulSoup, Tag, NavigableString html = """ Title METAR: ENBR 270920Z 0KT ... short-TAF: ENBR 270800Z 270918 VRB05KT ... long-TAF: ENBR 271212 VRB05KT ... """ soup = BeautifulSoup( html, convertEntities='html' ) bolds = soup.findAll( 'b' ) dict = {} for b in bolds : key = b.next.strip() val = b.next.next.strip() print 'key=', key print 'val=', val, '\n' dict[key] = val print dict # end happy pythoning Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Library/classes to burn DVDs given a set of .AVI files
Aldo Ceccarelli schrieb: Hi All, do you have any experience about any library tool suitable to burn video DVDs from video (f.i. .avi) file formats? In negative case and as an alternative: do you have any in other programming languages? see : http://www.rastersoft.com/programas/devede.html or : http://tovid.wikia.com/wiki/Tovid_Wiki thanks in advance WKR, Aldo hth herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Image Processing (batch)
Thomas Guettler schrieb: Hi, I tried PIL for image batch processing. But somehow I don't like it - Font-Selection: You need to give the name of the font file. - Drawing on an image needs a different object that pasting and saving. - The handbook is from Dec. 2006. What image libraries do you suggest? try : http://photobatch.stani.be/ hth Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: DISLIN 9.3 starting issues
adolfo wrote: I built the following little program: from numpy import * from dislin import * def main(): x = arange (100, typecode=Float32) plot (x, sin (x/5)) disfin () main() *** Here are the problems: 1. The "from Numeric import" statement did not work, I replaced with "from numpy import*" and no complains form the interpreter. 2. If I enyter "from dislin import *" I get: Traceback (most recent call last): File "", line 1, in from dislin import * ImportError: No module named dislin I checked the environmental variables paths and it all seems Ok: c:\dislin SYSTEM PATH = %SystemRoot%\system32;%SystemRoot%;\System32;\Wbem;C: \Archivos de programa;\QuickTime;\QTSystem;C:\dislin\win PYTHON PATH = C:\Archivos de programa\ArcGIS\bin;c:\dislin\python the environment variable is PYTHONPATH and i has to contain the directory where the dislin.pyd module can be found; you should set environment variable DISLIN too (see python.inf, which you can find in the dislin-distribution) depending on your python version (2.4 or 2.5) you need the correct dislin-distribution, because dislin is a fortran/c library with a layer for python access. and try some examples of the distribution (they are importing only dislin and math modules). hth Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Automated Graph Plotting in Python
[EMAIL PROTECTED] schrieb: > My python program spits lot of data. I take that data and plot graphs > using OfficeOrg spredsheet. I want to automate this task as this takes > so much of time. I have some questions. > > 1. Which is the best graph plotting utility in python or linux. Can I > write a code in such a way that my python code automatically gives me a > graph. I know little about gnuplot. If you know any better tool without > much learning curve please tell me in Linux. if you want to plot graphs : use pydot the wrapper for graphviz http://dkbza.org/pydot.html http://www.research.att.com/sw/tools/graphviz/ if you want to plot datas (2d) : matplotlib http://sourceforge.net/projects/matplotlib or (2d/3d) dislin (=a plotting library with a python-wrapper) http://www.dislin.de/ > 2. I want to write a script such that my python code writes to a file, > some graph utility like gnuplot takes that data from the file and I get > my graph ready made. Do you think its possible ? > > Any feedback regarding above is appreciated. > > Thanks > happy pythoning Herbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Data visualization in Python
Am 2009-08-17 21:10, schrieb kj: I'm looking for a good Python package for visualizing scientific/statistical data. (FWIW, the OS I'm interested in is Mac OS X). The users of this package will be experimental biologists with little programming experience (but currently learning Python). SciDAVis is a free application for Scientific Data Analysis and Visualization. http://scidavis.sourceforge.net/ Veusz is a scientific plotting and graphing package written in Python. http://home.gna.org/veusz/ Open source data visualization and analysis for novice and experts. Data mining through visual programming or Python scripting. Extensions for bioinformatics and text mining. Comprehensive, flexible and fast. http://www.ailab.si/orange/ (I normally visualize data using R or Mathematica, but I don't want to saddle these novices with the task of learning yet another language.) hth Herbert -- http://mail.python.org/mailman/listinfo/python-list