Multiple Python one-liners
http://jugad2.blogspot.com/2013/06/multiple-python-one-liners.html Some interesting and useful one-liners there ... -- http://mail.python.org/mailman/listinfo/python-list
Riemann and Bernhard, a distributed systems monitor and Python client
This may be of interest to the group: Riemann and Bernhard, a distributed systems monitor and Python client http://jugad2.blogspot.in/2013/06/riemann-and-bernhard-distributed.html - Vasudev Ram dancingbison.com Python training and consulting -- http://mail.python.org/mailman/listinfo/python-list
PDF in a Bottle - creating PDF using xtopdf, ReportLab, Bottle and Python
Hi list, Might be of interest: PDF in a Bottle - creating PDF using xtopdf, ReportLab, Bottle and Python http://jugad2.blogspot.in/2013/05/pdf-in-bottle-creating-pdf-using-xtopdf.html - Vasudev Ram Python, Linux and open source training and development www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
XML to PDF book with ElementTree and xtopdf
Hi list, This may be of interest - a program to create simple PDF books from XML text content: Create PDF books with XMLtoPDFBook: http://jugad2.blogspot.in/2013/06/create-pdf-books-with-xmltopdfbook.html XMLtoPDFBook.py requires ElementTree (which is in the standard Python library), xtopdf, ReportLab and Python. Relevant download links for xtopdf and ReportLab are in the post linked above. Here is a guide to installing xtopdf: http://jugad2.blogspot.in/2012/07/guide-to-installing-and-using-xtopdf.html - Vasudev Ram Python, Linux and open source consulting and training Site: http://dancingbison.com Blog: http://jugad2.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Python, meet Turtle
http://jugad2.blogspot.com/2013/07/python-meet-turtle.html -- http://mail.python.org/mailman/listinfo/python-list
PipeController v0.1 - experimental tool to simulate simple UNIX-style pipes in Python
I wrote PipeController recently to experiment with doing UNIX-style pipes in Python. Blog post about it: http://jugad2.blogspot.in/2012/08/pipecontroller-v01-released-simulating.html The blog post has a link to the downloadable PipeController source code. It will be released under the New BSD License, which means you can use it for any purpose, commercial or otherwise, subject to the terms of the license. - Vasudev Ram www.dancingbison.com jugad2.blogspot.com twitter.com/vasudevram -- http://mail.python.org/mailman/listinfo/python-list
Re: PipeController v0.1 - experimental tool to simulate simple UNIX-style pipes in Python
On Saturday, September 1, 2012 9:02:33 PM UTC+5:30, Ramchandra Apte wrote: > On Friday, 31 August 2012 03:27:54 UTC+5:30, vasudevram wrote: > > > I wrote PipeController recently to experiment with doing UNIX-style pipes > > in Python. > > > Doesn't the pipes module already do this? Yes. As Ian Kelly points out here: http://www.mail-archive.com/python-list@python.org/msg335943.html the pipes module of Python does deal with actual UNIX pipes. But I had mentioned this - Python's pipes module - in my first post, some months ago, about doing UNIX-pipes in Python ( on my blog, here: http://jugad2.blogspot.in/2011/09/some-ways-of-doing-unix-style-pipes-in.html ), and that first post was in turn linked to, in the current post under discussion ( i.e. this one: http://jugad2.blogspot.in/2012/08/pipecontroller-v01-released-simulating.html ). To Ian Kelly: > No, that deals with actual Unix pipes. This appears to be about pipelined > processing within a single program and not IPC; the description "Unix-like" > is a bit misleading, IMO. I guess it can be interpreted as a bit misleading, but it was not intentionally so. The way I meant it was that PipeController tries to achieve _roughly_ similar functionality, of composing a program out of components, as UNIX pipes do. (That too, only a small subset, as I mention in my blog post). In the case of UNIX the components are commands, in the case of my Python approach the components are functions. Also, I used the term "UNIX-style pipes", not "UNIX pipes", to stress that it was the overall concept of a pipeline that was being simulated, not the exact design / implementation details, and you can also notice that my first post has links to many different third-party ways of simulating UNIX-pipes in Python, some of which are not like actual UNIX pipes at all, in their implementation. But I agree that your description of PipeController as "pipelined processing within a single program" is more accurate. I could have used a better choice of words but there was no intention to mislead. - Vasudev Ram www.dancingbison.com jugad2.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Re: PipeController v0.1 - experimental tool to simulate simple UNIX-style pipes in Python
On Monday, September 3, 2012 1:05:03 AM UTC+5:30, vasudevram wrote: > > To Ian Kelly: > > No, that deals with actual Unix pipes. This appears to be about pipelined > > processing within a single program and not IPC; the description "Unix-like" > > is a bit misleading, IMO. > I guess it can be interpreted as a bit misleading, but it was not > intentionally so. The way I meant it was that PipeController tries to achieve > _roughly_ similar functionality, of composing a program out of components, as > UNIX pipes do. To Ian again: Also, I used the word "synchronous" somewhat deliberately (see in my blog post: "PipeController is a tool to experiment with a simple, sequential, synchronous simulation of UNIX-style pipes in Python."). I used the word synchronous to indicate that my PipeController implementation runs the functions one after another (for each item in the input), in contrast to actual Unix pipes, where the different commands in a pipeline can, and IIRC, do, run in parallel / asynchronously, with their IPC being coordinated / managed by the kernel and shell. -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for an IPC solution
On Saturday, September 1, 2012 6:25:36 PM UTC+5:30, Wolfgang Keller wrote: > > There are just so many IPC modules out there. I'm looking for a > > > solution for developing a new a multi-tier application. The core > > > application will be running on a single computer, so the IPC should > > > be using shared memory (or mmap) and have very short response times. > > > > Probably the fastest I/RPC implementation for Python should be > > OmniOrbpy: > > > > http://omniorb.sourceforge.net/ > > > > It's cross-platform, language-independent and standard-(Corba-) > > compliant. > > > > > I have seen a stand alone cross platform IPC server before that could > > > serve "channels", and send/receive messages using these channels. But > > > I don't remember its name and now I cannot find it. Can somebody > > > please help? > > > > If it's just for "messaging", Spread should be interesting: > > > > http://www.spread.org/ > > > > Also cross-platform & language-independent. > > > > Sincerely, > > > > Wolfgang Though I'm not the OP, thanks for the info. Will put Spread on my stack to check out ... -- http://mail.python.org/mailman/listinfo/python-list
Using PipeController (v0.2) to run a pipe incrementally
I've released v0.2 of PipeController, my experimental tool to simulate pipes in Python. It can be downloaded here: http://dancingbison.com/pipe_controller-v0.2.zip Changes in v0.2: - module name changed to avoid clashes with pipes module in the standard Python library; the module is now called pipe_controller.py instead of pipes.py; - you can now pass input and output filename arguments on the command in your program that calls PipeController, instead of having to use I/O redirection; - you can now import class PipeController from the module, with: from pipe_controller import PipeController - you can now run a PipeController pipe incrementally, i.e., run the pipe in a loop, adding a pipe component (a Python function) in each iteration, and it can save the intermediate outputs resulting from each iteration, to separate output files; the program test_pipe_controller_03.py in the download package shows how to do this. This feature can be useful to debug your pipe's logic, and also to save the intermediate computation results in case they are of use in their own right. Blog post about using PipeController v0.2 to run a pipe incrementally: http://jugad2.blogspot.in/2012/09/using-pipecontroller-to-run-pipe.html - Vasudev Ram www.dancingbison.com jugad2.blogspot.com twitter.com/vasudevram -- http://mail.python.org/mailman/listinfo/python-list
fmap(), "inverse" of Python map() function
http://jugad2.blogspot.in/2012/10/fmap-inverse-of-python-map-function.html - Vasudev Ram www.dancingbison.com jugad2.blogspot.com twitter.com/vasudevram -- http://mail.python.org/mailman/listinfo/python-list
Re: fmap(), "inverse" of Python map() function
On Saturday, October 6, 2012 5:01:40 AM UTC+5:30, Devin Jeanpierre wrote: > On Fri, Oct 5, 2012 at 7:24 PM, Ian Kelly wrote: > > > I realize that. My point is that the function *feels* more like a > > > variant of reduce than of map. > > > > > >> If it's meant as a complaint, it's a poor one. > > > > > > It's not. > > > > Fair enough all around. Sorry for misunderstanding. > > > > -- Devin Thanks to all who replied. Always good to learn something new. - Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: fmap(), "inverse" of Python map() function
> Thanks to all who replied. Always good to learn something new. P.S. A reader posted a good comment with Scala as well as Python code for a compose function (basically same functionality as fmap, or more - the compose once, run many times thing). It's the 4th comment on my blog post. - Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Using pipe_controller to swap pipe components at runtime
I added a couple of methods / functions to my pipe_controller Python module, the Python tool to experiment with pipelined functions within a program. With these additions, it is now possible to swap the components of a pipe_controller 'pipe' programmatically, at runtime (*), and then run the pipe again (all within the same program), with differing results (from before and after the swap). (*) Instead of having to edit the source code to change the order in which the functions in the pipe are called, that change of order can be done programmatically, via a swap_processors() method. Blog post about it: http://jugad2.blogspot.in/2012/10/swapping-pipe-components-at-runtime.html The post includes snippets of the added methods / functions, and a sample run of a test program that demonstrates the new component-swapping feature. The latest code with the above changes is on Bitbucket at: https://bitbucket.org/vasudevram/pipe_controller - Vasudev Ram www.dancingbison.com jugad2.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
PDFBuilder can create composite PDFs
PDFBuilder is a tool to create composite PDFs, i.e. PDFs comprising of data from multiple different input data formats (any number of files, in any order). It is a new component of my xtopdf toolkit for PDF generation. A blog post about PDFBuilder gives more information, an example, and a download link: http://jugad2.blogspot.in/2012/11/pdfbuilderpy-can-create-composite-pdfs.html - Vasudev Ram http://www.dancingbison.com http://jugad2.blogspot.com http://twitter.com/vasudevram -- http://mail.python.org/mailman/listinfo/python-list
PDFBuilder can now take multiple input files from command line
Here is the blog post about it: http://jugad2.blogspot.in/2012/11/pdfbuilder-can-now-take-multiple-input.html In short: removed the temporary hard-coding, refactored the code some. PDFBuilder can now use multiple input files (of type .csv / .tdv), specified on the command-line, to create a composite PDF from those inputs. .tdv = Tab Delimited Values, such as commonly used in UNIX tools like sed / grep / awk and friends. - Vasudev Ram www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Domino, a Python PaaS for data science
Hi list, This may be of interest: Domino, a Python PaaS for data science: http://jugad2.blogspot.in/2013/12/domino-paas-for-data-science.html - Vasudev Ram Software training and consulting Python, Linux, C, open source, databases ... www.dancingbison.com jugad2.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list
Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)
Hi list, Can anyone - maybe one of the Python language core team, or someone with knowledge of the internals of Python - can explain why this code works, and whether the different occurrences of the name x in the expression, are in different scopes or not? : x = [[1,2], [3,4], [5,6]] [x for x in x for x in x] I saw this on a Hacker News thread about Python, and here is a post I wrote that gives more details about it, including relevant links, how I found that it can be extended to a triply-nested list, and my thoughts about the scope issue: http://jugad2.blogspot.in/2014/03/flatten-list-of-lists-with-list.html A few people commented about it, both on my blog, and on the Python Reddit where I also submitted my post, but I'm not sure I'm convinced of their reasoning or understand it, hence posting the question here. Thanks, Vasudev Ram www.dancingbison.com jugad2.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)
On Saturday, March 22, 2014 2:24:00 AM UTC+5:30, Rustom Mody wrote: > Lets try without comprehending comprehensions :-) > >>> x=[[1,2],[3,4]] > > >>> for x in x: > > ... for x in x: > > ... print x > > ... > > 1 > > 2 > > 3 > > 4 Nice and all, thanks, but doesn't answer the question. -- https://mail.python.org/mailman/listinfo/python-list
Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)
Thanks to all those who answered. - Vasudev -- https://mail.python.org/mailman/listinfo/python-list
New way of writing socket servers in #Linux kernel 3.9 (and in #Python too)
This may be of interest to readers of this newsgroup: Original article: http://lnkd.in/taAFNt Content (without links): A new way of writing socket servers has been introduced with the Linux kernel 3.9. It involves the ability to bind multiple listening sockets to the same port on the same host, by unrelated processes or threads. The socket option is called SO_REUSEPORT. Article about SO_REUSEPORT. The above article includes a demo of how to use the feature in Python, using the example of a simple echo server and netcat. Another article about SO_REUSEPORT on LWN.net by Michael Kerrisk. Hacker News thread about SO_REUSEPORT. About Michael Kerrisk. He has worked at DEC (Digital Equipment Corporation) and Google in the past. Coincidentally, I happened to have come across Michael Kerrisk's Unix and Linux work some months earlier and had emailed him with a few questions about it, which he was kind enough to answer. Kerrisk is the author of the book The Linux Programming Interface, which seems like an interesting and useful book. >From the web site for the The Linux Programming Interface book: [ The Linux Programming Interface (published in October 2010, No Starch Press, ISBN 978-1-59327-220-3) is a detailed guide and reference for Linux and UNIX system programming. With 1552 pages, 115 diagrams, 88 tables, nearly 200 example programs, and over 200 exercises, TLPI is the most comprehensive description of Linux and UNIX system programming available. The author, Michael Kerrisk, is the maintainer of the Linux man-pages project, which documents the Linux kernel and glibc APIs. He has long been active in the documentation, testing, and design review of Linux kernel-userspace interfaces. ] And if you want to write command-line programs in Linux using C (an area closely related to the topic of the TLPI book), you may wish to check out my article on the subject, written for IBM developerWorks: Developing a Linux command-line utility. I have not yet tried out the SO_REUSEPORT option, because I need to get Linux kernel 3.9 first, but it seems like a useful technique for increasing performance of socket servers. Note that there are various other issues involved, so you may not get increased performance just by using this option in your code. As always with performance tuning, you have to profile your code, identify hotspots, and then only work on improving certain parts of it that seem to be the bottlenecks. And in this case, even before all that, you may need to evaluate whether this socket option is relevant to your application at all. So, caveat lector :-) - Vasudev Ram - Dancing Bison Enterprises -- http://mail.python.org/mailman/listinfo/python-list
Convert Microsoft Word files to PDF with DOCXtoPDF
Hi list, I hope some people may find this useful. This post by me shows how to use DOCXtoPDF (a program I wrote recently) to convert the text in Microsoft Word files (that are in DOCX format) to PDF: Convert Microsoft Word files to PDF with DOCXtoPDF http://jugad2.blogspot.in/2013/10/convert-microsoft-word-files-to-pdf.html The prerequisites are also mentioned. They are: Python, Reportlab, my xtopdf toolkit and python-docx. --- - Vasudev Ram Dancing Bison Enterprises Software training and consulting - Python, Linux, databases, open source ... http://www.dancingbison.com http://jugad2.blogspot.com --- -- https://mail.python.org/mailman/listinfo/python-list
xtopdf, a Python toolkit for PDF creation from other file formats
Hi list, xtopdf is not new. I first created it some years ago. And have been updating it with new features and capabilities now and then. But I realized that there was no central place where its features and uses were described. So I created an online presentation about xtopdf, using http://slid.es, a cool online presentation service that I saw recently. Here is a blog post about the online presentation about xtopdf: http://jugad2.blogspot.in/2013/10/xtopdf-online-presentation.html Enjoy. - Vasudev Ram Dancing Bison Enterprises Software training and consulting (Python, C, Linux, databases, open source, ...) http://www.dancingbison.com http://jugad2.blogspot.com https://mobile.twitter.com/vasudevram -- https://mail.python.org/mailman/listinfo/python-list
Approach to creating a Boolean expression parser in Python?
Hi list, I'm working on an app in which longish text chunks (could be up to a few MB in size, and stored either in flat text files or in fields of database records - TBD) need to be searched for the presence of a combination of string constants, where the string constants can be combined with boolean operators (in the user input given in a web form, for the search). The DB is MongoDB, accessed from Python using the PyMongo driver / client. The text chunks are associated with structured fields of database records, of users (say, suppliers), so the end result wanted is that the app user should be able to specify a search using boolean operators and the app should search across all the text chunks belonging to all users (users to text chunks is a one-to-many relationship, whether the chunks are stored as long varchar in the DB or as flat files, with a field of a database record containing the filename of the text file containing the chunk). Then the app should return both the user names and the corresponding text chunks, for chunks that matched the boolean expression. Example return value: user2 filename1.txt filename4.txt user5 filename3.txt user7 filename6.txt (where the filenames.txt could instead be the chunks of text, if the chunks are stored in the DB instead of the file system). The boolean expressions can be like these: apple and orange apple or pear apple and (pear or mango) (apple and pear) or mango not orange apple or not (pear and orange) etc. What are some good approaches to doing this using Python? I'm first looking at pure Python code approaches, though have considered using search tools like Solr (via PySolr), ElasticSearch, etc. Right now the app is in the prototype stage so I first want to establish the feasibility and a simple approach to doing the search, though later, if the app needs to scale, may investigate the tools like PySolr or ES. I think I may need to use one of the parsing libraries for Python such as PLY and others mentioned here: https://wiki.python.org/moin/LanguageParsing Let's say a parse tree is built up by whichever approach is used. A related question would be how to use this parse tree to search in the text chunks. I realize that it is a somewhat complex questiom, so am not looking for complete solutions, but for suggestions on how to go about it. Thanks for any suggestions. -- Vasudev Ram www.dancingbison.com jugad2.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list
Inner workings of this Python feature: Can a Python data structure reference itself?
Hi group, Please refer to this blog post about code showing that a Python data structure can be self-referential: http://jugad2.blogspot.in/2015/05/can-python-data-structure-reference.html Gotten a couple of comments on it already, but interested in hearing thoughts of Python core dev team members or others who can comment on the internals of how this feature operates, why, etc. Thanks Vasudev Ram Site: www.dancingbison.com Python posts: jugad2.blogspot.com/search/label/python -- https://mail.python.org/mailman/listinfo/python-list
Re: Inner workings of this Python feature: Can a Python data structure reference itself?
On Sunday, May 3, 2015 at 1:47:04 AM UTC+5:30, Tim Chase wrote: > [dangit, had Control down when I hit and it sent prematurely] > > On 2015-05-02 13:02, vasudevram wrote: > > http://jugad2.blogspot.in/2015/05/can-python-data-structure-reference.html > > > > https://docs.python.org/2/reference/datamodel.html > > > > and saw this excerpt: > > > > [ CPython implementation detail: CPython currently uses a > > reference-counting scheme with (optional) delayed > > detection of cyclically linked garbage, which collects > > most objects as soon as they become unreachable, but is > > not guaranteed to collect garbage containing circular > > references. ] > > > > Not sure whether it is relevant to the topic at hand, > > since, on the one hand, it uses the words "cyclically > > linked", but on the other, it says "garbage collection". > > The gotcha happens in a case where you do something like this: > > lst = [] > lst.append(lst) # create a cycle > del lst > > This creates a cycle, then makes it unreachable, but the list is > still referenced by itself, so the reference count never drops to > zero (where it would get GC'd), and thus that item lingers around in > memory. > > If you know that you're creating such cyclical structures, it's best > to manually unlink them before freeing them: > > lst = [] > lst.append(lst) # create the cycle > lst[:] = [] # break the cycle > # or lst.remove(lst) # though this takes more care > del lst > > -tkc Thanks for the reply. Will check that out. -- https://mail.python.org/mailman/listinfo/python-list
Re: Inner workings of this Python feature: Can a Python data structure reference itself?
On Sunday, May 3, 2015 at 1:32:14 AM UTC+5:30, vasudevram wrote: > Hi group, > > Please refer to this blog post about code showing that a Python data > structure can be self-referential: > > http://jugad2.blogspot.in/2015/05/can-python-data-structure-reference.html > > Gotten a couple of comments on it already, but interested in hearing thoughts > of Python core dev team members or others who can comment on the internals of > how this feature operates, why, etc. > > Thanks > Vasudev Ram > Site: www.dancingbison.com > Python posts: jugad2.blogspot.com/search/label/python Thanks again to all who answered. I will reply separately today to individual answers that need a reply. - Vasudev -- https://mail.python.org/mailman/listinfo/python-list
Re: Inner workings of this Python feature: Can a Python data structure reference itself?
On Sunday, May 3, 2015 at 4:48:11 AM UTC+5:30, Terry Reedy wrote: > On 5/2/2015 4:02 PM, vasudevram wrote: > > Hi group, > > > > Please refer to this blog post about code showing that a Python data > > structure can be self-referential: > > > > http://jugad2.blogspot.in/2015/05/can-python-data-structure-reference.html > > > > Gotten a couple of comments on it already, but interested in hearing > > thoughts of Python core dev team members or others who can comment on > > the internals of how this feature operates, why, etc. > > Please correct the following: >"g (a list) contains itself as a list item (of g)." > g is a dict, as you yourself later said. > > "Case 2) But if the evaluation works in a different order, i.e. the > globals() function is first called (before the variable g is created), > then at this point its return value (the dict) should not contain the > item with key 'g' (and value g), and it is this dict that should get > assigned to the variable g. Hence when we print g, we should not see g > again within it." > > This seems like you are presenting this as a statement of fact, but you > then admit it is false. The lead in sentence should more carefully > state that what follows are possible hypotheses. one is true and the > other (mostly) not. > > The key point is the meaning of "the globals() function returns a dict > representing the current global symbol table," "Global symbol table" is > an abstraction. In CPython, the implementation is a dict and globals > returns that dict, not a copy. Python generally does not copy objects > unless requested. > > Similarly, locals() returns a dict representing the current local symbol > table. In a CPython class statement, the local symbol table is > implemented with a dict, and locals() is that dict. In a CPython def > statement, the local symbol table is implemented as a C array (of > pointers to PyObjects). Locals() is a dict (created just once) updated > from local names in the code object and the objects in the array *at the > time of the call* > > >>> def f(a): > g = locals() > print(id(g), g) > g = locals() > print(id(g), g) > > >>> f(3) > 56288136 {'a': 3} > 56288136 {'a': 3, 'g': {...}} > > 'Case 2" applies for the first locals() call, but only for the first. > > I believe that there was a time when printing a recursive structure hit > the recursion limit like your flatten did. But I will not reload 1.5 to > check. > > -- > Terry Jan Reedy Terry Reedy: Thanks for the detailed answer. I have corrected the list vs. dict mistake in a comment to my original post on my blog. Don't want to edit the post itself since some readers will get it twice via feed readers. Re. statement of fact vs. hypotheses. While I'm not sure of your exact meaning in that paragraph, I understand the concept, and yes, I was not clear enough in phrasing that part. It should have read like something along these lines: Observations -> One or more hypotheses -> deductions -> one or more alternative conclusions. I mixed that up a bit. Thanks. - Vasudev -- https://mail.python.org/mailman/listinfo/python-list
Re: Inner workings of this Python feature: Can a Python data structure reference itself?
On Sunday, May 3, 2015 at 6:30:16 PM UTC+5:30, vasudevram wrote: > On Sunday, May 3, 2015 at 4:48:11 AM UTC+5:30, Terry Reedy wrote: > > On 5/2/2015 4:02 PM, vasudevram wrote: > > > Hi group, > > > > > > Please refer to this blog post about code showing that a Python data > > > structure can be self-referential: > > > > > > http://jugad2.blogspot.in/2015/05/can-python-data-structure-reference.html > > > > > > Gotten a couple of comments on it already, but interested in hearing > > > thoughts of Python core dev team members or others who can comment on > > > the internals of how this feature operates, why, etc. > > > > Please correct the following: > >"g (a list) contains itself as a list item (of g)." > > g is a dict, as you yourself later said. > > > > "Case 2) But if the evaluation works in a different order, i.e. the > > globals() function is first called (before the variable g is created), > > then at this point its return value (the dict) should not contain the > > item with key 'g' (and value g), and it is this dict that should get > > assigned to the variable g. Hence when we print g, we should not see g > > again within it." > > > > This seems like you are presenting this as a statement of fact, but you > > then admit it is false. The lead in sentence should more carefully > > state that what follows are possible hypotheses. one is true and the > > other (mostly) not. > > > > The key point is the meaning of "the globals() function returns a dict > > representing the current global symbol table," "Global symbol table" is > > an abstraction. In CPython, the implementation is a dict and globals > > returns that dict, not a copy. Python generally does not copy objects > > unless requested. > > > > Similarly, locals() returns a dict representing the current local symbol > > table. In a CPython class statement, the local symbol table is > > implemented with a dict, and locals() is that dict. In a CPython def > > statement, the local symbol table is implemented as a C array (of > > pointers to PyObjects). Locals() is a dict (created just once) updated > > from local names in the code object and the objects in the array *at the > > time of the call* > > > > >>> def f(a): > > g = locals() > > print(id(g), g) > > g = locals() > > print(id(g), g) > > > > >>> f(3) > > 56288136 {'a': 3} > > 56288136 {'a': 3, 'g': {...}} > > > > 'Case 2" applies for the first locals() call, but only for the first. > > > > I believe that there was a time when printing a recursive structure hit > > the recursion limit like your flatten did. But I will not reload 1.5 to > > check. > > > > -- > > Terry Jan Reedy > > Terry Reedy: > > Thanks for the detailed answer. I have corrected the list vs. dict mistake in > a comment to my original post on my blog. Don't want to edit the post itself > since some readers will get it twice via feed readers. > > Re. statement of fact vs. hypotheses. While I'm not sure of your exact > meaning in that paragraph, I understand the concept, and yes, I was not clear > enough in phrasing that part. It should have read like something along these > lines: > > Observations -> One or more hypotheses -> deductions -> one or more > alternative conclusions. > > I mixed that up a bit. > > Thanks. > - Vasudev I may have needed to put the "experiments" step in there as well :) See: http://en.wikipedia.org/wiki/Scientific_method -- https://mail.python.org/mailman/listinfo/python-list
Re: Inner workings of this Python feature: Can a Python data structure reference itself?
On Sunday, May 3, 2015 at 6:38:28 PM UTC+5:30, Chris Angelico wrote: > On Sun, May 3, 2015 at 10:59 PM, vasudevram wrote: > > Re. statement of fact vs. hypotheses. While I'm not sure of your exact > > meaning in that paragraph, I understand the concept, and yes, I was not > > clear enough in phrasing that part. It should have read like something > > along these lines: > > > > Observations -> One or more hypotheses -> deductions -> one or more > > alternative conclusions. > > I just took a glance at your blog post, and it's reasonably clear now. > (Though I tend to try to avoid making substantive edits to blog posts > once they've been published and read; a codicil, or at very least an > italicized comment saying "(Edit: Actually, blah blah blah.)", is > clearer. Of course, trivial edits like typos can be corrected - nobody > would be bothered by those unexpectedly changing.) Posts to the > newsgroup/mailing list basically can't be edited, so the normal way to > acknowledge an error or correction is simply a follow-up post. > > ChrisA Good points, thanks. -- https://mail.python.org/mailman/listinfo/python-list
youtube-dl, a YouTube downloader in Python
Folks may find this of interest, both from a programming and from an end-user point of view: youtube-dl, a YouTube downloader in Python: http://jugad2.blogspot.in/2013/03/youtube-dl-yourube-downloader-in-python.html I tried it out and it worked well. Downloaded a few videos using it. (The "rube" in the URL was a typo, I would have had to delete and re-enter the post to fix it - see the post for the details :) - Vasudev Ram www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Curl and python httplib?
On Tuesday, April 2, 2013 1:03:58 AM UTC+5:30, Mark Lawrence wrote: > On 30/03/2013 05:08, СѧPHP wrote: > > > Guys, > > > > > > I take a project that need send request to Hadoop by curl. > > > But now, the curl and pycurl can't satisfy my project. So i need use the > > > powerful httplib. > > > But failed. > > > > > > *my curl request:* > > > curl -i -X PUT "http://localhost:50070/webhdfs/v1/levi/7?op=CREATE"; > > > > > > *my return:* > > > HTTP/1.1 307 TEMPORARY_REDIRECT > > > Content-Type: application/octet-stream > > > Location: > > > http://58.53.211.47:50075/webhdfs/v1/levi/7?op=CREATE&overwrite=false > > > Content-Length: 0 > > > Server: Jetty(6.1.26) > > > > > > *Now, i change the curl request to httplib:* > > > import httplib > > > import urllib > > > > > > params=urllib.urlencode({"@op":"CREATE","@user.name":"levi"}) > > > headers={"Content-type": "application/x-www-form-urlencoded","Accept": > > > "text/plain"} > > > conn=httplib.HTTPConnection("localhost:50070") > > > conn.request("PUT","/webhdfs/v1/levi/7.txt",params,headers) > > > response=conn.getresponse() > > > print response.status, response.reason > > > data=response.read() > > > print data > > > conn.close() > > > > > > *But it failed:* > > > #print response.status, response.reason > > > 500 Internal Server Error > > > #print data > > > '{"RemoteException":{"exception":"WebApplicationException","javaClassName":"javax.ws.rs.WebApplicationException","message":null}}' > > > > > > Who knows why? It's OK when i use curl, so where is the problem in > > > httplib method? > > > Or some other reasons? > > > Who can help me change the curl request to httplib edition? > > > > > > TIA > > > Levi > > > > > > > > > > Try the requests module https://pypi.python.org/pypi/requests/ as if I > > can successfuly use it anybody can :) > > > > -- > > If you're using GoogleCrap™ please read this > > http://wiki.python.org/moin/GoogleGroupsPython. > > > > Mark Lawrence Or try httplib2 GIYF -- http://mail.python.org/mailman/listinfo/python-list
Using xtopdf and pypyodbc to publish MS Access database data to PDF
Wrote a program that lets you publish your MS Access database data to PDF, using Python, ReportLab, xtopdf (my toolkit) and pypyodbc. Sharing it here. Link: http://jugad2.blogspot.in/2013/04/using-xtopdf-and-pypyodbc-to-publish-ms.html Note: Saw some comments about my blog post on the Python Reddit, which made me realize that I had not explained that similar code can be used to publish data from any ODBC database (for which you have an ODBC driver, and which is supported by pypyodbc), to PDF. All you have to do is change the connection string in the code, and maybe a few other small tweaks for differences between SQL dialects of different RDBMS's. Enjoy. - Vasudev Ram www.dancingbison.com jugad2.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
What is the reason for defining classes within classes in Python?
Hi list, I saw an example of defining a class within another class, here, in the docs for peewee, a simple ORM for Python: http://peewee.readthedocs.org/en/latest/peewee/quickstart.html In what way is this useful? Thanks, Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: What is the reason for defining classes within classes in Python?
On Wednesday, April 24, 2013 3:52:57 AM UTC+5:30, Ian wrote: > On Tue, Apr 23, 2013 at 3:50 PM, vasudevram wrote: > > > > > > Hi list, > > > > > > I saw an example of defining a class within another class, here, in the > > docs for peewee, a simple ORM for Python: > > > > > > http://peewee.readthedocs.org/en/latest/peewee/quickstart.html > > > > > > In what way is this useful? > > > > In that particular case they're just using it as a namespace. Django > > does the same thing. Not clear. An example or more explanation might help, if you can. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: What is the reason for defining classes within classes in Python?
On Wednesday, April 24, 2013 6:20:36 AM UTC+5:30, alex23 wrote: > On Apr 24, 9:13 am, vasudevram wrote: > > > On Wednesday, April 24, 2013 3:52:57 AM UTC+5:30, Ian wrote: > > > > On Tue, Apr 23, 2013 at 3:50 PM, vasudevram wrote: > > > > > I saw an example of defining a class within another class > > > > > In what way is this useful? > > > > > > > In that particular case they're just using it as a namespace. > > > > > > Not clear. An example or more explanation might help, if you can. Thanks. > > > > Namespaces are used to allow for the same label to be applied to > > different concepts without the labels conflicting with each other. If > > I was writing a program that dealt with the mathematics of morality, I > > might want to use the sine function and refer to it in the standard > > way as 'sin', and I might also want to store a value representing your > > lack of goodness as 'sin'. As you can't use the same label in the same > > scope to refer to two different objects, one way of dealing with this > > that lets you still use what you feel are the most appropriate names > > is to put them into a namespace. So you could express this as: > > > > class Math(object): > > sin = function() > > > > class Morality(object): > > sin = True > > > > Then in your code you can clearly distinguish between the two by using > > Math.sin and Morality.sin. Modules & packages are also namespaces, so > > in this example we'd replace the Math class with `import math`, which > > has a sin function defined within it. > > > > A nested class definition will be defined as an attribute of the class > > its defined within: > > > > >>> class Outer(object): > > ... foo = 'FOO' > > ... class Inner(object): > > ... bar = 'BAR' > > ... > > >>> Outer.Inner > > > > >>> Outer.Inner.bar > > 'BAR' > > > > With peewee, the Model class looks for a Meta attribute and uses > > attributes on it to perform some tasks, like where to retrieve/store > > the model data. This allows for a way of distinguishing between > > attributes used to define fields, and attributes needed for those > > tasks. It also means your Models can use field names that the class > > would otherwise reserve for its own internal purposes: > > > > class DatabaseDetails(Model): > > # these attributes are fields > > database = CharField() > > owner = CharField() > > > > # ...but the Meta attribute isn't > > class Meta: > > # these attributes are used by the Model class > > database = db > > > > Here, database as a field is a text string that could contain a > > database name, while DatabaseDetails.Meta.database contains a > > reference to an actual database where the DatabaseDetails record would > > be stored. Actually, I did know what namespaces are in general. What I didn't get was how the inner class Meta in the peewee example was being used as a namespace. Your explanation makes things very clear. Thank you. Just one other doubt: > >>> Outer.Inner > > > In the above output, I would have thought Python would print __main__.Outer.Inner or Outer.Inner instead of __main__.Inner, since Inner is an attribute of Outer? -- http://mail.python.org/mailman/listinfo/python-list
Re: What is the reason for defining classes within classes in Python?
Interesting. Thank you. -- http://mail.python.org/mailman/listinfo/python-list
PDF in a Bottle - creating PDF using xtopdf, ReportLab, Bottle and Python
pdf_bottle.py is a program I wrote that allows you to create a PDF file from text, over the web, by entering your text into a form and submitting it. Here is the post about it: http://jugad2.blogspot.in/2013/05/pdf-in-bottle-creating-pdf-using-xtopdf.html - Vasudev Ram dancingbison.com jugad2.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
GUIDE: Using xtopdf to create PDF from text and DBF files (including creating simple PDF e-books)
Hi, I'm giving below, steps to install and use my xtopdf PDF creation/conversion toolkit. This post is for end-users. xtopdf is both a set of end-user tools and a library for use by developers, to create PDF from various input formats. I'll post another message here about how developers can use it in various ways, sometime later. The steps are for the Windows platform. Will do another post for Linux. 1. Get Python v2.4.3 here: http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Size is not more than 10 MB. Install it - its an MSI, so just double-click. (Any Python version >= 2.2 will work for xtopdf). 2. Get Reportlab open source version 1.21 here: http://www.reportlab.org/ftp/ReportLab_1_21.tgz Size is not more than 3 MB. (Don't use ReportLab 2.0 although it is available. I've not yet tested xtopdf with it. ReportLab 1.21 is the latest stable version in the version 1 series.) Install it following the instructions in the README file. It should be straightforward. The main points to take care of are: 2.1 First, before installing ReportLab, run Python once (you may have to add the dir. where Python got installed, say C:\Python24, to your PATH variable first). Once that dir. is added to your PATH (preferably via Control Panel), open a DOS prompt. At this prompt, type: python This should start the Python interpreter. You will get a one or two line message with the Python version, and then the Python interpreter prompt. 2.2. At this prompt, type the following two lines: import sys print sys.path This should display a list of all the dirs. that are in the Python PATH - an internal Python variable that gets set automatically, upon startup of the interpreter, to a set of default dirs. This variable is analogous to the DOS PATH variable. In this list of dirs., look for "C:\Python24\lib\site-packages" as one of the dirs. It should be there by default. If it is there, then exit the Python interpreter by typing Ctrl-Z and Enter. 3. Now install Reportlab: Unzip the ReportLab_1_21.tgz file with WinZip, into some folder, say c:\reportlab. This will create a folder called either: a) reportlab_1.21 with a folder called reportlab under it or b) just a folder called reportlab. If a), then move the reportlab folder (which is under reportlab_1.21) to under C:\Python24\Lib\site-packages . If b), then move the reportlab folder to under C:\Python24\Lib\site-packages. The above steps should make ReportLab work. An alternative way is to just unzip the reportlab .tgz file into some folder, say, C:\RL, and then create a file called, say, reportlab.pth, which contains just one line - the path to this folder where the extracted contents get stored.e.g. C:\RL\reportlab . Please check that step out (in the ReportLab .tgz file's README file for the exact details). 4. After the above steps, to check that Reportlab works, go to a DOS prompt again, run python again as before, and then at the Python prompt, enter either or both of the following commands (on separate lines): import reportlab from reportlab import pdfgen If either or both of these above commands work (and if there is no error message), it means that Reportlab is properly installed. 5. Now you can install xtopdf. Get xtopdf here: http://sourceforge.net/projects/xtopdf (click on the green rectangle which says "Download Conversion of other formats to PDF". After downloading the file, unzip it into a folder, say c:\temp. This will create a folder called xtopdf-1.0 under C:\temp. Go to that folder. There are many Python programs here with extension .py. To run, e.g., WritePDF.py, do this: python WritePDF.py some_file.txt This will run it and the output will be a file called some_file.pdf. Try opening it in Adobe Reader. Similarly try running some more programs: python DBFReader.py test1.dbf (or test2.dbf or test3.dbf or test4.dbf - all of which are in the package) This should read the DBF file and display its metadata (file header and field headers) and data records to standard output - the screen. python DBFToPDF.py test1.dbf test1.pdf This should do the same as the above (DBFReader.py), except that instead of the output going to the screen, it will go to a file called test1.pdf. And so on, try out a few others. Most of all of the programs can be run as "python prog_name.py". Some require one or more command-line arguments (all of them require at least one command-line argument, at least an input file). Some of them give usage messages if you run them without any command-line arguments, but this is not necessarily the case for all of them, nor are the messages always user-friendly enough - I'm working on fixing that in the next release. (Developers who have at least a working knowledge of Python should be easily able to figure out the usage, though, just by reading the start of the main() function for each program - the part where the code checks the command-line arguments.) But you should be able to run at least a few of them like this
Info on continuations?
Hi, I am Googling and will do more, found some stuff, but interested to get viewpoints of list members on: Continuations in Python. Saw a few URLs which had some info, some of which I understood. But like I said, personal viewpoints are good to have. Thanks Vasudev - Software consulting and training http://www.dancingbison.com PDF conversion toolkit: http://sourceforge.net/projects/xtopdf (stable version 1.0, supports plain text and DBF conversions to PDF) - -- http://mail.python.org/mailman/listinfo/python-list
Re: Info on continuations?
[EMAIL PROTECTED] wrote: > vasudevram wrote: > > Hi, > > > > I am Googling and will do more, found some stuff, but interested to get > > viewpoints of list members on: > > > > Continuations in Python. > > > Could you be a little more specific on what you're looking for? > Continuations are a big can of worms. > Thanks for the reply. Can't really be more specific, since I don't know enough. The question and the interest was exploratory in nature - as part of wanting to learn more about some dynamic / advanced features of Python. Will Google more and read the docs ... Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: Info on continuations?
Michele Simionato wrote: > vasudevram wrote: > > Hi, > > > > I am Googling and will do more, found some stuff, but interested to get > > viewpoints of list members on: > > > > Continuations in Python. > Thanks to all who replied. Vasudev -- http://mail.python.org/mailman/listinfo/python-list
ANN: xtopdf: PDF creation / conversion toolkit: alpha release of v1.3
Hi group, ANN: xtopdf: PDF creation / conversion toolkit: alpha release of v1.3 This is actually a somewhat preliminary announcement, but may be of interest to developers / users who know Python and/or have earlier checked out my xtopdf PDF creation / conversion toolkit ( http://sourceforge.net/projects/xtopdf): I've released (via my own web site, not yet properly packaged/documented and put on the SourceForge site, that will be done in some days), the next version of xtopdf: v1.3. This version adds support for conversion of CSV, TDV (Tab Delimited Values) and XLS (limited support) to PDF. v1.3 also adds some GUI tools written using wxPython (v1.0 had only command-line tools and a library for developers). Users/developers will need to install wxPython and properly configure it to work with their Python installation before they can use these GUI tools. This is fairly straightforward on Windows using the .MSI or .EXE (can't remember which it is right now) installer for wxPython, but on Linux, you'll need to know how to handle the tools that are used to build packages from source code, i.e. make, configure, etc. Also, wxPython is a medium-sized package - it took around an hour or two to fully build on my reasonably fast PC. So be patient (get yourself a coffee or two, or do something else in another Linux console / window while wxPython builds :-) Those who know even basic Python should be able to install and run both xtopdf v1.0 and the new stuff in v1.3, at least for the command-line tools (the programs are quite simple). Main SourceForge site for xtopdf v1.0: http://sourceforge.net/projects/xtopdf URL for xtopdf v1.3 on my web site: http://www.dancingbison.com/xtopdf-1.3.zip URL for xtopdf v1.0 on my web site: http://www.dancingbison.com/xtopdf-1.0.tar.gz wxPython site: http://wxpython.org xtopdf requires both Python and the open source version of the ReportLab toolkit. ReportLab site: http://www.reportlab.org xtopdf was developed using ReportLab v1.17, should work with all v1.x, may or may not work (not tested yet) with v2.x. More details (for Windows) are available in a guide here: http://itext.ugent.be/library/question.php?id=41 I'd appreciate any feedback, about bugs (v1.3 is tested but not a lot yet, that will be done in next some days), or how / what for anyone is using it. Apart from the "proper" packaging/documenting and upload to SourceForge (and my web site), I shall be writing and posting more about how to use it, etc. in the coming days. Enjoy, and Thanks Vasudev === Vasudev Ram Software consulting and training http://www.dancingbison.com === -- http://mail.python.org/mailman/listinfo/python-list
ANN: xtopdf: PDF creation / conversion toolkit: alpha release of v1.3
Hi group, xtopdf: PDF creation / conversion toolkit: alpha release of v1.3 This is actually a somewhat preliminary announcement, but may be of interest to developers / users who know Python and/or have earlier checked out my xtopdf PDF creation / conversion toolkit: I've released (via my web site, not yet properly packaged/documented and put on the SourceForge site, that will be done in some days), the next version of xtopdf: v1.3. This version adds support for conversion of CSV, TDV (Tab Delimited Values) and XLS (limited support) to PDF. v1.3 also adds some GUI tools written using wxPython (v1.0 had only command-line tools and a library for developers). Users/developers will need to install wxPython and properly configure it to work with their Python installation before they can use these GUI tools. This is fairly straightforward on Windows using the .MSI or .EXE (can't remember which it is right now) installer for wxPython, but on Linux, you'll need to know how to handle the tools that are used to build packages from source code, i.e. make, configure, etc. Also, wxPython is a medium-sized package - it took around an hour or two to fully build on my reasonably fast PC. So be patient (get yourself a coffee or two, or do something else in another Linux console / window while wxPython builds :-) Those who know even basic Python should be able to install and run both xtopdf v1.0 and the new stuff in v1.3, at least for the command-line tools (the programs are quite simple). Main SourceForge site for xtopdf v1.0: http://sourceforge.net/projects/xtopdf There are no releases between 1.0 and 1.3 :-) URL for xtopdf v1.3 on my web site: http://www.dancingbison.com/xtopdf-1.3.zip URL for xtopdf v1.0 on my web site: http://www.dancingbison.com/xtopdf-1.0.tar.gz wxPython site: http://wxpython.org xtopdf requires both Python and the open source version of the ReportLab toolkit. Python site: [You shouldn't be reading this group if you don't know the site :-), ok, maybe you're a newbie to Python and happened across this group;its http://www.python.org] ReportLab site: http://www.reportlab.org More details (for Windows) are available in a guide here: http://itext.ugent.be/library/question.php?id=41 I'd appreciate any feedback, about bugs (v1.3 is tested but not a lot yet, that will be done in next days), or how / what for anyone is using it. Apart from the "proper" packaging/documenting and upload to SourceForge (and my web site), I shall be writing and posting more about how to use it, etc. in the coming days. Enjoy, and Thanks Vasudev === Vasudev Ram Software consulting and training http://www.dancingbison.com === -- http://mail.python.org/mailman/listinfo/python-list
Re: Info on continuations?
Michael wrote: > vasudevram wrote: > > > > > Hi, > > > > I am Googling and will do more, found some stuff, but interested to get > > viewpoints of list members on: > > > > Continuations in Python. > > > > Saw a few URLs which had some info, some of which I understood. But > > like I said, personal viewpoints are good to have. > > Python doesn't really support continuations. Generators (and co-routines in > general) have similar properties to continuations, however they're not > continuations. Closures are also sometimes considered cousins to > continuations, and python's support for those is pretty good IMO. (again > however, closures are not continuations). > > Since it looks like you're also looking for what continuations are, I think > the following is the simplest way of explaining them. If you've ever > programmed in BASIC, *in a way* if you think of methods/functions as a > named GOSUB, then continuation (in a way) are a way of giving a name to a > goto (it's more subtle than that though since a continuation os often > defined to "remember" state in a similar way to a closure). Like a function > you can pass them round as objects. Like a generator/closure they remember > the state they were in. > > *Personally* , I think python NOT supporting full continuations is a GOOD > thing, since full continuations, whilst powerful, are also a great source > of confusion for people. (That said, I have a usecase I'd find them useful > for - I think they'd be useful for plugin architectures - but IMO that > doesn't outweigh the risk of code obfuscation :-) > > One particular usecase that people seem to like continuations for, > specifically how they're used in seaside, is actually a subset of > functionality that python *can* support (to a large extent). > > Essentially the idea is to be able to take a web application and make it > look linear. CherryFlow allows you for example to write this: > > @expose > @flow > def example_flow(): > yield view.first_page() > if request.args["choice"] == "a": > yield view.choice_a_page() > else: > yield view.choice_b_page() > yield view.last_page() > > (example from: http://tinyurl.com/qzpqu ) > > This causes the user's browser to show a page where they have a choice of > "a" or "b". Depending on what they choose, they then either are presented > with choice_a_page or choice_b_page. Finally, no matter which option they > chose, you are presented with the last page. > > Something similar can be done using Kamaelia, though at present only the > mechanism exists there, without any sugar (http://tinyurl.com/n3bh7 - > specifically websiteSessionExampleComponent). The reason I mention it is to > say that it's relatively simple to do using python :-) > > I have to stress though, this usage of continuations in Seaside, as > emulate-able in python is a subset of the full power of continuations, > which isn't available in python at present. (Though it's possible hacking > greenlets could result in something). (In fact the way seaside uses them as > far as I can tell is more to implement co-routine like behaviour than > anything else (!)) > > Anyway, hope that's interesting/useful - looking at your other comments, > you're just looking for information and usecases at the moment :-) > > Regards, > > > Michael. Yes, that's quite right - only looking for info and use cases at present - and thanks for the info, it was interesting and useful :-) Need to check all the inputs out ... Vasudev -- http://mail.python.org/mailman/listinfo/python-list
xtopdf: PDF creation / conversion toolkit: alpha release of v1.3
Hi group, xtopdf: PDF creation / conversion toolkit: alpha release of v1.3 This is actually a somewhat preliminary announcement, but may be of interest to developers / users who know Python and/or have earlier checked out my xtopdf PDF creation / conversion toolkit: I've released (via my web site, not yet properly packaged/documented and put on the SourceForge site, that will be done in some days), the next version of xtopdf: v1.3. This version adds support for conversion of CSV, TDV (Tab Delimited Values) and XLS (limited support) to PDF. v1.3 also adds some GUI tools written using wxPython (v1.0 had only command-line tools and a library for developers). Users/developers will need to install wxPython and properly configure it to work with their Python installation before they can use these GUI tools. This is fairly straightforward on Windows using the .MSI or .EXE (can't remember which it is right now) installer for wxPython, but on Linux, you'll need to know how to handle the tools that are used to build packages from source code, i.e. make, configure, etc. Also, wxPython is a medium-sized package - it took around an hour or two to fully build on my reasonably fast PC. So be patient (get yourself a coffee or two, or do something else in another Linux console / window while wxPython builds :-) Those who know even basic Python should be able to install and run both xtopdf v1.0 and the new stuff in v1.3, at least for the command-line tools (the programs are quite simple). Main SourceForge site for xtopdf v1.0: http://sourceforge.net/projects/xtopdf There are no releases between 1.0 and 1.3 :-) URL for xtopdf v1.3 on my web site: http://www.dancingbison.com/xtopdf-1.3.zip URL for xtopdf v1.0 on my web site: http://www.dancingbison.com/xtopdf-1.0.tar.gz wxPython site: http://wxpython.org xtopdf requires both Python and the open source version of the ReportLab toolkit. ReportLab site: http://www.reportlab.org More details (for Windows) are available in a guide here: http://itext.ugent.be/library/question.php?id=41 I'd appreciate any feedback, about bugs (v1.3 is tested but not a lot yet, that will be done in next days), or how / what for anyone is using it. Apart from the "proper" packaging/documenting and upload to SourceForge (and my web site), I shall be writing and posting more about how to use it, etc. in the coming days. Enjoy, and Thanks Vasudev === Vasudev Ram Software consulting and training http://www.dancingbison.com === -- http://mail.python.org/mailman/listinfo/python-list
Re: Recurse Directories and process files in directory
KraftDiner wrote: > Hi I need help writing a python script that traverses (recursivly) a > directory and its sub directories and processes all files in the > directory. So at each directory if there are files in it I must build > a list of those files and process them by exectuing a system command > (exec?) > > Can some one tell me what methods to use to: > a) Walk the directory tree > b) execute a system command with parameters. > > TIA. Hi, Try os.walk(). Don't remember the syntax right now, should be straightforward. Check the standard Python docs that come with your Python installation. Or start python and do: import os print os.walk.__doc__ And executing a system comand is os.system(...). Caveat: there can be security risks with system(). Depends how you use it and who you let use it with what arguments. Similar to risks with CGI forms. HTH ~~ Vasudev Ram xtopdf - PDF creation/converson toolkit: http://www.dancingbison.com/products.html ~~ -- http://mail.python.org/mailman/listinfo/python-list
Packt published an article about xtopdf - creating PDF from Plain Text, DBF, CSV, TDV, and XLS Data
Hi group, This is an article I wrote for Packt Publishing - http://www.packtpub.com : Using xtopdf, a PDF creation toolkit - http://www.packtpub.com/article/Using_xtopdf It shows how to use xtopdf - http://sourceforge.net/projects/xtopdf - to create PDF from plain text, DBF, CSV, TDV and XLS data. Use of both command-line and the GUI tools in xtopdf is covered. xtopdf is written in Python and requires the ReportLab toolkit. The GUI tools are written in wxPython - http://www.wxpython.org. Enjoy Vasudev Ram ~~ Software consulting and training http://www.dancingbison.com ~~ -- http://mail.python.org/mailman/listinfo/python-list
Re: Where can I find good python code?
Chris Lambacher wrote: > On Sat, Oct 14, 2006 at 01:08:37AM +0900, js wrote: > > Hi, > > > > I've learned basics of Python and want to go to the next step. > > So I'm looking for good python examples > > I steal good techniques from. > > > > I found Python distribution itself contains some examples in Demo directory. > > I spent some time to read them and > > I think they're good but seemed not so practical to me. > > > > Any recommendations? > A large portion of the standard library is pure python and of high > quality(thats how it made it there in the first place). The newer a module is > to the library, the better it will conform to current best practices. > > On Unix environments you can find the standard library in > $PREFIX/lib/python$VERSION/ where $PREFIX is often /usr but sometimes > /usr/local and version is the version you have installed (maybe 2.4 or 2.5?) > > On Windows you can find the standard library in c:\Python%VERSION%\Lib where > %VERSION% is the version you installed (maybe 24 or 25?) > > -Chris Try reading the code in this package: http://sourceforge.net/projects/xtopdf Not very idiomatic or Pythonic code (done when I was still fairly new to Python), but clear, well-commented - IMO, of course. Also it is a real-world, though small, app, with both end-user tools and a developer API. So you can play around with using and extending it, etc. - and its easy to understand too. Might help motivate the learning if you try to build something useful with it :-) HTH Vasudev Ram ~~ Software training and consulting Dancing Bison Enterprises http://www.dancingbison.com ~~ -- http://mail.python.org/mailman/listinfo/python-list
Using xtopdf, a PDF creation toolkit - Creating PDF Output from Plain Text, DBF, CSV, TDV, and XLS Data
Hi, Though I posted about this article earlier, reposting it with a more appropriate title, to make it easier for searches. "Using xtopdf, a PDF creation toolkit" URL: http://www.packtpub.com/article/Using_xtopdf This is an article by me, written for Packt Publishing, about how to use my xtopdf toolkit to create PDF from text, DBF, TDV, CSV and XLS data. xtopdf is available at http://www.dancingbison.com/products.html . Enjoy, and feel free to give your feedback on wanted features, bugs, etc. in xtopdf - its appreciated. Vasudev Ram ~~ Software consulting and training Dancing Bison Enterprises http://www.dancingbison.com "Now creating PDFs from Python is even easier" - Steve Holden http://del.icio.us/steve.holden/pdf ~~ -- http://mail.python.org/mailman/listinfo/python-list
Re: Has anyone generated Open Office Calc XML files from python
vj wrote: > I just found something in perl: > > http://tools.openoffice.org/profiling/pod/LogFile/XML.html > > Will try and reverse engineer this, unless something like this exists > in python. > > VJ Isn't generating CSV output suitable to your needs? Python's CSV module makes that very simple - unless you want to include images, etc. in the XLS file? Vasudev ~~ Vasudev Ram Dancing Bison Enterprises Software consulting and training, custom software development http://www.dancingbison.com http://sourceforge.net/projects/xtopdf ~~ -- http://mail.python.org/mailman/listinfo/python-list
Request new feature suggestions for my PDF conversion toolkit - xtopdf
Hi all, I had created this open source project - xtopdf - http://sourceforge.net/projects/xtopdf - some time ago. It's a toolkit to help with conversion of other file formats to PDF. The current tools in xtopdf are available as both end-user command-line tools, and as a library (in both procedural and object-oriented versions) for use by developers in their own apps. Its written in Python (needs V2.2 or higher) and uses the open source version of the Reportlab toolkit (http://www.reportlab.org - needs V1.17 or higher) for the PDF generation. Initially I had included support for plain text and .DBF (XBase) files as input formats. The current version of xtopdf is 1.0 and is in a stable state. Recently I've added support for CSV and ODBC as input formats (still to be uploaded to the site, after some cleanup, refactoring and testing). I also have a few other related enhancements / extensions which I'm working on, and will mention on this group after getting at least a proof-of-concept working. Meanwhile, please give your suggestions for additional features or input formats for xtopdf. I can't promise to implement all (or any) of them - depends on the feasibility, how easy or difficult I find it, and so on, but will consider all reasonable suggestions seriously and see if I can implement some of them. I'd also welcome comments on the xtopdf code itself, from people who know Python well. I wrote it soon after learning a little Python, so it may not be written in a very Pythonic or idiomatic style. As I go along, I plan to incorporate more Pythonic style of doing things into the code, including stuff like new-style classes, generators/yield, etc. - anything that makes sense and seems appropriate, not just for the sake of adding it. I'll create a Credits page in the xtopdf tarball and site, and give due credit to anyone who suggests features, input formats, or code improvements (or reports bugs:-). Thanks! ----- Vasudev Ram ----- Personal site: http://www.geocities.com/vasudevram Open source projects: http://sourceforge.net/projects/xtopdf - tools for conversion of other file formats to PDF http://sourceforge.net/projects/xtopdf - tools for conversion of other file formats to RTF Profile and way to contact me: http://www.gojobby.com/Jobby/Resume/?user=454 Blog on software innovation: http://jugad.livejournal.com ----- -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython: where is the demo?
John Salerno wrote: > I just realized that after installing wxPython, it did not add the usual > menu item to my Start menu (Windows), where I can access the docs and > demo. I searched through the wxPython folder in the site-packages > directory, but I can't seem to find it. > > Anyone know how I can get this back? > > Thanks. Its a separate download. See: http://wxpython.org/download.php#binaries Look down the page to the section Prebuilt Binaries - MS Windows - Docs, Demos, Samples. The direct link is: http://prdownloads.sourceforge.net/wxpython/wxPython2.6-win32-docs-demos-2.6.3.2.exe HTH Vasudev Ram Independent software consultant "On a clear day you can see the blue screen of death" - Me :-). http://www.geocities.com/vasudevram -- http://mail.python.org/mailman/listinfo/python-list
Re: Request new feature suggestions for my PDF conversion toolkit - xtopdf
> Thanks! You're welcome. > So here is an idea for a great enhancement: > rst -> PDF What is rst? I Googled for it, first few hits found didn't make sense (like Remote Sensing Tutorial :-). The one that did seem to make sense (in relation to xtopdf), was this : http://docutils.sourceforge.net/rst.html i.e. reStructured Text. Is that the one you mean? - Vasudev David Isaac wrote: > "vasudevram" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > http://sourceforge.net/projects/xtopdf > > Serendipity: > I was just looking for this functionality. > Thanks! > > So here is an idea for a great enhancement: > rst -> PDF > The good news: the project is all Python, > so you will only have to write a writer! > (But to make this great: support stylesheets!) > > Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list
Re: convert .pdf files to .txt files
If you don't already have xpdf, you can get it here: http://glyphandcog.com/Xpdf.html Install it and then try what Baiju said, should work. I've used it, its good, that's why I say it should work. If any problems, post here again. --- Vasudev Ram Independent software consultant Personal site: http://www.geocities.com/vasudevram PDF conversion tools: http://sourceforge.net/projects/xtopdf --- Baiju M wrote: > Davor wrote: > > Hi, my name is david. > > I need to read information from .pdf files and convert to .txt files, > > and I have to do this on python, > > If you have 'xpdf' installed in your system, > 'pdftotext' command will be available in your system. > > Now to convert a pdf to text from Python use system call. > For example: > > import os > os.system("pdftotext -layout my_pdf_file.pdf") > > This will create 'my_pdf_file.txt' file. > > Regards, > Baiju M -- http://mail.python.org/mailman/listinfo/python-list
Re: PIL problem after installation
Probably the jpeg library - libjpeg is not present on your system. Search Google for it, then download and install it. Try http://rpmfind.net also to find it: http://rpmfind.net/linux/rpm2html/search.php?query=libjpeg&submit=Search+... But Fredrik's advice is very good - whenever installing a software package, make sure to read the installation guide, release notes, etc - carefully, and then do accordingly. This can save you a lot of time and rework. --- Vasudev Ram Independent software consultant Personal site: http://www.geocities.com/vasudevram PDF conversion tools: http://sourceforge.net/projects/xtopdf --- Fredrik Lundh wrote: > Lad wrote: > > > I installed PIL under Linux but now when I try it I get the error: > > > > decoder jpeg not available > > How can I correct that problem? > > if you built PIL yourself, the setup script told you how to fix this. > > - make sure you have right libraries installed (see the >"prerequisites" section in the README) > > - run setup and read the BUILD SUMMARY report carefully > > - if the setup script cannot find a component, you'll have to edit >the setup.py file and set the appropriate ROOT variable. see in- >structions in the setup.py file for details. > > if you got a binary release, complain to the distributor. > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Bridge: Ruby to Python communication
[EMAIL PROTECTED] wrote: > Hello all. I want a ruby and a python module to be able to communicate > with each other, access classes, instances and the like. Is there a > bridge for this? I'm aware of rupy, but the documentation seems rather > inadequate for the uninitiated. Are there other libraries/bridges or > maybe a rupy tutorial? Thank you. Hi, Don't know if there is a specific Ruby/Python bridge, but one way that will work for some needs is to use XML-RPC. Its not very difficult to understand and to program. XML-RPC is a lightweight distributed computing method, much simpler than say, CORBA. Also has less features, but may suffice for your needs. It has support for many languages and, as long as the needed libraries are there for your language, you can use any language for the client and any language for the server. I know for sure that XML-RPC supports Python and have used it with Python myself. Check out http://xmlrpc.com (and also Google for more resources on this topic) to learn more, download source code examples, and to check if there is Ruby support for it. HTH Vasudev Ram Independent software consultant http://www.geocities.com/vasudevram PDF conversion tools: http://sourceforge.net/projects/xtopdf -- http://mail.python.org/mailman/listinfo/python-list
Re: Linux info
os.system('ls -lL ' + path) should also work. But check, I may be wrong about the L option, and am not near a Linux system right now. That's "lL" - a small letter l (ell) followed by a capital letter L in the ls options above. This way may be slower than os.path.realpath if that is implemented as a system call, i.e.via Python ->C->Linux kernel, which it probably is. Slower since my way given above will create a new process to run the ls command in. Just mentioning it as another way, plus, it does have the small benefit that it'll work the same way on any other language such as Perl, Ruby, etc., which supports something similar to os.system(). Vasudev Ram http://www.geocities.com/vasudevram PDF conversion tools: http://sourceforge.net/projects/xtopdf faulkner wrote: > os.path.realpath > > TheSaint wrote: > > Hello there, > > > > I still learning, but I couldn't find anything which tells me where a > > symlink is pointing to. > > A part of os.system('ls -l ' + path) and cutting down to the need, I haven't > > got any specialized function. > > > > F -- http://mail.python.org/mailman/listinfo/python-list
Re: Python database access
The odbc module is part of the Python Standard Library. So you can search for docs on using it in the Python2x.chm help file (or the HTML version of the same docs) that comes with the Windows Python disttribution. Its quite easy to use ODBC from Python, at least for simple tasks like "select * from tablename". Vasudev Ram http://www.geocities.com/vasudevram PDF conversion toolkt: http://sourceforge.net/projects/xtopdf BartlebyScrivener wrote: > > But I don't know how to make the connectivity or rather which module to > > import. > > Try mxODBC > > http://www.egenix.com/files/python/mxODBC.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Python database access
Yes, Steve is right. Sorry for the mistake. In my case, I don't use Active Python, I use the vanilla Python for Windows (the .msi installer from python.org) and then immediately install the win32all package, link to which is usually on the same page as the MSI. I do this as a routine, whenever I upgrade my Windows Python version. Mainly use win32all for the PythonWin IDE (a pretty decent one, particularly the debugging support) which comes with it, though the win32all package also has some support for using COM from Python. So when I did an "import ODBC", since I had not separately installed an ODBC module, I thought it was part of the Standard Library - whereas its a part of win32all. Vasudev --- Vasudev Ram Independent software consultant Personal page: http://www.geocities.com/vasudevram PDF conversion toolkit: http://sourceforge.net/projects/xtopdf (written in Python, requires Python v2.2 or higher, ReportLab toolkit (http://www.reportlab.org) v1.17 or higher). Blog on software innovation: http://jugad.livejournal.com --- Steve Holden wrote: > Damjan wrote: > >>The odbc module is part of the Python Standard Library. > > > > > > Since when? > > > > > Nope, it's a standard part of Mark Hammond's win32all extensions. As > such it probably comes with ActivePython for Windows, which many people > use as their standard distro. > > 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 2.4 tutorial
Try: Dive into Python (for experienced programmers): http://diveintopython.org A Byte of Python (for beginning programmers): http://www.byteofpython.info/ Both are good. Vasudev --- Vasudev Ram http://www.geocities.com/vasudevram PDF conversion toolkit (written in Python) http://sourceforge.net/projects/xtopdf --- BartlebyScrivener wrote: > Search the group for "tutorial" > > http://tinyurl.com/h5obg > > Or look here > > http://wiki.python.org/moin/BeginnersGuide/NonProgrammers > > Ask better questions. > > http://www.catb.org/esr/faqs/smart-questions.html > > Are you a programmer or a nonprogrammer? > > rd -- http://mail.python.org/mailman/listinfo/python-list
Re: Can I do it using python?? about xterm and telnet
Just FYI - pexpect is a Python app that works like Expect - which is by Don Libes and written in TCL. Expect comes with most Linux distributions and is available for most UNIX / Linux versions from its web site http://expect.nist.gov/ The expect man page is enough to get started for simple needs, such as yours appears to be. You might want to play around with the original Expect a bit and then try out pexpect - or you could just use Expect itself for your needs. HTH Vasudev --- Vasudev Ram Independent software consultant http://www.geocities.com/vasudevram PDF conversion toolkit: http://sourceforge.net/projects/xtopdf --- faulkner wrote: > try pexpect. > http://pexpect.sourceforge.net/ > > valpa wrote: > > I'm a net admin for about 20 unix servers, and I need to frequently > > telnet on to them and configure them. > > It is a tiring job to open a xterm and telnet, username, password to > > each server. > > > > Can I do it automatically by python? After that, there have 20 xterm > > consoles opened and telneted to their corresponding servers. Then I > > could start to type command in these xterms. > > > > Any suggestion appreciate. Much thanks. -- http://mail.python.org/mailman/listinfo/python-list
Publishing ODBC database content as PDF
Publishing ODBC database content as PDF: A blog post by me on how to do this, using my PDF conversion toolkit, xtopdf. This is sample code from my next upcoming release of xtopdf, which will support more input formats, such as CSV, XLS, TDV and ODBC data. http://jugad.livejournal.com/2006/07/07/ Enjoy, and feedback welcome. Vasudev Vasudev Ram http://www.geocities.com/vasudevram PDF conversion toolkit: http://sourceforge.net/projects/xtopdf -- http://mail.python.org/mailman/listinfo/python-list
Re: Publishing ODBC database content as PDF
Oops: The source indentation - tabs - is removed in the blog post, by the LiveJournal software. You will need to insert them at the appropriate places, for which you will need to know Python and understand the code, at least the overall logic. I'll post the code as a zip file (with some other samples) on one of my sites, and then put a link to it here. - Vasudev. vasudevram wrote: > Publishing ODBC database content as PDF: > > A blog post by me on how to do this, using my PDF conversion toolkit, > xtopdf. > This is sample code from my next upcoming release of xtopdf, which will > support more input formats, such as CSV, XLS, TDV and ODBC data. > > http://jugad.livejournal.com/2006/07/07/ > > Enjoy, and feedback welcome. > Vasudev > > Vasudev Ram > http://www.geocities.com/vasudevram > PDF conversion toolkit: > http://sourceforge.net/projects/xtopdf > -- http://mail.python.org/mailman/listinfo/python-list
Re: Generating a PDF file on Linux (try using xtopdf)
George Adams wrote: > Sorry for what is probably a very basic question... > > I have a database of contact info data (names, addresses, phone, etc.) > I want to take that data and generate a printable booklet-form directory > that can be handed out to people. > > So the database may look something like this: > >FNAME,LNAME,ADDRESS,HOMEPHONE,WORKPHONE,HOMEEMAIL,WORKEMAIL > >"George","Adams","123 Faketreet", >NULL,"555-1212",NULL,"[EMAIL PROTECTED]" > >"John","Doe","456 Nowhere Lane", >"555-","555-","[EMAIL PROTECTED]","[EMAIL PROTECTED]" > > > and I want the printable output to "look" something like this: > >Adams, George >123 Fake Street >Work phone: 555-1212 >Work e-mail: [EMAIL PROTECTED] > >Doe, John >456 Nowhere Lane >Home phone: 555- >Work phone: 555- >Home e-mail: [EMAIL PROTECTED] >Work e-mail: [EMAIL PROTECTED] > > I can use a scripting language like Perl to handle any programming logic > I may need (such as not printing out a line for any fields that are > empty in the database). What I don't know is how to generate a nicely > formatted PDF file containing the line breaks, red text, bold text, etc. > that's ready for printing. > > Can anyone point me to the tool I need to make this happen? (maybe it's > a Perl module? Maybe a standalone tool that takes my pseudocode > and turns it into valid PDF code?) > > Thanks to anyone who can help! My xtopdf toolkit may be of help. It has both end-user tools (some command-line, some GUI (using wxPython (v 2.6 or higher needed)), and an API for developers. Both the tools and the API are quite easy to use. Check the links here: http://www.dancingbison.com This page has a link to an article I wrote for Packt Publishing (http://www.packtpub.com), on how to use xtopdf to generate PDF from CSV data - which is the kind you have. You can use the article and the accompanying code (links available in the article) as a model for your needs. http://www.dancingbison.com/products.html This page has links to get xtopdf, a guide to installing and using it (on Windows), etc. xtopdf is cross-platform, works on both Linux and Windows. I haven't yet written a Linux-specific install and use guide, but the generic instructions in the README should suffice if you know Linux some, how to install software on it, and how to set up additional Python libraries on it. You can also post here if you have problems making xtopdf work on Linux, and I'll try to help. (I developed and tested it on Linux, then tested it on Windows, so it should work ok on Linux). xtopdf is written in Python (http://www.python.org, needs v2.2 or higher) and uses the open source version of the ReportLab toolkit (http://www.reportlab.org, needs v1.17 or higher, but use the 1.x series, its not tested with Reportlab v2.x, though it might work with it). IMO, Python is easier to learn and develop in than Perl, so if you say you can do it in Perl, you should be able to do it in Python. To get the line breaks you can write code to read each cell of each row of the CSV file, and put the line breaks wherever you want to. For color changes, its a little more difficult - though the ReportLab toolkit supports colors, I didn't expose that support in the xtopdf API, though I may in future. (I did expose the ability to set the font for any chunk of text, though). If you don't mind digging into the source, you can try making the changes to allow colors to be specified for arbitrary chunks of text, as per your need. It shouldn't be too difficult, since the code is written for understandability, and there are enough comments. The CSV and other new formats support (TDV, XLS) is alpha and may have some bugs. Also, CSV is know to be a variable format - different products like different spreadsheets, generate various "dialects" of it. I've not (yet) tested the CSV support with many differing CSV dialects, only with the MS Excel format of Office 2000. Feel free to let me know if you find any bugs. If you make the changes for color support, do consider sending them to me, to include in the next release of xtopdf. Otherwise, I'll probably add it myself. HTH Vasudev Ram Software training and consulting http://www.dancingbison.com 10.times say "Truly rural" -- http://mail.python.org/mailman/listinfo/python-list
Hot new programming languages - according to the TIOBE index
Interesting post by voidspace. Ruby and Python are doing well, according to the latest TIOBE index. Java, C and C++ and 1, 2 and 3 on the list http://jugad.livejournal.com/2006/09/29/ Vasudev Ram http://www.dancingbison.com P.S. Dunno why "hot new" though - not too many of them are new. More like "newly hot" ... :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Has anyone generated Open Office Calc XML files from python
vj wrote: > > Isn't generating CSV output suitable to your needs? > > Python's CSV module makes that very simple - unless you want to include > > images, etc. in the XLS file? > > You cannot create multiple worksheets using this method, or apply any > other form of formatting. > > VJ Ok, got it. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python work in UK
Hi, A few suggestions, you may have tried them already: Search for UK Python jobs on major job sites like Monster, Dice, etc. Some (like Monster) have country-specific sites, I think. I know Monster has an India-specific site, it probably also has one for the UK. Have you considered the option of being a freelancer and working via Net job sites like eLance, Guru.com, oDesk? Also check out the Python job board at http://www.python.org/community/jobs/ HTH Vasudev --- Site: http://www.dancingbison.com Blogs: http://jugad.livejournal.com http://dancingbison.blogspot.com Open source project: http://www.dancingbison.com/products.html --- Will McGugan wrote: > Hi, > > I'd love to work in Python, for the sake of my blood pressure, but there > doesnt seem to be that many jobs that look for Python as the main skill. > I use Python at work from time to time, and occasionaly get to spend > several days on a Python project but the majority of the time I use C++. > How can I make that leap to working with Python? There doesn't seem to > be many UK positions on the jobs section of Python.org or the usual jobs > sites. Any recommended jobs sites or tips? (I have googled) > > In the off chance that a potential empolyer is reading this, I'm looking > for something in web development, applications, graphics or other > interesting field. Here is a copy of my CV. > > http://www.willmcgugan.com/cvwillmcgugan.pdf > > Regards, > > Will McGugan > -- > http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Book recommendations
>Can someone recommend a Python book for a newbie and perhaps you have a used one for sale? Thank you. A Byte of Python is supposed to be good for beginners too. See http://www.byteofpython.info/ Its also a recommended book on the main Python site www.python.org >From the preface: "This book serves as a guide or tutorial to the Python programming language. It is mainly targeted at newbies (those who are new to computers). It is also useful for experienced programmers who are new to Python. The aim is: If all you know about computers is how to open and save text files, then you should be able to learn Python from this book. If you have previous programming experience, then this book should be useful to get you up to speed on Python. " HTH Vasudev ~~~ Vasudev Ram Software consulting and training Dancing Bison Enterprises http://www.dancingbison.com http://jugad.livejournal.com http://dancingbison.blogspot.com ~~~ -- http://mail.python.org/mailman/listinfo/python-list
Re: SOAP Server with WSDL?
Ravi Teja wrote: > tobiah wrote: > > Actually, do I have to make a WSDL? Do people hand write these, or > > are there tools? I don't really need to publish an interface. I just > > want some in house apps to communicate. > > Java and .NET based tools can auto-generate WSDL from code. Python does > not have such because function definitions do not contain the type > information required for such a tool. However , you can grab a free > Java (Netbeans with Enterprise pack) or .NET (Visual Studio Express) > IDE (or just the respective SDK if you don't mind reading through the > docs), create a stub function, mark it as a WebMethod, let it generate > the WSDL and pass it to wsdl2py that comes with ZSI. This is a twisted > approach. > > But you state that you don't need to publish an interface. If that is > the case, it can be as simple as this. > > import SOAPpy > def hello(): > return "Hello World" > > server = SOAP.SOAPServer(("localhost", 8080)) > server.registerFunction(hello) > server.serve_forever() > > Pasted from > http://pywebsvcs.sourceforge.net/soappy.txt > > > I can't figure out if I want SOAP, or CORBA, or would it just be > > easier if I just starting opening sockets and firing data around > > directly. Ideally, I'd like to share complex objects. That's why > > I thought that I needed one of the above standards. > > I posted a few days ago a simple guide to choosing a remoting > framework. > http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/f53221adfca5c819/58057e83c0ad7c27?rnum=1&hl=en&q=webraviteja&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2Ff53221adfca5c819%2F3f056c5c87279aca%3Flnk%3Dgst%26q%3Dwebraviteja%26rnum%3D4%26hl%3Den%26#doc_3f056c5c87279aca > > For *complex* objects, you need a stateful remoting mechanism. The > choice is Pyro if both the server and all the clients are written in > Python. Else, use CORBA or ICE with DMI. All of these are simple to use > for simple remote object invocations although distributed computing in > general does have a learning curve. > > Ravi Teja. -- http://mail.python.org/mailman/listinfo/python-list
Re: Sybase module 0.38pre1 released
Sébastien Sablé wrote: > WHAT IS IT: > > The Sybase module provides a Python interface to the Sybase relational > database system. It supports all of the Python Database API, version > 2.0 with extensions. > > MAJOR CHANGES SINCE 0.37: > > * This release works with python 2.5 > > * It also works with sybase 15 > > * It works with 64bits clients > > * It can be configured to return native python datetime objects > > * The bug "This routine cannot be called because another command > structure has results pending." which appears in various cases has > been corrected > > * It includes a unitary test suite based on the dbapi2.0 compliance > test suite Hi, Where can we get it? Thanks Vasudev -- Vasudev Ram Dancing Bison Enterprises Software consulting and training http://www.dancingbison.com http://dancingbison.blogspot.com http://jugad.livejournal.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Sybase module 0.38pre1 released
Sébastien Sablé wrote: > By the way, I forgot to say that new releases can now be downloaded > from this page: > > https://sourceforge.net/project/showfiles.php?group_id=184050 > > regards > > -- > Sébastien Sablé > Thanks. Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: removing the header from a gzip'd string
Fredrik Lundh wrote: > Gabriel Genellina wrote: > > > Using the default options ("deflate", default compression level, no > > custom dictionary) will make those first two bytes 0x78 0x9c. > > > > If you want to encrypt a compressed text, you must remove redundant > > information first. > > encryption? didn't the OP say that he *didn't* plan to decompress the > resulting data stream? > > > Knowing part of the clear message is a security hole. > > well, knowing the algorithm used to convert from the original clear > text to the text that's actually encrypted also gives an attacker > plenty of clues (especially if the original is regular in some way, > such as "always an XML file" or "always a record having this format"). > sounds to me like trying to address this potential hole by stripping > off 16 bits from the payload won't really solve that problem... > > Yes, I'm also interested to know why the OP wants to remove the header. Though I'm not an expert on the zip format, my understanding is that most binary formats are not of much use in pieces (though some composite formats might be, e.g. you might be able to meaningfully extract a piece, such as an image embedded in a Word file). I somehow don't think a compressed zip file would be of use in pieces (except possibly for the header itself). But I could be wrong of course. Vasudev Ram http://www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: How a script can know if it has been called with the -i command line option?
Peter Wang wrote: > Michele Simionato wrote: > > The subject says it all, I would like a script to act differently when > > called as > > $ python script.py and when called as $ python -i script.py. I looked > > at the sys module > > but I don't see a way to retrieve the command line flags, where should > > I look? > > I realize this is quite a hack, but the entire command line is > preserved in the process's entry in the OS's process table. if you do > "ps -ax" you will see that the interpreter was invoked with -i. I > didn't test this under windows, but it works on Mac and Linux. That hack might not work - at least, as described, and on Linux or Mac OS if the UNIX-based one, i.e. OS X). Because there could be other users who ran python command lines with or without the -i option. As described, there's no way for this user to know which python invocation is his/hers, and which are of other users. There might be a way, though, if we can get this user's python instance's process id and then grep for a line containing that id (in the appropriate column) in the ps output. Vasudev Ram ~~ Dancing Bison Enterprises http://www.dancingbison.com http://dancingbison.blogspot.com ~~ Check out the cool Snap.com preview feature on my web site. Free signup for anyone at www.snap.com I'm not affiliated with it. -- http://mail.python.org/mailman/listinfo/python-list
Re: Elliptic Curve Library
Mike Tammerman wrote: > Hi, > > I need an elliptic curve library that can be used by python. I googled > but couldn't find a one. I'll appreciate, if you could show me. > > Mike What is the library you need supposed to do? Vasudev Ram Dancing Bison Enterprises www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: How a script can know if it has been called with the -i command line option?
vasudevram wrote: > Peter Wang wrote: > > Michele Simionato wrote: > > > The subject says it all, I would like a script to act differently when > > > called as > > > $ python script.py and when called as $ python -i script.py. I looked > > > at the sys module > > > but I don't see a way to retrieve the command line flags, where should > > > I look? > > > > I realize this is quite a hack, but the entire command line is > > preserved in the process's entry in the OS's process table. if you do > > "ps -ax" you will see that the interpreter was invoked with -i. I > > didn't test this under windows, but it works on Mac and Linux. > > That hack might not work - at least, as described, and on Linux or Mac > OS if the UNIX-based one, i.e. OS X). Because there could be other > users who ran python command lines with or without the -i option. As > described, there's no way for this user to know which python invocation > is his/hers, and which are of other users. There might be a way, > though, if we can get this user's python instance's process id and then > grep for a line containing that id (in the appropriate column) in the > ps output. > > Vasudev Ram > ~~ > Dancing Bison Enterprises > http://www.dancingbison.com > http://dancingbison.blogspot.com > ~~ > Check out the cool Snap.com preview feature on my web site. > Free signup for anyone at www.snap.com > I'm not affiliated with it. Just realized: getting the python process's process id is possible from the Python program itself, using os.getpid(). Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: Connection python with C
Fredrik Lundh wrote: > Χρυσάνθη Αϊναλή wrote: > > > I want to connect a script in python with a source code in C. Any > > ideas about it? > > http://docs.python.org/lib/module-ctypes.html > http://docs.python.org/ext/ext.html > http://effbot.org/pyfaq/extending-index.htm > > Just a suggestion: another way could be to use XML-RPC. It's a lightweight distributed computing technology. Python standard library has an XML-RPC module. I'm not sure, but I think there may be a similar module for C. I'm almost certain there is one for C++. Try xmlrpc.com or xml-rpc.com and also Google for appropriate patterns, e.g. "XML-RPC library for C". Try a few variations on the pattern, that helps. Yet another way - might be suitable only if your Python script and your C program can both read/write standard input/output, and one is a producer and the other is the related consumer. In this case you can just use: $ python my_python_script | my_C_binary or the other way around, as per need. HTH Vasudev ~ Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com Check out the cool Snap.com link preview feature on my site. Free sign-up at www.snap.com I'm not affiliated with Snap.com ~ -- http://mail.python.org/mailman/listinfo/python-list
Saw a possibly interesting Python PDF library - pyPDF
Saw a possibly interesting Python PDF library - pyPDF. For merging/splitting PDFs and related operations. It's at http://pybrary.net/pyPdf/ HTH Vasudev ~ Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com Check out the cool Snap.com link preview feature on my site. Free sign-up at www.snap.com I'm not affiliated with Snap.com ~ -- http://mail.python.org/mailman/listinfo/python-list
Re: Elliptic Curve Library
Jaap Spies wrote: > Mike Tammerman wrote: > > > I need an elliptic curve library that can be used by python. I googled > > but couldn't find a one. I'll appreciate, if you could show me. > > > > You could look at http://sage.scipy.org/sage/ > http://sage.scipy.org/sage/features.html > > Jaap Sorry, don't know about those areas. Hope the other reply is of help. Vasudev www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: db access
king kikapu wrote: > On Dec 29, 12:12 am, johnf <[EMAIL PROTECTED]> wrote: > > king kikapu wrote: > > > Hi to all, > > > > > is there a way to use an RDBMS (in my case, SQL Server) from Python by > > > using some built-in module of the language (v. 2.5) and through ODBC ?? > > > I saw some samples that use statements like "import dbi" or "import > > > odbc" but neither modules (dbi, odbc) are present on my system... > > > > > Any hint(s) ?? > > Its not really related to your question, but if you also want to publish your database data to PDF, here's one way: http://mail.python.org/pipermail/python-list/2006-July/392099.html Vasudev ~~ Vasudev Ram Dancing Bison Enterprises Software training and consulting http://www.dancingbison.com http://www.dancingbison.com/products.html ~~ -- http://mail.python.org/mailman/listinfo/python-list
Re: python unix install, sqlite3
On May 29, 11:40 pm, Simon <[EMAIL PROTECTED]> wrote: > On May 29, 7:05 am, vasudevram <[EMAIL PROTECTED]> wrote: > > > > > > > On May 29, 5:52 pm, Simon <[EMAIL PROTECTED]> wrote: > > > > I installed the source code on unix for python 2.5.1. The install went > > > mainly okay, except for some failures regarding: > > > _ssl, _hashlib, _curses, _curses_panel. > > > > No errors regarding sqlite3. > > > However, when I start python and do an import sqlite3 I get: > > > > /ptmp/bin/> python > > > Python 2.5.1 (r251:54863, May 29 2007, 05:19:30) > > > [GCC 3.3.2] on sunos5 > > > Type "help", "copyright", "credits" or "license" for more information.>>> > > > import sqlite3 > > > > Traceback (most recent call last): > > > File "", line 1, in > > > File "/ptmp/Python-2.5.1/lib/python2.5/sqlite3/__init__.py", line > > > 24, in > > > from dbapi2 import * > > > File "/ptmp/Python-2.5.1/lib/python2.5/sqlite3/dbapi2.py", line 27, > > > in > > > from _sqlite3 import * > > > ImportError: No module named _sqlite3 > > > Some ideas: > > > I don't know if sqlite3 comes bundled with the standard Python source > > bundle. My guess is not. If not, that's the cause of the error - you > > need to install sqlite3 (and probably pysqlite3 (not sure of the name > > (whether it has a trailing 3) which, if I remember, is the Python > > binding/wrapper for sqlite3 (which is a C library, I think). Other > > possible cause of the error (if sqlite3 _is_ bundled with Python and > > no Python binding/wrapper is needed, is that sqlite3 depends on one of > > those other libraries you mention (such as _hashlib) for which you got > > errors while installing Python from source. > > > HTH > >VasudevRam > > Dancing Bison Enterpriseswww.dancingbison.com-Hide quoted text - > > > - Show quoted text - > > Vasudev, > Thanks so much for the reply. I went to their website and your guess > was correct. Python 2.5 has included support for sqlite but it only > includes the PySqlite interface module (now called sqlite3). It does > not include sqlite3 with the source distribution. > > Simon You're welcome, Simon. Good to hear that it worked :-) Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Do eval() and exec not accept a function definition? (like 'def foo: pass) ?
Hi group, Question: Do eval() and exec not accept a function definition? (like 'def foo: pass) ? I wrote a function to generate other functions using something like eval("def foo: ") but it gave a syntax error ("Invalid syntax") with caret pointing to the 'd' of the def keyword. Details (sorry for the slight long post but thought it better to give more details in this case - wording is pretty clear, though, I think, so shouldn't take long to read): While working on a personal project for creating a server for a certain protocol (which I may make into an open source project later if it turns out to be any good), I wrote some simple functions to generate HTML start and end tags like , , , , etc. - just to simplify/shorten my code a little. (I'm aware that there are HTML generation libraries out there, but don't think I need the overhead, since my needs are very simple, and anyway wanted to roll my own just for fun. For a bigger/more serious project I would probably use the existing libraries after doing a proper evaluation). So, this question is not about HTML generation but about Python's eval() function and exec statement. Started by writing functions like this: def start_html(): return '\r\n' def end_html(): return '\r\n' ... and similarly for the 'body', 'p', etc. HTML tags. (I used '\r\n' at the end because the server will send this output to the browser over HTTP, so that my code conforms to Internet protocols, and also so that while debugging, my output would have only one tag per line, for readability. Not showing the '\r\n in the rest of the code below) Then I realized that all these functions are very similar - only differ in the return value of the tag. So (being interested in metaprogramming of late), thought of writing a function that would generate these functions, when passed the appropriate tag name argument. [ Digression: I could of course have used another simple approach such as this: def start_tag(tag_name): return '<' + tag_name + '>' # called like this: # print start_tag('html') # print start_tag('body') # and def end_tag(tag_name): return '' # called like this: # print end_tag('body') # print end_tag('html') # and called similarly for the other HTML tags. While the above would work, it still would involve a bit more typing than I'd like to do, since I'[d have to pass in the tag name as an argument each time. I'd prefer having functions that I could call like this: print start_html() # which would print "" print start_body() # which would print "" # and so on ... just to make the code a little shorter and more readable. End of Digression] So, I wrote this code generation function: # import string def generate_html_tag_function(tag_name, start_or_end): start_or_end.lower() assert(start_or_end in ('start', 'end')) if start_or_end == 'start': func_def = "def start_" + tag_name + ":()\n" + \ "return '<' + tag_name + '>' else: func_def = "def end_" + tag_name + ":()\n" + \ "return '' function = eval(func_def) return function # meant to be called like this: start_html = generate_html_tag_function('html', 'start') start_body = generate_html_tag_function('body', 'start') end_html = generate_html_tag_function('html', 'end') end_body = generate_html_tag_function('body', 'end') # and the generated functions would be called like this: print start_html() print start_body() print end_body() print end_html() # # giving the output: But when I ran the above code (between the lines marked # and #), I got an error "Invalid syntax" with the caret pointing at the "d" of the def statement. I had used eval a few times earlier for somewhat similar uses, so thought this would work. I then looked up the Python Language Reference help, and saw that eval is used to evaluate Python expressions, not statements, and def is a statement. So looked up the exec statement of Python and saw that its syntax seemed to allow what I wanted. So replaced the line containing eval in the above with: exec(func_def) But that too gave the same error (I think so - I tried this yesterday and forgot to save the error messages, sorry about that, so can't be sure, but do think this was the case - if not, I'll save the exact code and output/errors later and repost here - not at my PC right now.) Thanks for any suggestions, Vasudev Ram Bize site: http://www.dancingbison.com PDF creation / conversion toolkit: http://sourceforge.net/projects/xtopdf Blog on software innovation: http://jugad.livejournal.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Do eval() and exec not accept a function definition? (like 'def foo: pass) ?
On Jun 24, 1:20 am, Eduardo Dobay <[EMAIL PROTECTED]> wrote: > Hey, > > I think you could use lambda functions for that matter (Ever heard of > them?). You could write something like: > > def generate_html_tag_function(tag_name, start_or_end): >start_or_end.lower() >assert(start_or_end in ('start', 'end')) >if start_or_end == 'start': >function = lambda: '<' + tag_name + '>' >else: >function = lambda: '' >return function > > Then you would create the functions using the same code you had > written before: > > start_html = generate_html_tag_function('html', 'start') > start_body = generate_html_tag_function('body', 'start') > end_html = generate_html_tag_function('html', 'end') > end_body = generate_html_tag_function('body', 'end') > > That seems to do what you want. > > Eduardo Thanks to all the repliers. @Eduardo: Yep, I had heard of lambdas, but didn't think to use them here. Will try this out - thanks! - Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: Do eval() and exec not accept a function definition? (like 'def foo: pass) ?
On Jun 24, 6:28 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Sun, 24 Jun 2007 11:17:40 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >On Sat, 23 Jun 2007 19:58:32 +, vasudevram wrote: > > >> Hi group, > > >> Question: Do eval() and exec not accept a function definition? (like > >> 'def foo: pass) ? > > >eval() is a function, and it only evaluates EXPRESSIONS, not code blocks. > > Actually, that's not exactly true: > > >>> x = compile('def foo():\n\tprint "hi"\n', '', 'exec') > >>> l = {} > >>> eval(x, l) > >>> l['foo']() > hi > >>> > > Jean-Paul Thanks, all. Will check out the replies given. - Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: automatical pdf generating
On Jun 24, 10:03 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-06-24, Jackie <[EMAIL PROTECTED]> wrote: > > > For each folder, I want to print the 4 pictures into a single-paged > > pdf file (letter sized; print horizontally). All together, I want to > > get 50 pdf files with names: 01.pdf,02.pdf,...,50.pdf. > > > Is it possible to use Python to realized the above process? > > Yes. > > > I know there is a module named "reportlab". Is there any easy > > command in the module to do my job? > > Yes. > > http://www.reportlab.org/rl_toolkit.htmlhttp://www.reportlab.com/docs/userguide.pdf > > -- > Grant Edwards grante Yow! You mean you don't > at want to watch WRESTLING >visi.comfrom ATLANTA? There are many different ways to do what you want, as the other replies say. 1. If you're not a programmer, the OpenOffice suggestion is good. 2.1 If you're a programmer, read up on the ReportLab docs shown in a previous reply by Grant Edwards, and try it out. Equivalently, you could use Ruby and PDF::Writer. Both ReportLab and PDF::Writer have support for creating PDFs with images, and both Python and Ruby can automate the part of iterating over the multiple files and directories. 2.2 Also you could try another approach - use some scripting language like Python (or Perl or Ruby) together with one of the free PDF creation / conversion tools that you can easily find on the Internet by a Google search (using suitable keywords like "HTML to PDF", "PDF conversion", etc. Make sure to try out various combinations / variations of keywords if you don't get a solution at once - this is fundamental to Web searching. And ... if you're not a programmer, consider becoming one :-) It's good fun, and will help you do a lot of things ... Vasudev Ram http://www.dancingbison.com http://jugad.livejournal.com http://sourceforge.net/projects/xtopdf -- http://mail.python.org/mailman/listinfo/python-list
How does py2exe work?
Hi, I recently checked out py2exe (on Windows). Looks good. Was able to build an EXE out of one of my Python apps. Wondering how it works? Does it actually compile the Python source of your script into machine language, or does it do something more like bundling the Python interpreter, the Python libraries and the script itself, into a file? Will look at the source code but would like to get some ideas ... Thanks ... Vasudev Ram Dancing Bison Enterprises Biz site: http://www.dancingbison.com Blog on software innovation: http://jugad.livejournal.com xtopdf: PDF creation/construction toolkit: http://www.dancingbison.com/products.html -- http://mail.python.org/mailman/listinfo/python-list
Re: How does py2exe work?
On Jul 2, 12:43 am, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Thomas Jollans wrote: > > On Sunday 01 July 2007, vasudevram wrote: > > >> Wondering how it works? Does it actually compile the Python source of > >> your script into machine language, or does it do something more like > >> bundling the Python interpreter, the Python libraries and the script > >> itself, into a file? > > > essentially, that's what it does. > > Q: A or B? > A: Yes. > > *nudgenudge* > /W He should have said "the 2nd way" but thanks, I did guess what he meant :-) - Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: execute script in certain directory
On Jul 9, 8:31 pm, brad <[EMAIL PROTECTED]> wrote: > When I use idle or a shell to execute a python script, the script > executes in the directory it is currently in (in this case, my desktop). > However, when using GNOME and right clicking the py script and selecting > 'open with python', the execution occurs in my home directory, not my > desktop. > > Is there a way to force py scripts to always run within the directory > that they reside in? > > Thanks > > Brad > > /home/brad/Desktop/output - python from shell > /home/brad/Desktop/output - python from idle > /home/brad/output - python from Gnome 'right click' open with menu Any program that runs has a concept of a "current directory". All its work is done relative to that, unless you open files with absolute paths. Don't know if there's a generic way to do what you want. (There may be, just can't think of it right now). But there are specific ways - script-specific, that is: Add these lines to the top of your script: import os os.chdir(rundir) # Replace rundir above with the absolute path (in quotes) of whatever directory you want the script to have as its current directory when it runs. Looks like GNOME is doing a chdir to your home directory (probably for convenience or security reasons) before running your script, thats why you see that behaviour. This is why I say there may not be an easy generic way to do it - because it would involve modifying all possible execution environments from which your script could be launched. E.g.: even if you modify GNOME to do what you want, how about if tomorrow someone else wants to run your script from KDE or some other window manager? these could do things differently. HTH Vasudev Ram http://www.dancingbison.com http://jugad.livejournal.com http://sourceforge.net/projects/xtopdf -- http://mail.python.org/mailman/listinfo/python-list
Re: How to Machine A python script execute Machine B python script?
On Jul 9, 1:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Jul 8, 6:45 pm, johnny <[EMAIL PROTECTED]> wrote: > > > Anyone know how I can make Machine A python script execute a python > > > script on Machine B ? > > > xmlrpc will work. > > Or pyro > > http://pyro.sourceforge.net/ > > Pyro is short for PYthon Remote Objects. It is an advanced and > powerful Distributed Object Technology system written entirely in > Python, that is designed to be very easy to use. Never worry about > writing network communication code again, when using Pyro you just > write your Python objects like you would normally. With only a few > lines of extra code, Pyro takes care of the network communication > between your objects once you split them over different machines on > the network. All the gory socket programming details are taken care > of, you just call a method on a remote object as if it were a local > object! > > -- > Nick Craig-Wood <[EMAIL PROTECTED]> --http://www.craig-wood.com/nick >> xmlrpc will work. Right. Pretty easy to use. Go to the xml-rpc.com site to read about it. Python has it included in the standard library, so you don't need to get anything extra to use XML-RPC. And it works as advertised, more or less - I recently wrote some simple servers and clients using Python and XML-RPC. Or SOAP (Google for "Python SOAP"). But not sure if SOAP is actively supported for Python nowadays. Or ICE - see www.zeroc.com. Haven't tried it out yet, but appears interesting. But it seems ICE has more overhead to setup (your ICE code, I mean, not to install the software itself) than XML-RPC or Pyro. (It looks like a lighter version of CORBA - some of the key people who created it are ex-CORBA experts). Could possibly give better performance or have more features, though ... Also, XML-RPC, SOAP, and ICE are all interoperable with different languages - meaning your server and client can be in different languages; at least, XML-RPC and SOAP have support in many languages, while ICE has it for at least for C++, C#, Java, Python, Ruby, PHP, and Visual Basic (some of these have only support for clients, when I last checked). Vasudev Ram http://www.dancingbison.com http://jugad.livejournal.com http://sourceforge.net/projects/xtopdf -- http://mail.python.org/mailman/listinfo/python-list
Re: Technology solutions for Ruby?
[ Though the OP posted his message to comp.lang.ruby, I'm cross- posting it to comp.lang.python, since he mentions Python as a possible alternative he's looking at, and also because I've recommended Python for his stated needs. Also, interested to see what other Pythonistas have to say in response to my reply. - Vasudev] > On Jul 16, 2007, at 2:21 AM, Michael Reiland wrote: > At the heart of the issue is the fact that I refuse to use Java for this project, I prefer not to use .Net because of the portability issues, and I'd like to get away from C++ for obvious reasons. > To me this means Ruby, Python, or, as mentioned above, Perl. If anyone can tell me of a way to meet the above requirements in either Python or Perl, I'm all ears (I just prefer Ruby). Yes, I think it would be really great for the Ruby community and for the growth of the language if wxRuby was more mature as a GUI toolkit. (Not knocking the wxRuby developers at all, its great that they've even done what they have - I know that creating other language (like Ruby) bindings to a C++ lib is a non-trivial task). My suggestion: Python + wxPython + Python DBI + (Py2Exe + InnoSetup) *might* meet all your needs. (As with any decision about what software technologies to use, you'll have to evaluate the suggested options to see if they fit your needs.) Note: I've used and like both Ruby and Python (saying this after using many, though not all, language features and libraries of both languages), and am not trying to discourage you from using Ruby for your needs; its just that, based on your needs as described, it looks to me as if Python meets them better than Ruby at present: > 1. GUI - Native Look and Feel. According to wxRuby the bindings aren't mature enough for production use. Does anyone have any experience with this and/or can you offer alternatives that provide a native look and feel (I I don't know enough about wxRuby to comment. wxPython has this (Native Look and Feel), I think (used it some, a while ago), not 100% sure, you can check on the site - http:/ www.wxpython.org - to make sure. The site does say that it is cross-platform: "wxPython is a cross-platform toolkit. This means that the same program will run on multiple platforms without modification. Currently supported platforms are 32-bit Microsoft Windows, most Unix or unix- like systems, and Macintosh OS X. " but that doesn't necessarily mean that it will have native look and feel on all supported platforms. (The two are not the same thing.) That's why you will need to check. wxPython pros: Its fairly easy to learn, at least for simple GUI apps (e.g. a few widgets / controls and a file dialog or two). I was able to build these simple ones - see the code, article and screenshots available here (or from links from here): http://www.packtpub.com/article/Using_xtopdf - in quite a short time, starting from zero knowledge of wxPython (I did know some Python from before), just by looking at the sample apps, and some reading of the docs. See the quotes about wxPython: http://www.wxpython.org/quotes.php >2. Databases - contemplating using ActiveRecord, but I would like to use ODBC to support multiple types of DB's in a uniform way (if you know of alternatives to ODBC or ActiveRecord, please let me know). I think, but again, not sure, that Python DBI + appropriate database drivers, may meet this need. Basically Python DBI is similar to ODBC (roughly), and to Perl DBI + DBD, as I understand. There's also ODBC support in the Win32 extensions package for Python - IIRC, Google for 'win32all' to get it. Its also available as a link from the Python for Win32 MSI installer on python.org. I've used Python ODBC some, it works and is easy to use. See this for a simple example: http://jugad.livejournal.com/2006/07/07/ (See the second post at that page, titled "Publishing ODBC database content as PDF ". The code shown in the post is not indented as per proper the Python syntax (LiveJournal messed up the indentation), sorry about that, but its trivial to correct if you know Python indenting rules). Also read the Python ODBC docs and examples, of course. >3. Binary - Are there any utilities for compiling Ruby into a binary executable? The issue is twofold, speed, and not handing the customer the source :) For Python, there is py2exe (for Windows only). I used py2exe recently and it works well enough for the simple cases that I tried. (I tried building EXEs for a simple Python hello-world program, and for a simple wxPython GUI app based on my xtopdf toolkit. Both worked ok.) For cross-platform (Windows and Linux, IIRC), there is PyInstaller (Google for it), haven't tried it out yet, just downloaded it recently. I don't think you'll gain much speed by this compiling step, though (over and above what Python gives you itself, when it compiles your .py files to .pyc files). The purpose of py2exe is more to hide the source code than to speed it up, as I understand (could be wrong). N
Re: Technology solutions for Ruby?
On Jul 16, 10:25 pm, vasudevram <[EMAIL PROTECTED]> wrote: > [ Though the OP posted his message to comp.lang.ruby, I'm cross- > posting it to comp.lang.python, since he mentions Python as a possible > alternative he's looking at, and also because I've recommended Python > for his stated needs. Also, interested to see what other Pythonistas > have to say in response to my reply. > - Vasudev] > > > On Jul 16, 2007, at 2:21 AM, Michael Reiland wrote: > > At the heart of the issue is the fact that I refuse to use Java for this > > project, I prefer not to use .Net because of the portability issues, > and > I'd like to get away from C++ for obvious reasons. > > > To me this means Ruby, Python, or, as mentioned above, Perl. If anyone > > can tell me of a way to meet the above requirements in either Python > or > Perl, I'm all ears (I just prefer Ruby). > > Yes, I think it would be really great for the Ruby community and for > the growth of the language if wxRuby was more mature as a GUI toolkit. > (Not knocking the wxRuby developers at all, its great that they've > even done what they have - I know that creating other language (like > Ruby) bindings to a C++ lib is a non-trivial task). > > My suggestion: Python + wxPython + Python DBI + (Py2Exe + InnoSetup) > *might* meet all your needs. (As with any decision about what software > technologies to use, you'll have to evaluate the suggested options to > see if they fit your needs.) > > Note: I've used and like both Ruby and Python (saying this after using > many, though not all, language features and libraries of both > languages), and am not trying to discourage you from using Ruby for > your needs; its just that, based on your needs as described, it looks > to me as if Python meets them better than Ruby at present: > > > 1. GUI - Native Look and Feel. According to wxRuby the bindings aren't > > mature enough for production use. Does anyone have any experience > with > this and/or can you offer alternatives that provide a native look and > feel (I > > I don't know enough about wxRuby to comment. > > wxPython has this (Native Look and Feel), I think (used it some, a > while ago), not 100% sure, you can check on the site - http:/www.wxpython.org > - to make sure. The site does say that it is cross-platform: > > "wxPython is a cross-platform toolkit. This means that the same > program will run on multiple platforms without modification. Currently > supported platforms are 32-bit Microsoft Windows, most Unix or unix- > like systems, and Macintosh OS X. > " > > but that doesn't necessarily mean that it will have native look and > feel on all supported platforms. (The two are not the same thing.) > That's why you will need to check. > > wxPython pros: Its fairly easy to learn, at least for simple GUI apps > (e.g. a few widgets / controls and a file dialog or two). I was able > to build these simple ones - see the code, article and screenshots > available here (or from links from here): > > http://www.packtpub.com/article/Using_xtopdf > > - in quite a short time, starting from zero knowledge of wxPython (I > did know some Python from before), just by looking at the sample apps, > and some reading of the docs. > > See the quotes about wxPython:http://www.wxpython.org/quotes.php > > >2. Databases - contemplating using ActiveRecord, but I would like to use > > ODBC to support multiple types of DB's in a uniform way (if you know > of > alternatives to ODBC or ActiveRecord, please let me know). > > I think, but again, not sure, that Python DBI + appropriate database > drivers, may meet this need. Basically Python DBI is similar to ODBC > (roughly), and to Perl DBI + DBD, as I understand. There's also ODBC > support in the Win32 extensions package for Python - IIRC, Google for > 'win32all' to get it. Its also available as a link from the Python for > Win32 MSI installer on python.org. > I've used Python ODBC some, it works and is easy to use. > See this for a simple example: > > http://jugad.livejournal.com/2006/07/07/ > > (See the second post at that page, titled "Publishing ODBC database > content as PDF > ". The code shown in the post is not indented as per proper the Python > syntax (LiveJournal messed up the indentation), sorry about that, but > its trivial to correct if you know Python indenting rules). Also read > the Python ODBC docs and examples, of course. > > >3. Binary - Are there any utilities for compiling Ruby into a binary > > executable? The issue is twofold, speed, and not handing the > customer > the source :) > > F
Re: Python MAPI
On Jul 20, 10:57 pm, [EMAIL PROTECTED] wrote: > Hi, > > I've been googling all over and can't find any good answers about this > problem. I would like to create some kind of MAPI interface with > Python such that when I open Microsoft Word (or another Office > program) and click File, Send To, Mail Recipient it opens a program I > wrote in Python and uses it to send the email rather than Outlook. > > The closest I've come is finding the registry key HKLM\Software\Clients > \Mail which seems to control the default email client. I did figure > out how to redirect mailto directives on websites to my program > successfully, but this is a whole 'nother ballgame. > > Any suggestions are welcome. I am considering writing some VBA hooks > in Office Apps in question, but would prefer to avoid that. > > Thanks! > > Mike > > P.S. Currently using Python 2.4, wxPython 2.8.3 (for GUI) on Windows > XP Pro. Hi, 1: I don't know much about Windows APIs, but am currently reading the "Windows Internals" book. Got this idea from it: Go to http://www.microsoft.com/technet/sysinternals/default.mspx and check out the SysInternals utilities there. The book says that you can use some of them to "spy" on what an app is doing - what registry keys it is reading/writing, lots of other OS-level calls it makes as it runs. Digging around and using some of these utilities to check out what an Office app does when you use it to send mail, might help you figure out a way to do what you want. 2. Try looking for registry entries specific to Office Apps, and look under those subtrees for likely email-related entries to modify (if you haven't tried that already). I guess you already know that fiddling with the registry can be risky and can crash your system, so take backups, etc. Using COM via Python may also help - again, some digging required. You probably already have the PyWin32 Python extensions for Windows COM (earlier called win32all - see http://wiki.python.org/moin/Win32All) - if not, its available here: http://www.python.org/download/releases/2.4.4/ (scroll down the page for the link) Vasudev Ram www.dancingbison.com jugad.livejournal.com sourceforge.net/projects/xtopdf -- http://mail.python.org/mailman/listinfo/python-list
Re: Python MAPI
On Jul 21, 12:28 am, [EMAIL PROTECTED] wrote: > On Jul 20, 1:48 pm, vasudevram <[EMAIL PROTECTED]> wrote: > > > > > > > On Jul 20, 10:57 pm, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > I've been googling all over and can't find any good answers about this > > > problem. I would like to create some kind of MAPI interface with > > > Python such that when I open Microsoft Word (or another Office > > > program) and click File, Send To, Mail Recipient it opens a program I > > > wrote in Python and uses it to send the email rather than Outlook. > > > > The closest I've come is finding the registry key HKLM\Software\Clients > > > \Mail which seems to control the default email client. I did figure > > > out how to redirect mailto directives on websites to my program > > > successfully, but this is a whole 'nother ballgame. > > > > Any suggestions are welcome. I am considering writing some VBA hooks > > > in Office Apps in question, but would prefer to avoid that. > > > > Thanks! > > > > Mike > > > > P.S. Currently using Python 2.4, wxPython 2.8.3 (for GUI) on Windows > > > XP Pro. > > > Hi, > > > 1: I don't know much about Windows APIs, but am currently reading the > > "Windows Internals" book. Got this idea from it: > > > Go tohttp://www.microsoft.com/technet/sysinternals/default.mspx > > and check out the SysInternals utilities there. The book says that you > > can use some of them to "spy" on what an app is doing - what registry > > keys it is reading/writing, lots of other OS-level calls it makes as > > it runs. Digging around and using some of these utilities to check out > > what an Office app does when you use it to send mail, might help you > > figure out a way to do what you want. > > > 2. Try looking for registry entries specific to Office Apps, and look > > under those subtrees for likely email-related entries to modify (if > > you haven't tried that already). I guess you already know that > > fiddling with the registry can be risky and can crash your system, so > > take backups, etc. > > > Using COM via Python may also help - again, some digging required. You > > probably already have the PyWin32 Python extensions for Windows COM > > (earlier called win32all - seehttp://wiki.python.org/moin/Win32All) - > > if not, its available here: > > >http://www.python.org/download/releases/2.4.4/ > > (scroll down the page for the link) > > > Vasudev Ramwww.dancingbison.com > > jugad.livejournal.com > > sourceforge.net/projects/xtopdf > > Thanks for the ideas...I am already monitoring the registry to see > what happens when I switch between two email clients. In this case, I > am switching between Outlook 2003 and Thunderbird 2. The pertinent > registry files are as follows: > > # changes which email client to use > [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail] > > # obviously changes the .eml file association > [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.eml] > > # haven't the fogiest idea what this does, if anything > [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{29F458BE-8866-11D5- > A3DD-00B0D0F3BAA7}] > > # change mailto functionality > [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\DefaultIcon] > @="C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe,0" > [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\command] > @="\"C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe\" -osint - > compose \"%1\"" > > I assume you're referring to "Process Monitor", which is a really cool > tool. Maybe it'll help, but I usually can't get it to filter out > enough of the noise to make the output useful. I'll give it a go > nonethless. > > I am running all my tests in a VM, so I really don't care if the > registry gets hosed at this point. > > Thanks again, > > Mike- Hide quoted text - > > - Show quoted text - You're welcome :) If Process Monitor has an option to save its output as text files / CSV files (some of the other SysInternals tools do), you might want to try using (a Windows version) of grep or awk to filter out the noise .. Vasudev -- http://mail.python.org/mailman/listinfo/python-list
Re: GUI tutorial
On May 13, 10:51 pm, John K Masters <[EMAIL PROTECTED]> wrote: > Can someone point me in the direction of a good tutorial on programming > python with a GUI? I'm just starting out with python and have written a > few scripts successfully but would like to add a graphical front end to > them to make it easier for my work colleagues, most of whom have never > used a command line, to use. > > Regards, John > -- > War is God's way of teaching Americans geography > Ambrose Bierce (1842 - 1914) That depends on which GUI toolkit you want to use. There are at least one or two good online tutorials on the Web for Tkinter (the Python interface to the Tk toolkit). One is by Fredrik Lundh (a.k.a the effbot, a leading Python contributor). Google for suitable keywords, e.g. Tkinter tutorial. Tkinter comes with Python by default on Windows, so that helps. But wxPython is not a bad toolkit either. (You'll have to download and install it, also the demos (see below) are often a separate download.) I've used it some, and like it. I don't know of any tutorials for it, though there may be some - again, Google for info. But if you already have some GUI programming background, its not too difficult to pick up it up. It comes with a big set of demos with source code, and I was able to learn enough wxPython to write some simple apps just by looking at the demos source code and reading some of the reference documentation. Those apps are here: http://www.packtpub.com/article/Using_xtopdf Check the last part of the article for links to the source code. PyQt is another option, recommended by some people. Haven't tried it myself but have used Qt (the C++ GUI toolkit to which PyQt is a binding) a little, and like it a lot. Qt again is supposed to be of very high quality, according to some people. I am currently reading a book Programming Qt and found most of it pretty straightforward (though not simple :-) to understand (you do need to understand the concept of signals and slots, as that is fundamental to Qt programming). HTH Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Help required with Python App
On May 21, 8:11 pm, Trevor Hennion <[EMAIL PROTECTED]> wrote: > Hi, > > I am producing a Web based database application for a customer and could > do with some help producing pdf documents from the data. > > The project uses Apache. Postgresql and Python CGI scripts on a Linux > server for a company with 20-25 users. > > I have been looking at thehttp://www.reportlab.org- ReportLab Toolkit, > but am rather busy with the other parts of the project, so if any one > located in the UK - Reading/Basingstoke area has the right > skills and time available now, please contact me. > > I have a small budget available for this work. > > Regards > > Trevor > > PS UK/Reading/Basingstoke area is essential. I don't have the time right now, though I'd be free for some work after a week or two; but I'm not in your area. ReportLab is quite good and has many features. I used it to build my xtopdf toolkit, a toolkit for conversion of other file formats to PDF. You could try using it (ReportLab) directly from the Python scripts in your app. If your needs are only for text to PDF conversion (of the textual data - numbers, strings and dates from the database), then you might want to take a look at xtopdf - see http://www.dancingbison.com/products.html. It may be a bit easier to use than ReportLab itself (it has a small and simple to use API), but only for text to PDF conversion - it doesn't support images as of now. It's released under the same license as ReportLab, the BSD license. xtopdf has sample programs that show you how to use it. It supports setting the font (anywhere in the output, but only one font at a time, headers and footers for each page, and automatic pagination). You can also read this article about it: http://www.packtpub.com/article/Using_xtopdf The article above shows how to use xtopdf to create PDF from various input formats - CSV, text, TDV, XLS, etc. All done very simply with just a few lines of code. You could try using either Reportlab or xtopdf or getting someone to help with using one of them. HTH Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Help required with Python App
On May 21, 8:11 pm, Trevor Hennion <[EMAIL PROTECTED]> wrote: > Hi, > > I am producing a Web based database application for a customer and could > do with some help producing pdf documents from the data. > > The project uses Apache. Postgresql and Python CGI scripts on a Linux > server for a company with 20-25 users. > > I have been looking at thehttp://www.reportlab.org- ReportLab Toolkit, > but am rather busy with the other parts of the project, so if any one > located in the UK - Reading/Basingstoke area has the right > skills and time available now, please contact me. > > I have a small budget available for this work. > > Regards > > Trevor > > PS UK/Reading/Basingstoke area is essential. I don't have the time right now, though I'd be free for some work after a week or two; but I'm not in your area. ReportLab is quite good and has many features. I used it to build my xtopdf toolkit, a toolkit for conversion of other file formats to PDF. You could try using it (ReportLab) directly from the Python scripts in your app. If your needs are only for text to PDF conversion (of the textual data - numbers, strings and dates from the database), then you might want to take a look at xtopdf - see http://www.dancingbison.com/products.html. It may be a bit easier to use than ReportLab itself (it has a small and simple to use API), but only for text to PDF conversion - it doesn't support images as of now. It's released under the same license as ReportLab, the BSD license. xtopdf has sample programs that show you how to use it. It supports setting the font (anywhere in the output, but only one font at a time, headers and footers for each page, and automatic pagination). You can also read this article about it: http://www.packtpub.com/article/Using_xtopdf The article above shows how to use xtopdf to create PDF from various input formats - CSV, text, TDV, XLS, etc. All done very simply with just a few lines of code. You could try using either Reportlab or xtopdf or getting someone to help with using one of them. HTH Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I time a method of a class in python using Timeit
On May 24, 8:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am using timeit to time a global function like this > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > result = t.timeit(); > > But how can i use timeit to time a function in a class? > class FetchUrlThread(threading.Thread): > def aFunction(self): ># do something > > def run(self): > # how can I time how long does aFunction() take here? > aFunction(); > > Thank you. Try this: def run(self): import time t1 = time.clock() aFunction(); t2 = time.clock() print "aFunction took %d seconds" % int(t2 - t1 + 1) (Code is not tested as I'm not at my PC right now). The int() is to round it off to an integer, and the +1 is to give a more accurate result - may not work in all cases, experiment, and check for a ceil/floor type function in Python. Vasudev Ram Dancing Bison Enterprises www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: How to get started as a xhtml python mysql freelancer ?
On May 26, 5:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On May 25, 7:55 pm, gert <[EMAIL PROTECTED]> wrote: > > > > > > > On May 26, 2:09 am, Paul McNett <[EMAIL PROTECTED]> wrote: > > > > gert wrote: > > > > I made something that i was hoping it could make people happy enough > > > > so i could make a living by providing support for commercial use of > > > >http://sourceforge.net/projects/dfo/ > > > > > But in reality i am a lousy sales men and was wondering how you people > > > > sell stuff as a developer ? > Some suggestions: - give more details on the front page of the sourceforge site, on what your product is about and its benefits. Consider creating a web site for it. -write articles about it / post on appropriate newsgroups about your product, giving code examples of how it can be used, and the benefits. - if you haven't already, create a personal web site - its better to get your own paid one than to use a free one, and put (objective) info there on your skills, your past experience, your open source work, your writings, etc. Give your contact info too. I've done this myself and it has resulted in getting leads for contracting work. Be patient though - work leads may not come in a hurry. - join sites like Elance.com or ODesk.com for getting work. Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Periodic tasks.
On May 29, 4:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Alternatively, the user could make use of the already-existing "sched" > module from the standard library. With a little threading that would do > the job fine. > > regards > Steve > -- > Steve Holden+1 571 484 6266 +1 800 494 3119 > Holden Web LLC/Ltd http://www.holdenweb.com > Skype: holdenweb http://del.icio.us/steve.holden > -- Asciimercial - Yes. Also, there's an example in the Python Cookbook (print edition) which is exactly about this - using sched. The recipe before that also shows how to do it without using the sched library. Both those recipes are purely in Python. Vasudev Ram Dancing Bison Enterprises www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list
Re: python unix install, sqlite3
On May 29, 5:52 pm, Simon <[EMAIL PROTECTED]> wrote: > I installed the source code on unix for python 2.5.1. The install went > mainly okay, except for some failures regarding: > _ssl, _hashlib, _curses, _curses_panel. > > No errors regarding sqlite3. > However, when I start python and do an import sqlite3 I get: > > /ptmp/bin/> python > Python 2.5.1 (r251:54863, May 29 2007, 05:19:30) > [GCC 3.3.2] on sunos5 > Type "help", "copyright", "credits" or "license" for more information.>>> > import sqlite3 > > Traceback (most recent call last): > File "", line 1, in > File "/ptmp/Python-2.5.1/lib/python2.5/sqlite3/__init__.py", line > 24, in > from dbapi2 import * > File "/ptmp/Python-2.5.1/lib/python2.5/sqlite3/dbapi2.py", line 27, > in > from _sqlite3 import * > ImportError: No module named _sqlite3 Some ideas: I don't know if sqlite3 comes bundled with the standard Python source bundle. My guess is not. If not, that's the cause of the error - you need to install sqlite3 (and probably pysqlite3 (not sure of the name (whether it has a trailing 3) which, if I remember, is the Python binding/wrapper for sqlite3 (which is a C library, I think). Other possible cause of the error (if sqlite3 _is_ bundled with Python and no Python binding/wrapper is needed, is that sqlite3 depends on one of those other libraries you mention (such as _hashlib) for which you got errors while installing Python from source. HTH Vasudev Ram Dancing Bison Enterprises www.dancingbison.com -- http://mail.python.org/mailman/listinfo/python-list