Re: Live Video Capture using Python

2009-12-20 Thread David Lyon

Also try..

http://www.unixuser.org/~euske/python/vnc2flv/index.html

On Mon, 21 Dec 2009 11:15:32 +0530, Banibrata Dutta
banibrata.du...@gmail.com wrote:
 Have you searched the archives of this list ? I remember seeing a related
 discussion 5-6 months back.
 
 On Mon, Dec 21, 2009 at 2:35 AM, aditya shukla
 adityashukla1...@gmail.comwrote:
 
 Hello Guys,

 I am trying to capture images from a live broadcast of a cricket match
 or
 say any video using python. I can see the video in the browser.My aim is
 to
 capture the video at any moment and create an images.Searching on google
 turns up  http://videocapture.sourceforge.net/ .I am not sure if this
 would be help here.I would appreciate if someone points me in the right
 direction.


 Thanks

 Aditya

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


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


[issue7227] Shell Support for installation of Python Packages (.EGG)

2009-10-27 Thread David Lyon

New submission from David Lyon david.l...@preisshare.net:

Under Windows, it would be very handy to have shell support for
installing .EGG packages.

To implement this would require the addition of some registry keys into
the cpython installation to associate the .EGG extension as being a
python package.

Then a new script would be assigned to process the .EGG file if called
from explorer.

This would provide the user with the ability to easily install packages
from web sites such as pypi.

--
components: Demos and Tools, Installation, Windows
messages: 94600
nosy: djlyon
severity: normal
status: open
title: Shell Support for installation of Python Packages (.EGG)
type: feature request
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 
3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7227
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: ubuntu dist-packages

2009-08-30 Thread David Lyon
On Thu, 27 Aug 2009 07:05:51 -0700 (PDT), Paul Boddie p...@boddie.org.uk
wrote:
 No, it's the problem of the Pythonic packaging brigade that package
 retrieval, building and installing is combined into one unsatisfactory
 whole. 

Brigade? That implies a disciplined and systematic approach..

I would suggest a better term is just guerrilla fighters.

There's no central planning.. no looking out for the greater good..

No sense of future.. forgive my pessimism.. 

 In fact, the distributions have proven themselves
 to be quite competent at managing huge numbers of software packages in
 a semi-automated fashion, so it's baffling that people doing work on
 Pythonic packaging tools wouldn't want to learn as much as they can
 about how those people manage it.

That's a serious and true allegation. I think the answer is that the
people that are running it aren't interested in cleaning things up
for the linux or windows platform.

Consensus seems to be just remove anything that relates to windows
or linux as an approach to harmonising it.

I believe that it should be harmonised.


 For me, when making Debian packages, it has become easier to use the
 debhelper stuff to install things like documentation and resources
 than it is to figure out which special options have to be passed to
 the particular distutils incarnation of the setup function in order to
 get such stuff put in the right place, especially since distutils
 probably still employs an ad-hoc 1990s proprietary UNIX oh just dump
 that stuff in some directory or other and forget about it mentality.

It doesn't. Actually, it can't even do that very well.

90's which '90s ? 1890's ?

 Really, distutils should be all about *dist*ribution and even then get
 out of the way as much as possible - the hard stuff is extracting the
 appropriate knowledge about the built Python interpreter in order to
 build extensions. 

Exactly.

 Installation should be left to something which has
 an opinion about where things should be placed on a particular system,
 and which has the capability to know how to uninstall stuff - a
 capability which never seems to get any closer in the distutils scene.

(sigh) - it is true...

David

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


Re: install package in a particular python version

2009-08-23 Thread David Lyon
On Thu, 20 Aug 2009 20:53:18 -0700 (PDT), Steve1234 sflen...@comcast.net
wrote:
 Benjamin suggested:
 sudo python2.5 setup.py install
 and it works.  This makes sense, thanks.
 
 I downloaded pythonpkgmgr from source and installed it.  I got the
 error that reguired wx package was missing.  I couldn't find this
 package for Linux or source.

That's wxpython.

You'll need to look at http://www.wxpython.org/download.php#binaries

David


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


Re: install package in a particular python version

2009-08-20 Thread David Lyon
On Thu, 20 Aug 2009 17:57:53 -0700 (PDT), Steve1234 sflen...@comcast.net
wrote:
 I installed the boto module in my Ubuntu system using python setup.py
 install and it installs in my python2.6 version and works great.  Now
 I want to install boto into my python2.5 version because my hosting
 services supports 2.5 but not 2.6. and I want to test my code locally,
 sting.format() is not in 2.5.
 
 How do I install a package in a particular version of python?
 
 I tried several different install switches without any luck.

If you wish to do it in a gui rather than at the commandline then
you could try the python package manager at :

  http://sourceforge.net/projects/pythonpkgmgr/

You will need to download it from source.

In the Options Dialog, there is a dropdown list that allow you to 
easily change from one version of python to another.

Regards

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


Re: Python docs disappointing - group effort to hire writers?

2009-08-10 Thread David Lyon
On Mon, 10 Aug 2009 09:13:34 -0700, Ethan Furman et...@stoneleaf.us
wrote:
 As someone who relies heavily on the docs I will also say that the idea 
 of giving the ability to modify the official documentation to somebody 
 who is /learning/ the language is, quite frankly, terrifying.  

What is more terrifying is the way feedback from newbies is handled.

Your statement implies that the only way feedback can be handled is
to throw the keys down in discust and walk away. That's primative
behaviour. And misleading, because that isn't going to happen.

 My bookshelf currently has Learning Python, Programming 
 Python, Python Cookbook, Python Programming on Win32, and Regular 
 Expressions.  All great books, and not too pricey if you can get them
used.

So, what you're advocating is let things stay how they are...

Ignore feedback... tell people to freak off...


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


Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-09 Thread David Lyon

Since you're talking about documentation, which is a part of python,
don't you think you should be discussing it on python-dev ?

That's where discussions about the documentation should be held.

haha - I'm just curious to see how long it will for them to
shut the discussion down. 

Before you do that, you should clearly work out in your own mind
how you think things need to improve. It's not good enough just
saying this or that is bad without having specific ideas on what
needs to change.

Good luck fellow sinner and blasphemer...

How dare you suggest that things could be improved...


