Re: Write ooxml .ods (spreadsheat) from python?

2008-02-14 Thread johnf
Neal Becker wrote:

 I'd like to output some data directly in .ods format.  This format appears
 to be quite complex.  Is there any python software available to do this? 
 I
 did look at pyuno briefly.  It looks pretty complicated also, and it looks
 like it uses it's own private version of python, which would not help me.

Try 
import ooolib
#http://ooolib.sourceforge.net
-- 
http://mail.python.org/mailman/listinfo/python-list


where is uno?

2007-12-20 Thread johnf
I'm using SUSE 10.3 have installed OpenOffice Python interface from the
distro DVD.  But still I need help because I can't import uno.  And
that's because it's not in my site-packages.  

I read about how to use it and have reviewed code that uses it but no where
did any of the articles explain where to retrieve the actual 'uno' py
package.

Can someone provide a hint?

Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Database intensive application

2007-08-12 Thread johnf
Rohit wrote:

 I am a novice. I want to know whether Python can be used to develop
 client/server database and web applications like .NET. Which is the
 best book/source to learn Python?


IMO you should use Dabo (www.dabodev.com).  If you want to strike on your
own check using SQLAlchemy as your database connection.  

Check out the O'Reilly books.

John
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: gui application on cross platform

2007-05-28 Thread johnf
james_027 wrote:

 Hi,
 
 I am using delphi to develop gui application, and wish to make a shift
 to python. here are some of my question/concern...
 
 1. is python develop gui application a cross platform? just like java
 swing?
 2. delphi makes things easy for me like coding for a specific event on
 a specific component, could it be the same for python?
 3. are there cool library of component like in delphi available for
 python that will make database application more usesable?
 4. where do I start the learning curve? I did some research and I
 don't know which one to take among wxwdiget, pygtk, and etc.
 
 
 Thanks
 james
May I suggest you take a close look at Dabo (www.dabodev.com).  Dabo was
designed from the ground up to do exact what you are asking for.  Take a
look at the Dabo screencast
(http://leafe.com/screencasts/dataenvironment1.html)
which will provide an easy review of most of what Dabo can do.  

Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyCon blogs?

2007-02-27 Thread johnf
[EMAIL PROTECTED] wrote:

 Was anybody blogging about PyCon (talks and/or sprints)?  Got any
 pointers?
 
 Thanks,
 
 Skip
At least one session was posted on YouTube
http://dabodev.com/pycon2007
Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which Object Database would you recommend for cross platform application?

2007-02-15 Thread johnf
Thomas Ploch wrote:

 Hello folks,
 
 I am currently developing an open source Event Managment software
 (events in real-life, like concerts, exhibitions etc. :-) ) using wx for
 the GUI, and I need an Object database. Since this is the first time I
 actually need doing this, I wondered if anybody here could recommend
 one. It can be fairly simple. It doesn't need threading support and will
 only host one client (the application, but I am thinking about making
 this database accessible via the web, but this is still far in the
 future), although the database might get big (around 1GiB). It should be
 available for linux, mac os and windows.
 
 I looked into ZODB, but thats totally overloaded for my purpose. I
 looked into Durus (a re-implementation of ZODB, but without this
 overloaded stuff, but the documentation is very thin). Both of them
 don't really appeal.
 
 So I wondered if any of you could recommend one that (more or less) best
 fits the described conditions.
 
 Thanks in advance,
 Thomas
This answer does not really answer your question.  But have you looked a
dabo (www.dabodev.com).  It doesn't support the web (yet) but you said
that's in the furture.  Dabo was built for this type of app.  Dabo supports
Postgres,MsSQL,MySQL,Firebird, and SQLite.  Non of the DB's are what I'd
call an object database but is that a real requirement?  BTW the first 4
DB's can support 1GB and more.

Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Learning Python book, new edition?

2007-01-11 Thread johnf
Demel, Jeff wrote:

 This email is intended only for the individual or entity to which it is
 addressed.  This email may contain information that is privileged,
 confidential or otherwise protected from disclosure. Dissemination,
 distribution or copying of this e-mail or any attachments by anyone other
 than the intended recipient, or an employee or agent responsible for
 delivering the message to the intended recipient, is prohibited. If you
 are not the intended recipient of this message or the employee or agent
 responsible for delivery of this email to the intended recipient, please
 notify the sender by replying to this message and then delete it from your
 system.  Any use, dissemination, distribution, or reproduction of this
 message by unintended recipients is strictly prohibited and may be
 unlawful.

