Re: Reversing a string

2007-06-30 Thread Martin Durkin
ptn <[EMAIL PROTECTED]> wrote in news:1182997438.541012.54100 @o61g2000hsh.googlegroups.com: > def rev(x): > mylist = [] > for char in x: > mylist.append(char) > mylist.reverse() > for letter in mylist: > print

Re: shelve crashing under Win ME

2007-06-30 Thread gluckj
OK, here's my workaround for shelve -- it's primitive and obviously much slower (it saves the entire dictionary each time), and you have to manually save -- BUT: it works...even on the Win ME machine. And it's possibly more universally portable in the long run than shelve...Also, once you open the

Re: unicode

2007-06-30 Thread Erik Max Francis
7stud wrote: > Based on this example and the error: > > - > u_str = u"abc\u" > print u_str > > UnicodeEncodeError: 'ascii' codec can't encode character u'\u' in > position 3: ordinal not in range(128) > -- > > it looks like when I try to display the string, the ascii decoder > p

unicode

2007-06-30 Thread 7stud
Based on this example and the error: - u_str = u"abc\u" print u_str UnicodeEncodeError: 'ascii' codec can't encode character u'\u' in position 3: ordinal not in range(128) -- it looks like when I try to display the string, the ascii decoder parses each character in the string and

How to uninstall packages

2007-06-30 Thread Rustom Mody
Recently I had trouble with the sqlite package under my debian etch box as follows: I first installed the debian package python-pysqlite1.1 using synaptic. Since this seemed too old for other packages (sqlalchemy) I downloaded the sources pysqlite-2.3.4.tar.gz and ran setup install. This gave th

Re: object references/memory access

2007-06-30 Thread dlomsak
Paul Rubin wrote: > dlomsak <[EMAIL PROTECTED]> writes: > > knowledge of the topic to help. If the above are not possible but you > > have a really good idea for zipping large amounts of data from one > > program to another, I'd like to hear it. > > One cheesy thing you might try is serializing wi

Re: object references/memory access

2007-06-30 Thread Paul Rubin
dlomsak <[EMAIL PROTECTED]> writes: > knowledge of the topic to help. If the above are not possible but you > have a really good idea for zipping large amounts of data from one > program to another, I'd like to hear it. One cheesy thing you might try is serializing with marshal rather than pickle.

Re: object references/memory access

2007-06-30 Thread Evan Klitzke
On 6/30/07, dlomsak <[EMAIL PROTECTED]> wrote: > If there is not a good Pythonic way to do the above, I am open to > mixing in some C to do the job if that is what it takes. I apologize > if this topic has been brought up many times before but hopefully I > have stated my intentions clearly enough

Re: Reading image dimensions before it is loaded from a web form using python.

2007-06-30 Thread Evan Klitzke
On 6/30/07, Cameron Laird <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Evan Klitzke <[EMAIL PROTECTED]> wrote: > >On 6/30/07, Norman Khine <[EMAIL PROTECTED]> wrote: > >> Hello, > >> I am writing an application using python that allows the user to upload > >> an image to a folder

Re: Problem with PEXPECT in Python

2007-06-30 Thread Kevin Erickson
On Jun 30, 5:50 pm, Kevin Erickson <[EMAIL PROTECTED]> wrote: > Hello, > > I am attempting to use pexpect in python to copy files from a server > using scp; the copy works however exceptions are thrown and it exits > unsuccessfully. Below is the a sample code and the error: > > #Begin Code > > im

Re: shelve crashing under Win ME

2007-06-30 Thread gluckj
Hi Jim, Thanks for your messages -- however, py2exe is NOT the issue -- as you can see with my example above, shelve is crashing even just by calling it from IDLE (latest PC version of IDLE & Python), running on a Win ME machine. Anyone else out there having access to a Win ME PC willing to try i

Python app as a Display Manager