On Sun, 9 Aug 2009 20:04:43 -0700 (PDT), Xah Lee xah...@gmail.com wrote:
 The prob with python docs is with the python priests.
 
 there are frequent posts about python doc's poor quality, and some
 efforts to improve the doc (such as wiki or seggestions), about few
 times a year (in so much as i've seen), the typical response is
 pissing fight, with python priests to tell them not to start another
 wiki, or “you should apply in our church first and formulate a PEP
 proposal first or kindly donate or otherwise fuckoff”, and so on.
 
 i've wrote several articles about this issue, total time spend on this
 is probably more than 2 months full-time work. See:
 
 • Python Documentation Problems
   http://xahlee.org/perl-python/python_doc_index.html
 
 just about each article above generates a thread of flames.
 
 I also have re-wrote the entire python regex doc in 2005:
 
 • Pyhton Regex Documentation: String Pattern Matching
   http://xahlee.org/perl-python/python_re-write/lib/module-re.html
 
 there are some positive reviews, but most are drawn out by nay-sayers.
 
 I often receive thank you emails for 2 particular articles, which are
 most frequently google searched as indicated by my weblog:
 
 • Python Doc Problem Example: gzip
   http://xahlee.org/perl-python/python_doc_gzip.html
 
 • Python Doc Problem Example: sort()
   http://xahlee.org/perl-python/python_doc_sort.html
 
 • Sorting in Python and Perl
   http://xahlee.org/perl-python/sort_list.html
 
 See also:
 
 • Language, Purity, Cult, and Deception
   http://xahlee.org/UnixResource_dir/writ/lang_purity_cult_deception.html
 
   Xah
 ∑ http://xahlee.org/
 
 ☄
 
 On Jul 31, 1:10 pm, kj no.em...@please.post wrote:
 I'm pretty new to Python, and I like a lot overall, but I find the
 documentation for Python rather poor, overall.

 I'm sure that Python experts don't have this problem: they have
 internalized some good ways to access the documentation, are
 productive with it, and therefore have lost the ability to see why
 the Python documentations is deficient for beginners.  This explains
 why a suboptimal situation can persist like this: those who are
 most able fix it are also the least able to perceive it.

 I've heard similar complaints from other experienced programmers
 who are trying out Python for the first time: poor documentation.

 Here is an *entirely typical* example: on some Unix, try

 % pydoc urllib

 The displayed documentation mention the optional parameter data
 in practically every function listed (a few dozen of them).  This
 parameter is not documented *anywhere* on that page.  All that we
 are told is that its default value is always None.

 I'm sure that I can find a full description of this parameter if
 I fire up Google, and search online.  In fact, more likely than
 not, I'll find far more documentation than I want.  But my point
 is that a programmer should not need to do this.  The full
 documentation should be readily accessible directly through a few
 keystrokes.

 I would love to know how experienced Python programmers quickly
 zero in on the Python documentation they need.

 TIA!

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


Re: Python docs disappointing - group effort to hire writers?

2009-08-04 Thread David Lyon

It isn't totally about the writers...

Peoples egos are also at stake - it seems.

If Fred X wrote Doc Y.. they don't want their name taken off.. So
they generally speaking don't want the docs changed.

If you talk too much about docs.. you can be told you're OT..

even in a thread about docs...

On Fri, 31 Jul 2009 17:12:43 -0700, Kee Nethery k...@kagi.com wrote:
 I too find the Python docs not very useful and it really slows down my  
 learning curve.
 
 I wonder if it would make sense to find good tech writers, get a  
 quotes, and get some professionally written documentation WITH LOTS OF  
 EXAMPLES added to the standard Python documentation tree.
 
 I'd chip in money for that task. I've certainly spent enough buying  
 Python books to where it would be very reasonable to chip in the cost  
 of one book towards this project. Get enough people ... could be a  
 great thing.
 
 Even though it is not the version I use, I would suggest that the  
 really detailed docs with lots of examples be written against the  
 latest python version.
 
 Just a thought.
 
 Kee Nethery
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: easy_install: unresolved external symbol

2009-08-04 Thread David Lyon
On Tue, 4 Aug 2009 10:52:20 +0200, Bart Smeets bartsmeet...@gmail.com
wrote:
 I could ofcourse use cxfreeze's binary package. But bbfreeze is not
 available as a binary. I would love to get easy_install to work. But I
have
 no idea what's going wrong here.

What is going on is that setuptools does some very 'advanced' things.

The best you can do is give the option to link to the ez_setup.py
install script and let the users install it them themselves...

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


Re: Problem in installing PyGreSQL

2009-08-03 Thread David Lyon
On Tue, 4 Aug 2009 09:15:47 +0530, Thangappan.M thangappan...@gmail.com
wrote:
 I want to access the database related stuffs in python.So I found the
 PyGreSQL module in net.
 Then I tried to download the module.But I am not able to download it.

Did none of the links here work?

http://www.pygresql.org/readme.html#where-to-get

 I am not a super user.
 I am using Linux debian machine
 Python version is 2.4.4

Try building it from source.

Otherwise try getting it from pypi

http://pypi.python.org/pypi/PyGreSQL/

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


Re: Newbie thwarted by sys.path on Vista

2009-08-01 Thread David Lyon
On Sat, 1 Aug 2009 22:58:53 +0100, Michael M Mason
mich...@altra-optics.co.uk wrote:
 I'm running Python 3.1 on Vista and I can't figure out how to add my own 
 directory to  sys.path.
 
 The docs suggest that I can either add it to the PYTHONPATH environment 
 variable or to the PythonPath key in the registry.  However, PYTHONPATH 
 doesn't exist, and updating the registry key has no effect

 So where does sys.path get its value from, and how do I change it?

The simplest hack (worst - but most direct) is that sys.path is a list
and you can use it like any other list. (add, delete, change items in it)

It gets loaded from site.py (in the standardard library) at startup.

Anything else you'll have to ask somebody else.

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


Re: Does python have the capability for driver development ?

2009-07-29 Thread David Lyon
 MalC0de wrote:
 hello there, I've a question :
 I want to know does python have any capability for using Ring0 and
 kernel functions for driver and device development stuff .
 if there's such a feature it is very good, and if there something for
 this kind that you know please refer me to some reference and show me
 some snippet .

What operating system are you talking about?

Most device drivers run at ring 3 (or lower) and not zero. This way if
there
is a driver crash the whole operating system doesn't freeze.

Python is generally considered a high-level language. If you want
to play around with drivers.. usb serial.. etc do it at a python
level through the existing device drivers.

imho the performance of interpreted python isn't compatible with
writing block-mode device drivers (hard-disks) and so forth.

What hardware do you have that you need to write a device driver
for ? Isn't there a device driver available already? or do you
mean just a device controller?

David



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


Re: Using easy_install, reduncant?

2009-07-27 Thread David Lyon
On Mon, 27 Jul 2009 09:42:06 -0700 (PDT), ray ray.jos...@cdicorp.com
wrote:
 I am working on a Trac installation.  I am new to Python.  To install
 packages, it is suggested to use setuptools.  I have not understood
 the directions.
 
 I execute ez_install.py.
 
 Then I attempt to execute easy_install.py setuptools-0.6c9-py2.6.egg.
 There response that setuptools is already the active version in easy-
 install.pth.  Then:
 Installing easy_install.exe script to C:\Python26\Scripts error:  C:
 \Python26\Scripts\Easy_install.exe: Permission denied.
 
 I have compared the file entries before and after this attempt and
 there are no new files.  Is there any problems here?  What did I miss?

Try using python package manager :
http://sourceforge.net/projects/pythonpkgmgr/

You might find it a lot simpler. It will download and install setuptools
for you if you are still having problems.

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


Re: Extract images from PDF files

2009-07-27 Thread David Lyon

pdftohtml on sourceforge may help...

On Mon, 27 Jul 2009 19:52:01 -0700 (PDT), writeson doug.farr...@gmail.com
wrote:
 Hi all,
 
 I've looked around with Google quite a bit, but haven't found anything
 like what I'm looking for. Is there a Python library that will extract
 images from PDF files? My ultimate goal is to pull the images out, use
 the PIL library to reduce the size of the images and rebuild another
 PDF file that's an essentially thumbnail version of the original PDF
 file, smaller in size.
 
 We've been using imagick to extract the images, but it's difficult to
 script and slow to process the input PDF. Can someone suggest
 something better?
 
 Thanks in advance,
 Doug
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setuptools question.

2009-07-21 Thread David Lyon
On Tue, 21 Jul 2009 11:12:01 -0700, Fred C f...@bsdhost.net wrote:
 I have a python program and when I install this program from the  
 module home directory using setup.py everything works fine.
 
 But easy_install fails with the following error, because I am trying  
 to install some start up shell scripts into /etc/init.d
 
   The package setup script has attempted to modify files on your system
  that are not within the EasyInstall build area, and has been aborted.
 
 Is there a way to use easy_install to install the start scripts into / 
 etc/init.d. If not, what is the best way to install these scripts.

What package is it? what platform ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: convert Dbase (.dbf) files to SQLite databases

2009-07-15 Thread David Lyon
On Wed, 15 Jul 2009 11:53:28 +0200, Helmut Jarausch
jarau...@igpm.rwth-aachen.de wrote:
 Hi,
 
 I have a lot of old Dbase files (.dbf) and I'll like to convert these
 to SQLite databases as automatically as possible.
 Does anybody know a tool/Python script to do so?
 
 I know, I could use dbfpy and create the SQLite table and import all
 data. But is there something easier?

yes...

Use OpenOffice-Scalc or MS-Office-Excel to open the table...

Export to csv

Use SQLite Manager (https://addons.mozilla.org/en-US/firefox/addon/5817)

and use the import wizard to import your data

It shouldn't take too long...

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


Re: Where does setuptools live?

2009-07-07 Thread David Lyon
On Tue, 07 Jul 2009 09:06:49 +0100, Chris Withers ch...@simplistix.co.uk
wrote:
 What hasn't happened is enough testing of pypi packages and installing
 with setuptools/pip/enstall from pypi.
 
 What needs testing?

It's software... therefore it needs testing...

David


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


Re: Where does setuptools live?

2009-07-07 Thread David Lyon
On Tue, 07 Jul 2009 13:07:48 +0100, Chris Withers ch...@simplistix.co.uk
wrote:
 What hasn't happened is enough testing of pypi packages and installing
 with setuptools/pip/enstall from pypi.
 What needs testing?
 
 It's software... therefore it needs testing...
 
 Yes, which is why I asked WHAT needs testing? :-)

I've written a package manager gui. I think it is
orderly to comprehensively ascertain which packages will 
and won't install from pypi with the tool.

I'll run the same install test for pip, easyinstall 
and enstall. And come up with a preferred installer.

Which I will then suggest as the preferred tool.

David


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


Re: Where does setuptools live?

2009-07-06 Thread David Lyon
On Tue, 07 Jul 2009 02:09:41 +0100, Chris Withers ch...@simplistix.co.uk
wrote:
 I wonder how close setuptools is to being forked because of Phil Eby's 
 unwillingness to apply patches and/or clean up the horrible setuptools
 code?

setuptools... as far as I can see isn't actually installed until you
install easyinstall...

Pip (http://pypi.python.org/pypi/pip) and enstall 
(http://pypi.python.org/pypi/Enstaller/3.1.0) seem to be forks of 
setuptools already...

So it looks like it's already been forked to some degree..

What hasn't happened is enough testing of pypi packages and installing
with setuptools/pip/enstall from pypi.

If the xmlrpc links actually worked on pypi...

http://wiki.python.org/moin/PyPiXmlRpc?action=showredirect=CheeseShopXmlRpc

ie.. that they would allow a developer to download a packages via rpc

then this whole issue could probably be fixed more easily...

ok - the process isn't perfect... 

but there's room for improvement...

David

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


Re: System default sys.path

2009-07-01 Thread David Lyon
On Wed, 01 Jul 2009 19:48:04 -0700, Brock Pytlik bpyt...@sun.com wrote:
 Hi, I'm trying to find a way to get the value sys.path would have on a 
 particular system if python was started with an empty python path. I do 
 want it to include the site specific additional paths. I know I can hack 
 this information myself, 

Copy the code out from site.py...


 but I'd rather be able to get this on demand so 
 that if things change in the future, I don't have grovel around looking 
 for which directory string to change.

for index in range(len(sys.path)):
del sys.path[0]
site.addsitedir(self.p.python_sitepackages_path)

 If nothing else, I think the following would satisfy my needs:
 1) a variable containing the directories to use as a prefix (I think 
 sys.exec_prefix and sys.prefix are what I want here)
 2) a variable containing the list of suffixes that are applies to the 
 prefixes, like lib/pythonversion/site-packages
 3) a way of handing the *.pth files

What way do you want to handle them?


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


ANN: Package Manager GUI for Python (Windows)

2009-06-30 Thread David Lyon

Hi All,

I'm pleased to announce a GUI package manager (v 0.12) for 
Python versions 2.x under Windows.

http://sourceforge.net/projects/pythonpkgmgr/

It's tightly linked to the pypi repository and offers
the following functions:

 - search packages on pypi by name

 - install (via easyinstall or pip)

 - deinstall/remove packages

 - see package documentation

 - see package examples

 - install .EGG packages

 - Generate package manifest

If you find any issues, please don't hesitate to report
them via our tracker on the project page.

Regards

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


Re: packaging apps

2009-06-30 Thread David Lyon
On Tue, 30 Jun 2009 11:11:15 -0400, Ronn Ross ronn.r...@gmail.com wrote:
 I have a simple application that has a glade file and a .py file. How
would
 I package that into an installer for Windows, Mac, and a deb file? Can
 anyone point me in the right direction?

I don't think there is a simple way to do that just yet...

Of course, you could make a source distribution and do it for
each of these platforms using the documentation available at:

 http://docs.python.org/distutils/

I'm struggling with that myself.. I can never remember command lines..

So maybe it is time that I try to throw together a tool a little
bit like the package manager except that it does the building..

for all those platforms...

I think it's time for distutils to have some sort of gui build
tool... and I've been talking about it for too long now... haha

David


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


Re: IDLE / Python 2.5 under Jaunty

2009-06-23 Thread David Lyon
On Wed, 24 Jun 2009 00:55:14 +0100, duncan smith
buzz...@urubu.freeserve.co.uk wrote:
  Does anyone know how I can configure Boa to use wxPython 2.8.9.1?  Does
 anyone know if it's possible to configure the Python version under SPE?

It definitely is possible. In fact you need to use wxpython 2.8 with Boa.

I had a similar problem under some ubuntu version. You can install 2.6 and
2.8 wxpython. But from memory there is a wxversion ubuntu package also. 

I had to do some forceing as there seemed to be circular dependencies.

In the end I got it to work just fine...

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


Re: .pth files and figuring out valid paths..

2009-06-09 Thread David Lyon
On Tue, 9 Jun 2009 16:30:06 -0700 (PDT), rh0dium steven.kl...@gmail.com
wrote:

  Apparently there is a problem with the if statement???

  Thanks
 
 No for .pth files this needs to be on a single line..

I can't really see why you need conditional code...

If you want to add more locations...

Simply create another .PTH file.

Having multiple paths or multiple .PTH files isn't a 
problem for python.

David


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


Re: .pth files and figuring out valid paths..