So what happens with google bots etc... Information provided in the email
could be helpful to others that are NOT the original recipient.  And what
happens to the archive stuff?

John
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Read from database, write to another database, simultaneously

2007-01-10 Thread johnf
Bjoern Schliessmann wrote:

 Sean Davis wrote:
 
 The author of one of the python database clients mentioned that
 using one thread to retrieve the data from the oracle database and
 another to insert the data into postgresql with something like a
 pipe between the two threads might make sense, keeping both IO
 streams busy.
 
 IMHO he's wrong. Network interaction is quite slow compared with CPU
 performance, so there's no gain (maybe even overhead due to thread
 management and locking stuff). That's true even on multiprocessor
 machines, not only because there's almost nothing to compute but
 only IO traffic. CMIIW.
 
 Using multiplexing, you'll get good results with simple code without
 the danger of deadlocks. Have a look at asyncore (standard library)
 or the Twisted framework -- personally, I prefer the latter.
 
 Regards,
 
 
 Björn
 
Sean you can't win - everyone has a different idea!  You need to explain
that oracle has millions of records and it's possible to a pipe open to
feed the Postgres side.  

One thing I didn't get - is this a one time transfer or something that is
going to happen often.  

One time transfer live to the time issue.  

Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: I want to see all the variables

2006-12-30 Thread johnf
Steven D'Aprano wrote:


 
 There are three other underscore conventions in use:
 
 (1) Objects with a single leading underscore like _attribute are private
 by convention, but Python doesn't enforce it. Starting an object with a
 single underscore is like writing # Private! Don't touch! after it.
 
 (2) By convention, if you want to create a name that is the same as a
 built-in object without shadowing (hiding) the built-in, put a single
 trailing underscore after it like file_. That's just a style convention
 though, you are free to call it FiLE ,or anything else, if you prefer.
 
 (3) Last but not least, class attributes with two leading and trailing
 underscores are considered special but public, like __init__ and __repr__.
 It is probably a bad idea to invent your own.
 
 
 