2007-06-30 Thread hg
Hi, I asked that question a while back ... and then gave up: I want to write a simple display manager (*nix / X11) in Python. I'm going through lots of documentation as well as the code of XDM. 1) I currently understand that the "X11 Intrinsics" are what I need to master in order to get there.

Re: Reading image dimensions before it is loaded from a web form using python.

2007-06-30 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Evan Klitzke <[EMAIL PROTECTED]> wrote: >On 6/30/07, Norman Khine <[EMAIL PROTECTED]> wrote: >> Hello, >> I am writing an application using python that allows the user to upload >> an image to a folder on the server. >> >> Is there a way to get the size of the file b

Problem with PEXPECT in Python

2007-06-30 Thread Kevin Erickson
Hello, I am attempting to use pexpect in python to copy files from a server using scp; the copy works however exceptions are thrown and it exits unsuccessfully. Below is the a sample code and the error: #Begin Code import sys import pexpect def GetServerData(self): foo = pexpect.sp

help search file

2007-06-30 Thread Alejandro Decchi
Hello Python user. I am a newbie with python and i am interesting to do a web apliation to search file on the hard disk and give a link to download the file found. Someone can give a help ??? Thz Ale -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory leak in PyQt application

2007-06-30 Thread David Boddie
On Thu Jun 28 19:21:36 CEST 2007, Alexander Eisenhuth wrote: > I've a memory leak in a PyQt application and no idea how to find it. What > happens in the application ? > > From QWindow a QDialog is called on a button "pressed()" signal, that > instantiate a QThread and waits for it. If the thr

object references/memory access

2007-06-30 Thread dlomsak
Hello, I have searched a good deal about this topic and have not found any good information yet. It seems that the people asking all want something a bit different than what I want and also don't divulge much about their intentions. I wish to improve the rate of data transfer between two python

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: ... > >>Hmmm... For a dinausor, C seems well alive. Can you remind me which > > > > So do chickens. > > > I'm afraid I didn't get the joke... Are you saying that C is a rather, > well, primitive language ? The joke's just based on the fact that

Python + Google Calendar API issue

2007-06-30 Thread kyosohma
Hi, I was trying to hook into Google Calendar today using their gdata module for Python, but I can't seem to get Python to work with it. When I run the setup.py from the command line, I get the following: Traceback (most recent call last): File "J:\Python\Lib\site-packages\gdata\setup.py", line

How To Greatly Increase Your Calling Area ... [prtkb]

2007-06-30 Thread Steven Simmons
Hello I just bought a new V3 razor phone and I have t-mobile, but didn't buy it through t-mobile, thing is I get good reception everywhere but in my house. It says emergency only and I have problems sending a txt message. Will this product actually work for that and increase mt reception? Tha

Re: Reading image dimensions before it is loaded from a web form using python.

2007-06-30 Thread Evan Klitzke
On 6/30/07, Norman Khine <[EMAIL PROTECTED]> wrote: > Hello, > I am writing an application using python that allows the user to upload > an image to a folder on the server. > > Is there a way to get the size of the file before it has been uploaded > onto the server and give an error if the size doe

Re: Building a Python app with Mozilla

2007-06-30 Thread Brian Quinlan
Kevin Walzer wrote: > Komodo is not a Python application. It is a Mozilla application that > supports Python development. Komodo is more akin to Thunderbird and > Firefox than anything else; it uses the XUL framework for rendering > widgets, if I'm not mistaken. If you want to build an applicati

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Paddy
On Jun 30, 8:30 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Paul Rubin a écrit : > > > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > >>>[A type system is a] tractable syntactic method for proving the > >>>absence of certain program behaviors by classifying phrases > >>>ac

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
I wrote: > P.S. The last time I took a language class (about five or six years > ago), the most interesting languages I thought were descended from > Self, not any functional language. (And Self, of course is descended > from Smalltalk, which is descended from Lisp.) I think that Cecil is the p

Re: win32event.WaitForInputIdle() returns too soon