2009-06-09 Thread David Lyon
On Tue, 9 Jun 2009 21:33:56 -0700 (PDT), rh0dium steven.kl...@gmail.com
wrote:

 Having multiple paths or multiple .PTH files isn't a
 problem for python.
 ..  
 We use it for our dev tree before we roll to production.  Once dev is
 QA'd then we (integrate) those changes to main and release.

Makes sense...

:-)

I was just wondering...

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


Re: how to get the path of a module (myself) ?

2009-06-01 Thread David Lyon
On Mon, 01 Jun 2009 23:28:16 +0200, Stef Mientki stef.mien...@gmail.com
wrote:
 hello,
 
 I've pictures stored in a path relative to my python source code.
 To get a picture, I need to know what path I'm on in each python module.
 I thought __file__ would do the job,
 but apparently I didn't read the documentation carefully enough,
 because file is the path to the module that called my module.
 
 Any ways to get the path of myself ?

This ain't the official way... but the hackers way.

Check site.path (import site)...

If your module got loaded, and it's own succinct directory or .egg, then
it will have been added to site.path. 

You might have to parse the values in site.path but we're only talking
a few lines of code because you already know the package name.

If not, there's another way through pkg_utils...

Regards

David

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


Re: SendMessage question

2009-05-25 Thread David Lyon

you might have more luck with http://pypi.python.org/pypi/SendKeys/0.3


On Sat, 23 May 2009 08:58:14 +0800, zhouhaifeng myprom...@sina.com wrote:
 Hi,I want to send ctrl + A and ctrl + C to a window,
 but my code can not work, who can help me ?
 
 Thanks a lot!
 
 hWnd = win32gui.FindWindow(None, “pad)
 print hWnd
 if hWnd  0:
 point = (555, 175)
 x, y = point
 win32api.SetCursorPos(point)
 
 win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x, y, 0, 0)
 win32api.SetCursorPos(point)
 win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
 
 #ctrl + A
 win32api.SendMessage(hWnd, 0, win32con.VK_CONTROL, 0)
 win32api.Sleep(10)
 win32api.SendMessage(hWnd, 0, 65, 0)
 win32api.SendMessage(hWnd, win32con.KEYEVENTF_KEYUP, 65, 0)
 win32api.SendMessage(hWnd, win32con.KEYEVENTF_KEYUP, win32con.VK_CONTROL,
 0)
 win32api.Sleep(10)
 
 #ctrl + C
 win32api.SendMessage(hWnd, win32con.WM_KEYDOWN, win32con.VK_CONTROL, 0)
 win32api.Sleep(10)
 win32api.SendMessage(hWnd, win32con.WM_KEYDOWN, 67, 0)
 win32api.SendMessage(hWnd, win32con.WM_KEYUP, 67, 0)
 win32api.SendMessage(hWnd, win32con.WM_KEYUP, win32con.VK_CONTROL, 0)
 win32api.Sleep(10)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to get rid of pyc files ?

2009-05-24 Thread David Lyon
On Sun, 24 May 2009 15:01:51 +0200, Stef Mientki stef.mien...@gmail.com
wrote:
 hello,
 
 Moving my entire program section between windows and Ubuntu,
 sometimes causes problems, due to the existence of pyc-files
 (and probably because my program still has hard coded paths).
 
 Is there a way to prevent generating pyc-files ?
 Or is there a way to redirect the generated pyc-files to a dedicated 
 location ?

Yes.. I see your problem...

try something else linking the files in linux...

Try this:

 - create a windows run-directory as in 'mkdir win-run'

 - create symbolic link in the win-run directory for each script

- 'cd win-run'

- 'ln -s /home/user/mypythondir/hello.py hello.py'

- for every source file...


Now you'll be able to run both...

Under windows the .pyc files will be created in the
win-run directory and under linux in /home/user/mypythondir

David

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


Re: Compile python extensions under windows/cygwin

2009-05-24 Thread David Lyon
On Sun, 24 May 2009 15:34:42 -0700 (PDT), Joana joanacfcam...@gmail.com
wrote:
 I mantain Python on Windows, all installed packages are under c:
 \Python25\Lib\site-packages. Now I have to build C libraries used by
 python extensions and I am using cygwin, but I don't know how to
 install the module in Windows directory.
 
 Can anyone help me?

I think it is a problem because as far as I know cygwin cannot
see files outside of /cygwin. 

Where is python installed in cygwin?

Can't you install the same packages into cygwin?

and then do your building in there...?

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


Re: html ui + py background? any tut?

2009-05-23 Thread David Lyon

Hi,

I don't know any tutorial either...

At work, we have made gui apps using wxpython to make the gui...

wxpython has html viewer component...

you can use Cheetah or another template engine to make the
html...

It's pretty easy and effective...

David


On Sat, 23 May 2009 15:48:38 +0800, oyster lepto.pyt...@gmail.com wrote:
 I have read for many times that the modern appliaction (not a web one,
 but desktop on) uses html + js for its UI, and python code is for the
 background work
 but I have never found event a simple (yet completed) article on how
 to develop such a thing from scrach in these advocacy thing.
 
 Can anyone point out some simple, can-be-followed tutorial on such
 thing especially for windows os?
 
 thanx
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: dbfpy - cannot store new record

2009-05-22 Thread David Lyon
On Fri, 22 May 2009 08:34:17 +0200, Laszlo Nagy gand...@shopzeus.com
wrote:
 Now I also tried to set -1. In any of the above cases, if I open that 
 dbf file with a commercial DBF editor application then I see that the 
 value is not null.
 
 - Borland Database Desktop shows False value
 - CDBF shows an invalid value, noted with a question mark (screenshot 
 attached)

dbfpy is very old code.

Try setting up a CHAR(1) field and filling it with Y or N or
T or F.. indicating yes,no,true or false...

This might be an easier solution...

otherwise... just debug the dbfpy code...


David

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


Re: dbfpy - cannot store new record

2009-05-21 Thread David Lyon

Hi,

Try not opening the file in append mode (no a+)

Inside the logic, there is already a seek to the end of the file
and the record counters at the start of the file need updating
too.

Regards

David


On Thu, 21 May 2009 13:25:04 +0200, Laszlo Nagy gand...@shopzeus.com
wrote:
 Given this example program:
 
 import dbfpy
 def dbf_open(tblname):
 fpath = os.path.join(local.DB_DIR,tblname)
 f = file(fpath,ab+)
 f.seek(0)
 tbl = dbf.Dbf(f)
 return tbl
 
 tbl = dbf_open(partners.dbf)
 rec = tbl.newRecord()
 rec[FIELDNAME1] = 1
 rec[FIELDNAME2] = Somebody
 rec.store()
 tbl.close()
 
 I get no exception, no error etc. But the new record is NOT appended to 
 the table. What is wrong here?
 
 Thanks,
 
Laszlo
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Package problem

2009-05-19 Thread David Lyon
On Tue, 19 May 2009 15:45:42 +0900, David Cournapeau courn...@gmail.com
wrote:
 There is no simple solution to the following situation:
- install setuptools from ubuntu...

When I have a ubuntu system I will try it

 But still, the whole
 value of ..(python).. is to have a whole set of packages which
 are tested together. Updating packages 'randomly' from 3rd party
 sources is inherently against this.

Well I presume pypi goes a long way to offering this...

I've used easy_install a few hundred times manually now and I've 
noticed some incorrect outcomes. For example, downloading a
package marked debian into my windows system... and wondering
why it didn't work

for most packages... it seems to work quite well though..

I think the issue is really that if we can do tests and count
test results.. we'll probably get a lot further than we have
in the past.

We seem to be at the 85% mark... next stop should be 95% or
at least some known and measurable number...

I'm fully agreeing it can get better...

David





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


Re: Package problem

2009-05-19 Thread David Lyon
On Wed, 20 May 2009 00:40:28 +0900, David Cournapeau courn...@gmail.com
wrote:

 The discussion has nothing to do with setuptools, or even python for
 that matter. 

It has everything to do with python

 on any system (including windows). That's why you should avoid
 installing from sources into the locations managed by the OS, be it
 /usr for unix, or C:\Windows on windows, etc...

I actually kind of agree with what you're saying here. Under Linux
it seems to me that users shouldn't be playing around in the
bowels of /usr/ or anything lower...

but

site-packages is the directory that one would want to keep
python packages in. That should be a developer/sysop area
and not owned and run by the o/s.

maybe... maybe... although too late now (?) somewhere
like /etc/site-packages might be a lot better place to
keep ones site packages. Or /opt.

Under windows in python 2.6, they have this concept of
user-packages.

One could easily also apply that concept to linux and
have a /home/user/.user-packages directory in which
one could keep all ones user packages.

 The problem is that overwriting files managed by the
 software management system without its consent is bound to be broken,

Something like what I describe above would totally
satisfy linux system organisation requirements.

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


Re: Package problem

2009-05-19 Thread David Lyon
On Tue, 19 May 2009 13:29:47 +0100, A. Cavallo a.cava...@cavallinux.eu
wrote:
 You could try:
 
 http://download.opensuse.org/repositories/home:/cavallo71:/python-opt/
 
 This is a python interpreter installed under /opt/opt-python-2.7a0.
 All you have to do is sourcing /opt/opt-python-2.7a0/opt-python-env.sh
 from a shell and start using the python 2.7 (it's directly from the svn 
 trunk).
 
 If you download a python module to generate the rpm for it all you have
to
 do 
 is:
 $ . /opt/opt-python-2.7a0/opt-python-env.sh
 $ python setup.py bdist_rpm 
 
 It will generate a package rpm installable under /opt/python-2.7a0 and
 won't 
 interfere with the system.

I'm fascinated by this and want to try...

The above just gave me an ftp link?

Can you explain again how to do it?


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


Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread David Lyon
On Mon, 18 May 2009 11:49:15 +0200, Philipp Hagemeister phi...@phihag.de
wrote:
 1) According to http://docs.python.org/dev/install/, The most
 convenient way is to add a path configuration file to a directory
that’s
 already on Python’s path, (...).

It's true...

 2) Path configuration files have an extension of .pth, (...)

Yes.

 12 = 3) A file test.pth with the content /example/ should result in
 sys.path containing /example/.

No. Python, once finding the .pth will process it. 

 
 4)  (the current directory) is the first element of my sys.path

Not always - but maybe it is. Let's not assume anything.

 
 14 = 5) The current directory qualifies for a directory that’s
 already on Python’s path,


 
 135 = 6) echo /example/  test.pth; python -c 'import
 sys;print(repr(sys.path))' should contain '/example'.
 
 
 I think I misinterpreted the documentation, but what exactly is wrong
here?

What are you expecting? and maybe we can tell you why you aren't getting
it...

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


Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread David Lyon
On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister phi...@phihag.de
wrote:
 Yes, but that processing will add /example/ to sys.path, right?

