ANN: Python Enthought Edition Version 0.9.7 Released
Enthought is pleased to announce the release of Python Enthought Edition Version 0.9.7 (http://code.enthought.com/enthon/) -- a python distribution for Windows. 0.9.7 Release Notes: Version 0.9.7 of Python Enthought Edition includes an update to version 1.0.7 of the Enthought Tool Suite (ETS) Package and bug fixes-- you can look at the release notes for this ETS version here: http://svn.enthought.com/downloads/enthought/changelog-release.1.0.7.html About Python Enthought Edition: --- Python 2.3.5, Enthought Edition is a kitchen-sink-included Python distribution for Windows including the following packages out of the box: Numeric SciPy IPython Enthought Tool Suite wxPython PIL mingw f2py MayaVi Scientific Python VTK and many more... More information is available about all Open Source code written and released by Enthought, Inc. at http://code.enthought.com -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Vancouver Python Workshop: New Keynoter
What's New? === The Vancouver Python Workshop is pleased to announce the addition of a third keynote speaker to this year's conference. Ian Cavén is the primary developer of the Lowry Digital Images motion picture restoration system. This Python and Zope-based system has been used to restore over 150 motion pictures. Highlights include Citizen Kane, Sunset Boulevard and both the Indiana Jones and Star Wars trilogies. While Ian was Chief Scientist at Lowry Digital, his rack of computers grew from a few Macintoshes on his desktop to over six hundred Macintosh and Linux servers - at one point earning Lowry the title as the second biggest installation of parallel processing Maintoshes in the world. In 2005, Lowry Digital Images was acquired by DTS (the famous movie audio company) and renamed DTS Digital Images. The motion picture restoration system has been discussed in publications as diverse as IEEE Spectrum, USA Today, the BBC NEWS, the New York Times and Apple.com. Ian has been a Python enthusiast since 1999. About the Vancouver Python Workshop === The conference will begin with keynote addresses on August 4st by Guido van Rossum [1], Jim Hugunin [2], and Ian Cavén. Further talks (and tutorials for beginners) will take place on August 5th and 6th. The Vancouver Python Workshop is a community organized conference designed for both the beginner and for the experienced Python programmer with: * tutorials for beginning programmers * advanced lectures for Python experts * case studies of Python in action * after-hours social events * informative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportunity to visit one of the most extraordinary cities in the world [3]. For more information about traveling to Vancouver, see: http://www.vanpyz.org/conference/vancouver.html http://www.tourismvancouver.com http://en.wikipedia.org/wiki/Vancouver Important dates === Talk proposals accepted: May 15th to June 15th Early registration (discounted): May 22nd to June 30th Normal registration: from July 1st Keynotes: August 4th Conference and tutorial dates: August 5th and 6th [1] Guido van Rossum (Google) is the inventor of Python and has managed its growth and development for more than a decade. Guido was awarded the Free Software Foundation Award in 2002 and Dr.Dobb's 1999 Excellence in Programming Award. Guido works at Google and spends half of his time on Python. [2] Jim Hugunin (Microsoft) is the creator of numerous innovations that take Python into new application domains. Jim's most recent project, IronPython integrates Python into Microsoft's .NET runtime. Jim's previous project, Jython is Python for the Java runtime and was the second production-quality implementation of Python. Before that, Jim's Numeric Python adapted Python to the needs of number crunching applications. Jim works at Microsoft adapting the .NET runtime to the needs of dynamic languages like Python. [3] http://news.bbc.co.uk/2/hi/business/2299119.stm Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Dr. Dobb's Python-URL! - weekly Python news and links (Jun 7)
QOTW: You can gain substantial speed-ups in very certain cases, but the main point of Pyrex is ease of wrapping, not of speeding-up. - Simon Percivall The rule of thumb for all your Python Vs C questions is ... 1.) Choose Python by default. . . . - Ravi Teja Do you remember Python's early (notice the mention of traversal of the World-Wide Web. All of it!) days? Guido invites your reminiscences: http://www.artima.com/forums/flat.jsp?forum=106thread=161207 Paul Boddie wraps up the how can I compile Python? FAQ as authoritatively as possible (at least for the moment): http://groups.google.com/group/comp.lang.python/msg/ccdadf2b24af0f91 Nick Craig-Wood contributes a Process definition to access a Linux process table programmatically: http://groups.google.com/group/comp.lang.python/msg/61ae7c3716fa17db Embedding Python? Initialization is more subtle than first appears. Stefan Schukat explains an example which arises when working with win32: http://groups.google.com/group/comp.lang.python/msg/5cb4424ba6c8fa97 pysqlite has a create_function. Gerhard Haering illustrates its use: http://groups.google.com/group/comp.lang.python/msg/f100756cf7569e13 Everything Python-related you want is probably one or two clicks away in these pages: Python.org's Python Language Website is the traditional center of Pythonia http://www.python.org Notice especially the master FAQ http://www.python.org/doc/FAQ.html PythonWare complements the digest you're reading with the marvelous daily python url http://www.pythonware.com/daily Mygale is a news-gathering webcrawler that specializes in (new) World-Wide Web articles related to Python. http://www.awaretek.com/nowak/mygale.html While cosmetically similar, Mygale and the Daily Python-URL are utterly different in their technologies and generally in their results. For far, FAR more Python reading than any one mind should absorb, much of it quite interesting, several pages index much of the universe of Pybloggers. http://lowlife.jp/cgi-bin/moin.cgi/PythonProgrammersWeblog http://www.planetpython.org/ http://mechanicalcat.net/pyblagg.html comp.lang.python.announce announces new Python software. Be sure to scan this newsgroup weekly. http://groups.google.com/groups?oi=djqas_ugroup=comp.lang.python.announce Python411 indexes podcasts ... to help people learn Python ... Updates appear more-than-weekly: http://www.awaretek.com/python/index.html Steve Bethard, Tim Lesher, and Tony Meyer continue the marvelous tradition early borne by Andrew Kuchling, Michael Hudson and Brett Cannon of intelligently summarizing action on the python-dev mailing list once every other week. http://www.python.org/dev/summary/ The Python Package Index catalogues packages. http://www.python.org/pypi/ The somewhat older Vaults of Parnassus ambitiously collects references to all sorts of Python resources. http://www.vex.net/~x/parnassus/ Much of Python's real work takes place on Special-Interest Group mailing lists http://www.python.org/sigs/ Python Success Stories--from air-traffic control to on-line match-making--can inspire you or decision-makers to whom you're subject with a vision of what the language makes practical. http://www.pythonology.com/success The Python Software Foundation (PSF) has replaced the Python Consortium as an independent nexus of activity. It has official responsibility for Python's development and maintenance. http://www.python.org/psf/ Among the ways you can support PSF is with a donation. http://www.python.org/psf/donate.html Kurt B. Kaiser publishes a weekly report on faults and patches. http://www.google.com/groups?as_usubject=weekly%20python%20patch Although unmaintained since 2002, the Cetus collection of Python hyperlinks retains a few gems. http://www.cetus-links.org/oo_python.html Python FAQTS http://python.faqts.com/ The Cookbook is a collaborative effort to capture useful and interesting recipes. http://aspn.activestate.com/ASPN/Cookbook/Python Among several Python-oriented RSS/RDF feeds available are http://www.python.org/channews.rdf http://bootleg-rss.g-blog.net/pythonware_com_daily.pcgi http://python.de/backend.php For more, see http://www.syndic8.com/feedlist.php?ShowMatch=pythonShowStatus=all The old Python To-Do List now lives principally in a SourceForge reincarnation. http://sourceforge.net/tracker/?atid=355470group_id=5470func=browse http://www.python.org/dev/peps/pep-0042/ The online Python Journal is
Pydev 1.1.0 Released
Hi All, Pydev and Pydev Extensions 1.1.0 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: - - Bug-fixes Release Highlights in Pydev: -- - Startup is now faster for the plugin: actions, scripts, etc. are now all initialized in a separate thread - Indentation engine does not degrade as document grows - Multiple-string does not mess up highlighting anymore - code completion issue with {} solved - Ctrl+W: now expands the selection to cover the whole word where the cursor is - Assign to attributes (provided by Joel Hedlund) was expanded so that Ctrl+1 on method line provides it as a valid proposal - A Typing preferences page was created so that the main page now fits in lower resolutions What is PyDev? --- PyDev is a plugin that enables users to use Eclipse for Python and Jython development -- making Eclipse a first class Python IDE -- It comes with many goodies such as code completion, syntax highlighting, syntax analysis, refactor, debug and many others. Cheers, -- Fabio Zadrozny -- Software Developer ESSS - Engineering Simulation and Scientific Software http://www.esss.com.br Pydev Extensions http://www.fabioz.com/pydev Pydev - Python Development Enviroment for Eclipse http://pydev.sf.net http://pydev.blogspot.com -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
ANNOUNCE: Zenoss 0.20.0 Available
Version 0.20.0 of Zenoss is available for download. This version adds native SNMP performance monitoring and a new install system. To download: http://www.zenoss.org/download Release Notes: http://dev.zenoss.org/trac/wiki/zenoss-0.20 --- Project Blurb: Zenoss is a powerful enterprise monitoring system written in Python/ Zope. Zenoss provides monitoring of organization-wide infrastructure in an integrated product. Key features include: - Monitoring across layers (network, servers, apps, environment...) - Monitoring across platforms (windows, linux, unix...) - Monitoring across perspectives (availability, performance, events, configuration) - Support for various collection methods (SNMP, WMI, SSH, Telnet) - Automated modeling of the IT environment - Role-based access/management through web portal - GPL License Enjoy, -EAD Erik Dahl -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
python-dev Summary for 2006-04-01 through 2006-04-15
python-dev Summary for 2006-04-01 through 2006-04-15 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-04-01_2006-04-15] = Announcements = - Python 2.5a1 Released - Python 2.5 alpha 1 was released on April 5th. Please download it and try it out, particularly if you are an extension writer or you embed Python -- you may want to change things to support 64-bit sequences, and if you have been using mismatched PyMem_* and PyObject_* allocation calls, you will need to fix these as well. Contributing threads: - `TRUNK FREEZE. 2.5a1, 00:00 UTC, Wednesday 5th of April. http://mail.python.org/pipermail/python-dev/2006-April/063324.html`__ - `outstanding items for 2.5 http://mail.python.org/pipermail/python-dev/2006-April/063328.html`__ - `chilling svn for 2.5a1 http://mail.python.org/pipermail/python-dev/2006-April/063403.html`__ - `Reminder: TRUNK FREEZE. 2.5a1, 00:00 UTC, Wednesday 5th of April. http://mail.python.org/pipermail/python-dev/2006-April/063426.html`__ - `RELEASED Python 2.5 (alpha 1) http://mail.python.org/pipermail/python-dev/2006-April/063441.html`__ - `TRUNK is UNFROZEN http://mail.python.org/pipermail/python-dev/2006-April/063443.html`__ - `segfault (double free?) when '''-string crosses line http://mail.python.org/pipermail/python-dev/2006-April/063572.html`__ - `pdb segfaults in 2.5 trunk? http://mail.python.org/pipermail/python-dev/2006-April/063591.html`__ - `IMPORTANT 2.5 API changes for C Extension Modules and Embedders http://mail.python.org/pipermail/python-dev/2006-April/063637.html`__ -- Contributor agreements -- If you're listed in the `Python acknowledgments`_, and you haven't signed a `contributor agreement`_, please submit one as soon as possible. Note that this includes even the folks that have been around forever -- the PSF would like to be as careful as possible on this one. .. _Python acknowledgments: http://svn.python.org/projects/python/trunk/Misc/ACKS .. _contributor agreement: http://www.python.org/psf/contrib-form-python.html Contributing threads: - `PSF Contributor Agreement for pysqlite http://mail.python.org/pipermail/python-dev/2006-April/063578.html`__ --- Firefox Python bug searches --- Anthony Baxter has created a `Firefox searchbar`_ for finding Python bugs by their SourceForge IDs. There are also two Firefox sidebar options: `Mark Hammond's`_ and `Daniel Lundin's`_. .. _Firefox searchbar: http://www.python.org/~anthony/searchbar/ .. _Mark Hammond's: http://starship.python.net/~skippy/mozilla/ .. _Daniel Lundin's: http://projects.edgewall.com/python-sidebar/ Contributing thread: - `Firefox searchbar engine for Python bugs http://mail.python.org/pipermail/python-dev/2006-April/063285.html`__ - Building Python with the free MS Toolkit compiler - Paul Moore documented how to build Python on Windows with the free MS Toolkit C++ compiler `on the wiki`_. The most up-to-date version of these instructions is in `PCbuild/readme.txt`_. .. _on the wiki: http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit .. _PCbuild/readme.txt: http://svn.python.org/projects/python/trunk/PCbuild/readme.txt Contributing thread: - `Building Python with the free MS Toolkit compiler http://mail.python.org/pipermail/python-dev/2006-April/063719.html`__ -- Please login to the wiki when you make changes -- Skip Montanaro has requested that anyone posting to the wiki sign in first, as this makes things easier for those monitoring changes to the wiki. When you're logged in, your changes appear with your name, and so can be immediately recognized as not being wiki-spam. Contributing thread: - `Suggestion: Please login to wiki when you make changes http://mail.python.org/pipermail/python-dev/2006-April/063447.html`__ --- Checking an older blamelist --- While the buildbot blamelist may scroll off the `main page`_ in a matter of hours, you can still see the blamelist for a particular revision by checking a particular build number, e.g. to see build 800 of the trunk on the G4 OSX, you could check http://www.python.org/dev/buildbot/trunk/g4%20osx.4%20trunk/builds/800. .. _main page: http://www.python.org/dev/buildbot/all/ Contributing threads: - `Preserving the blamelist http://mail.python.org/pipermail/python-dev/2006-April/063633.html`__ - `TODO Wiki (was: Preserving the blamelist) http://mail.python.org/pipermail/python-dev/2006-April/063673.html`__ = Summaries = - Garbage collection issues - One of the
ANN: W3C batchvalidator script 1.6
what is it -- A short script which calls the W3C HTML Validator in batch mode. Adapted from a Perl version. changes since the last release -- New option ``UPLOADFROMURL`` to retrieve files from e.g. a local server which the w3 validator may not be able to access. Useful if dynamic pages like .php or .jsp pages need to be validated. download download validate-1.6 - 060606 from http://cthedot.de/batchvalidator/ tested on Python 2.4 only but should work on other versions as it is really quite simple... Included is a (modified) httplib_multipart.py script (originally from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306) to be able to POST fields and files to an HTTP host as multipart/form-data. any comment will be appreciated, thanks christof -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
IPython 0.7.2 is out.
Hi all, The IPython team is happy to release version 0.7.2, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? 1. An interactive shell superior to Python's default. IPython has many features for object introspection, system shell access, and its own special command system for adding functionality when working interactively. 2. An embeddable, ready to use interpreter for your own programs. IPython can be started with a single call from inside another program, providing access to the current namespace. 3. A flexible framework which can be used as the base environment for other systems with Python as the underlying language. 4. A shell for interactive usage of threaded graphical toolkits. IPython has support for interactive, non-blocking control of GTK, Qt and WX applications via special threading flags. The normal Python shell can only do this for Tkinter applications. Where to get it --- IPython's homepage is at: http://ipython.scipy.org and downloads are at: http://ipython.scipy.org/dist We've provided: - Source download (.tar.gz) - An RPM (for Python 2.4, built under Ubuntu Dapper 6.06). - A Python Egg (http://peak.telecommunity.com/DevCenter/PythonEggs). - A native win32 installer. The egg is 'light', as it doesn't include documentation and other ancillary data. If you want a full ipython installation, use the source tarball or your distribution's favorite system. We note that IPython is now officially part of most major Linux and BSD distributions, so packages for this version should be coming soon, as the respective maintainers have the time to follow their packaging procedures. Many thanks to Jack Moffit, Norbert Tretkowski, Andrea Riciputi, Dryice Liu and Will Maier for the packaging work, which helps users get IPython more conveniently. Many thanks to Enthought for their continued hosting support for IPython. Release notes - As always, the full ChangeLog is at http://ipython.scipy.org/ChangeLog. The highlights of this release follow. Also see the What's New page at http://projects.scipy.org/ipython/ipython/wiki/WhatsNew for more details on some of these features. * Walter Doerwald's ipipe module, which provides a handy way to browse and manipulate tabular data, e.g. groups of files or environment variables (this is currently mostly a *nix feature, due to its need for ncurses). Walter is now a member of the IPython team. * The IPython project is the new home for the UNC readline extension, which allows win32 users to access readline facilities (tab completion, colored prompts, and more). UNC readline has been renamed PyReadline, and has a number of important new features, especially for users of non-US keyboards. See this page for more details: http://projects.scipy.org/ipython/ipython/wiki/PyReadline/Intro * A new extension and configuration API. * Hardened persistence. Persistence of data now uses pickleshare, a shelve-like module that allows concurrent access to the central ipython database by multiple ipython instances. * Simpler output capture: files=!ls will now capture the 'ls' call into the 'files' variable. * New magic functions: %timeit, %upgrade, %quickref, %cpaste, %clip, %clear. Also, a 'raw' mode has been added to %edit, %macro, %history. * Batch files. If the file ends with .ipy, you can launch it by ipython myfile.ipy. It will be executed as if it had been typed interactively (it can contain magics, aliases, etc.) * New pexpect-based 'irunner' module, to run scripts and produce all the prompts as if they had been typed one by one. This lets you reproduce a complete interactive session from a file, which can be very useful when producing documentation, for example. The module provides default runners for ipython, plain python and SAGE (http://sage.scipy.org). Users can subclass the base runner to produce new ones for any interactive system whose prompts are predictable (such as gnuplot, a system shell, etc.). * New option to log 'raw' input into IPython's logs. The logs will then be valid .ipy batch scripts just as you typed them, instead of containing the converted python source. * Fixes and improvements to (X)Emacs support. PDB auto-tracking is back (it had broken in 0.7.1, and auto-indent now works inside emacs ipython buffers. You will need to update your copy of ipython.el, which you can get from the doc/ directory. A copy is here, for convenience: http://ipython.scipy.org/dist/ipython.el * The ipapi system offers a new to_user_ns() method in the IPython object, to inject variables from a running script directly into the user's namespace. This lets you have internal variables from a script visible interactively for further manipulation after %running it. * Thanks to Will Maier, IPython is now
Fredericksburg, VA ZPUG June 14: meld3 templating and memcached sessions
Please join us Wed., June 14, 7:30-9:00 PM, for another meeting of the Fredericksburg, VA Zope and Python User Group (ZPUG). We will have two full presentations, and some good snacks. If you plan to attend, an email 24 hours in advance would be appreciated (but last minute attendees are welcome). - Chris McDonough will talk about meld3, a Python HTML/XML templating system in the spirit of PyMeld and other 'push-based' templating systems. (http://www.plope.com/software/meld3) - Tres Seaver will present Using memcached in Python and Zope, including a demo of using his 'mcdutils' product to do shared session management in Zope. Gary General ZPUG information When: second Wednesday of every month, 7:30-9:00. Where: Zope Corporation offices. 513 Prince Edward Street; Fredericksburg, VA 22408 (tinyurl for map is http://tinyurl.com/duoab). Parking: Zope Corporation parking lot; entrance on Prince Edward Street. Topics: As desired (and offered) by participants, within the constraints of having to do with Python or Zope. Mailing list: [EMAIL PROTECTED] Contact: Gary Poster ([EMAIL PROTECTED]) -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
[ANN] Firedrop 0.2.2
`Firedrop 2 0.2.2 http://www.voidspace.org.uk/python/firedrop2/`_ is now available. You can download it from : `Firedrop-0.2.2.zip http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=firedrop2-0.2.2.zip`_ This is an important release with several new features, and contributions from new developers joining the team. What is Firedrop2 ? == **Firedrop2** is a free, cross-platform blogging tool written in `Python http://www.python.org`_. It keeps your blog source files on your computer, making it a *clientside* tool. This means you control your blog, and can easily move it from one server to another, with no risk of losing data. It also means you can manage your blog *offline*. It is fully open source, and has all the features you expect from a modern blogging program : * {acro;RSS;Really Simple Syndication} feed generation * Categories * Automatic archive generation * A powerful set of plugins, including spellchecker, emailer, and themes * Entries can be made in text, {acro;HTML}, {acro;ReST}, textile, sextile or markdown markup * HTML templating system and macros for all sorts of tricks * Built-in {acro;FTP} capability for uploading your blog to a server * Integrated blog comments support (Through Haloscan_) * Because it's written in Python, it is easy to extend Firedrop or create new plugins for it What's New ? == This release has a lot of bugfixes and changes. Hopefully I've remembered the important ones. {sm;:-)} * Fixed a bug with categories and the unicode wxPython * Added the Themes plugin by Stewart Midwinter [#]_ * RSS feeds can be generated for all the categories, by Davy Mitchell * Firedrop now saves user data in the users home (checking sensibly for directories where it has write permissions) * Now includes support for the `Haloscan http://www.haloscan.com/`_ comments system. * Addition of the Firedrop2 banner by Stewart Midwinter. Plus other code improvements and bug fixes. Their is already work being done on the next release. This will include features like : * Faster build time through entry HTML caching * Blog statistics report generation * Tagging * A Podcast plugin * Extension to the plugin protocol for extra plugin capabilities .. [#] The Themes plugin requires version 0.3.32 of `Wax http://sourceforge.net/projects/waxgui`_, or more recent. -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Re: Reading from a file and converting it into a list of lines
On 6/06/2006 4:15 PM, Girish Sahani wrote: Really sorry for that indentation thing :) I tried out the code you have given, and also the one sreeram had written. In all of these,i get the same error of this type: Error i get in Sreeram's code is: n1,_,n2,_ = line.split(',') ValueError: need more than 1 value to unpack And error i get in your code is: for n1, a1, n2, a2 in reader: ValueError: need more than 0 values to unpack Any ideas why this is happening? In the case of my code, this is consistent with the line being empty, probably the last line. As my mentor Bruno D. would say, your test data does not match your spec :-) Which do you want to change, the spec or the data? Thanks John, i just changed my Data file so as not to contain any empty lines, i guess that was the easier solution ;) You can change my csv-reading code to detect dodgy data like this (for example): for row in reader: if not row: continue # ignore empty lines, wherever they appear if len(row) != 4: raise ValueError(Malformed row %r % row) n1, a1, n2, a2 = row In the case of Sreeram's code, perhaps you could try inserting print line = , repr(line) before the statement that is causing the error. Thanks a lot, girish -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
assign operator as variable ?
hi in python is there any way to do this op = a = 10 b = 20 if a op b : print a is less than b ?? thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: A more elegant way to do this list comprehension?
Levi Self wrote: This probably seems very trivial, maybe even a bit silly, but I was wondering if someone has a better list comprehension that does the same thing as this one: print [[[i]*i for i in range(1,9)][j][k] for j in range(8) for k in range(j+1)] [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8] Thanks, Levi Sure. Try: [i+1 for i in range(8) for j in range(i+1)] Gary Herron -- http://mail.python.org/mailman/listinfo/python-list
Re: 10GB XML Blows out Memory, Suggestions?
fuzzylollipop wrote: you got no idea what you are talking about, anyone knows that something like this is IO bound. which of course explains why some XML parsers for Python are a 100 times faster than other XML parsers for Python... /F -- http://mail.python.org/mailman/listinfo/python-list
Re: assign operator as variable ?
[EMAIL PROTECTED] wrote: hi in python is there any way to do this op = a = 10 b = 20 if a op b : print a is less than b [EMAIL PROTECTED] wrote: hi in python is there any way to do this op = a = 10 b = 20 if a op b : print a is less than b Will this work for you?: import operator op = operator.lt a = 10 b = 20 if op(a, b): print a is less than b -- bj0rn -- http://mail.python.org/mailman/listinfo/python-list
Re: 10GB XML Blows out Memory, Suggestions?
fuzzylollipop wrote: Is it possible to read an XML document in compressed format? compressing the footprint on disk won't matter, you still have 10GB of data that you need to process and it can only be processed uncompressed. didn't you just claim that this was an I/O bound problem ? /F -- http://mail.python.org/mailman/listinfo/python-list
Re: assign operator as variable ?
[EMAIL PROTECTED] wrote: in python is there any way to do this op = a = 10 b = 20 if a op b : print a is less than b ?? the operator module contains functions corresponding to all builtin operators: import operator ops = { ==: operator.eq, !=: operator.ne, : operator.ne, : operator.lt, =: operator.le, : operator.gt, : operator.ge } op = a = 10 b = 20 if ops[op](a, b): print a is less than b /F -- http://mail.python.org/mailman/listinfo/python-list
Any good module for chart creation ?
Hi , I am just doing a trivial job , which generate a bar chart from a collection of data , for example :I have a file like below ,Tom:23John:12Marry:56Jack:34... What I want to do is to read the data from the file and display it as a bar chart or some other chartand then put the chart in my web page !I know it is something veryeasy but I got blocked in installing reportlab package . It failed to generate any picture and told that it can't find the 'Times-Roman' .pfd file .And the traceback is at below :Warn: Can't find .pfb for face 'Times-Roman'Traceback (most recent call last): File ./test1.py, line 21, in ? renderPM.draw(d,c,0,0,showBoundary=rl_config._unset_) File /usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py, line 49, in drawR.draw(drawing, canvas, x, y, showBoundary=showBoundary) File /usr/lib/python2.4/site-packages/reportlab/graphics/renderbase.py, line 188, in drawself.initState(x,y) File /usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py, line 86, in initState self.applyState() File /usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py, line 80, in applyStateself._canvas.setFont(s['fontName'], s['fontSize']) File /usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py, line 327, in setFont _setFont(self._gs,fontName,fontSize) File /usr/lib/python2.4/site-packages/reportlab/graphics/renderPM.py, line 207, in _setFontraise RenderPMError, Can't setFont(%s) missing the T1 files?\nOriginally %s: %s % (fontName,s1,s2) reportlab.graphics.renderPM.RenderPMError: Can't setFont(Times-Roman) missing the T1 files?Originally exceptions.TypeError: makeT1Font() argument 2 must be string, not NoneI get bored to do that , can anyone give me some help or is there any other python package to accomplish the task more simply and fast ?Thanks in advance !Best Regards ! -- http://mail.python.org/mailman/listinfo/python-list
Re: Using pysqlite2
Many thanks Gerhard - the solution you offer is workable in the scope of my project. Gracias muchacho Xera121 -- http://mail.python.org/mailman/listinfo/python-list
Re: 10GB XML Blows out Memory, Suggestions?
[EMAIL PROTECTED] wrote: Paul, This is interesting. Unfortunately, I have no control over the XML output. The file is from Goldmine. However, you have given me an idea... Is it possible to read an XML document in compressed format? sure. you can e.g. use gzip.open to create a file object that decompresses on the way in. file = gzip.open(data.xml.gz) for event, elem in ET.iterparse(file): if elem.tag == item: elem.clear() I tried compressing my 1 GB example, but all 1000-byte records in that file are identical, so I got a 500x compression, which is a bit higher than you can reasonably expect ;-) however, with that example, I get a stable parsing time of 26 seconds, so it looks as if gzip can produce data about as fast as a preloaded disk cache... /F -- http://mail.python.org/mailman/listinfo/python-list
Re: python-dev Summary for 2006-04-01 through 2006-04-15
- Python 2.5a1 Released - Python 2.5 alpha 1 was released on April 5th. Please download it and try it out, particularly if you are an extension writer or you embed Python -- you may want to change things to support 64-bit sequences, and if you have been using mismatched PyMem_* and PyObject_* allocation calls, you will need to fix these as well. gotta do something about the lag, really ;-) for the record, 2.5 alpha 2 was released in late april; get it here: http://www.python.org/download/releases/2.5/ the rest of the summary blurb still applies; extension writers should read PEP 353: http://www.python.org/dev/peps/pep-0353 http://www.python.org/dev/peps/pep-0353/#conversion-guidelines /F -- http://mail.python.org/mailman/listinfo/python-list
Re: newbie: python application on a web page
puzz wrote: Hi all, I'd also appreciate a link to a beginner forum http://www.daniweb.com/techtalkforums/forum114.html and (not really a beginner forum, not really high volume, either) http://community.livejournal.com/python_dev/ -- http://mail.python.org/mailman/listinfo/python-list
pyqt show wizard
Hi, I have a mainwindow in my pyqt application, and on click of a button I want to start an assistant (wizard). I have create the wizard with the Qt Designer, generated the python code with pyuic, imported it from assistant import *, and subclassed it as usual. To show it, the onclick method of the button does: w = Wizard() w.show() bot nothing happens... How must I do to start the wizard...? Best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list
Re: how not to run out of memory in cursor.execute
whenever you are using a package that leaks memory. it can be appropriate to use Rpyc (http://rpyc.wikispaces.com/) to run the leaking code in a different process, and restart it from time to time. I've been using this method to avoid the leaks of matplotlib. -- http://mail.python.org/mailman/listinfo/python-list
Re: A more elegant way to do this list comprehension?
[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8] [i+1 for i in range(8) for j in range(i+1)] [i for i in range(9) for j in range(i)] -- http://mail.python.org/mailman/listinfo/python-list
Re: what are you using python language for?
Desktop application development -- http://mail.python.org/mailman/listinfo/python-list
Re: what are you using python language for?
scientific computing testing systems hobby: games. check http://mashebali.com/?Chess_2 -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing to a certain line?
Tommy B wrote: bruno at modulix wrote: (snip) import os old = open(/path/to/file.txt, r) new = open(/path/to/new.txt, w) for line in old: if line.strip() == Bob 62 line = line.replace(62, 66) new.write(line) old.close() new.close() os.rename(/path/to/new.txt, /path/to/file.txt) (snip) Umm... I tried using this method and it froze. Infiinite loop, I'm guessing. Wrong guess - unless, as Fredrik suggested, you have an infinite disk with an infinite file on it. If so, please share with, we would be *very* interested !-) Seriously : a for loop can only become an infinite loop if the iterable is infinite. AFAIK, file objects (created from regular files on a standard filesystem) are definitively not infinite. Problem is elsewhere. But since you prefered to guess - instead of providing relevant informations - we just can't help. -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')]) -- http://mail.python.org/mailman/listinfo/python-list
Bug in list comprehensions?
I was playing with list comprehensions, to try and work out how doubled up versions work (like this one from another thread: [i for i in range(9) for j in range(i)]). I think I've figured that out, but I found something strange along the way: alpha = [one, two, three] beta = [A, B, C] [x for x in alpha for y in beta] ['one', 'one', 'one', 'two', 'two', 'two', 'three', 'three', 'three'] [x for x in y for y in beta] ['C', 'C', 'C'] beta = [alpha, alpha, alpha] beta [['one', 'two', 'three'], ['one', 'two', 'three'], ['one', 'two', 'three']] [x for x in y for y in beta] ['C', 'C', 'C'] [y for y in beta] [['one', 'two', 'three'], ['one', 'two', 'three'], ['one', 'two', 'three']] [x for x in y for y in beta] ['one', 'one', 'one', 'two', 'two', 'two', 'three', 'three', 'three'] Shoudn't both lines '[x for x in y for y in beta]' produce the same list? I'm guessing I'm the one confused here... but I'm confused! What's going on? Iain -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in list comprehensions?
Iain King wrote: I'm guessing I'm the one confused here... but I'm confused! What's going on? reading the documentation may help: /.../ the elements of the new list are those that would be produced by considering each of the for or if clauses a block, nesting from left to right, and evaluating the expression to produce a list element each time the innermost block is reached. the clauses nest from left to right, not from right to left, so [x for x in y for y in beta] is equivalent to out = [] for x in y: for y in beta: out.append(x) /F -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in list comprehensions?
Iain King wrote: [x for x in y for y in beta] ['C', 'C', 'C'] [y for y in beta] [['one', 'two', 'three'], ['one', 'two', 'three'], ['one', 'two', 'three']] [x for x in y for y in beta] ['one', 'one', 'one', 'two', 'two', 'two', 'three', 'three', 'three'] Shoudn't both lines '[x for x in y for y in beta]' produce the same list? [x for x in y for y in beta] is a shorthand for: tmp = [] for x in y: for y in beta: tmp.append(x) So x iterates over whatever y is before the loop starts, and y iterates over beta (but that doesn't affect what x is iterating over). The important thing is to remember that the order of 'for' and 'if' statements is the same as though you had written the for loop out in full. -- http://mail.python.org/mailman/listinfo/python-list
Use of Python in .NET
Hi, I am developing a code which has MVC (Model - View - Controler) architecture.My view is in .NET. And my controller is in Python.So can i call Python script from .NET? If yes, Can anybody tell me method or related documentation? Thanks in Advamce -- http://mail.python.org/mailman/listinfo/python-list
secure xmlrpc server?
Hello, I'm trying to create a simple XMLRPC server and a client. It is a small application, but the connection needs to be secure. I would like the client to be as thin as possible. Ideally, the client should only require the basic python library, nothing else. I found many examples on the net. But I could not find secure ones (except twisted/xmlrpc, but I would like to use the basic python lib on the client side, if possible). I know that python supports HTTPS. In theory, this could be used to bulild a secure xmlrpc server. I think that the client would work with this code: # Connect to server server = ServerProxy(https://myserver.com:8000;) But I do not know how to create an XML RPC server in Python that uses HTTPS for XML transports. (The server may use other libraries, just the client needs to be thin.) Can you help me please? Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list
Re: Need pixie dust for building Python 2.4 curses module on Solaris 8
John Was libncurses.a compiled with -fpic (or -fPIC, if necessary)? John http://mail.python.org/pipermail/python-dev/2001-March/013510.html When built shared the source was compiled with -fPIC. -fPIC is not used when not built shared. I forced that in a non-shared build. It still gave me the undefined acs32map error. I tried adding either termlib or termcap to the link libraries, as they both provide that symbol: bash-2.03$ nm -p /usr/lib/libtermcap. libtermcap.a libtermcap.solibtermcap.so.1 bash-2.03$ nm -p /usr/lib/libtermcap.so | egrep acs32map 245332 B acs32map bash-2.03$ nm -p /usr/lib/libtermcap.a | egrep acs32map 04 D acs32map 00 U acs32map 00 U acs32map 00 U acs32map 00 U acs32map 00 U acs32map I got all sorts of warnings about various symbols having differing sizes: ld: warning: symbol `acs_map' has differing sizes: (file /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_acs.o) value=0x200; file /usr/ccs/lib/libtermcap.so value=0x4); /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_acs.o) definition taken ld: warning: symbol `numnames' has differing sizes: (file /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(names.o) value=0xa0; file /usr/ccs/lib/libtermcap.so value=0x88); /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(names.o) definition taken ... The link succeeded when I added termcap and the generated _curses and _curses_panel modules import successfully. The fact that both modules appear to refer to /usr/lib/libcurses.so.1 now: $ ldd build/lib.solaris-2.8-i86pc-2.4/_curses.so libcurses.so.1 =/usr/lib/libcurses.so.1 libgcc_s.so.1 = /opt/app/nonc++/lib/libgcc_s.so.1 libc.so.1 = /usr/lib/libc.so.1 libdl.so.1 =/usr/lib/libdl.so.1 $ ldd build/lib.solaris-2.8-i86pc-2.4/_curses_panel.so libcurses.so.1 =/usr/lib/libcurses.so.1 libgcc_s.so.1 = /opt/app/nonc++/lib/libgcc_s.so.1 libc.so.1 = /usr/lib/libc.so.1 libdl.so.1 =/usr/lib/libdl.so.1 bothers me since I explicitly asked to get the version I had installed and (based on the warnings above) it appears to have retrieved many symbols from that version. Also, running the unit test seems to hang. It certainly ties up the xterm. Skip -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
[EMAIL PROTECTED] wrote: class A: ... pass ... a = A() b = a del b a __main__.A instance at 0x00B91BC0 I want to delete 'a' through 'b', why It does't? How can I do that? del a,b -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
[EMAIL PROTECTED] i'rta: class A: ... pass ... a = A() b = a del b a __main__.A instance at 0x00B91BC0 I want to delete 'a' through 'b', why It does't? How can I do that? You must undestand that 'a' and 'b' are names. You can only delete names, not objects. Objects are freed by the garbage collector, automatically. Probably you used to write programs in C or Pascal or other languages with pointers. In Python, there are no pointers, just references and you cannot free an object. You can only delete the references to it. The good question is: why would you like to free an object manually? The garbage collector will do it for you automatically, when the object has no more references. (Well, cyclic references are also garbage collected but not immediately.) If you need to handle resources, you can still use the try-finally statement. Like in: f = file('example.txt','r') try: s = f.read() finally: f.close() # The resource is freed. But the object that was used to access the resource, may not be freed here Regards, Laszlo -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
Boris Borcic wrote: [EMAIL PROTECTED] wrote: class A: ... pass ... a = A() b = a del b a __main__.A instance at 0x00B91BC0 I want to delete 'a' through 'b', why It does't? How can I do that? del a,b But 'b' is also deleted, i want use 'b' to delete 'a', 'b' is exists. -- http://mail.python.org/mailman/listinfo/python-list
CENSORSHIP - Django Project (Schema Evolution Support)
[posted publicly to comp.lang.python, with email notification to 6 recipients relevant to the topic] I have implemented a simple schema evolution support for django, due to a need for a personal project. Additionally, I've provided an Audit: http://case.lazaridis.com/wiki/DjangoAudit As a result, I was censored ('banned' from the development list) My initial non-public complain [1] about censorship on django devel, sent to six relevant project recipients [2] remained unanswered. The only 'answer' I got was an additional censorship on the _user_ list, which is _completely_ unjustified, as I've just requested comments to my code-level working results: http://groups.google.com/group/django-users/browse_frm/thread/88dcc4946c3bd7b2 - I understand that the community was possibly confused due to my past evaluations. But this gives in _no_ way the right to attack me personally and to apply censorship. Django was originally created in late 2003 at World Online, the Web division2 of the Lawrence Journal-World newspaper in Lawrence, Kansas http://code.djangoproject.com/browser/django/trunk/AUTHORS#L128 The Django Project should really avoid such non-liberal actions in future. Please enable my access to the user list, thus I can complete my work. Thank you. - P.S.: If anyone is interested to verify the results, in order to stabelize the simple schema evolution support for django, please review the results here: http://case.lazaridis.com/wiki/DjangoProductEvaluation http://case.lazaridis.com/wiki/DjangoSchemaEvolution http://case.lazaridis.com/browser/django/rework/evolve.py http://case.lazaridis.com/browser/django/rework/add_evolvedb_command.diff - Sidenote: I've implemented the above as the suggestions from the django project (manually create an execute ALTER TABLE statements) would hinder me to develop my application incrementally: If you do care about deleting data, you'll have to execute the ALTER TABLE statements manually in your database. That's the way we've always done it, because dealing with data is a very sensitive operation that we've wanted to avoid automating. That said, there's some work being done to add partially automated database-upgrade functionality. http://www.djangoproject.com/documentation/faq/#if-i-make-changes-to-a-model-how-do-i-update-the-database - - - [1] Date : 2006-06-03 08:32 Subject: pj.audit.django.censorship/offer. *SUMMARY* * Censorship on django-developer * Personal Projects [...] - (non-public commercial part omitted) *CENSORSHIP* I would like to know for which reason I was banned from the developers list. Django comes from an newspaper environment, and I think you should really evaluate your information twice before you *censor* someone on the list, who has posted only topics relevant to django development in order to fulfill several tasks for an Audit: http://case.lazaridis.com/multi/wiki/DjangoAudit Is this here really enough to justify censorship?: http://groups.google.com/group/django-developers/msg/fbb5a3aafe39d239 Please, Mr. Holovaty, enable my access to the development-list again thus I can finalize my work. - *PERSONAL_PROJECTS* Instead of blocking me without any justification from the development-list, why don't you just look on my website, where I list some links (including that one found' and explain the project: http://lazaridis.com/core/eval/index.html I've worked several years on this Core Project, which is finalized, and in 2006 I've started to define the resulting services: http://lazaridis.com/pj/index.html As stated, I use django for a personal project (which I hope will secure me some incomings). The evolve functionality was necessary in order to start with development of my project. At the same time I made the audit publicly, thus other people can benefit from my experiences. Additionally, I look for a reference customer. Although I had planned to finalize the Audit first and then to contact you, the missing access to the developer list forces me to change my schedule. [...] - (non-public commercial part omitted) [2] The recipients were take for the following file: http://www.djangoproject.com/documentation/faq/#who-s-behind-this and from this file: http://code.djangoproject.com/browser/django/trunk/AUTHORS . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
Laszlo Nagy wrote: You must undestand that 'a' and 'b' are names. You can only delete names, not objects. Objects are freed by the garbage collector, automatically. Probably you used to write programs in C or Pascal or other languages with pointers. In Python, there are no pointers, just references and you cannot free an object. You can only delete the references to it. The good question is: why would you like to free an object manually? The garbage collector will do it for you automatically, when the object has no more references. (Well, cyclic references are also garbage collected but not immediately.) If you need to handle resources, you can still use the try-finally statement. Like in: f = file('example.txt','r') try: s = f.read() finally: f.close() # The resource is freed. But the object that was used to access the resource, may not be freed here Regards, Laszlo Thanks for your so detailed explain, I think I know you, But my Engish is not enough to explain. I create same object in Tree, I want to update Tree, when I need to delete subtree. If where no references, I can't do that. some thing like blow: for i in list: del i From that code, I can't update list anymore. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
Thanks for your so detailed explain, I think I know you, But my Engish is not enough to explain. I create same object in Tree, I want to update Tree, when I need to delete subtree. If where no references, I can't do that. some thing like blow: for i in list: del i This makes no sense. In python, objects are garbage collected when there are no references to the anymore. What you do is - create a reference to an object by letting i point to it - remove i, such that the reference is removed. This has no effect at all -- 1 - 1 = 0 If you want to remove items from a list, do something like this: l[:] = [e for e in l if predicate(e)] This will alter the list l such that only the elements of it that fullfill the predicate are retained. In other words: your code above should work when written like this: l[:] = [] which effectively removes all elements from the list. This does NOT mean that the objects referenced to by the list are deleted! If they are referenced from anywhere else, they are kept!! Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
http://en.wikipedia.org/wiki/Ilias_Lazaridis [posted publicly to comp.lang.python, with no email notification to recipients that certainly don't consider this a relevant topic and for all those who don't know Illias] Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: tempfile Question
On 7/06/2006 3:57 PM, Dennis Lee Bieber wrote: On Wed, 07 Jun 2006 09:56:13 +1000, John Machin [EMAIL PROTECTED] declaimed the following in comp.lang.python: The dir, prefix and suffix parameters are passed to mkstemp(). snip So I'd be thinking about using the (deprecated) mktemp() instead, I think you passed over the mkstemp() variation. Granted, it, too, returns an opened file, along with the full pathname of the file, but it requires the caller to handle eventual disposal of the file. Merely close the opened file; pass the pathname to the subprocess, await completion of subprocess, reopen the file for use in Python... Then at the end, close the file and use the pathname to delete the file from the system. I passed over mkstemp() because (according to my reading of the manual), mkstemp() requires an *extra* step (close the file), leaving the situation then *exactly* the same as with mktemp() i.e. some pirate process may molest the file before the caller's child process can open the file. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
Ilias Lazaridis wrote: [posted publicly to comp.lang.python, with email notification to 6 recipients relevant to the topic] I have implemented a simple schema evolution support for django, due to a need for a personal project. Additionally, I've provided an Audit: http://case.lazaridis.com/wiki/DjangoAudit As a result, I was censored ('banned' from the development list) Please see this message for background: http://groups.google.com/group/django-users/msg/5a96eabf75f2b9c7 To summarise, it was felt that Ilias was deliberately trolling the mailing list. No further explanation seems necessary. -- http://mail.python.org/mailman/listinfo/python-list
Re: secure xmlrpc server?
Using Twisted on the server side for xmlrpc doesn't restrict your options to using only Twisted on the client side. Nothing prevents you from using xmlrpclib.ServerProxy on the client side. Jeethu Rao Laszlo Nagy wrote: Hello, I'm trying to create a simple XMLRPC server and a client. It is a small application, but the connection needs to be secure. I would like the client to be as thin as possible. Ideally, the client should only require the basic python library, nothing else. I found many examples on the net. But I could not find secure ones (except twisted/xmlrpc, but I would like to use the basic python lib on the client side, if possible). I know that python supports HTTPS. In theory, this could be used to bulild a secure xmlrpc server. I think that the client would work with this code: # Connect to server server = ServerProxy(https://myserver.com:8000;) But I do not know how to create an XML RPC server in Python that uses HTTPS for XML transports. (The server may use other libraries, just the client needs to be thin.) Can you help me please? Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
Diez B. Roggisch wrote: http://en.wikipedia.org/wiki/Ilias_Lazaridis What has this wikipedia entry to do with the topic here? What is the credibility and value of the provided wikipedia entry? Let's review the editor's list: http://en.wikipedia.org/w/index.php?title=Ilias_Lazaridisaction=history Ubernostrum Howdy. I'm James Bennett, a web developer[...]and then moved to Lawrence, Kansas where I now work for World Online, the online division of the Lawrence Journal-World and home of the Django web framework. http://en.wikipedia.org/wiki/User:Ubernostrum Gldnspud - no profile available - http://en.wikipedia.org/wiki/User:Gldnspud - Note to readers: Further links and explanations about my past evaluation work are publicized on my website: http://lazaridis.com/core/eval/index.html http://lazaridis.com/core/index.html Those evaluations are now closed, and I try to focus on personal projects, whilst contribution results back to other users in the open source way. - I try now to apply such Requirements Compliancy Audits in a more decent way: http://case.lazaridis.com/wiki For some reason, the Django Project Community and leadership has reacted extremely against my findings, writings and even code-level contributions. At this point I don't know why. But possibly I will do so shortly. - -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
A WAD(-like) C-level exception catcher for Windows?
For Unix there exists the WAD (part of SWIG) to catch C/machine-level errors (mem. access error, etc. ) and transform them into nice Python exceptions. ( http://www.usenix.org/events/usenix01/full_papers/beazley/beazley.pdf ) Does something like that exist for Windows? Or does somebody know a roadmap how to do something like that with Windows most easily? -robert -- http://mail.python.org/mailman/listinfo/python-list
Re: subprocesses, stdin/out, ttys, and beating insubordinate processes into the ground
Jonathan Smith wrote: First a bit about what I'm trying to do. I need a function which takes a patchfile and patches a source directory. Thats it. However, I need to be able to do so no matter what the patchlevel (-px) of the diff is. So, my solution is to just try to patch until it works or you try a level more than 3. However, if you have a reversed patch, or patch can't find the right file, GNU patch tries to ask for input and I don't want that. I know that patch will run non-interactively when backgrounded in a shell (no controlling tty). This is what I've tried so far: def patchme(self, provides, f, destDir, patchlevels): for patchlevel in patchlevels: patchArgs = ['patch', '-d', destDir, '-p%s'%patchlevel, ] if self.backup: patchArgs.append(['-b', '-z', self.backup]) if self.extraArgs: patchArgs.append(self.extraArgs) log.info('attempting to patch the source with file %s and patchlevel %s' % (f,patchlevel)) p1 = subprocess.Popen([provides, f], stdout=subprocess.PIPE, shell=False) p2 = subprocess.Popen(patchArgs, stdin=p1.stdout, shell=False) message = p2.communicate()[0] # patch seems to use stdout for everything, even errors if message != None and self.patcherror.search(message): os.kill(p2.pid, signal.SIGTERM) elif p2.wait(): log.info('patch did not apply with path level %s' % patchlevel) print message else: return log.error('could not apply the patch to your build dir') However, I still get an interactive prompt, no matter what I try! Using shell=False did not help, nor did trying to kill the pid if python sees a line from patch which isn't saying what its patching or giving info on a specific hunk. Any suggestions? -smithj PS: if you're a maintainer for GNU patch, a --non-interactive would be really nice ;-) (and no, -f and -t aren't good enough as they force other things that I don't want) If the technique you want to use doesn't work, it's usually a good idea to try another technique. Your current approach is pretty dreadful, when it would be relatively easy to parse the start of the patchfile and determine the appropriate level (i.e. -p argument) by finding the file to be patched. Neither your approach nor my suggested alternative is that good when the patch is modifying a file whose name appears at several points in the directory hierarchy (as may be the case with README, for example), so it might be even better to parse the whole patchfile and ensure that the level you choose correctly identifies all target files. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: secure xmlrpc server?
Laszlo Nagy wrote: cut ssl for xmlrpc Have a look at: http://trevp.net/tlslite/ -- mph -- http://mail.python.org/mailman/listinfo/python-list
Re: tempfile Question
John Machin wrote: On 7/06/2006 3:57 PM, Dennis Lee Bieber wrote: On Wed, 07 Jun 2006 09:56:13 +1000, John Machin [EMAIL PROTECTED] declaimed the following in comp.lang.python: The dir, prefix and suffix parameters are passed to mkstemp(). snip So I'd be thinking about using the (deprecated) mktemp() instead, I think you passed over the mkstemp() variation. Granted, it, too, returns an opened file, along with the full pathname of the file, but it requires the caller to handle eventual disposal of the file. Merely close the opened file; pass the pathname to the subprocess, await completion of subprocess, reopen the file for use in Python... Then at the end, close the file and use the pathname to delete the file from the system. I passed over mkstemp() because (according to my reading of the manual), mkstemp() requires an *extra* step (close the file), leaving the situation then *exactly* the same as with mktemp() i.e. some pirate process may molest the file before the caller's child process can open the file. Surely if you set permissions correctly on /tmp (sticky-but to require ownership for deletion) and you create your temporary file with sensible ownership and permissions then rogue processes without root privileges can't do anything bad to your files. Or am I wrong? Of course if a rogue process has root privileges then all security bets are off anyway. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: Again, Downloading and Displaying an Image from the Internet in Tkinter
Fredrik Lundh wrote: Dustan wrote: Ok, that worked (was it plain w or the writelines/readlines that messed it up?). the plain w; very few image files are text files. But Tkinter still can't find the image. I'm getting an error message: TclError: image C:\Documents and [pathname snipped] doesn't exist If it makes a difference, I'm on a Windows XP machine, and don't have to go cross-platform. the image option takes a PhotoImage object, not a file name: http://effbot.org/tkinterbook/photoimage.htm note that the built-in PhotoImage type only supports a few image formats; to get support for e.g. PNG and JPEG, you can use PIL which ships with it's own PhotoImage replacement: http://effbot.org/imagingbook/imagetk.htm Thanks for the information. The reason I hadn't made any attempt before is well illustrated here; I didn't have enough information at my disposal to know where to start and how I it works. My references are more basic-level than that (I do have a better reference to look to, but it's currently inaccessible). -- http://mail.python.org/mailman/listinfo/python-list
Re: Use of Python in .NET
[EMAIL PROTECTED] wrote: Hi, I am developing a code which has MVC (Model - View - Controler) architecture.My view is in .NET. And my controller is in Python.So can i call Python script from .NET? If yes, Can anybody tell me method or related documentation? http://www.google.com/search?q=python+.net There are at least two individual projects in the top ten results that may work for you... :-) Fuzzyman http://www.voidspace.org.uk/python/index.shtml Thanks in Advamce -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
Ilias Lazaridis wrote: Diez B. Roggisch wrote: http://en.wikipedia.org/wiki/Ilias_Lazaridis What has this wikipedia entry to do with the topic here? What is the credibility and value of the provided wikipedia entry? [snip..] Wow, you're a troll with your own wikipedia entry. That's impressive - you should put it on your CV. Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list
cgi and popen
A long story made short, I've build a python/cgi website consisting of two pages. Page1 has a html form in which you can input a series of queries. Then via Popen it starts a pythons search script, which stores the results in a python shelve. As the Popen command is given it should redirect to page2, which will check if the shelve is ready (search finished) and if not displays a search page, refreshing itself after 10 seconds. The Popen command works nice when tried out in the console. The script isueing the Popen quits, and the other process keeps on running till finished. But when embedded in page1.cgi, page 1 waits till the search is finished, resulting in a browser timeout when big queries are done. It was this problem in the first place why I split up the page in two and added Popen. Does anybody know how to get the page not waiting on Popen to finish? thnx Maarten -- http://mail.python.org/mailman/listinfo/python-list
Re: how not to run out of memory in cursor.execute
[EMAIL PROTECTED] == [EMAIL PROTECTED] com [EMAIL PROTECTED] writes: [EMAIL PROTECTED] whenever you are using a package that leaks memory. [EMAIL PROTECTED] it can be appropriate to use Rpyc [EMAIL PROTECTED] (http://rpyc.wikispaces.com/) to run the leaking [EMAIL PROTECTED] code in a different process, and restart it from [EMAIL PROTECTED] time to time. I've been using this method to avoid [EMAIL PROTECTED] the leaks of matplotlib. The only known leak in matplotlib is in the tkagg backend which we believe comes from tkinter and is not in matplotlib proper. There are a variety of ways to make it look like matplotlib is leaking memory, eg overplotting when you want to first clear the plot, or failing to close figures properly. We have unit tests to check for leaks, and they are passing. Perhaps you can post some code which exposes the problem. JDH -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
ripley wrote: Boris Borcic wrote: [EMAIL PROTECTED] wrote: class A: ... pass ... a = A() b = a del b a __main__.A instance at 0x00B91BC0 I want to delete 'a' through 'b', why It does't? How can I do that? del a,b But 'b' is also deleted, i want use 'b' to delete 'a', 'b' is exists. You can't do what you want to do. Python names are independent references to objects. The del statement deletes a name from a namespace (or an item from a structure), and cannot be used to delete all references to a given object. In general there's no way to delete a referenced object - we normally rely on the implementation (in CPython reference counting plus garbage collection, in other implementations just plain garbage collection) to perform the deletion when no live references to an object remain. Perhaps you'd like to explain *why* you find a need to do this (in other words, what's your use case)? Weak references are one possibility that might help you, but without knowing your real requirements it's difficult to be more helpful. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: python socket proxy
Hi Thanks for the reply. I found a proxy that works for me. Now I would like to know if its possible to run a python script, so its not visible in the cmd window (windows, i know, its bad :-) ) Maybe run it as a windows service? Filip Wasilewski wrote: [EMAIL PROTECTED] wrote: Hi all I am trying to create a lighweight tcp proxy server. [...] There is a bunch of nice recipies in the Python Cookbook on port forwarding. In the [1] and [2] case it should be fairly simple to add an extra authentication step with pyOpenSSL. [1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/483730 [2] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/114642 [3] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/483732 best, fw -- http://mail.python.org/mailman/listinfo/python-list
Re: secure xmlrpc server?
Martin P. Hellwig wrote: Laszlo Nagy wrote: cut ssl for xmlrpc Have a look at: http://trevp.net/tlslite/ C:\temp\cccpython setup.py install running install running build running build_py running build_ext error: The .NET Framework SDK needs to be installed before building extensions f or Python. C:\temp\ccc Does it mean that .NET framework is required for tlslite on Windows? Also can you please provide an example for tlslite/xmlrpc integration? The documentation of tlslite is very detailed, but it has many options and I could not find an example. Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list
Re: secure xmlrpc server?
Laszlo Nagy wrote: Martin P. Hellwig wrote: Laszlo Nagy wrote: cut ssl for xmlrpc Have a look at: http://trevp.net/tlslite/ C:\temp\cccpython setup.py install running install running build running build_py running build_ext error: The .NET Framework SDK needs to be installed before building extensions f or Python. C:\temp\ccc In the installers directory is exe for windows installation. Does it mean that .NET framework is required for tlslite on Windows? Also can you please provide an example for tlslite/xmlrpc integration? The documentation of tlslite is very detailed, but it has many options and I could not find an example. SimpleXMLRPCServer uses SimpleHTTPServer for its transfer stuff, so you might want to look more in that direction. Thanks, Laszlo -- mph -- http://mail.python.org/mailman/listinfo/python-list
Re: python socket proxy
Simplest way would be to rename your python file with a .pyw extension instead of a .py extension. If you're looking for windows services, checkout win32serviceutil.ServiceFramework in pywin32. Jeethu Rao [EMAIL PROTECTED] wrote: Hi Thanks for the reply. I found a proxy that works for me. Now I would like to know if its possible to run a python script, so its not visible in the cmd window (windows, i know, its bad :-) ) Maybe run it as a windows service? Filip Wasilewski wrote: [EMAIL PROTECTED] wrote: Hi all I am trying to create a lighweight tcp proxy server. [...] There is a bunch of nice recipies in the Python Cookbook on port forwarding. In the [1] and [2] case it should be fairly simple to add an extra authentication step with pyOpenSSL. [1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/483730 [2] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/114642 [3] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/483732 best, fw -- http://mail.python.org/mailman/listinfo/python-list
Re: capture video from camera
i had no intention to say that videocapture is bad but it's not what i'm looking for. concerning docs, everybody has their own view on how docs should look like. that said, i should have written more clearly what i'm looking for. -- http://mail.python.org/mailman/listinfo/python-list
Re: secure xmlrpc server?
Martin P. Hellwig írta: Laszlo Nagy wrote: Martin P. Hellwig wrote: Laszlo Nagy wrote: cut ssl for xmlrpc Have a look at: http://trevp.net/tlslite/ C:\temp\cccpython setup.py install running install running build running build_py running build_ext error: The .NET Framework SDK needs to be installed before building extensions f or Python. C:\temp\ccc In the installers directory is exe for windows installation. http://trevp.net/tlslite/ - no exe installers. http://sourceforge.net/projects/tlslite/ - no file packages to download :-( SimpleXMLRPCServer uses SimpleHTTPServer for its transfer stuff, so you might want to look more in that direction. Yes, In fact I read the whole source code of SimpleXMLRPCServer and other examples like http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/165375 but I cannot combine the two. I see that the request handler is a customised HTTP request handler: class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): but I have no idea how to use it with https. Do you know a small example (like the ones above)? That would help a lot. Laszlo -- http://mail.python.org/mailman/listinfo/python-list
Re: pyqt show wizard
Yves Glodt wrote: I have a mainwindow in my pyqt application, and on click of a button I want to start an assistant (wizard).I have create the wizard with the Qt Designer, generated the python code with pyuic, imported it from assistant import *, and subclassed it as usual.To show it, the onclick method of the button does: w = Wizard() w.show()bot nothing happens... If this is within a method that returns immediately after the show() call, the wizard will go out of scope and be deleted. I suspect that you really want to call w.exec_loop() intead, since this will only return control to the method after the user has finished interacting with the wizard. Take a look at the QWizard documentation for more information: http://doc.trolltech.com/3.3/qwizard.html David -- http://mail.python.org/mailman/listinfo/python-list
Re: pyqt show wizard
Summary of the usual mess made by the Google Groups web interface: I suspect that you really want to call w.exec_loop() instead, since this will only return control to the method after the user has finished interacting with the wizard. Take a look at the QWizard documentation for more information: http://doc.trolltech.com/3.3/qwizard.html David -- http://mail.python.org/mailman/listinfo/python-list
curses event handling
I have a curses app that is displaying real time data. I would like to bind certain keys to certain functions, but do not want to block waiting for c = screen.getch() Is it possible to register callbacks with curses, something like screen.register('keypress', myfunc) Thanks, JDH -- http://mail.python.org/mailman/listinfo/python-list
Re: what are you (not) using python language for?
hacker1017 wrote: im just asking out of curiosity. I am curious for what kind of (new) serious programs and projects the Python language and its offsprings like Pyrex would not be the optimal programming language currently? (Unless you completely misbelieve in Ruby) Device drivers, small memory mics and browser client software - areas which (still) lack Python support ? -robert -- http://mail.python.org/mailman/listinfo/python-list
Re: Python language problem
May be you are looking for weakref module: http://www.python.org/doc/current/lib/module-weakref.html -- Baiju M -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
[Replying to comp.lang.python, due to censorship on Django User] [additional notification of poster via email, as medium is changed] [EMAIL PROTECTED] wrote: yep. i feel particularly hosed for trying to work with you offline to synchronize our efforts. I don't think that telling me when your project starts and stops can be called working with me offline. and even more retarded for the time i spent and help i offered regarding your web site design, resume and general how to better present yourself as a consulting business. You suggestion subjecting the term failure was a positive one and I have reacted. But again, I think you exaggerate about the amount of time invested. (overall conversation: 7 messages of yours, 20 lines, ~3 lines/message) (considering i've been a fulltime programmer/consultant for many years now and you were claiming to just be starting out) I've just (Jan 2006) re-started with the _new_ services. however i am far from your largest detractor here. and i don't wish to be, so i won't contribute any more to this discussion. this will be my last post here regarding you. I've not asked you to post about me, but about the SoC Schema Evolution Project. See further below: -- derek p.s. for the record i'm not totally convinced you're an intentional troll. i suspect you're just socially and professionally inept. but with your history on other listservs, it seems that you are incapable of learning how to better interact with others. so a rose by any other name... the effect is the same. = {i suspect you're just socially and professinally inept} I better don't take you as an example how to better interact with others. And btw: why speculating, instead of just reading the explanations?: http://lazaridis.com/core/eval/index.html i recommend to all ignoring ilias here. Possibly to avoid the basic question? My question to you was basically: May I ask you to point my to a resource which shows your current plans, results etc.? Mine is here: http://case.lazaridis.com/wiki/DjangoSchemaEvolution And with a little support of the team, it could be now a stable working temporary solution, and a reference/foundation for your SoC project. Derek Anderson wrote: i believe it's time for... Mr. Anderson, we had some private conversation at the start of my work with Django, where I had answered all of your questions. Based on this, you should have a better rating about me, especially when knowing my private situation (or at least some indicators). - You are the Student which will execute the Google Summer of Code Project, which will implement the Schema Evolution Support for Django, http://code.djangoproject.com/wiki/SchemaEvolution May I ask you to point my to a resource which shows your current plans, results etc.? As you have seen, I have provided within a few days something what the django project and its community has not provided since a _very_ long time. A working draft version of a Schema Evolution Support for Django: http://case.lazaridis.com/multi/wiki/DjangoSchemaEvolution - You should understand that it looks really somehow, that especially you talk so loud about a 'troll'. Finally, you should be aware of something: all of your writings were publically archived. ___ /| /| | | ||__|| | Please don't | / O O\__ feed | / \ the trolls| / \ \| / _\ \ -- /|\\ \ || / | | | |\/ || / \|_|_|/ |__|| / / \|| || / | | /|| --| | | |// | --| * _| |_|_|_| | \-/ *-- _--\ _ \ // | / _ \\ _ // |/ * / \_ /- | - | | * ___ c_c_c_C/ \C_c_c_c -- derek :) . -- http://lazaridis.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Django users group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~--- -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
wddx problem with entities
I'm confused about why I get this error: UnicodeError: ASCII encoding error: ordinal not in range(128) when I try to load a wddx file containing this string: stringThe image file, gif/aper#231;u.png, does not exist./string When I loop through the file as if it's text and check the ord() value of each character, of course it's clean. Do I have to replace numbered entities in the wddx file before I can wddx.load() it? thanks! --tim example program: --- from xml.marshal import wddx datastring = '''?xml version=1.0? !DOCTYPE wddxPacket SYSTEM wddx_0090.dtd wddxPacket version=0.9 header/ datastruct stringThe image file, gif/aper#231;u.png,does not exist./string /struct/data/wddxPacket''' data = wddx.loads(datastring) -- http://mail.python.org/mailman/listinfo/python-list
Re: secure xmlrpc server?
Laszlo Nagy wrote: cut http://trevp.net/tlslite/ - no exe installers. http://sourceforge.net/projects/tlslite/ - no file packages to download :-( Download the zip and unpack it: http://trevp.net/tlslite/tlslite-0.3.8.zip Then there is an installers directory SimpleXMLRPCServer uses SimpleHTTPServer for its transfer stuff, so you might want to look more in that direction. Yes, In fact I read the whole source code of SimpleXMLRPCServer and other examples like http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/165375 but I cannot combine the two. I see that the request handler is a customised HTTP request handler: class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): but I have no idea how to use it with https. Do you know a small example (like the ones above)? That would help a lot. Laszlo Something like: import SocketServer import SimpleXMLRPCServer import tlslite.api # Overriding with ThreadingMixIn and TLSSocketServerMixIN # to create a secure async server. class txrServer(SocketServer.ThreadingMixIn, tlslite.api.TLSSocketServerMixIn, SimpleXMLRPCServer.SimpleXMLRPCServer): pass But the above is untested (been a while ago, since I experimented with it, for my case it was more functional to use VPN's instead of SSL/TLS). For the rest you can follow the same principals as for the SimpleHTTPServer: http://trevp.net/cryptoID/docs/public/tlslite.integration.TLSSocketServerMixIn.TLSSocketServerMixIn-class.html -- mph -- http://mail.python.org/mailman/listinfo/python-list
Re: tkinter: making widgets instance or not?
John McMonagle wrote: def __init__(self, master): self.parent = master self.entry1 = self.draw_entry('First Name:') self.entry2 = self.draw_entry('Last Name:') Genius! :) Looks like you solved both of my problems! Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: what are you using python language for?
hacker1017 wrote: im just asking out of curiosity. Embedded control system -- http://mail.python.org/mailman/listinfo/python-list
Re: what are you (not) using python language for?
On 2006-06-07, robert [EMAIL PROTECTED] wrote: I am curious for what kind of (new) serious programs and projects the Python language and its offsprings like Pyrex would not be the optimal programming language currently? The stuff I work on for which I don't use Python: * Device drivers (Linux and BSD). * Embedded systems. Even at the high end of things, my projects have only a few MB of memory -- not nearly enough to run Python. There's really not much point in discussing Python for the smaller projects with 16KB of ROM and 256 bytes of RAM. ;) -- Grant Edwards grante Yow! I'm gliding over a at NUCLEAR WASTE DUMP near visi.comATLANTA, Georgia!! -- http://mail.python.org/mailman/listinfo/python-list
help to install MySQL-python module
Dear python users, I have an account on a Linux Cluster. I installed python version 2.3.5 on my account. I need to install the module MySQL-python to interact with a MySQL server already installed on the cluster. However, I read the README file but running python setup.py build the system fails to build the module and gives me the following error: error: invalid Python installation: unable to open /usr/local/lib/python2.3/config/Makefile (No such file or directory) How can I solve this problem? Thank you in advance Ernesto - This mail sent through IMP: http://horde.org/imp/ -- http://mail.python.org/mailman/listinfo/python-list
THE IMPORTANCE OF MAKING THE GOOGLE INDEX DOWNLOADABLE
THE IMPORTANCE OF MAKING THE GOOGLE INDEX DOWNLOADABLE I write here to make a request on behalf of all the programmers on earth who have been or are intending to use the Google web search API for either research purposes or for the development of real world applications, that Google make their indexes downloadable. Currently application programmers using the Google web search API are limited to 1000 queries a day. This on the one hand is a reasonable decision by Google because; limiting the queries will prevent harm on the Google system by unnecessary automated queries; but it is also limiting us programmers severely. The query limit limits the usefulness of whatever applications we decide to craft out and even limits our imagination on what is possible with a handful of indexes. Firstly, I will commend the Google Corporation for opening their preciously crawled indexes. This is a great service to humanity and especially to the band of programmers who are interested in epistemology and are using the Google web search API to enable them achieve their goals. Google would be doing another great service for us if they would make their indexes downloadable to programmers with a good interface for programmatically accessing the indexes. The advantages of the above approach would be: 1. Decentralizing the Google system. 2. Reducing the overhead of queries on Google from programmers. 3. Enabling programmers to craft out applications that run on their local systems (only requiring internet connection when a web page is needed since the links return on a query are the most important in the result set) thus enabling them have unlimited number of queries should these applications go public. 4. Give Google the competing edge in search engine technology and user satisfaction by gaining programmer loyalty. 5. Encouraging the global adoption and use of the API + INDEXES provided by Google. 6. Another good thing may be here for Google if they create mechanisms in the downloaded INDEXES + API that enable programmers update the indexes from the web. An agreement can now be made that Google will have unlimited access to the indexes whenever the user's computer is online and IDLE. So Google update its own indexes from the ones on various programmers' local machines. Thereby building a truly distributed global crawler. This can be achieved using grid technologies thereby possibly cutting down the 300year range for crawling the world's crawlable information. Google may still enforce their terms of service by enforcing some kind of authentication for the use of index already residing on the programmer's local machine. Though it may not require that the programmer be on the internet every time he/she wishes to access the system; since the programmer may wish to tinker with the API and indexes locally without requiring an internet connection. Online authentication may be required anytime the user gets online. The non-commerciability of the indexes must be emphasized through several schemes. The Google API can be a tool for epistemological engineers to craft future Infowares (Information Applications). The most important thing in the indexes is the links to resources that are returned on queries. 2 versions of the API + INDEXES can be made available. 1. The one without cached pages attached. So that on querying the API on the local machine with the locally stored indexes, the results are like those on the regular internet API result set. 2. The one with the cached pages. This one is optional as it will be large in size. If you people were good enough to release your API's publicly then you would also consider this request. It would be good if the API + INDEX download is accessible by programmers who program in the following languages: (a) Python (b) Java (c) Perl (d) Ruby Or some language independent mechanism can be formulated so programmers in various languages can access the API + INDEX download. Page Rank may or may not be included in the package depending on decisions at Google. It may also be closed source / open source / or partial source (part open part closed). This will be a great service to humanity and to programmers especially. Thanks, Ogah Ejini, Nigeria, West Africa. Mobile: +234 802 601 5061 -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
Ilias Lazaridis wrote: [Replying to comp.lang.python, due to censorship on Django User] [additional notification of poster via email, as medium is changed] And yet you still don't see why people call you a troll? This is completely inappropriate for comp.lang.python. Please take it elsewhere. This newsgroup is not a proxy for any other group who may have tired of your postings, and is not an arbitration forum for disputes. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
Steve Holden wrote: Ilias Lazaridis wrote: [Replying to comp.lang.python, due to censorship on Django User] [additional notification of poster via email, as medium is changed] And yet you still don't see why people call you a troll? Missing liberal qualities? http://dev.lazaridis.com/base/wiki/LiberalProjectDefinition This is completely inappropriate for comp.lang.python. Please take it elsewhere. This is perfectly appropriate for comp.lang.python, as it is the closest usenet group for django. This newsgroup is not a proxy for any other group who may have tired of your postings, and is not an arbitration forum for disputes. no. It's a place to discuss python. And it's a place to continue discussions which were censored within other media of the python domain. - sidenote: I forgot to post the link to the original article: http://groups.google.com/group/django-users/msg/710f456a3c1f1ee5 regards Steve -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
Re: THE IMPORTANCE OF MAKING THE GOOGLE INDEX DOWNLOADABLE
gen_tricomi wrote: Currently application programmers using the Google web search API are limited to 1000 queries a day. This on the one hand is a reasonable decision by Google because; limiting the queries will prevent harm on the Google system by unnecessary automated queries; but it is also limiting us programmers severely. The query limit limits the usefulness of whatever applications we decide to craft out and even limits our imagination on what is possible with a handful of indexes. If you know which sites you are interested in searching then you can already license hardware from Google which will let you index up to 15 million documents and an api to search the indexed content without restriction. If you simply want to compete with Google on searching the entire internet then they are unlikely to want to help you. If you fall somewhere in between what can be done with a Google Search Appliance and competing with Google then you are talking about paying Google sufficient money that they ought to be interested in sitting round a table with you. As it says on their website: For larger deployments, contact us and well be happy to talk to you about building a custom search solution for your environment. -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
Ilias Lazaridis wrote: snip http://lazaridis.com I would agree with you that this is a place to discuss python. However, your posts primarily deal with your expulsion from another group. Instead of discussing that, why don't your discuss the python technicalities of your project and leave the rest alone since we want to hear about the former and not the later. Brian -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
Ilias Lazaridis wrote: Steve Holden wrote: Ilias Lazaridis wrote: [Replying to comp.lang.python, due to censorship on Django User] [additional notification of poster via email, as medium is changed] And yet you still don't see why people call you a troll? Missing liberal qualities? http://dev.lazaridis.com/base/wiki/LiberalProjectDefinition Your definition, not anyone else's. And not a very good one IMO. This is completely inappropriate for comp.lang.python. Please take it elsewhere. This is perfectly appropriate for comp.lang.python, as it is the closest usenet group for django. Nope, the Django group is that. This is *not* a substitute, and it is *not* acceptable to post to the closest usenet group to one that won't tolerate your actions. This newsgroup is not a proxy for any other group who may have tired of your postings, and is not an arbitration forum for disputes. no. It's a place to discuss python. And it's a place to continue discussions which were censored within other media of the python domain. Sorry, that's exactly what it isn't. Kindly stop. - sidenote: I forgot to post the link to the original article: http://groups.google.com/group/django-users/msg/710f456a3c1f1ee5 I repeat: and yet you still don't see why people call you a troll? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: THE IMPORTANCE OF MAKING THE GOOGLE INDEX DOWNLOADABLE
gen_tricomi wrote: THE IMPORTANCE OF MAKING THE GOOGLE INDEX DOWNLOADABLE I write here to make a request on behalf of all the programmers on earth who have been or are intending to use the Google web search API for either research purposes or for the development of real world applications, that Google make their indexes downloadable. Frankly I doubt whether the average programmer possesses sufficient storage or has access to sufficient bandwidth to make downloading the Google indexes a practical proposition - let alone the cached page contents too. There's also the tiny factoid that Google might regard their index structure, not to mention its contents, as proprietary. Finally, how frequently would you propose to update your local copy? Google is adding the results of new spidering to their indices all the time. A nice idea, perhaps, but surely completely impractical. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: How to add few pictures into one
K.S.Sreeram wrote: Lad wrote: I really would like to have ALL pictures in one file. import Image def merge_images( input_files, output_file ) : img_list = [Image.open(f) for f in input_files] out_width = max( [img.size[0] for img in img_list] ) out_height = sum( [img.size[1] for img in img_list] ) out = Image.new( 'RGB', (out_width,out_height) ) y = 0 for img in img_list : w,h = img.size out.paste( img, (0,y,w,y+h) ) y += h out.save( output_file ) Use like this: merge_images( ['1.jpg','2.jpg','3.jpg'], 'output.jpg' ) Regards Sreeram, Thanks a lot --enig1BF4CF77824C603826EE139D Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: inline; filename=signature.asc Content-Description: OpenPGP digital signature X-Google-AttachSize: 253 -- http://mail.python.org/mailman/listinfo/python-list
Re: cgi and popen
Am Wed, 07 Jun 2006 14:54:41 +0200 schrieb Maarten van Veen: A long story made short, I've build a python/cgi website consisting of two pages. Page1 has a html form in which you can input a series of queries. Then via Popen it starts a pythons search script, which stores the results in a python shelve. As the Popen command is given it should redirect to page2, which will check if the shelve is ready (search finished) and if not displays a search page, refreshing itself after 10 seconds. The Popen command works nice when tried out in the console. The script isueing the Popen quits, and the other process keeps on running till finished. Hi, You can find out where the process hangs, by sending SIGINT to the python script: kill -SIGINT PID This is like ctrl-c, you should get a traceback. If the page1 script is not alive anymore, during the unwanted waiting, this does not work. Which form of popen do you use? Popen4 is the best, because you cannot get a deadlock if there is output on stdout and stderr. I guess you have the same strange thing, if you ssh to the server, start the script1 and you want to logoff before the subprocesses is finished. You can try to start the script like this: nohup nice mein-script $HOME/log/mein-script.log 21 /dev/null HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Re: 10GB XML Blows out Memory, Suggestions?
Am I missing something? I don't read where the poster mentioned the operation as being CPU intensive. He does mention that the entirety of a 10 GB file cannot be loaded into memory. If you discount physical swapfile paging and base this assumption on a normal PC that might have maybe 1 or 2 GB of RAM is his assumption that out of line? And I don't doubt that Python is efficient as possible for I/O operations. But since it is an interpreted scripting language how could it be just as fast as any language as you claim? C would have to be faster. Machine language would have to be faster. And even other interpreted languages *could* be faster, given certain conditions. A generalization like the claim kind of invalidates the remainder of your assertion. fuzzylollipop wrote: K.S.Sreeram wrote: Diez B. Roggisch wrote: What the OP needs is a different approach to XML-documents that won't parse the whole file into one giant tree - but I'm pretty sure that (c)ElementTree will do the job as well as expat. And I don't recall the OP musing about performances woes, btw. There's just NO WAY that the 10gb xml file can be loaded into memory as a tree on any normal machine, irrespective of whether we use C or Python. So the *only* way is to perform some kind of 'stream' processing on the file. Perhaps using a SAX like API. So (c)ElementTree is ruled out for this. Diez B. Roggisch wrote: No what exactly makes C grok a 10Gb file where python will fail to do so? In most typical cases where there's any kind of significant python code, its possible to achieve a *minimum* of a 10x speedup by using C. In most cases, the speedup is not worth it and we just trade it for the increased flexiblity/power of the python language. But in this situation using a bit of tight C code could make the difference between the process taking just 15mins or taking a few hours! Ofcourse I'm not asking him to write the entire application in C. It makes sense to just write the performance critical sections in C, and wrap it in Python, and write the rest of the application in Python. you got no idea what you are talking about, anyone knows that something like this is IO bound. CPU is the least of his worries. And for IO bound applications Python is just as fast as any other language. -- http://mail.python.org/mailman/listinfo/python-list
Re: cgi and popen
In article [EMAIL PROTECTED], Thomas Guettler [EMAIL PROTECTED] wrote: Am Wed, 07 Jun 2006 14:54:41 +0200 schrieb Maarten van Veen: A long story made short, I've build a python/cgi website consisting of two pages. Page1 has a html form in which you can input a series of queries. Then via Popen it starts a pythons search script, which stores the results in a python shelve. As the Popen command is given it should redirect to page2, which will check if the shelve is ready (search finished) and if not displays a search page, refreshing itself after 10 seconds. The Popen command works nice when tried out in the console. The script isueing the Popen quits, and the other process keeps on running till finished. Hi, You can find out where the process hangs, by sending SIGINT to the python script: kill -SIGINT PID This is like ctrl-c, you should get a traceback. If the page1 script is not alive anymore, during the unwanted waiting, this does not work. Which form of popen do you use? Popen4 is the best, because you cannot get a deadlock if there is output on stdout and stderr. I guess you have the same strange thing, if you ssh to the server, start the script1 and you want to logoff before the subprocesses is finished. You can try to start the script like this: nohup nice mein-script $HOME/log/mein-script.log 21 /dev/null HTH, Thomas Thx for your reply Thomas. I use subprocess.Popen, because popen 1t/m 4 are deprecated. I found a dodgy way around my problem though. By inserting another page between the input and the results page,a user sees a i'm searching page which wants to redirect to the results page directly, but keeps waiting for the search process to finish. So I put what used to be my problem to good use. :D Maarten -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
Brian wrote: Ilias Lazaridis wrote: snip http://lazaridis.com I would agree with you that this is a place to discuss python. However, your posts primarily deal with your expulsion from another group. Instead of discussing that, why don't your discuss the python technicalities of your project and leave the rest alone since we want to hear about the former and not the later. Brian thank you. - *IMPORT* I would like to know, if this construct is valid, or if it can result in problems: 1082try: 1083from django.rework.evolve import evolvedb 1084except ImportError: 1085def evolvedb(): 1086Evolve Command Dummy 1087print 'Command evolvedb not imported' 1088evolvedb.args ='' - *PATCHING* A second problem is, how to make the setup for users (testers) more convenient. Is there e.g. any mechanism to apply a patch in an automated manner (e.g. using a python library)? - *ALIAS_METHOD* The django commands are hard-coded: http://code.djangoproject.com/browser/django/trunk/django/core/management.py#L1180 thus elegant/dynamic additions of commands seem not possible. Another possibility is to enlink (hook?) the functionality into an existent function Is there any way (beside a patch) to alter the behaviour to an existing function. Is ther a python construct similar to the alias_method of Ruby: (example from an simple evolution support for a ruby orm) #-- # use alias_method to enlink the code #-- class SqliteAdapter alias_method :old_create_table, :create_table def create_table(*args) table_evolve(*args) result = old_create_table(*args) return result end end http://lazaridis.com/case/persist/og-evolve.rb - - - If anyone is interested to verify the results in order to stabelize the simple schema evolution support for django, please review the results here: http://case.lazaridis.com/wiki/DjangoProductEvaluation http://case.lazaridis.com/wiki/DjangoSchemaEvolution http://case.lazaridis.com/browser/django/rework/evolve.py http://case.lazaridis.com/browser/django/rework/add_evolvedb_command.diff . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
Re: pyqt show wizard
David Boddie wrote: Summary of the usual mess made by the Google Groups web interface: I suspect that you really want to call w.exec_loop() instead, since this will only return control to the method after the user has finished interacting with the wizard. Take a look at the QWizard documentation for more information: http://doc.trolltech.com/3.3/qwizard.html David test -- http://mail.python.org/mailman/listinfo/python-list
Re: 10GB XML Blows out Memory, Suggestions?
Fredrik Lundh wrote: fuzzylollipop wrote: you got no idea what you are talking about, anyone knows that something like this is IO bound. which of course explains why some XML parsers for Python are a 100 times faster than other XML parsers for Python... dependes on the CODE and the SIZE of the file, in this case processing 10GB of file, unless that file is heavly encrypted or compressed will, the process will be IO bound PERIOD! And in the case of XML unless the PARSER is extremely inefficient, and I assume, that would be an edge case, the parser is NOT the bottle neck in this case. The relativel performance of Python XML parsers is irrelvant in relationship to this being an IO bound process, even the slowest parser could only process the data as fast as it can be read off the disk. Anyone saying that using C instead of Python will be faster when 99% of the time in this case is just waiting on the disk to feed a buffer, has no idea what they are talking about. I work with TeraBytes of files, and all our Python code is just as fast as equivelent C code for IO bound processes. -- http://mail.python.org/mailman/listinfo/python-list
Very nice python IDE (windows only)
I have just discovered Python Scripter by Kiriakos Vlahos and it was a pleasant surprise. I thought that it deserved to be signalled. It is slim and fairly fast, with embedded graphical debugger, class browser, file browser... If you are into graphical IDEs you are probably going to enjoy it. Windows only unfortunately. http://mmm-experts.com/Products.aspx?ProductId=4 -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
Ilias Lazaridis: What is the credibility and value of the provided wikipedia entry? Wikipedia always tells the Absolute Truth, because if it doesn't, we can edit it and fix it right away. -- http://mail.python.org/mailman/listinfo/python-list
Re: Django Quick Start with Schema Evolution Support
Steve Holden wrote: Ilias Lazaridis wrote: Steve Holden wrote: Ilias Lazaridis wrote: ... This thread is now technical. Thank you for your comments. . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
Re: PUDGE - Project Status, Alternative Solutions
Ilias Lazaridis wrote: Ilias Lazaridis wrote: What is going on with the pudge project? Any chance to get an comment on this? After a little bit off-list discussion, I understand that many python documentation projects stop at some point, and that efforts are in general not very synchronized. Small overview here (work in progress): http://case.lazaridis.com/wiki/Docgen - btw: Still, the pudge.general list needs to be activated!!! Mr. Patrik O'Brien (Orbtech LLC) had told me that there is no similar tool available within the python domain, thus I have invested some effort to create a Website template, and to enable pudge to generate colored code: http://audit.lazaridis.com/schevo/wiki/SchevoWebsiteReview I like to reuse the results for personal projects, but I am wondering that the pudge email-list is death (since the server update) - and that no one of the project reacts to personal and public postings. Additionally, the schevo project removes the pudge stuff, mscott, the developer which has introduced pudge removes it again (although this was done with several other tools in the past, too): http://schevo.org/trac/changeset/2127 - Is there a similar tool available, with which I can generate python documentation / websites or both based on templates and reST? Or an overview of such tools? I mean such an organized tool is essential for developmente with python. . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
Rene Pijlman wrote: Ilias Lazaridis: What is the credibility and value of the provided wikipedia entry? Wikipedia always tells the Absolute Truth, because if it doesn't, we can edit it and fix it right away. fascinating! . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list
Re: help to install MySQL-python module
On 6/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear python users, I have an account on a Linux Cluster. I installed python version 2.3.5 on my account. I need to install the module MySQL-python to interact with a MySQL server already installed on the cluster. However, I read the README file but running python setup.py build the system fails to build the module and gives me the following error: error: invalid Python installation: unable to open /usr/local/lib/python2.3/config/Makefile (No such file or directory) How can I solve this problem? Thank you in advance Ernesto Ernesto, Where did the install put Python - the obvious situation is that the Makefile is not where the install of MySQL-Python thinks it is. Lou -- Artificial Intelligence is no match for Natural Stupidity -- http://mail.python.org/mailman/listinfo/python-list
Re: curses event handling
John Hunter wrote: I have a curses app that is displaying real time data. I would like to bind certain keys to certain functions, but do not want to block waiting for c = screen.getch() Is it possible to register callbacks with curses, something like screen.register('keypress', myfunc) You could use curses.halfdelay(), so that screen.getch() doesn't block indefinitely. I'm not sure if this will be fast enough for your application. Servus, Walter -- http://mail.python.org/mailman/listinfo/python-list
Re: 10GB XML Blows out Memory, Suggestions?
Thanks guys for all your posts... So I am a bit confusedFuzzy, the code I saw looks like it decompresses as a stream (i.e. per byte). Is this the case or are you just compressing for file storage but the actual data set has to be exploded in memory? fuzzylollipop wrote: Fredrik Lundh wrote: fuzzylollipop wrote: you got no idea what you are talking about, anyone knows that something like this is IO bound. which of course explains why some XML parsers for Python are a 100 times faster than other XML parsers for Python... dependes on the CODE and the SIZE of the file, in this case processing 10GB of file, unless that file is heavly encrypted or compressed will, the process will be IO bound PERIOD! And in the case of XML unless the PARSER is extremely inefficient, and I assume, that would be an edge case, the parser is NOT the bottle neck in this case. The relativel performance of Python XML parsers is irrelvant in relationship to this being an IO bound process, even the slowest parser could only process the data as fast as it can be read off the disk. Anyone saying that using C instead of Python will be faster when 99% of the time in this case is just waiting on the disk to feed a buffer, has no idea what they are talking about. I work with TeraBytes of files, and all our Python code is just as fast as equivelent C code for IO bound processes. -- http://mail.python.org/mailman/listinfo/python-list
Re: help to install MySQL-python module
error: invalid Python installation: unable to open /usr/local/lib/python2.3/config/Makefile (No such file or directory) Ernesto, Where did the install put Python - the obvious situation is that the Makefile is not where the install of MySQL-Python thinks it is. Some binary distros of Python omit this piece of the package. I had a similar problem with the installation of WebStack on Debian Linux. Alexis Roda's solution of apt-get install python2.3-dev got matters working for me. Likely there's a python development package you can install for your version of Python that should provide this header. You omit details regarding what platform you're using, though you hint at something *nix-ish given the path (/usr/local/lib/python...). If it's Debian, the same solution may work for you too. -tkc -- http://mail.python.org/mailman/listinfo/python-list
creating and naming objects
I have a question that some may consider silly, but it has me a bit stuck and I would appreciate some help in understanding what is going on. For example, lets say that I have a class that creates a student object. Class Student: def setName(self, name) self.name = name def setId(self, id) self.id = id Then I instantiate that object in a method: def createStudent(): foo = Student() /add stuff Now, suppose that I want to create another Student. Do I need to name that Student something other than foo? What happens to the original object? If I do not supplant the original data of Student (maybe no id for this student) does it retain the data of the previous Student object that was not altered? I guess I am asking how do I differentiate between objects when I do not know how many I need to create and do not want to hard code names like Student1, Student2 etc. I hope that I am clear about what I am asking. Thanks, Brian -- http://mail.python.org/mailman/listinfo/python-list
How do I automatically redirect stdout and stderr when using os.popen2?
How do I automatically redirect stdout and stderr when using os.popen2 to start a long running process. If the process prints a lot of stuff to stdout it will eventually stop because it runs out of buffer space. Once I start reading the stdout file returned by os.popen2 then the process resumes. I know that I could just specify /dev/null when starting the process but I'd like to know if there is a way to start a process using os.popen2 or some other way so that all standard out and standard error goes to /dev/null or some other file. Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list
Re: CENSORSHIP - Django Project (Schema Evolution Support)
* Ilias Lazaridis (2006-06-07 12:35 +) [posted publicly to comp.lang.python, with email notification to 6 recipients relevant to the topic] I think I have a deja-vu... Did someone say Xah?! T. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python to C converter
Chance Ginger wrote: If you are looking for a real python to C, well in this case C++ look for the shedskin compiler. It will take a rather nice subset of Python and generate C++ code from it. In which sense is shedskin a more real python to C/C++ compiler than some of the other mentioned projects? As most of the others (PyPy, Pyrex), Shedskin works only for a small number of Python programs that don't mix types too wildly. BTW: While the RPython (the subset of the Python language that PyPy can compile) might not be extremely advanced, using it gives you a number of very interesting features: like having the resulting program been enhanced to not use the C stack (for deeply recursive code), using different garbage collection strategies... Cheers, Carl Friedrich Bolz -- http://mail.python.org/mailman/listinfo/python-list