2007-06-30 Thread Hans
"Gabriel Genellina" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > En Thu, 28 Jun 2007 19:15:40 -0300, Hans <[EMAIL PROTECTED]> escribió: > >> I'm sending keyboard and mouse events to a seperate windows application. >> I use win32event.WaitForInputIdle() before calling e.g. >> wi

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : >> >> wrt/ proofs of correctness, I'll just point to the spectacular failure >> of Ariane, which was caused by a *runtime* type error in a system >> programmed in ADA - one of the languages with the most psychorigid >> declarative static type systems. > > > That's si

Re: win32event.WaitForInputIdle() returns too soon

2007-06-30 Thread Hans
<[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] On Jun 29, 3:03 pm, "Hans" <[EMAIL PROTECTED]> wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> schreef in > berichtnews:[EMAIL PROTECTED] > > > > > En Thu, 28 Jun 2007 19:15:40 -0300, Hans <[EMAIL PROTECTED]> escribió: > > >> I'm sen

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Lenard Lindstrom <[EMAIL PROTECTED]> writes: > Explicitly clear the exception? With sys.exc_clear? Yes. Is there a problem with that? |>oug -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Paul Rubin writes: > Haskell and ML are both evaluate typed lambda calculus unlike Lisp > which is based on untyped lambda calculus. Certainly the most > familiar features of Lisp (dynamic typing, S-expression syntax, > programs as data (Lisp's macro system results from

trouble with sqlite under debian etch

2007-06-30 Thread Rustom Mody
I was trying to follow the sqlalchemy tutorial on my debian etch box and got stuck with installation. Any help/pointers will be welcome. First after installing sqlalchemy needed some sqlite package synaptic showed me packages python-pysqlite, python-pysqlite1.1 and python-pysqlite2. Theres some

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Paul Rubin
Douglas Alan <[EMAIL PROTECTED]> writes: > > I'd say Haskell and ML are descended from Lisp, just like mammals are > > descended from fish. > > Hardly -- they all want to share the elegance of lambda calculus, > n'est-ce pas? Also, ML was originally implemented in Lisp, and IIRC > correctly, at l

Reading image dimensions before it is loaded from a web form using python.

2007-06-30 Thread Norman Khine
Hello, I am writing an application using python that allows the user to upload an image to a folder on the server. Is there a way to get the size of the file before it has been uploaded onto the server and give an error if the size does not comply to the maximum size. So far, my apps loads the im

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Paul Rubin writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> P.S. Besides Haskell is basically a refinement of ML, which is a >> dialect of Lisp. > I'd say Haskell and ML are descended from Lisp, just like mammals are > descended from fish. Hardly -- they all want

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Michele Simionato <[EMAIL PROTECTED]> writes: >> Right. So? I understand this issue completely and I code >> accordingly. > What does it mean you 'code accordingly'? IMO the only clean way out > of this issue is to NOT rely on the garbage collector and to manage > resource deallocation explicit

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Paul Rubin
Douglas Alan <[EMAIL PROTECTED]> writes: > P.S. Besides Haskell is basically a refinement of ML, which is a > dialect of Lisp. I'd say Haskell and ML are descended from Lisp, just like mammals are descended from fish. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-30 Thread Douglas Alan
Paul Rubin writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> But that's a library issue, not a language issue. The technology >> exists completely within Lisp to accomplish these things, and most >> Lisp programmers even know how to do this, as application framewor

Re: How do I remotely access Scheduled Tasks from Windows XP to Windows Server 2003?

2007-06-30 Thread Roger Upole
"kj7ny" wrote: > How can I access and manipulate Scheduled Tasks in Windows using > Python? > > I have a Windows XP workstation running Python 2.4.4 using the > win32all modules to control the windows services on multiple Windows > 2003 servers. It works great. > > However, I also need to remotel

Re: shelve crashing under Win ME

2007-06-30 Thread jim-on-linux
On Saturday 30 June 2007 10:07, jim-on-linux wrote: > On Saturday 30 June 2007 04:52, > [EMAIL PROTECTED] > > wrote: > > Hi, > > > > I'm not a Win ME fan myself (I'm a Mac user), > > but I'm here in Thailand developing software > > for special-needs kids, and the test PC in my > > home office is a

Re: Building a Python app with Mozilla

2007-06-30 Thread Sebastian Wiesner
[ "Diez B. Roggisch" <[EMAIL PROTECTED]> ] > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > > PyQT are actually what I want (because the lack of GUI builders and > > they don't really look good on Windows and Linux). > > The latter statement is bogus. Qt is THE native look

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Diez B. Roggisch
> > wrt/ proofs of correctness, I'll just point to the spectacular failure > of Ariane, which was caused by a *runtime* type error in a system > programmed in ADA - one of the languages with the most psychorigid > declarative static type systems. That's simply not true. The problem hadn't to d

Re: shelve crashing under Win ME

2007-06-30 Thread jim-on-linux
On Saturday 30 June 2007 04:52, [EMAIL PROTECTED] wrote: > Hi, > > I'm not a Win ME fan myself (I'm a Mac user), > but I'm here in Thailand developing software > for special-needs kids, and the test PC in my > home office is a Win ME machine (sigh). So when > I ported my Python program today to th

Re: Python Memory Usage

2007-06-30 Thread malkarouri
On Jun 20, 4:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am using Python to process particle data from a physics simulation. > There are about 15 MB of data associated with each simulation, but > there are many simulations. I read the data from each simulation into > Numpy arrays and

Re: Building a Python app with Mozilla

2007-06-30 Thread Diez B. Roggisch
Sebastian Wiesner schrieb: > [ "Diez B. Roggisch" <[EMAIL PROTECTED]> ] >> And as it has been said in this thread already, Qt has an excellent free >> GUI-builder. > > Free as long as you develop free software. Development of proprietary, > non-gpl software with Qt requires a commercial licence f

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Bruno Desthuilliers
Alex Martelli a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >... > >>I still maintain that the primary *practical* reason behind static >>typing is to provide optimization clues for the compiler. You can (or at > > > It's definitely a helpful aspect, yes -- given that compilers

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: ... > I still maintain that the primary *practical* reason behind static > typing is to provide optimization clues for the compiler. You can (or at It's definitely a helpful aspect, yes -- given that compilers able to infer types are still not ver

Re: Building a Python app with Mozilla

2007-06-30 Thread Kevin Walzer
Thorsten Kampe wrote: > Hi, > > I've already sent this to the Komodo mailing list (which seemed to me > the more appropriate place) but unfortunately I got no response. > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > PyQT are actually what I want (because the lack of

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Eduardo \"EdCrypt\" O. Padoan
On 6/30/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Eduardo "EdCrypt" O. Padoan a écrit : > > Remember that pure CPython has no different "compile time" and > > runtiime. > > Oh yes ? So what's the compiler doing, and what are those .pyc files ? > (hint: read the doc) Sorry, I surely know

Re: linecache and comparison with input

2007-06-30 Thread Ross Hetherington
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Sebastian Wiesner wrote: > Then you will see, that getline returns the line *including the newline > character*, while raw_input does not. Use line.strip('\n') to remove > trailing newline characters from the return value of getline. Ah, thank yo

Re: linecache and comparison with input

2007-06-30 Thread Sebastian Wiesner
[ Ross Hetherington <[EMAIL PROTECTED]> ] > #!/usr/bin/env python > > import random > import sys > import linecache > > rnd = random.randint(1,3) > line = linecache.getline('testfile', rnd) > > print line Try print repr(line) ... > > gss = raw_input('Enter line: ',) and print repr(gss) ;) > if gss

linecache and comparison with input

2007-06-30 Thread Ross Hetherington
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Say I've got a file called 'testfile' that contains the following three lines: foo bar baz And a script that goes like this: #!/usr/bin/env python import random import sys import linecache rnd = random.randint(1,3) line = linecache.getline('test

Re: Building a Python app with Mozilla

2007-06-30 Thread Sebastian Wiesner
[ "Diez B. Roggisch" <[EMAIL PROTECTED]> ] > And as it has been said in this thread already, Qt has an excellent free > GUI-builder. Free as long as you develop free software. Development of proprietary, non-gpl software with Qt requires a commercial licence from Trolltech. -- Freedom is always

Re: noob question How do I run a Python script.

2007-06-30 Thread Bruno Desthuilliers
CarlP a écrit : > How do I run a Python script. usually, it's: $ python /path/to/somescript.py arg1 argN on a command line prompt. > I have one that gmail loader needs to > run on my email box. Here's the script > > http://www.marklyon.org/gmail/cleanmbox.py > > I can't seem to find what I ne

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Bruno Desthuilliers
Paul Rubin a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >>>[A type system is a] tractable syntactic method for proving the >>>absence of certain program behaviors by classifying phrases >>>according to the kinds of values they compute. (Pierce 2002)." >> >>Is this supp

Re: simplifying algebraic expressions

2007-06-30 Thread [EMAIL PROTECTED]
"DavidM" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So if someone can point me in the direction of an algebraic expressions > library that can simplify expression trees and weed out redundancies, that > would be awesome. half-joking: Maxima http://maxima.sourceforge.net/ --

Re: ironpython exception line number

2007-06-30 Thread Troels Thomsen
>If you're hosting IronPython and catching this from a .NET language >then you'll be catching the .NET exception. Yes >In that case you can access the original Python exception >from ex.Data["PythonExceptionInfo"]. Yes ! YES ! Thx regards tpt -- http://mail.python.org/mailman/listinfo/pytho

shelve crashing under Win ME

2007-06-30 Thread gluckj
Hi, I'm not a Win ME fan myself (I'm a Mac user), but I'm here in Thailand developing software for special-needs kids, and the test PC in my home office is a Win ME machine (sigh). So when I ported my Python program today to the PC, it quickly crashed. Everything seems to work except for shelve. U

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-30 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > [A type system is a] tractable syntactic method for proving the > > absence of certain program behaviors by classifying phrases > > according to the kinds of values they compute. (Pierce 2002)." > > Is this supposed to contradict my a

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-06-30 Thread Luis M . González
On Jun 29, 7:48 am, "Mark Dufour" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have just released version 0.0.22 of Shed Skin, an experimental > Python-to-C++ compiler. Among other things, it has the exciting new > feature of being able to generate (simple, for now) extension modules, > so it's much

Re: ORM layer

2007-06-30 Thread Ben Finney
David <[EMAIL PROTECTED]> writes: > I am looking for an ORM for Python that fulfills a few simple needs. > > - ability to support a number of backends (probably mysql and sqlite   > at present, csv a bonus) > - ability to be used easily from console python scripts, a bonus if I   > can add a simpl

Re: Building a Python app with Mozilla

2007-06-30 Thread Diez B. Roggisch
Thorsten Kampe schrieb: > Hi, > > I've already sent this to the Komodo mailing list (which seemed to me > the more appropriate place) but unfortunately I got no response. > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > PyQT are actually what I want (because the lack o

Re: Building a Python app with Mozilla

2007-06-30 Thread Diez B. Roggisch
> You apparently didn't look very hard. On the wxPython end of things > (which I have experience with), there is wxGlade, XRCed, Boa > Constructor, Dabo, etc. I don't know about Tkinter (I don't use it), > but I know that at least Qt has a very nice GUI designer and builder > (from Trolltech

Re: Building a Python app with Mozilla

2007-06-30 Thread Josiah Carlson
Thorsten Kampe wrote: > Hi, > > I've already sent this to the Komodo mailing list (which seemed to me > the more appropriate place) but unfortunately I got no response. > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > PyQT are actually what I want (because the lack of