It actually works the other way around. The directories listed in
sys.path are scanned for .pth files.

You can add packages by listing them inside a .PTH.

 I'm expecting .pth files in the current directory to be be processed,
 according to docs/install/. Christian Heimes already pointed out this is
 not the case; so I'm wondering whether this is a mistake in the
 documentation or just my faulty logic.

Perphaps you don't understand them yet.

.PTH files are for adding run-time packages.

May I ask why you are playing with .PTH files? they are a fairly
advanced sort of concept for describing where packages are located
to the python interpreter.

If you are using .PTH files... you should be using import .. 
inside your code..

Regards

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


Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread David Lyon
On Mon, 18 May 2009 14:05:50 +0100, Tim Golden m...@timgolden.me.uk
wrote:

 According to http://docs.python.org/install/index.html and my
 own reasonably long experience of them, they're just a way of
 getting extra paths into sys.path. 

Well, fair enough... 

 The docs referred to above do indeed say add a path configuration 
 file to a directory that’s already on Python’s path but until I
 saw Christian H's post just now, I'd never bothered to understand
 exactly what the mechanism was: I just stick site.pth into c:\pythonxx
 and it works for me.

Sure. Only I have been debugging the code lately to try to understand
how to do package installation/deinstallation for a python package 
manager. Perphaps my understunding is simplistic.

I think the area of confusion here is the word directory. I suggest
that perphaps the term package is more modern.

For example, a .PTH file in a sys.path directory contains links to all 
the packages available to python is perphaps is clearer than :

a .PTH file in a sys.path directory contains links to all the 
directories available to python

Everybody knows your experience goes back a lot further than mine.

So you're probably in a much better position to explain it than me.

Good - I can go back to my code now...

:-)

David




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


Re: Package problem

2009-05-18 Thread David Lyon

Hi David,

I guess paraphrased you are saying don't touch your packages..

To my point of view, the needs of the developer override the
priorities of the O/S house...

We should expect old packages on our systems from the O/S

and have an easier way to update them to whatever we want..

That's why imho, we can benefit with a package manager tool
that can do just that. I just don't have anything running
on ubuntu just yet - sadly.

On Tue, 19 May 2009 13:15:14 +0900, David Cournapeau courn...@gmail.com
wrote:
 On Tue, May 19, 2009 at 4:52 AM, Sverre sverreodeg...@gmail.com wrote:
 I'm using Ubuntu and some of the packages in the repository are too
 old. So I got the thought to remove nearly  all packages downloaded
 from the repository and install them with easy_install. Is this a way
 to go without greater problems?
 
 This is probably the worst way to do it :)
 
 As a rule, you should never install anything from sources (be it
 python packages or anything else) in /usr, which should be considered
 as 'owned' by the package. By /usr is owned, I mean that anything
 installed with prefix /usr (/usr/lib, /usr/include, etc...) can be
 overwritten by the Ubuntu package manager. Unfortunately, by default,
 python setup.py install will install in /usr (whereas most sources
 packages installed in /usr/local/ if no --prefix is given - that's the
 case of any software using autoconf, like python for example).
 
 You could either install system-wide (for all users) in /usr/local, or
 somewhere just for yourself. To handle dependencies, you could use
 something like virtualenv for packages using autotools. For
 development, a more heavy-weight (but more reliable) method is to use
 chroot and other 'jail-like' systems.
 
 You should avoid building by yourself things which depend on a lot of
 C libraries - it quickly becomes unmanageable in my own experience.
 For some distributions which have long release periods (e.g. RHEL),
 that's a significant problem without any easy solution (I almost
 always use a virtual machine in that case if possible).
 
 cheers,
 
 David
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Package problem

2009-05-18 Thread David Lyon
On Tue, 19 May 2009 13:53:18 +0900, David Cournapeau courn...@gmail.com
wrote:
 Given that nobody has managed to solve this problem, I doubt you will
 find a solution. 

It is solved in other languages.. for example perl.. and delphi

 If there was a reasonable solution, it would have
 already been developed. 

Maybe we are slower because we like to do things better

 Trying to fight the OS deployment system is thinking backward IMHO.

Fight it ??? I didn't even get a python interpreter with my operating
system...

So there's no possible way I can be against it...


David


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


Re: (Windows) Finding out which process has locked a file.

2009-05-14 Thread David Lyon

 In message 787d6072-3381-40bd-
 af20-8e1a40405...@h23g2000vbc.googlegroups.com, CinnamonDonkey wrote:
 
 I have a script running which occa[s]ionally fails because it is trying
 to delete a file in use by another process. When this happens I want
 it to log which process has the lock.

Maybe there is something on sysinternals.com that you can download
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: capture stdout and stderror from within a Windows Service?

2009-05-14 Thread David Lyon
On Thu, 14 May 2009 11:16:51 -0500, Grant Edwards inva...@invalid wrote:
 On 2009-05-14, Chris Curvey ccur...@gmail.com wrote:
 I'm trying to get this invocation right, and it is escaping me.  How
 can I capture the stdout and stderr if I launch a subprocess using
 subprocess.check_call()?  The twist here is that the call is running
 from within a Windows service.

 I've tried:

 check_call(mycmd.exe, stdout=subprocess.PIPE)  [raises an exception
 An integer is required]

 check_call(mycmd.exe, stdout=file(c:\\temp\\foobar.txt, w))
 [raises an exception An integer is required]

In the past, windows services have never been allowed to make any output
to the console or the GDI or get any user input. Rules said they could 
send stuff to syslog etc.

All writing can go to logfiles and so forth...

I've never heard of that being allowable

David

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


Re: py2exe + win32com + DAO

2009-05-13 Thread David Lyon
On Tue, 12 May 2009 22:06:42 -0700 (PDT), Trevor trevor.la...@gmail.com
wrote:
 I do not believe your assertion applies to the following line of code:
 
 daoEngine = win32com.client.Dispatch(r'DAO.DBEngine.36')

It doesn't. I'm simply suggesting that it is possible you are opening
the database in Access or something in Administrator/dba mode. That
could be causing an exclusive lock on the database so that no sub
task can then open it. 

i have seen this on old versions of Access.

To provide excellent performance, microsoft used to load the whole
database into memory if it could. And just operate mostly from there.


 is it possible to obtain more
 verbose error output from Python modules?  The error message in the
 original post was generated from:
 
 print sys.exc_info()[0]

possibly but i'm not sure how...

David

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


Re: python script as service

2009-05-13 Thread David Lyon

On XP, go to Start Menu/All Programs/Accessories/System Tools/Scheduled
Tasks

Add your program in with the scheduled task wizard...

On Wed, 13 May 2009 13:10:25 +0530, prakash jp prakash.st...@gmail.com
wrote:
 Hi all,
 
 could any one tell how to run a python script as a scheduled service(say
 every one minute). I tried out the windows registration
 
 method but encountered an error . The error reads:
 
 The 'script name'  on local Computer started and then stopped. Some
 services stop automatically if they have no work to do, for example, the
 Performance Logs and Alerts service
 
 Regards
 Prakash
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread David Lyon
On Wed, 13 May 2009 13:54:49 +0200, Thomas Heller thel...@python.net

 
 Well, if you don't like the windows installer than you can always
 install from the sources.  Please go ahead and try it out.

Thanks for the offer... 

but aren't python .eggs supposed to remove the need for doing that ?

Regards

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


Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-13 Thread David Lyon
On Thu, 14 May 2009 08:33:12 +1000, Mark Hammond skippy.hamm...@gmail.com
wrote:

 But if PYTHONPATH was set incorrectly it really doesn't matter how 
 Python was installed, it would still fail.  The installer didn't set 
 PYTHONPATH, a human did.

Hi Mark,

Well I am just trying to write a package manager for python because
I felt spoiled on my last platform, perl. When I came to python I found 
a bit primitive in python under windows in comparison. I felt like
starting to write something that might be useful..

I've personally used your packages at work and find them useful. 

At the same time it is a very interesting learning process about python
and how it works..

Best Regards

David


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


Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread David Lyon
On Tue, 12 May 2009 23:57:48 GMT, David Lees debl2nos...@verizon.net
 Mark and David,
 
 Thanks for the help.  I just got it to install for Python 2.6.  All I 
 did was change PYTHONPATH (as suggested by Mark) from 
 C:\Python25\Lib\site-packages to C:\Python26\Lib\site-packages

lol - so simple...

Thankfully, we got a quick answer by the package writing master himself.. 

but imho - package installation shouldn't be that tricky.. it should be
click and shoot... which is what i'm working on doing..

I have to say that I don't mind being corrected because I learnt 
something valuable too... 

David

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


Re: py2exe + win32com + DAO

2009-05-12 Thread David Lyon

Maybe VB is opening the table in Exclusive mode... then when you
are opening it as a subprocess, it's already locked.

It's possible the win32com module is not giving you a very
descriptive error message.

Try running your process while vb is running at the same time
with the database open and if you get the same error then it 
might confirm my assertion.

Otherwise it is likely that it is something else.

On Tue, 12 May 2009 17:20:15 -0700 (PDT), Trevor trevor.la...@gmail.com
wrote:
 I have a Python code module that adds records to a MS Access
 database.  The following line of code executes successfully when the
 code module is run as a Python script:
 
 daoEngine = win32com.client.Dispatch(r'DAO.DBEngine.36')
 
 It also runs successfully when the Python script is compiled and run
 as an executable using the Py2exe utility.  However, when the compiled
 executable is called from VBA using the win32 CreateProcess function,
 the preceding code produces this output:
 
 !!python/name:pywintypes.com_error ''
 
 What is causing this error?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-12 Thread David Lyon
On Wed, 13 May 2009 05:32:16 +0200, Martin v. Löwis mar...@v.loewis.de
wrote:
 
 I think this was a case of obscure misconfiguration of the system.
 It is always possible to configure a system in such a way that even
 the most resilient installation procedure will break.

Technically, you are right..

but imho.. windows installers are overkill and shouldn't be used
for this sort of thing. That is, installing libraries. And not
the fault of the package authors either...

if we could clean up the python universe and ensure all packages
are in either .egg or distutils packages then i think it would
be a nicer place...

Take care

David 

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


Re: Unable to install Pywin32 for Python 2.6.2

2009-05-11 Thread David Lyon
On Tue, 12 May 2009 02:22:56 GMT, David Lees debl2nos...@verizon.net
wrote:
 I have no problem installing Python 2.6.2 for windows under XP SP3 and 
 IDLE and the command line versions work fine.  When I run the pywin32 
 installer downloaded from sourceforge (pywin32-212.win32-py2.6.exe) I 
 get the following error message:
 
 Traceback (most recent call last):
