Re: Python servlet for Java applet ?

2009-04-24 Thread ryniek90
Temat: Python servlet for Java applet ? Od: Linuxguy123 Data: Fri, 24 Apr 2009 11:34:09 -0600 Do: python-list@python.org Do: python-list@python.org Hi guys. Is there a way to use a python application as the back end (i

Re: Python not importing mysqldb

2009-04-24 Thread Christian Heimes
83nini schrieb: > hi guys, > > i've been sweating the whole day trying to make python work with mysql > but in vain! > i'm doing the following: > 1. visiting http://sourceforge.net/projects/mysql-python > 2. dowloading mysql-python-test-1.2.3c1 > 3. extracting the files to C:\Python26\Lib\site-pac

Re: Python not importing mysqldb

2009-04-24 Thread Jerry Hill
On Fri, Apr 24, 2009 at 4:04 PM, 83nini <83n...@gmail.com> wrote: > hi guys, > > i've been sweating the whole day trying to make python work with mysql > but in vain! > i'm doing the following: > 1. visiting http://sourceforge.net/projects/mysql-python > 2. dowloading mysql-python-test-1.2.3c1 > 3.

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-24 Thread Martin v. Löwis
> Why not use U+DCxx for non-UTF-8 encodings too? I thought of that, and was tricked into believing that only U+DC8x is a half surrogate. Now I see that you are right, and have fixed the PEP accordingly. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: pythoncom -- ImportError: DLL load failed - Solved, sort of.

2009-04-24 Thread Richard Whidden
I installed a clean copy of Python 2.5, pywin32 and PyGreSQL and it works. I'll have to figure out what broke with my 2.6 install. Thanks for letting me scribble here. "Richard Whidden" wrote in message news:002a58fa$0$25248$c3e8...@news.astraweb.com... > I've sniffed around for a solution to

Finding partition containing a path?

2009-04-24 Thread skip
This little shell script lists the partitions containing /var/opt on a set of hosts: for h in host1 host2 host3 ; do echo -n "$h " ssh $h df -h /var/opt | egrep -v '^Filesystem' | awk '{print $6}' done producing output like this: host1 /var/opt host2 /var/opt host

Re: PyQt4 - widget signal trouble

2009-04-24 Thread Phil Thompson
On Fri, 24 Apr 2009 12:37:02 -0500, Joacim Thomassen wrote: > Hello, > > I'm trying to get my first PyQt4 application to work as intended, but it > seems I'm stuck and out of ideas for now. > > The program is a simple GUI showing an image. If the image on disk change > my intension is that the

Re: Modifying the value of a float-like object

2009-04-24 Thread C or L Smith
I happened across the recent discussion and found it very interesting as I have been dusting off and trying to get ready a module that I had made that created a number class that handled numeric values and uncertainties in computations by computing (via overloaded operators) a new value and unce

Re: Presentation software for Python code

2009-04-24 Thread ajaksu
alex23 wrote: >Michael Hoffman wrote: > > > That looks like it would be perfect. Unfortunately it doesn't seem to > > work on my Windows laptop: > > > I don't understand this. OpenGL Extensions Viewer says I have OpenGL 1.5 > > and the glGenBuffers function. > > That's a shame, if you feel like pur

debugging in IPython

2009-04-24 Thread Nick Matzke
This is a general question, but maybe there is some obvious solution I've missed. When I am writing code, I have a main script that calls functions in another .py file. When there is a bug or crash in the main script, in IPython I can just start typing the names of variables etc. to see what

Re: HTTP Authentication using urllib2

2009-04-24 Thread Wojtek Walczak
On Fri, 24 Apr 2009 04:25:20 -0700 (PDT), Lakshman wrote: > I am trying to authenticate using urllib2. The basic authentication > works if I hard code authheaders. ... > except IOError, e: > print "Something wrong. This shouldnt happen" First of all, don't shoot yourself in the foot an

Re: Finding partition containing a path?

2009-04-24 Thread Christian Heimes
s...@pobox.com schrieb: > This little shell script lists the partitions containing /var/opt on a set > of hosts: > > for h in host1 host2 host3 ; do > echo -n "$h " > ssh $h df -h /var/opt | egrep -v '^Filesystem' | awk '{print $6}' > done > > producing output like this: > >

Re: Superclass initialization

2009-04-24 Thread Aahz
In article , Ole Streicher wrote: > >I am trying to initialize a class inherited from numpy.ndarray: > >from numpy import ndarray > >class da(ndarray): >def __init__(self, mydata): >ndarray.__init__(self, 0) >self.mydata = mydata > >When I now call the constructor of da: >da(r

Collections.py -- any help?

2009-04-24 Thread Josh English
In my quest to learn more, I've been trying to get the collections.py module to do anything but look cool. So far, it's only a cool idea. How do they work? I can't find a tutorial on the web anywhere explaining how I would use them in my code. Any clues? Josh -- http://mail.python.org/mailman/lis

Re: confused with so many python package locations for imports

2009-04-24 Thread Ben Finney
Krishnakant writes: > Now my question is, which the perfect place? Your question is unrelated to the message to which you're replying. To start a new discussion, do not reply to an existing message (causing your message to be incorrectly associated with that existing message). Instead, compose

Re: Collections.py -- any help?

2009-04-24 Thread Jerry Hill
On Fri, Apr 24, 2009 at 6:56 PM, Josh English wrote: > In my quest to learn more, I've been trying to get the collections.py > module to do anything but look cool. So far, it's only a cool idea. > How do they work? I can't find a tutorial on the web anywhere > explaining how I would use them in my

Re: Convert numpy.ndarray into "normal" array

2009-04-24 Thread Piet van Oostrum
> Johannes Bauer (JB) wrote: >JB> Hi group, >JB> I'm confused, kind of. The application I'm writing currently reads data >JB> from a FITS file and should display it on a gtk window. So far I have: >JB> [...] >JB> pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height) >JB> pb_pi

Re: python list handling and Lisp list handling

2009-04-24 Thread Mark Tarver
On 24 Apr, 19:54, Arnaud Delobelle wrote: > Mark Tarver writes: > > Ah;  so this > > > def cons (x,y): > >   return [x] + y > > > is not accurate? > > Depends what you mean by accurate! > > in lisp, if you do: > >     (setq a '(1 2)) >     (setq b (cons 0 a)) >     (rplaca a 3) > > Then >     a i

Re: Collections.py -- any help?

2009-04-24 Thread Josh English
Sorry, I was referring to the abstract base classes defined there... mea culpa. I didn't get out of my head while posting. Josh On Apr 24, 4:15 pm, Jerry Hill wrote: > On Fri, Apr 24, 2009 at 6:56 PM, Josh English > > > Doug Hellmann wrote an article on the collections module for his > Python M

Re: if statement, with function inside it: if (t = Test()) == True:

2009-04-24 Thread Piet van Oostrum
> Steven D'Aprano (SD) wrote: >SD> On Fri, 24 Apr 2009 03:00:26 -0700, GC-Martijn wrote: >>> -- The long way >>> t = Test() >>> if (t == 'Vla': >>> print t # must contain Vla >SD> What's wrong with that? Missing ')' or better spurious '(' :=) -- Pi

Re: getter and setter and list appends

2009-04-24 Thread Piet van Oostrum
> dasacc22 (d) wrote: >d> The property method of parent and children actually calls a >d> _set_as_parent() and _set_as_child() method after setting the private >d> variable to pack the object for display purposes so that children can >d> be detached from the parent (becoming its own parent) a

Re: Python servlet for Java applet ?

2009-04-24 Thread Piet van Oostrum
> Linuxguy123 (L) wrote: >L> Hi guys. >L> Is there a way to use a python application as the back end (ie rpc) for >L> a Java based applet ? Yes, you can use Corba, XMLRPC, SOAP, JSON-RPC. Corba probably will have to be tunnelled through port 80 (the others already do this by default because

Re: python list handling and Lisp list handling

2009-04-24 Thread Rhodri James
On Sat, 25 Apr 2009 00:32:26 +0100, Mark Tarver wrote: OK; I think I get it. RPLACA and RPLACD are part of the id of Common Lisp which I rarely contemplate. However what it seems to be is that the difference is this. Lisp operates a destructive operation like RPLACA in such a way that RPLAC

Learning Python the quick way

2009-04-24 Thread mercurish
Hi guys, I have decided to learn Python a little more than I already do. But I found few problems, I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good compiler. So I wanted to learn more about the proj

Re: Collections.py -- any help?

2009-04-24 Thread Terry Reedy
Josh English wrote: Sorry, I was referring to the abstract base classes defined there... ABCs are new in 3.0. I have not used them, have no immediate plans to do so, and consider them a somewhat advanced feature. I suggest that you find the PEP 3### that gives their rationale and intended u

An unexpected visit_decref assertion fail (code works under python 2.4, doesn't under 2.5)

2009-04-24 Thread Joe Ardent
Hello, I'm running into a very odd problem here with a Python module (written in C). The following code works fine when built against and loaded into Python 2.4, but fails when built against and loaded into Python 2.5.1: klass = PyClass_New(bases, classDict, className); if (klass && meth

Re: Learning Python the quick way

2009-04-24 Thread Tim Chase
I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good compiler. I've rarely found this to be a problem unless you're doing CPU-intensive work. However, the usual workflow involves: 1) code it in Pyt

Re: if statement, with function inside it: if (t = Test()) == True:

2009-04-24 Thread Lawrence D'Oliveiro
In message , GC-Martijn wrote: > Nothing is wrong with it , but it cost more lines (= more scrolling) > When possible I want to keep my code small. Maybe you'd be better off with Perl than Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding partition containing a path?

2009-04-24 Thread Lawrence D'Oliveiro
In message , s...@pobox.com wrote: > Is there an easy way in Python to get the mount point in which a path > resides? (Unix only is fine.) See the os.statvfs call . -- http://mail.python.org/mailman/listinfo/python-list

Re: JSON and Firefox sessionstore.js

2009-04-24 Thread Matt Nordhoff
Steven D'Aprano wrote: > On Thu, 23 Apr 2009 05:08:35 +0100, I V wrote: > >> For something with at least a vague air of credibility to it, somebody >> who appears to be a Mozilla developer comments on their bug tracker, >> that sessionstore.js isn't "pure JSON" (though he only identifies the >> pa

Re: python list handling and Lisp list handling

2009-04-24 Thread Carl Banks
On Apr 24, 8:19 am, Mark Tarver wrote: > This page says that Python lists are often flexible arrays > > http://www.brpreiss.com/books/opus7/html/page82.html > > but also says that their representation is implementation dependent. > As far as I see this should mean that element access in Python sho

Installing 2.6 on a Mac

2009-04-24 Thread Greg Reyna
I want to install Python 2.6 on a dual 1.42 GHz MacG4 tower running OS 10.5.6. The Python installer wants to create the Python.framework directory in "/Library/Frameworks" but it can't because there's an alias of the same name in there. On this machine, Python 2.5.1 is installed in "/System/

Re: confused with so many python package locations for imports

2009-04-24 Thread David Cournapeau
On Sat, Apr 25, 2009 at 2:36 AM, Krishnakant wrote: > > hello all, > I was doing my first complete python packaging for my software and I am > totally confused. > I see, /usr/local/lib/python-2.6/site-packages and also dist-packages. > Then I also see a directory called pyshare, then again site-pa

Re: repost: http web page fetch question

2009-04-24 Thread Gabriel Genellina
En Fri, 24 Apr 2009 11:54:40 -0300, grocery_stocker escribió: scheduler = sched.scheduler(time.time, time.sleep) How do I modify it so that it runs every hour on the hour. (The sched module is almost useless, IMHO) I'd use cron (linux) or schtasks (windows). If it has to be a Python scrip

Re: repost: http web page fetch question

2009-04-24 Thread Gabriel Genellina
En Fri, 24 Apr 2009 11:54:40 -0300, grocery_stocker escribió: scheduler = sched.scheduler(time.time, time.sleep) How do I modify it so that it runs every hour on the hour. (The sched module is almost useless, IMHO) I'd use cron (linux) or schtasks (windows). If it has to be a Python scrip

Re: Presentation software for Python code

2009-04-24 Thread Michael Hoffman
Sebastian Wiesner wrote: I'm willing to consider TeX- and HTML-based approaches. I can recommend latex with the beamer package. It doesn't directly support formatting of code snippets, but the pygments syntax highlighter comes with a Latex formatter. This is what I have been doing so fa

Lisp mentality vs. Python mentality

2009-04-24 Thread Carl Banks
In answering the recent question by Mark Tarver, I think I finally hit on why Lisp programmers are the way they are (in particular, why they are often so hostile to the "There should only be one obvious way to do it" Zen). Say you put this task to a Lisp and a Python programmer: Come up with a goo

authentication example with urllib.request

2009-04-24 Thread larryzhang
Dear all, I am trying to download data from a website that requires authentication (maybe with cookies). Any suggestions on how i can do this with the urllib.request module in py3? Where can I can find some working examples? Thanks a lot. Larry -- http://mail.python.org/mailman/listinfo/python-li

Re: Lisp mentality vs. Python mentality

2009-04-24 Thread Emmanuel Surleau
On Saturday 25 April 2009 08:06:30 Carl Banks wrote: > In answering the recent question by Mark Tarver, I think I finally hit > on why Lisp programmers are the way they are (in particular, why they > are often so hostile to the "There should only be one obvious way to > do it" Zen). > > Say you put

Re: Installing 2.6 on a Mac

2009-04-24 Thread Ned Deily
In article , Greg Reyna wrote: > I want to install Python 2.6 on a dual 1.42 GHz MacG4 tower running > OS 10.5.6. The Python installer wants to create the Python.framework > directory in "/Library/Frameworks" but it can't because there's an > alias of the same name in there. On this machine,

Re: Windows Shell Extensions - Out of Proc

2009-04-24 Thread Mark Hammond
Thomas Heller wrote: Ralf schrieb: I think that for whatever reasons, explorer always tries to create shell extensions as InProc. CoCreateInstance, which is the usual API to create COM instances, allows to specify which one you want. Thomas So there is no way to do this, other than to create

Re: pythoncom -- ImportError: DLL load failed - Solved, sort of.

2009-04-24 Thread Mark Hammond
Richard Whidden wrote: I installed a clean copy of Python 2.5, pywin32 and PyGreSQL and it works. I'll have to figure out what broke with my 2.6 install. Make sure you have 2.6.2 Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: http web fetch question

2009-04-24 Thread Tim Roberts
grocery_stocker wrote: >On Apr 23, 3:29 pm, Chris Rebert wrote: >> On Thu, Apr 23, 2009 at 3:21 PM, grocery_stocker wrote: >> > Say I have a script that fetches data from a website every hour. Is >> > there a general solution or is the solution operating system specific? >> >> WRT the periodic

Re: Lisp mentality vs. Python mentality

2009-04-24 Thread Lawrence D'Oliveiro
In message , Emmanuel Surleau wrote: > Ah well. I guess this explains Emacs. So how would you explain someone who uses Emacs to write Python code? Like me? -- http://mail.python.org/mailman/listinfo/python-list

<    1   2