Very detailed.  But I was attempting to debug some code which subclassed
other code. I got a traceback that something like no
mySubClass.__source.query() did not exist.  The superclass had something
like myClass.__source.query(sql) which worked
but mySubClass.__source.query(sql) did not work.  So I tried to debug
using dir(myClass.__source) and got an error.  And I also got error when
I dir(mySubClass.__source. So how could I have debugged the problem if
dir() will not display information on the __source?  I hope that explains
my issue.

Thanks 
Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: INSERT statements not INSERTING when using mysql from python

2006-12-29 Thread johnf
Ben wrote:

 I don't know whether anyone can help, but I have an odd problem. I have
 a PSP (Spyce) script that makes many calls to populate a database. They
 all work without any problem except for one statement.
 
 I first connect to the database...
 
 self.con = MySQLdb.connect(user=username, passwd =password)
 self.cursor = self.con.cursor()
 self.cursor.execute(SET max_error_count=0)
 
 All the neccesary tables are created...
 
 self.cursor.execute(CREATE DATABASE IF NOT EXISTS +name)
 self.cursor.execute(USE +name)
 
 self.cursor.execute(CREATE TABLE IF NOT EXISTS networks (SM
 varchar(20),DMC int,DM varchar(50),NOS int,OS varchar(50),NID
 varchar(20))
 
 Then I execute many insert statements in various different loops on
 various tables, all of which are fine, and result in multiple table
 entries. The following one is executed many times also. and seems
 identical to the rest. The print statements output to the browser
 window, and appear repeatedly, so the query must be being called
 repeatedly also:
 
 print pbSQL query executing/bp
 self.cursor.execute(INSERT INTO networks VALUES ('a',' +i+
 ','c','2','e','f','g'))
 print pbSQL query executed/bp
 
 I have, for debugging, set i up as a counter variable.
 
 No errors are given, but the only entry to appear in the final database
 is that from the final execution of the INSERT statement (the last
 value of i)
 
 I suspect that this is to vague for anyone to be able to help, but if
 anyone has any ideas I'd be really grateful :-)
 
 It occured to me that if I could access the mysql query log that might
 help, but I was unsure how to enable logging for MysQL with python.
  
 Cheers,
 
 Ben

Not sure this will help but where is the commit?  I don't use MySQL but
most SQL engines require a commit.
Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


I want to see all the variables

2006-12-29 Thread johnf
Hi,
When I use dir() I don't see the __ underscore items.  Is there anything
that will show all the private vars and functions?

johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I want to see all the variables

2006-12-29 Thread johnf
Steven D'Aprano wrote:

 On Fri, 29 Dec 2006 08:20:22 -0600, Larry Bates wrote:
 
 johnf wrote:
 Hi,
 When I use dir() I don't see the __ underscore items.  Is there anything
 that will show all the private vars and functions?
 
 johnf
 
 The idea of the underscore items is that they aren't to be used by
 you.
 
 Double leading+trailing underscore attributes are NOT private, they are
 *special* but public (e.g. __dict__, __class__, __str__, etc.). If you
 don't believe me, have a look at dir(int) and count the underscored
 attributes listed. Then try to find __dict__, __name__, __bases__,
 __base__ or __mro__ within the list. Why are they suppressed?
 
 But even if underscored attributes were private, the Python philosophy is
 that private attributes are private by convention only -- even
 name-mangled __private methods can be reached if you know how.
 
 
 If you wish to access private variables and functions you will
 almost certainly have to look at the source code to make sure of
 what they are and how they can be utilized.
 
 Not so.
 
 class Parrot(object):
 ... def _private(self):
 ... Private method, returns a magic string.
 ... return Don't touch!!!
 ...
 Parrot._private.__doc__
 Private method, returns a magic string.
 
 
 
Ok then how do debug when I have something like __source  and I need to
know what is available for the object?

John
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: db access

2006-12-28 Thread johnf
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) ??
 
 Thanks in advance
Although others have suggested using ODBC or ADO I have a different
solution.  If you wanted a multi-platform I would use FreeTDS with
psmssql.py.  psmssql.py does support the DB API 2.0 although it does not
support any of the extendsions.  Works with Linux, Mac and Windows.

Johnf


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: your opinion about psycopg vs pygresql

2006-12-20 Thread johnf
Martin P. Hellwig wrote:

 Hi all,
 
 I'm playing a bit with PostgreSQL, in which I've set me the target to
 create a python script which with user input creates a new user role and
 a database with that owner (connecting to template1 since I know that at
 least that db exists).
 
 Ok so I installed PostGreSQL and pygresql since it looked like that this
 is endorsed by PG, I had some trouble with the DB-API2 (complains about
 there is already a connection to template1, even when I closed and
 deleted the connector) so I solved it by using the pg api.
 
 But I was intrigued by this problem and started googling and by that
 time I've noticed that python projects like Django seem to favor the
 psycopg module.
 
 So I installed that one (the 1.1 version, since Django uses that too)
 and it looked like it has the same problem of creating a user after a
 database, I'm sure that there is a user error in there somewhere :-)
 
 However, given the choice, what in your opinion would be the reason why
 someone would chose one over the other? Now I know this could easily get
 into a flamewar, so if you comment (but please do so) I'll still
 investigate that, since at this moment I don't even have a clue how they
 differ and on what reason, why does PostgreSQL seem to favour pygresql
 and Pythoneers psycopg?
 
 Thanks in advance.
 
I have not used pygresql but I see it often as a standard package with the
SUSE DISTRO. But I use Psycopg 2.  I find that it is very fast and provides
a few extentions that I have used.  Reported bugs are fixed immediately.

John
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread johnf
John Nagle wrote:

 Jan Dries wrote:
 [EMAIL PROTECTED] wrote:
 
 I'm also looking for a MySQLdb binary for windows. This is holding me
 from upgrading from Python 2.4 to Python 2.5 !

 
 If you search the Help Forum of the MySQLdb project on SourceForge, you
 will find a couple of people who have successfully built MySQLdb on
 Windows for 2.5, and are willing to share their installers.
 That's how I got my binaries.
 
 Regards,
 Jan
 
 Yes, see
 
 http://sourceforge.net/forum/forum.php?thread_id=1571110forum_id=70461
 
 for an untested version created by a World of Warcraft guild:
 

http://www.guildmanus.com/uploaded/MySQL-python.exe-1.2.2b2.win32-py2.5.exe
 
 This, apparently, is the extent of current Python support for MySQL.
 Want to install that executable, as root, on your production machines?
 
 This is embarassing for the Python community.  Perl and PHP come
 with MySQL support built in.  Python is out to lunch on this.
 
 John Nagle
 Animats
I couldn't disagree more.  That fact that no Database drivers are built-in
makes Python stronger - allowing Python to access any Data Engine that
supports DBI 2.0.  Of course I'm not including pickle in my assessment.

Johnf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python visual IDE

2006-11-22 Thread johnf
king kikapu wrote:

 
 Hi to all,
 
 i am not sure if this question really belongs here but anyway, here it
 goes: I have seen a lot of IDEs for Python, a lot of good stuff but
 actually none of them has what, for example, Visual Studio has: a
 Visual Editor (with the  ability to place controls on forms etc etc),
 or RAD
 
 I know that there is Glade but does anybody knows of some product, or
 an ongoing effort to this direction so i can have a look at ?
 
 Coming from Windows and vs.net world, i think the only missing point
 here is the integration of the Pyrthon with a RAD IDE...
 
 Thanks a lot and i apologize if this isn't the correct place for this
 question...
 
 
 Kikapu

You might want to check out dabo www.dabodev.com. It's only at .7 but it
has a GUI designer (uses wxPython). Has a 3 tier design and able to use
MySQL, Postgres, FireBird, and soon MSSQL. The project has a ways to go but
it's goal is to be similar to windows IDEs such as VFP, VB6 and VS.

John  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and CMS

2006-10-22 Thread johnf
Echo wrote:

 I am going to start working on a church website. And since I like
 python, I decided to use WSGI. However, I later found out about all
 the different CMS's in php. So I wondered if there where any in
 python.
 
 Sadly, I only found Plone, skeletonz, and PyLucid (If there is any
 more, please let me know). Of those three, only PyLucid supports WSGI
 and it didn't look very nice to me.
 Both Plone and skeletonz looked very nice. However, they can't be
 hosted on a regular web host(at least to my knowledge) since they run
 as the web server themselves. So hosting would cost more, at least 2-3
 times more from what I've seen.
 
 So I'm thinking of making a python CMS based on WSGI. I'm now trying
 to figure out a few things like the best way to store the content and
 how to manage/use plugins. For storing the content, the only ways I
 know of are as files or in a database. But I'm not sure what would be
 better. And as for how to do plugings, I plan on looking at Plone and
 skeletonz.
 
 As for working with WSGI, I have found
 Colubrid(http://wsgiarea.pocoo.org/colubrid/) and
 Paste(http://pythonpaste.org/). I was wondering if anyone knew of any
 other libraries that make working with WSGI easier. Also, I wondering
 if anyone would like to share their experiences of working with those.
 
 
 ps. I know that this is a big and complicated project. But no matter
 how far I get, it will be fun because its Python:)
 
Turbogears???
John
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Web Site?

2006-10-17 Thread johnf
Michael B. Trausch mike$#at^nospam!%trauschus wrote:

 Tim Chase wrote:
 Is there a problem with the Python and wxPython web sites?
 I cannot seem to get them up
 
 Sounds like someone needs some pyagra...
 
 (grins, ducks, and runs)
 
 
 Interesting.  I thought at first it was a problem with Python's sites...
 but I got through to the Python site just now... but I can't get through
 to the wx* sites (wxwidgets.org, wxpython.org at the very least).  Seems
 that my trouble with the Python web site itself was coincidental.
 
 -- Mike
I have the problem all the time.  I just wait a couple of hours and all
works again.  

John
-- 
http://mail.python.org/mailman/listinfo/python-list