File string, line 565, in module
File string, line 291, in install
 ImportError: Module use of python25.dll conflicts with this version of 
 Python.
 *** run_installscript: internal error 0x ***
 
 I have tried uninstalling Python 2.6 and reinstalling, but still get the 
 same message.  I do have Python 2.5.4 and its associated Pywin32 on the 
 same machine, but I have a laptop with pywin32 installed for both python 
 2.5 and 2.6.
 
 TIA
 
 David Lees
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unable to install Pywin32 for Python 2.6.2

2009-05-11 Thread David Lyon

Hi,

hmmm... that's annoying..

Whilst I don't have an exact answer I have a few hunches...

Perphaps what has happened is that the windows installer between
the versions of pywin32 has installed newer versions of the same
dlls over the top of older ones.

Or, possibly, the installer hasn't wanted to replace older dll's 
because they already exist on the system.

This would result in a mismatch.

You may be lucky and find an install log. This might tell you which
files were actually installed. And you could play around with
moving them around.

Good luck with your night vision task

David


On Tue, 12 May 2009 02:22:56 GMT, David Lees debl2nos...@verizon.net
wrote:
 I have no problem installing Python 2.6.2 for windows under XP SP3 and 
 IDLE and the command line versions work fine.  When I run the pywin32 
 installer downloaded from sourceforge (pywin32-212.win32-py2.6.exe) I 
 get the following error message:
 
 Traceback (most recent call last):
File string, line 565, in module
File string, line 291, in install
 ImportError: Module use of python25.dll conflicts with this version of 
 Python.
 *** run_installscript: internal error 0x ***
 
 I have tried uninstalling Python 2.6 and reinstalling, but still get the 
 same message.  I do have Python 2.5.4 and its associated Pywin32 on the 
 same machine, but I have a laptop with pywin32 installed for both python 
 2.5 and 2.6.
 
 TIA
 
 David Lees
-- 
http://mail.python.org/mailman/listinfo/python-list


Fwd: Re: Unable to install Pywin32 for Python 2.6.2

2009-05-11 Thread David Lyon
Hi,

hmmm... that's annoying..

Whilst I don't have an exact answer I have a few hunches...

Perphaps what has happened is that the windows installer between
the versions of pywin32 has installed newer versions of the same
dlls over the top of older ones.

Or, possibly, the installer hasn't wanted to replace older dll's 
because they already exist on the system.

This would result in a mismatch.

You may be lucky and find an install log. This might tell you which
files were actually installed. And you could play around with
moving them around.

Good luck with your night vision task

David


On Tue, 12 May 2009 02:22:56 GMT, David Lees debl2nos...@verizon.net
wrote:
 I have no problem installing Python 2.6.2 for windows under XP SP3 and 
 IDLE and the command line versions work fine.  When I run the pywin32 
 installer downloaded from sourceforge (pywin32-212.win32-py2.6.exe) I 
 get the following error message:
 
 Traceback (most recent call last):
File string, line 565, in module
File string, line 291, in install
 ImportError: Module use of python25.dll conflicts with this version of 
 Python.
 *** run_installscript: internal error 0x ***
 
 I have tried uninstalling Python 2.6 and reinstalling, but still get the 
 same message.  I do have Python 2.5.4 and its associated Pywin32 on the 
 same machine, but I have a laptop with pywin32 installed for both python 
 2.5 and 2.6.
 
 TIA
 
 David Lees
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: local module-docs server on Linux?

2009-05-04 Thread David Lyon
Hi Soumen,

You could try running the Python Package Manager that we are developing
on sourceforge.

There isn't a release yet but we have implemented two buttons inside
the program for 'Examples' and 'Documentation'.

What they do is go off and find any documentation files or example
directories for third party modules that are installed on the system.

Then, if found, they will open a web browser on any documentation
or examples directories.

In the spirit of open source you could give it a try

svn co https://pythonpkgmgr.svn.sourceforge.net/svnroot/pythonpkgmgr
pythonpkgmgr

Any feedback is welcome..

David

On Tue, 5 May 2009 08:00:13 +0530, Soumen banerjee soume...@gmail.com
wrote:
 Hello,
 I had used python on windows and one of the features i liked best was
 that you could start a module-docs server and then use firefox to
 access it. This would show module-docs for all modules you had
 installed(including any 3rd party installs) . How do i do this on
 linux?
 regards
 Soumen
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Re: Third Party Modules

2009-04-29 Thread David Lyon

 On Tue, 28 Apr 2009 10:15:23 -0700, John Nagle na...@animats.com wrote:
 Brock wrote:
 Hi Everyone,

 I know this is most likely a basic question and you will roll your
 eyes, but I am just starting out with Python (hobbyist) and I see many
 tutorials on the web referring to the use of external modules.
 ...
 
 There are several different mechanism for handling this, and they
 all suck.
 The whole Python module distribution scheme is so uncoordinated that
 there's
 no uniform way to do this.  It's not your fault.
 ...
 I'm not going to put Python software out for public use again.  I
 don't
 have the time to deal with this crap.

People are working on this for example, I am working on a Package
Manager Project on sourceforge to solve exactly these problems.

Hopefully soon we will be ready to do a release.

In the spirit of open source, you would be welcome to join our project,
and do some testing. Report some bugs etc.

http://sourceforge.net/projects/pythonpkgmgr/

Best Regards

David









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


Re: screen scraping with Python?

2009-04-28 Thread David Lyon


On Mon, 27 Apr 2009 12:28:31 +0530, Meenakshi, Arun Kumar
arunkumar.meenak...@sc.com wrote:
 Hi Friends,
 
 Please let me know whether VT100 (Screen scrapping)
 emulation is possible or not. If screen scrapping / VT100 emulation is
 possible, please let me know how to do it. I will be happier, if you can
 provide me steps and sample codes. I am a beginner in python. So kindly
 help me by letting me know about the possibilities. EXPECTING THE REPLY
 MAIL Thanks

Of course...

VT-100 terminals were usually rs-232 devices connected at 9600 baud

If you can write some python code talking to the serial port, you can
easily read the data from the port... render it... and do whatever you
need...

If you are doing it over a network then you are using a terminal emulator.

Many of the top name termninal emulators provide a programming api.

If not.. go open source

There are just many.. many different ways these days... depending on
what platform and which terminal emulator you are using...

David

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


Re: Web based application development using python

2009-04-28 Thread David Lyon


On Tue, 28 Apr 2009 04:50:13 -0700 (PDT), Rahul r.warhe...@gmail.com
wrote:

 but i want to know which is the official standard recommended by
 python.

but there isn't one...

All of the frameworks are slightly different and solve
different problems.

It is for you to work out which one suites you best...

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


Re: getting linux distro used...

2009-04-27 Thread David Lyon

perphaps platform.uname()?

On Sun, 26 Apr 2009 22:35:29 -0700 (PDT), deostroll deostr...@gmail.com
wrote:
 Hi,
 
 I just found that you could use platform.system() to get the
 underlying os used. But is there a way to get the distro used...?
 
 --deostroll
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Re: How to import modules from specific Python installation?

2009-04-26 Thread David Lyon

On Sun, 26 Apr 2009 13:07:24 -0700 (PDT), kk maymunbe...@gmail.com wrote:
 I know there is a way to import from different Python installation but
 I could not find the answer.  I have Python 2.6 and 2.5

You can probably achieve this by adjusting the pythonpath to
search through the site-packages directory of the other installation.

David

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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Lyon


On Thu, 23 Apr 2009 07:04:35 -0400, David Stanek dsta...@dstanek.com
wrote:

 If I use win32com how do you expect me to support Linux? 

Of course not...

 What about the many packages on PYPI containing C? 

Exactly. 

 What if I decide to write only to Python 3?

Fair enough. But don't forget it is open source.

Let me ask these two questions...

 - What about the use case where somebody likes the code and wants 
   to use it on Python 2.5?

 - Should not that user be able to share back with other 
   Python 2.5 users?

 Who will support the other platforms if not the developer?

It's Open Source don't forget

Fact is these days.. developers come and go

If anything my suggestion promotes preserving the resources
of the original developer rather than letting them expire just
because their operating system does

(I'm talking windows here)

David


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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Lyon


On Thu, 23 Apr 2009 14:02:19 -0700, norseman norse...@hughes.net wrote:
 If you think I'm somehow able to take a look at a plain piece of code
 you posted yesterday and know that it was written 26 years ago on a CP/M
 2.0 dual HD DS 8 floppy drive system using Microsoft Assembly for the
 Z80 chip, intended as a generic print driver for the IBM Seletric
 converted to operate with computers of the day - you have an unrealistic
 esteem of my abilities.

Funny :-)

A build test under the last 5 significant versions of python interpretors 
would probably pick up the fact that it is dead code

hello:
mov bh,25
mov ah,bh

you had cp/m version 2? - wow

We're all ok... as far as we know

David



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


Re: installer for py2exe files?

2009-04-22 Thread David Lyon
Hi Gabriel,

look at ...

 - inno setup http://jrsoftware.org/isinfo.php
 - nsis http://sourceforge.net/projects/nsis/

I think these are the two clear leaders for open source...


On Wed, 22 Apr 2009 11:17:10 +0200, Gabriel Rossetti
gabriel.rosse...@arimaz.com wrote:
 Hello everyone,
 
 I am wanting to create an installer for my project. I first use py2exe
 to create win32 executables and then would like to have an easy to use
 (for the end user) installer. I would need the installer to launch a
 script (a python script also turned into an exec) after the install is
 done, or even better yet, incorperate the script's tasks in the
 installation process (configure files, check for open ports, etc.). Does
 anyone have an idea, recommendation or has had a similar situation
before?
 
 Thanks!
 Gabriel
 --
 http://mail.python.org/mailman/listinfo/python-list

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


Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Lyon

Hi all,

I'm working on a python package manager gui. Mainly because I struggle on
windows
getting python packages installed. In my mind, there seemed to be some
minor
problems, but then I did the numbers. Do the numbers I writa about here
reflect
reality?

Should we discuss stuff like this? Debate welcome...


= Introduction =

One of the big challenges for Python going forward is providing a testing
infrastructure for Python Packages. 

There are now over 6,000 packages listed on PyPi - and this number can only
get bigger.

Then, there are the three major operating systems:

 * Windows
 * Mac
 * Linix/Unix

To complicate the problem, there are now many versions of each operating
system.

Multiply those two combinations by all of the versions of Python that
already exist (not to mention the ones coming) and we start to that we are
heading into complexity. If there are 4 major windows revisions and 4 major
Linuxes, and two major Mac platforms, we end up with perphaps (6,000 x (4 +
4 + 2)) 60,000 delivery possibilities.

That number then needs to be multiplied by the number of python versions,
which possibly include 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 and coming up.. the 3
series...

So that could be (60,000 x 7 (python versions)) 420,000 variations of known
python packages.

To date... the testing has been done... we have to assume... manually with
some automation.

But we can't expect package maintainers to be forever testing their own
code on platforms that they simply don't have access to. 

A more reasonable and cost effective option is to have this testing done on
a server farm virtual environment building infrastructure.

In simple terms, we need to build all the packages that exist for Python on
a daily basis on all of the environments and report any issues back to the
registered maintainers.

This job is too big to be done manually. We need to use either a
Super-Computer or a Server Farm. Fortunately, Server Farms are close at
hand.

= Server Farm Virtual Environments =

Google and Amazon web services are two organisations amongst others that
offer commercial virtual server farms that could be employed to do the
above build process of all the python packages.

Python scripts would be developed utilising the python test frameworks to
supervise the build on each and every platform.

With this basic structure, a daily building/testing infrastructure working
across the different versions of python and operating systems, could easily
become a reality.

At present AWS offer virtual environments for both Windows and Linux. These
can be seen on these links:

 *
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=209
 *
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=208

A service to do building on Mac Virtual Machines needs to be located.

= Test Scripts =

A test script will be developed that will cycle through all the packages on
pypi, download the package and build it on all available platforms.

The results of the build can then be made available via some sort of web
delivery system. Describing on which platforms the builds were successful
and not.

In the past, it has been difficult for developers to test on all platforms.

These facilities are bound to improve overal code quality across the python
universe.

= Scope of Testing =

It's important to define what and can be and what cannot be tested. 

The scope of the framework will be:

 * to check that each package can be installed on all the relevant
platforms
   using the setup.py script

 * to run the built in tests within the package

 * to check that the package can be de-installed on the relevant platforms



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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Lyon

On Wed, 22 Apr 2009 16:39:05 -0700, Daniel Fetchinson
fetchin...@googlemail.com wrote:

 Have a look at http://www.snakebite.org/

Interesring...





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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Lyon

Hi Daniel,

On Wed, 22 Apr 2009 16:39:05 -0700, Daniel Fetchinson
fetchin...@googlemail.com wrote:

 Have a look at http://www.snakebite.org/

I'm not clear... 

 - are you saying they already test all the packages on pypi?

 - are they doing it in a one off manner?

Pardon me asking but it raised more questions than it answered...

David


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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Lyon


 Hi David,  

    

 Yes, I agree...  

But as an end-application-developer, I would put it to you that it is a lot 
of effort for developers to humanly contact the package developers every 
time we end-developers find a bug.
The task (for us developers) involves:

* finding the project page for the project... 
* finding their tracking system..
* sometimes finding the project is abandoned
* entering the bug
* waiting a few
days

Given that Python 3 is now on its way

It strikes me that are a lot of packages that are about to break.

What I am talking about (regression testing) already exists in the Perl world..

So I am hoping to have at least the same in the Python Universe 

It seems to me that from your perspective there would be no change? just

bug reports coming sooner, rather than later. 

 

David 

On Wed, 22 Apr 2009 22:13:54 -0400, David Stanek  wrote:
 On Wed, Apr 22, 2009 at 7:06 PM, David Lyon 
 wrote:

 One of the big challenges for Python going forward is providing a
 testing
 infrastructure for Python Packages.

 There are now over 6,000 packages listed on PyPi - and this number can
 only
 get bigger.

 
 Interesting ideas, but I'm not sure I see the value. As a package
 developer I publish eggs for various Py
thon versions and a source
 package. In some of my newer stuff I have been thinking of using 2.6+
 features, which means I don't care if it runs on any other version.
 
 I've been fine so far in relying on my code running the same on all
 platforms. I don't use any of the platform specific modules, but if I
 did as a package developer I can just say too bad -you need Linux. I
 have been bitten a few times by hardcoding '/' instead of os.path.sep,
 but I get a bug report and make a fix. So far no big deal.
 
 I think that if you do this or snakebite gets up and running then
 projects should opt in to platform/Python versions.
 
 --
 David
 blog: http://www.traceback.org
 twitter: http://twitter.com/dstanek

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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Lyon
Hi Steven,

You make some good points...

Let me try to answer them..

 Why is it the responsibility of the Python language to provide such a
 testing infrastructure?

First define Python language. 

Ok... we know it as the core interpretor. But to the developer it is also
all the packages that everybody has contributed.

The Python language is the interpretor and all the packages the
community has put together.

 Why? Why should every package on PyPI need to support all those Python
 versions? That should be the decision of the package maintainer. If they
 want to support every version of Python back to 1.0, they can, and if
 they want to only support version 2.5 that's fine too.

Why shouldn't packages support more than one python version?

Looking at it conversely

Why should the package developer dictacte which python version the package
will run on ?

 For all we know, three quarters of the
 packages on PyPI have never been tested *at all*.

Right. Why not run some tests

 What's the dire problem you are trying to
 solve? 

Backward and forward compatability of python package resources.

 What Super-Computers do you know of that run Python?

Google. Amazon web services..

 Who is paying for this?

From as little as $30 per month. Funding isn't so much the issue.

 With this basic structure, a daily building/testing infrastructure
 working across the different versions of python and operating systems,
 could easily become a reality.
 
 Oh yeah, easily.

pypi_packagelist = getallpypipackages()

for package in pypi_packagelist:
testpackageonallplatforms(package)

Best Regards

David




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


Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Lyon


Hi Steve,
 Why should the package developer dictacte which python version the
 package will run on ?
 
 Because they're the developer. Who else should decide what Python
 versions to support? 
The developer shouldn't be making such decisions at all
What hardware or operating systems we run his/her programs on is
up to the real world to decide.
If you think about it logically... why are we even asking our
developers to even build their packages for specific python
versions in the first place?
They should just:

* submit code
* The code gets built
* Somewhere the packages are made (eg pypi)...
* Downloaded... used
* bug reports come in...
* fix the
code...

There's no logical reason for developers to take on so much extra work if you think about it...

Python is an interpreted language...

It's all about source code... 

 What are you going to do, hold a gun to their head
 and force them to support Python 2.1 when they've written it using 2.6
 features?
No. Definitely not.

Just file a bug request 

 What's the *problem* that you are trying to solve? What bad thing will
 happen if we don't build your proposed system?

I will never get to drive a supercomputer 

 Google. Amazon web services..
 
 They're not super computers. They're distributed networks of regular
 computers.

But they're pretty fast... 

 Whether it is  a month or ,000 a month, who do you expect to pay it?

Oh please

It ain't that hard finding  

 pypi_packagelist = getallpypipackages()

 for 
package in pypi_packagelist:
 testpackageonallplatforms(package)
 
 
 You don't have either getallpypipackages() or
 testpackageonallplatforms(), so this is just Py in the Sky (pun intended)
 fantasizing. But okay, for the sake of the argument, let's pretend you
 have your cluster, and your test suite. You run the test, and get a list
 of 18,000 errors (that's an average of three errors per package). Now
 what?

File them as bug reports

David 

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


running pkg_resources from a compiled py2exe prog ram

2009-04-15 Thread David Lyon
Hi,

I'm trying to make an exe that uses pkg_resources.

Every time I try to run the compiled version it always fails complaining
that it is missing pkg_resources.


Traceback (most recent call last):
  File PythonPackageManager.py, line 6, in module
import MainWindow
  File MainWindow.pyc, line 16, in module

  File Packaging.pyc, line 9, in module

ImportError: No module named pkg_resources

This only happens in the .exe version. It runs fine without compilation.

Any ideas?

David

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


running pkg_resources from a compiled py2exe prog ram

2009-04-15 Thread David Lyon

btw

the code is just..


import ConfigParser
import zipfile
import os
import subprocess
import getopt, sys
import os.path
import _winreg
import pkg_resources



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


Re: Python AppStore / Marketplace

2009-03-29 Thread David Lyon


On Fri, 27 Mar 2009 08:16:01 -0700, Daniel Fetchinson
fetchin...@googlemail.com wrote:

 How will your solution be different from distutils, setuptools, pip,
 zc.buildout and a couple other similar packages I don't recall now?

For a start.. it doesn't replace those.. it drives them...

 Have you considered joining one of these efforts in order to not
 fragment the packaging and distribution arena? 

They seem pretty comprehensive and well developed as they are. I am not
sure what I could do to improve the under-the-hood functionality at this
point in time.

My GUI just drives their back end code..

 Have you evaluated these solutions in detail and have found that they 
 are not appropriate for your needs? 

Yes. They don't have a GUI.

If yes, what is the most problematic features of these
 already existing solutions that you don't like?

Not having a GUI is the biggest problem. Since I am swapping
languages (Python/Perl/+1 more) in any given day I'm just after
something that is simple. I can never remember the commandlines..

Regards

David






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


Re: email from windows

2009-03-29 Thread David Lyon

Hi Prakash,

You need to tell the system your smtp host...

ie 

 server = smtplib.SMTP('localhost')

needs to read something like

server = smtplib.SMTP('smtp.myisp.in')


On Mon, 30 Mar 2009 08:58:49 +0530, prakash jp prakash.st...@gmail.com
wrote:
 preexistant code :
 
 import sys, smtplib
 import string
 fromaddr = raw_input(From: )
 toaddrs  = string.splitfields(raw_input(To: ), ',')
 print Enter message, end with ^D:
 msg = ''
 count = 3
 while count  0:
 line = sys.stdin.readline()
 #if not line:
 #break
 msg = msg + line
 count = count -1
 # The actual mail send
 server = smtplib.SMTP('localhost')
 server.sendmail(fromaddr, toaddrs, msg)
 server.quit()
 
 -
 Running the program:
 --
 From: prakash.st...@gmail.com
 To: prakash.st...@gmail.com
 hai
 how r
 u
 ---
 error creeps in :
 error says
 
 Traceback (most recent call last):
   File C:\Python25\python-collection\mail\mail.py, line 17, in module
 server = smtplib.SMTP('localhost')
   File C:\Python25\lib\smtplib.py, line 244, in __init__
 (code, msg) = self.connect(host, port)
   File C:\Python25\lib\smtplib.py, line 310, in connect
 raise socket.error, msg
 error: (10061, 'Connection refused')
 
 On Mon, Mar 30, 2009 at 7:40 AM, prakash jp prakash.st...@gmail.com
 wrote:
 
 Hi all,

 In windows environment, how to send email from one gmail address to
 another
 gmail (or another mail) addrress


 Regards
 Prakash


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


Re: Python AppStore / Marketplace

2009-03-26 Thread David Lyon

I think Marcel has a point...

Much can be done and should be done to improve packaging and applications
for python.

That's why I for one am working on the python package manager project. On
sourceforge.

It uses the pypi interface to search.

Actually we haven't made a release yet. Still many.. many things to fix.

 Using my iPhone I suddenly realize how easy it is to find applications
 in Apple's AppStore. How easy and fast it is to install or de-install
 an app. My iPhone even checks in the background if there is an upgrade
 which could be installed painlessly.
 [...]
 Unfortunately there's nothing like this in the Python world...

It is being worked on...

 I'd be content
 to hear your projection for a mere 18 years out (the amount of time
 for which Python apps have been in production), or even 10 years
 (which takes us back to Python 1.5).

Just a GUI for package management that lets you seperate what is available
for the python platform that you are running on. Install, deinstall, and
get package information.

https://sourceforge.net/projects/pythonpkgmgr/

We only have source at the moment. Only for windows... and only for
python 2.5. Pretty limited... but we'll get there. 

David


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


Re: Ban Xah Lee

2009-03-09 Thread David Lyon


On Mon, 09 Mar 2009 20:25:16 -0700, Jürgen Exner jurge...@hotmail.com
wrote:

I'm certain he's the smartest computer guy on his street.
 
 Make that he ist certain, he is the smartest computer guy.

Which street? in a modern city? someplace in the developed world?

This we need to know


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


Re: Python AppStore / Marketplace

2009-03-03 Thread David Lyon

Hi all,

I only just noticed this thread... :-(

At the moment, I am working on a Python Package Manager project on
Sourceforge.

http://sourceforge.net/projects/pythonpkgmgr/

Firstly, I would welcome any developers who are willing to assist.

Secondly, I think there is much work to be done with python and it's
handling
of packages. To me it seems to need a great deal of streamlining. But I am
working mainly on windows.. and i know it is really easy with ubuntu and
so forth because the os seems to do the job really well.

 The client (there should be one for every supported platform) is a
 front-end application for the (PSF-) hosted super-cheeseshop, which
 end-users are not expected to access directly.
 
 
 Is my nirvana really that far away? ;-)

That's kindof what we're working on...

David

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


Re: looking for template package

2009-03-03 Thread David Lyon

 I know there are lots of template packages, but most seem aimed at web
 use.
 This is just text processing, not part of any web stuff.
 
 Any suggestions?

It doesn't matter if it is web or not. it's worth using a template
package.

You might very much like Cheatah... only takes a day to learn
and and it works well in non-web applications..

My recommendation...

David

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


Re: unziping a file in python..

2009-03-02 Thread David Lyon


On Mon, 02 Mar 2009 16:13:39 +, MRAB goo...@mrabarnett.plus.com
wrote:

 zf = zipfile.ZipFile('Archive.zip')
 for name in zf.namelist():
  new_path = os.path.join(output_folder, name)
  data = zf.read(name)
  try:
  open(new_path, 'wb').write(data)
  except IOError:
  # Create intermediate folders and try again
  os.makedirs(os.path.dirname(new_path))
  open(new_path, 'wb').write(data)
 --

Oh thanks for that...

Seems like the answer that i was looking for

Thank you very much...

(It's a 10 liner - I can live with that)

David

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


unziping a file in python..

2009-03-01 Thread David Lyon

It might seem a simple question.. but how does one programmaticaly unzip a
file in python?

In version 2.6 and above.. the zipfile module has an extractall method. But
it isn't available in 2.5 or below.

Any cross version, cross-platform answers welcome.

Any answers specific to win32 also welcome...

David

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


Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread David Lyon
Hi Dave,

 As of now, Enstaller 3.x is a command-line only tool but it does
 provide a lot of benefits over standard setuptools -- uninstall,
 update/upgrade command, found eggs aren't pre-pended to the full
 sys.path but instead inserted before the containing directory, etc.

Sounds extremely powerful.

Maye I should be looking at offering support for driving Enstaller
to the GUI tool. I think I will...

Regards

David

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


Python package Management GUI - New Project on Sourceforge

2009-02-01 Thread David Lyon
Hi all, 

I am pleased to announce that we have started a new python 
project on sourceforge. 

  Python Package Manager 
  pythonpkgmgr.sourceforge.net 

The goal is to provide a cross platform GUI tool that will 
vastly simplify loading and installing packages under python. 

 - written in python 
 - use WXWidgets for cross compatability
 - utilises distutils
 - provide a GUI wrapper for EasyInstall and pip
 - fetches packages from http://pypi.python.org/pypi 
   using their XML-RPC interface. 

Feel free to apply to join the project and help us build the solution that
we all need and deserve. 

Regards David Lyon 

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


Re: Python package Management GUI - New Project on Sourceforge

2009-02-01 Thread David Lyon
 What's wrong with Enstaller from Enthought ?

for a start

on https://svn.enthought.com/enthought/wiki/Enstaller

it claims to be depracated...

 Can I make a few suggestions ?

Sure..

 To be truly cross platform, consider
 using the Tcl/Tk toolkit rather tahn
 wxWindows. Why ? Because Tcl/TK
 is packaged and provided along with
 most Python distributions.

I agree with your point..

The problem is that Tcl/TK is a functionaly
handicapped and results in a less powerful GUI.

In an installer, it is not so hard to install
the wxWidgets dll (under windows)

But later, I won't mind redoing it in tk if
it becomes too much of a hassle.
 
 I would not simply have wrappers around
 easy_install and pip, I would integrate
 as best as you can into these libraries
 without trying to add or rewrite too much.

Sure... I agree

 Also, consider integrating with yolk
 as well, as it provides some food features
 and functionality that easy_install and pip
 don't provide.

Thanks - I will check out your suggestions in
detail.

Take care

David


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


Re: Python surpasses Perl in popularity?

2008-11-25 Thread david . lyon

Quoting John Machin [EMAIL PROTECTED]:


pyExcelerator is abandonware. Check out xlwt (a fork of pyExcelerator)
at http://pypi.python.org/pypi/xlwt


Thanks John.

That is very helpful.

I will move to that product..

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


Re: Python surpasses Perl in popularity?

2008-11-25 Thread david . lyon

Quoting Lawrence D'Oliveiro [EMAIL PROTECTED]:

Perl is the FORTRAN of scripting languages. Python is in some ways   
like Pascal.


Java is like COBOL.

C? Who knows...


Your memory goes way back...

haha


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


Python surpasses Perl in popularity?

2008-11-24 Thread david . lyon


Interesting topic !

I would venture so far to say that perl is todays 'C'..

Perl is todays language of technical complexity. It is obscure,  
complex, and is oriented towards the supremely intelligent (or equally  
- those seeking to get 'lost' in programming).


Python, whilst very powerful, doesn't have the sheer scale of  
contributors that Perl has. ie cpan. Many libraries, aren't as  
sophisticated - ie spreadsheet reading and writing.


Python is very clever.. but it goes in a 'purest' direction.

It is being used in stockbrocking and many other fields. It has a good  
following. It is being taught in schools here.. meaning it is  
extremely healthy.


More popular doesn't always mean better...

Quoting Xah Lee [EMAIL PROTECTED]:


herald: Python surpasses Perl in popularity!

According to
“TIOBE Programming Community Index for November 2008” at
http://www.tiobe.com/content/paperinfo/tpci/index.html

it seems that Python has surpassed Perl in popularity this month!

Good for Python!

From my own personal experience in the programing industry, i find it
hard to believe that Python actually surpassed Perl in terms of use in
companies. Python is used in, Google, as everybody knows, but where
else? Perl is used in, umm, about every company except Google (and
probably Google too! in fact).

A quick search in monster.com, i find that perl returns 2673 results,
and Python returns 879 results. Perlers, you still safe!

Looking at other lang popularity site,
http://www.langpop.com/
it indicates that it's pretty much a tie.

So, i think it's not all peaches and cream for Python yet.

However, am pretty sure it'll be so in the next couple of years.

(btw, for those perlers who wishes to learn Python, see a comparative
tutorial:

• Xah's Perl and Python Tutorial
  http://xahlee.org/perl-python/index.html
)

  Xah
∑ http://xahlee.org/

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





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


Re: Python surpasses Perl in popularity?

2008-11-24 Thread david . lyon

Quoting John Machin [EMAIL PROTECTED]:


Care to elaborate on the relative unsophistication of Python
spreadsheet reading and writing libraries?

Cheers,
John


Not really.

But one only has to use both languages on a regular basis to realise  
that perl is well ahead on the libaray/module front.


Some things in python are still pretty primitive...

but I know a lot of work has gone into them... just not anywhere near  
like what you see in perl.


David

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


Re: Python surpasses Perl in popularity?

2008-11-24 Thread david . lyon

Quoting John Machin [EMAIL PROTECTED]:


I'll try again: On what grounds do you assert that Many libraries,
aren't as sophisticated - ie spreadsheet reading and writing.? What
Python spreadsheet reading and writing libraries have you used? In
what way are they less sophisticated than their perl counterparts? Do
you have any particular enhancement requests?


Hi John,

Since you asked a second time and appear genuinely interested - I will  
answer properly. :-)


pyExcelorator  - Setting column widths. Doesn't seem to work.

Nor setting attrributes in sheets. Things seem to be only half done  
when compared to what I have seen in Perl.


Perl was much easier to get the same functionality working.

Here is my particular complaint:

..
from pyExcelerator import *
..
..
# -- Adjust the column width
if dbf1.fieldDefinitions()[f].fieldInfo()[1] == 'C':
ws.col(f).width = 0x0d00 + (f * 600)

in perl

$sheet1-set_column(0, 0, 20);


perl works nicely... I couldn't find a way to so easily set a column width...

plus.. colours are all broken...

If you can shed any light on it for me, I would be thankful.

Regards

David




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


Re: Python 2.5 and sqlite

2008-11-13 Thread david . lyon

Quoting Thorsten Kampe [EMAIL PROTECTED]:


And even if you want to compile Python yourself, SQLite doesn't have to
be _installed_. You simply can dump the files wherever you like and
point Python to it. This is often necessary on a machine where you
cannot install anything to the default locations because you don't have
admin rights.


Oh.. ok now I understand what you were trying to say.

That is fair enough.

Take care

David


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


Re: Python 2.5 and sqlite

2008-11-12 Thread david . lyon


Thorsten,

Quoting Thorsten Kampe [EMAIL PROTECTED]:


*  (Tue, 11 Nov 2008 17:58:15 -0500)

  Can you ask them if sqlite3 is installed? and if not... to install
  it?

 Why would he have to install SQLite?!

Seems a stupid question. If he wants to use SQLite... it needs to be
on the system


No.


really...?


Python cannot check whether SQLite is installed or not.


Of course it can


It checks
whether it can find the SQLite header files. So the SQLite source (or
the binary) is only needed for compiling Python. If you build SQLite
support as a shared library, you need the libsqlite package (not the
SQLite binary itself) at runtime. If you build it static, you don't need
SQLite at all at runtime. See Martin's answer in the same thread.


Anyway.. I think you just want to argue endlessly with silly  
statements.. you're being too pedantic..


Fact is different *nux distributions come with different parts  
(static/dynamic-libraries, header files etc). There is no blanket  
solution that will work on every platform every time.


I know many *nix distro's work with python out of the box.. but we are  
not talking about that..


Anyway.. I have work to do

Take care

David


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


Re: Python 2.5 and sqlite

2008-11-11 Thread david . lyon

 Can you ask them if sqlite3 is installed? and if not... to install it?

Why would he have to install SQLite?!


Seems a stupid question. If he wants to use SQLite... it needs to be  
on the system


ould include in your discussions well sqlite3 is part of python

 if it isn't, you haven't installed python properly

Sqlite3 is an optional part of Python.


But Python itself is dependent upon SQlite3 being installed first...

try it yourself...

first compile python 2.5 from source without SQLite.. see if it  
works... it won't.


Install Sqlite first... then compile python 2.5 from source.. python  
sqlite support will work...


The dependency is within the make files of python 2.5. It checks  
whether sqlite is installed on the machine and includes support if it  
is there.. if not.. doesn't support it...


It is very logical




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


Re: Python 2.5 and sqlite

2008-11-10 Thread david . lyon

Quoting [EMAIL PROTECTED] [EMAIL PROTECTED]:


Hi all,

On a (sun) webserver that I use, there is python 2.5.1 installed. I'd
like to use sqlite3 with this, however sqlite3 is not installed on the
webserver. If I were able to compile sqlite using a sun machine (I
normally use linux machines) and place this in my lunix home account
would I be able to use python and sqlite?

Any thoughts? I know its a bit of a stretch ...


Can you ask them if sqlite3 is installed? and if not... to install it?

You could include in your discussions well sqlite3 is part of python  
if it isn't, you haven't installed python properly


Worth a try...

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


Re: How to build the pysqlite? Where to find the sqlite3.h?

2008-11-04 Thread david . lyon


Hi Kurda,

I have been through this problem. Somebody needs to write a FAQ.

Took me a few days to pinpoint the problem.

Don't know which platform but I assume Linux...

Python depends upon Sqlite... which is weird... but it is what I discovered...

When Python is being built.. it checks for sqlite3.h.. in it's  
'configure' script. If it is not there it doesn't provide any support  
for it.


Other databases go 'ontop' of the language... so once you install your  
compiler/interpretor, you install your database. That is my experience.


Anyway, it is the other way around with sqlite. Install sqlite.. then  
build python... then it will all work.


The trick is having sqlite installed before the 'make configure' step  
in the install process.


If you have sophisticated packaging system in your linux... then use that...

Regards

David

Quoting Kurda Yon [EMAIL PROTECTED]:


On Nov 4, 8:59 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:

On Nov 5, 6:47 am, Kurda Yon [EMAIL PROTECTED] wrote:

 Hi,

 I try to build and install pysqlite? After I type python setup.py
 build I get a lot of error messages? The first error  is src/
 connection.h:33:21: error: sqlite3.h: No such file or directory. So,
 I assume that the absence of the sqlite3.h is the origin of the
 problem.

You can try downloading sqlite3 from the web and installing it in a
local dir. Update pysqlite setup.cfg to add these local dir names and
then try building it.

-srp



I see the problem. The pysqlite is a package which allows a
communication between the python and sqlite. I try to install the
pysqlite but I do not have the sqlite on my computer. So, I have
the problem. I tried to find out how to install the sqlite3 but it
seems there are no simple and clear explanations of how to do it. So,
I think I will give up and search for an easier way. Tank you for your
help.


 I found on the web, that this file should be either in /usr/local/
 include or in /usr/local/lib. I check this directories and I really
 do not have the sqlite3.h there.

 Thinks becomes even more complicated since I have no permissions to
 write to the 2 above mentioned directories? So, do I have any chance
 to install the pysqlite? If yes, what should I do?

 Should I find the file on the web and put in in some of my directories
 and then to change the path in the setup.cfg?

 Thank you for any help.


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





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


Re: Porting VB apps to Python for Window / Linux use

2008-10-19 Thread david . lyon

Quoting [EMAIL PROTECTED]:


Stef Mientki:

it's just Object Pascal , which is inferior to Python.


They are quite different languages, you can't compare them in a simple
way.
Delphi is kinda old, so today there are better languages than Delphi
(like D), but when Delphi 2-3 was out, there weren't many other
languages with IDEs at its level, especially for programs with a nice
GUIs plus interfaces with DBMSs.


I have programmed Delphi for years.. and was pretty much forced to  
move to python for different reasons.


I would go along best with the description of delphi being old. It  
was great in its time... and had many advancements over others. Still  
has some things that I would dearly love in python... like skinned  
gui applications.


As for porting... don't.

Just rewrite them

Shouldn't be so hard...

David






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


Python/Django hosting on normal hosting plans

2008-10-08 Thread david . lyon

Hi All,

I have chosen to use a Django app for a customer site and wish to put  
it up on the net.


Before I waste all day trying it myself (and probably getting it  
wrong) I thought I would ask the experts here.


My questions are:

 - can most everyday vanilla linux web hosts run a django site ?

 - can most everyday vanilla linux web hosts run python web scripts?

Thanks

David

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


Re: Web shopping carts

2008-09-10 Thread david . lyon

Quoting Luke Hamilton [EMAIL PROTECTED]:

I am wondering if there are any OS shopping cart application written  
 in python?


Hi Luke,

I'm sure there are a few.

But recently I have been asked by two customers to provide a solution.  
So I'm thinking about the same thing.


Actually, I've looked at a few systems like OS-commerce and so forth  
and my impression is that they are a bit old fashioned. As in, the web  
has moved a bit on since these projects started.


Plus, I have customers in the computer industry, whose requirements  
are a bit different than the generalist cart programs. They want to  
pull prices in from spreadsheets and have price auto-calculations etc


Basically, what I have put some work into has a search screen a bit  
like a search engine, and tries to combine leading edge javascript  
effects with a CherryPy/Cheetah back end.


There's also some fantastic javascript slideshows out there..

I was never excited about what web systems could do until now

javascript effects are just plain amazing... and what better to drive  
it than a python back end


Let me know what you think...




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


Re: Python web framework choice

2008-08-13 Thread david . lyon

Quoting Mahdi [EMAIL PROTECTED]:


I need to develop a medium-sized database web application for my
company. Given that:
 I don't know much about building web UI(s) but i have fair knowledge
about HTML  My schedule is tight.

a recommendation is v v v appreciated.


I'm in the same boat a few weeks in.

I've found that most of the python frameworks are based on the python  
cherrypy server. Thats a good place to work out how the webserver part  
of the non-zope systems work. ie django etc


So that is the webserver part

then you need to build your webpages

I have found Cheetah which is pretty powerful... that is a  
templating system to build the actual pages from the database content...


that works nicely...

obviously django and pylons wrap all these basics into a 'product'...

so it depends if you want to learn all the basic pieces  
(CherryPy/Cheetah)... or jump straight into the high level stuff  
straight away (pylons/django)...


depends how much money your boss is throwing your way i guess

David










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


Help with displaying images in CherryPy

2008-07-19 Thread David Lyon

Hi all,

I have a very simple question about configuration under CherryPy - it is 
such a simple one but I have been struggling to find an answer for a few 
days.


All I want is a sample configuration file that will allow me to display 
a page with a jpeg on it.


Whilst there are some examples in the CherryPy examples, they are mixed 
with so many other concepts that it is difficult for me (a newbie) to 
figure it out. None actually show me where to put image files.


This really should only take a few minutes for somebody who has done 
this in CherryPy before and I would certainly appreciate the assistance 
because it doesn't seem covered in any documentation that i could find.


Regards

David




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


Re: Python embedding question.

2008-07-15 Thread David Lyon

Thomas Troeger wrote:
I want to embed a Python application on a device with limited 
resources, esp. storage limitations. Is there a way to reduce the 
Python interpreter to a set of modules that's urgently needed? 

Of course there is. What is the target platform ?

What can be done is to go through the python source code and comment out 
everything that *you* find unneccessary. I can't tell you what this 
would be - because I don't know exactly what you are after. But to your 
question - the answer is yes.. of course.
Or is there a method to have gzipped modules that are unzipped on the 
fly into memory when they're accessed? That would be even better.

Yes - also possible.


Additionally, is there a Python module that contains all the stuff 
needed for an embedded application like graphics, sound etc.

No. Because that depends on what hardware platform you want to run on.
or do I have to use the various bindings to libraries like cairo, Qt 
or similar? Is there a site that helps with those decisions?
I doubt it. These are decisions for you to make according to the 
limitations of your hardware.


I've really looked at a lot of places but haven't found a suitable 
solutions yet, so I'm asking here in hope that someone has experience 
with that topic.



:-)

Regards

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


Re: Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-15 Thread David Lyon

Hi Hartmut,

I can sympathise with you on this one...

There are a few options...

there is a python based bake make like program... that is useful... 
http://projects.bertram-scharpf.de/bake/bake1.html


then there is Wine... that is a windows emulator under linux... that 
might be pretty easy http://www.winehq.org/


If you want to get more heavy-weight, then get a virtual machine.

But as per your question... the above specified options might satisfy 
your requests for speed and ease of use without having to change O/S.


Regards

David




Hartmut Goebel wrote:

Hi,

has anybody used McMillan Installer, PyInstall or py2exe cross-platform?

I have a Windows partition with Python installed there, so this would 
only required working on a different directory and for a different OS.
Since I'm working on Linux, it's awful to boot Windows each time I 
want to build a new release.


Any hint in this area?



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


Re: AW: Python embedding question.

2008-07-15 Thread David Lyon

Troeger, Thomas (ext) wrote:

Thanks for your answer. The plattform is x86, so basically it's a PC
with a compact flash drive. The problem is that the compact flash is
rather limited in speed and size (there is other stuff on it too).
  
Oh ok. Well just keep in mind that 4GB of flash memory can be bought in 
China for about 5 euros.


Since programming time is pretty expensive you need to do your sums 
about where you want to spend the time/money.

Or is there a method to have gzipped modules that are unzipped on
  
the 
  

fly into memory when they're accessed? That would be even better.
  

Yes - also possible.



That sounds promising, is there a link you can give? Or do I have to
modify the module loading code for this, i.e. the interpreter? 

http://squashfs.sourceforge.net/

I think
that wouldn't be too much of a problem if I understand where Python
loads modules; I haven't checked the Python source yet for that one, and
searching for Python and zip or similar always yields tons of links that
use the Python zip or tar module :)
  
Python modules are byte compiled. You can usually cut out a lot/some of 
space by removing the source (.py) and leaving the compile (.pyc) modules.


There is usually a lib or a sitelib directory. You could try cleaning 
that out of unwanted modules.


My advice would be to simply buy higher capacity flash memory

Regards

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