Re: recommended way to insert data into a one to many relationship using python

2010-05-03 Thread Wolfgang Meiners
Bryan schrieb: > Wolfgang Meiners wrote: >> one to many relationships are fairly common, i think. So there should be >> a recommended way to insert data into such a relation using python. >> >> Given the following programm, what is the recommended way to insert the >> list of NewEmployees to the da

Re: Python dot-equals (syntax proposal)

2010-05-03 Thread Steven D'Aprano
On Mon, 03 May 2010 06:37:49 +0200, Alf P. Steinbach wrote: > * Terry Reedy: >> * Alf P. Steinbach: >>> * Aahz: >> and sometimes they rebind the original target to the same object. >>> >>> At the Python level that seems to be an undetectable null-operation. >> >> If you try t=(1,2,3); t[

HTTP server + SQLite?

2010-05-03 Thread Gilles Ganault
Hello I'd like to build a prototype that will combine a web server as front-end (it must support GZIPping data to the remote client when there are a lot of data to return), and SQLite as back-end, call the server from a VB.Net application, and see how well this works. I want to see if performance

Re: HTTP server + SQLite?

2010-05-03 Thread alex23
Gilles Ganault wrote: > I'm no Python expert, so would appreciate any information on how to > combine a web server and SQLite into a single Python application. Hey Gilles, I'm a fan of the http framework, CherryPy[1]. Very quick and easy to get something up and running. The site also has some id

Re: HTTP server + SQLite?

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 12:46 AM, Gilles Ganault wrote: > I'd like to build a prototype that will combine a web server as > front-end (it must support GZIPping data to the remote client when > there are a lot of data to return), and SQLite as back-end, call the > server from a VB.Net application, a

Re: Python dot-equals (syntax proposal)

2010-05-03 Thread Peter Otten
Alf P. Steinbach wrote: > > >>> t = ([], [], []) > >>> t > ([], [], []) > >>> t[0] += ["blah"] > Traceback (most recent call last): > File "", line 1, in > TypeError: 'tuple' object does not support item assignment > >>> t > (['blah'], [], []) > >>> _ > > > Yep, it matters. > > Is this change

Re: HTTP server + SQLite?

2010-05-03 Thread Helmut Jarausch
On 05/03/10 09:46, Gilles Ganault wrote: > Hello > > I'd like to build a prototype that will combine a web server as > front-end (it must support GZIPping data to the remote client when > there are a lot of data to return), and SQLite as back-end, call the > server from a VB.Net application, and s

Re: HTTP server + SQLite?

2010-05-03 Thread Nat
interesting natalie5...@hotmail.co.jp natalie53...@yahoo.co.jp natalie5...@gmail.com wlipgf...@jupiter.ocn.ne.jp natalie5...@mbr.nifty.com natalie5...@xqg.biglobe.ne.jp natalie5...@zpost.plala.or.jp -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTP server + SQLite?

2010-05-03 Thread Gilles Ganault
On Mon, 03 May 2010 11:51:41 +0200, Helmut Jarausch wrote: >http://www.karrigell.fr/doc/ Thanks for the tip. -- http://mail.python.org/mailman/listinfo/python-list

win32 - catch events(wmi?)

2010-05-03 Thread Richard Lamboj
Hello, i want catch the following events: - registry has chanced - file has chanced - outgoing network connection - programm start and i want to be able to allow, or deny this "requests". Kind Regards Richi -- http://mail.python.org/mailman/listinfo/python-list

Teaching Programming

2010-05-03 Thread Samuel Williams
Dear Friends, I'm looking for some help from the Python community. I hope this is the right place to ask for information. I'm putting together a website aimed at high school students and teachers, and would like to make sure the following page is as good as possible: http://programming

Re: Parser

2010-05-03 Thread andrew cooke
On May 2, 3:54 pm, Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. Which parser would you recommend? > > Best, > Andreas I develop Lepl - http://www.acooke.org/lepl

Re: Teaching Programming

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 5:05 AM, Samuel Williams wrote: > Dear Friends, > > I'm looking for some help from the Python community. I hope this is the > right place to ask for information. > > I'm putting together a website aimed at high school students and teachers, > and would like to make sure the

ANN: expy 0.6.7 released!

2010-05-03 Thread Yingjie Lan
EXPY is an express way to extend Python! EXPY provides a way to extend python in an elegant way. For more information and a tutorial, see: http://expy.sourceforge.net/ I'm glad to announce a new release again today. ^_^ What's new: Version 0.6.7 1. Now functions can have 'value on failure'

strange interaction between open and cwd

2010-05-03 Thread Baz Walter
Python 2.6.4 (r264:75706, Mar 7 2010, 02:18:40) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.mkdir('/home/baz/tmp/xxx') >>> f = open('/home/baz/tmp/abc.txt', 'w') >>> f.write('abc') >>> f.close() >>> os.chdir('/home/baz/tmp/xxx'

Re: Teaching Programming

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 5:29 AM, Chris Rebert wrote: > On Mon, May 3, 2010 at 5:05 AM, Samuel Williams > wrote: >> Dear Friends, >> >> I'm looking for some help from the Python community. I hope this is the >> right place to ask for information. >> >> I'm putting together a website aimed at high s

Ann: Validating Emails and HTTP URLs in Python

2010-05-03 Thread andrew cooke
Hi, The latest Lepl release includes an implementation of RFC 3696 - the RFC that describes how best to validate email addresses and HTTP URLs. For more information please see http://www.acooke.org/lepl/rfc3696.html Lepl's main page is http://www.acooke.org/lepl Because Lepl compiles to regula

Re: strange interaction between open and cwd

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 5:42 AM, Baz Walter wrote: > Python 2.6.4 (r264:75706, Mar  7 2010, 02:18:40) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import os os.mkdir('/home/baz/tmp/xxx') f = open('/home/baz/tmp/abc.txt', 'w') f

Re: Ann: Validating Emails and HTTP URLs in Python

2010-05-03 Thread Philip Semanchuk
On May 3, 2010, at 9:06 AM, andrew cooke wrote: Hi, The latest Lepl release includes an implementation of RFC 3696 - the RFC that describes how best to validate email addresses and HTTP URLs. For more information please see http://www.acooke.org/lepl/rfc3696.html Lepl's main page is http://

Python code for outlook automation.

2010-05-03 Thread vithya subramani
hi, i need python source code for - Adding Contacts into Outlook. - Adding Blocked list,Safe sender list to junk Email folder in outlook - Counting total no of contacts in Blocked list,Safe sender list please provide help on these... Thanks, Vidu.. -- http:/

Re: Teaching Programming

2010-05-03 Thread Samuel Williams
Dear Chris, Thanks for reading further into the site. Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback. Please be aware that orange does not mean problem - it simply means take note that there may be potential issues that you need to consider

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 14:18, Chris Rebert wrote: Whether or not /home/baz/tmp/xxx/ exists, we know from the very structure and properties of directory paths that its parent directory is, *by definition*, /home/baz/tmp/ (just chop off everything after the second-to-last slash). I would assume this is what h

Re: strange interaction between open and cwd

2010-05-03 Thread Peter Otten
Baz Walter wrote: > attempting to remove the cwd would produce an error). but how can python > determine the parent directory of a directory that no longer exists? My tentative explanation would be that the directory, namely the inode, still exists -- only the entry for it in its parent director

Re: strange interaction between open and cwd

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 6:49 AM, Baz Walter wrote: > On 03/05/10 14:18, Chris Rebert wrote: >> Whether or not /home/baz/tmp/xxx/ exists, we know from the very >> structure and properties of directory paths that its parent directory >> is, *by definition*, /home/baz/tmp/ (just chop off everything af

Re: Teaching Programming

2010-05-03 Thread Chris Rebert
> On 4/05/2010, at 1:06 AM, Chris Rebert wrote: >> On Mon, May 3, 2010 at 5:29 AM, Chris Rebert wrote: >>> On Mon, May 3, 2010 at 5:05 AM, Samuel Williams >>> wrote: In particular, "Why would I learn this language?" section needs to have a few paragraphs. I don't use Python predominant

Re: Teaching Programming

2010-05-03 Thread Samuel Williams
Dear Chris, I will take your feedback into consideration and let you know the outcome when I have time to think about it. Again, I appreciate your thoughts. Thanks for taking the time to think about the comparison chart. Kind regards, Samuel On 4/05/2010, at 1:58 AM, Chris Rebert wrote: >> I

Re: Ann: Validating Emails and HTTP URLs in Python

2010-05-03 Thread andrew cooke
> FYI, Fourthought's PyXML has a module called uri.py that contains   > regexes for URL validation. I've over a million URLs (harvested from   > the Internet) through their code. I can't say I checked each and every   > result, but I never saw anything that would lead me to believe it was   > misbe

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 14:46, Peter Otten wrote: Baz Walter wrote: attempting to remove the cwd would produce an error). but how can python determine the parent directory of a directory that no longer exists? My tentative explanation would be that the directory, namely the inode, still exists -- only th

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Peter Otten <__pete...@web.de> wrote: > Baz Walter wrote: > >> attempting to remove the cwd would produce an error). but how can >> python determine the parent directory of a directory that no longer >> exists? Python doesn't determine the parent directory. The Unix system call and

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: > On 03/05/10 14:18, Chris Rebert wrote: >> Whether or not /home/baz/tmp/xxx/ exists, we know from the very >> structure and properties of directory paths that its parent directory >> is, *by definition*, /home/baz/tmp/ (just chop off everything after >> the second

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 14:56, Chris Rebert wrote: but how does '..' get resolved in the relative path '../abc.txt'? i'm assuming python must initially use getcwd() internally to do this, and then if that fails it falls back on something else. but what is that something else? is it something that is reproduc

Re: Ann: Validating Emails and HTTP URLs in Python

2010-05-03 Thread Philip Semanchuk
On May 3, 2010, at 10:13 AM, andrew cooke wrote: FYI, Fourthought's PyXML has a module called uri.py that contains regexes for URL validation. I've over a million URLs (harvested from the Internet) through their code. I can't say I checked each and every result, but I never saw anything that

Re: strange interaction between open and cwd

2010-05-03 Thread Dave Angel
Baz Walter wrote: On 03/05/10 14:18, Chris Rebert wrote: Whether or not /home/baz/tmp/xxx/ exists, we know from the very structure and properties of directory paths that its parent directory is, *by definition*, /home/baz/tmp/ (just chop off everything after the second-to-last slash). I would as

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: > On 03/05/10 14:56, Chris Rebert wrote: >>> but how does '..' get resolved in the relative path '../abc.txt'? i'm >>> assuming python must initially use getcwd() internally to do this, and then >>> if that fails it falls back on something else. but what is that so

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: > On 03/05/10 14:46, Peter Otten wrote: >> Baz Walter wrote: >> >>> attempting to remove the cwd would produce an error). but how can python >>> determine the parent directory of a directory that no longer exists? >> >> My tentative explanation would be that the di

long int computations

2010-05-03 Thread Victor Eijkhout
I have two long ints, both too long to convert to float, but their ratio is something reasonable. How can I compute that? The obvious "(1.*x)/y" does not work. Victor. -- Victor Eijkhout -- eijkhout at tacc utexas edu -- http://mail.python.org/mailman/listinfo/python-list

Re: using python2.6 on windows without installation

2010-05-03 Thread Mirko Vogt
Thanks a lot for all your solutions! Tried installing it "just for the current user" as suggested by Christian and it works like a charme, so there seems to be no need for another python distribution in this case. Thanks a lot once again! mirko On Fri, 2010-04-30 at 01:34 +0200, Christian Heime

Re: Teaching Programming

2010-05-03 Thread Helmut Jarausch
On 05/03/10 14:29, Chris Rebert wrote: > On Mon, May 3, 2010 at 5:05 AM, Samuel Williams > wrote: >> Dear Friends, >> >> I'm looking for some help from the Python community. I hope this is the >> right place to ask for information. >> >> I'm putting together a website aimed at high school students

Re: long int computations

2010-05-03 Thread Peter Otten
Victor Eijkhout wrote: > I have two long ints, both too long to convert to float, but their ratio > is something reasonable. How can I compute that? The obvious "(1.*x)/y" > does not work. >>> import fractions >>> x = 12345 * 10**1000 >>> y = 765 * 10**1000 >>> float(x) Traceback (most recent cal

Re: long int computations

2010-05-03 Thread Jerry Hill
On Mon, May 3, 2010 at 11:17 AM, Victor Eijkhout wrote: > I have two long ints, both too long to convert to float, but their ratio > is something reasonable. How can I compute that? The obvious "(1.*x)/y" > does not work. You didn't say what version of python you were using, but this seems to wor

How to check when OCRing is finished

2010-05-03 Thread varnikat t
Hi, How to check if OCR engine like cuneiform,ocropus,ocrad OCRing an image has completed the job if running it from a python program? I am using a progress bar on the front end to show the OCRing progress happening in background but how to stop progress bar automatically when OCRing is done. A

Re: matching strings in a large set of strings

2010-05-03 Thread Bryan
Karin Lagesen wrote: > I have approx 83 million strings, all 14 characters long. I need to be > able to take another string and find out whether this one is present > within the 83 million strings. [...] > I run out of memory building both the set and the dictionary, so > what I seem to be left wit

Re: long int computations

2010-05-03 Thread Dave Angel
Victor Eijkhout wrote: I have two long ints, both too long to convert to float, but their ratio is something reasonable. How can I compute that? The obvious "(1.*x)/y" does not work. Victor. You don't make clear what you mean by "too long to convert to float." Do you mean can't convert exa

Re: long int computations

2010-05-03 Thread Peter Pearson
On Mon, 03 May 2010 17:30:03 +0200, Peter Otten <__pete...@web.de> wrote: > Victor Eijkhout wrote: > >> I have two long ints, both too long to convert to float, but their ratio >> is something reasonable. How can I compute that? The obvious "(1.*x)/y" >> does not work. > import fractions

Re: long int computations

2010-05-03 Thread Jussi Piitulainen
Peter Otten writes: > Victor Eijkhout wrote: > > > I have two long ints, both too long to convert to float, but their > > ratio is something reasonable. How can I compute that? The obvious > > "(1.*x)/y" does not work. > > >>> import fractions > >>> x = 12345 * 10**1000 > >>> y = 765 * 10**1000 >

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 15:56, Grant Edwards wrote: On 2010-05-03, Baz Walter wrote: On 03/05/10 14:46, Peter Otten wrote: Baz Walter wrote: attempting to remove the cwd would produce an error). but how can python determine the parent directory of a directory that no longer exists? My tentative explan

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: >>> (something like the environment variable $PWD). shame that >>> os.getenv('PWD') isn't reliable, as it would solve my issue :( >> >> I don't understand what you mean by that. > > i'm trying to understand how the path of the cwd can be known if there > is no en

Re: long int computations

2010-05-03 Thread Peter Otten
Peter Pearson wrote: > On Mon, 03 May 2010 17:30:03 +0200, Peter Otten <__pete...@web.de> wrote: >> Victor Eijkhout wrote: >> >>> I have two long ints, both too long to convert to float, but their ratio >>> is something reasonable. How can I compute that? The obvious "(1.*x)/y" >>> does not work.

Re: HTTP server + SQLite?

2010-05-03 Thread lbolla
On May 3, 8:46 am, Gilles Ganault wrote: > Hello > > I'd like to build a prototype that will combine a web server as > front-end (it must support GZIPping data to the remote client when > there are a lot of data to return), and SQLite as back-end, call the > server from a VB.Net application, and s

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 15:55, Grant Edwards wrote: On 2010-05-03, Baz Walter wrote: On 03/05/10 14:56, Chris Rebert wrote: but how does '..' get resolved in the relative path '../abc.txt'? i'm assuming python must initially use getcwd() internally to do this, and then if that fails it falls back on somet

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: > it's a fact that realpath/abspath/normpath etc can fail for paths > that don't when used with os.stat or the builtin open function. True. > i think it's reasonable to expect that a path that can be used to > successfully open a file wont then produce "No such

Re: Python dot-equals (syntax proposal)

2010-05-03 Thread Terry Reedy
On 5/3/2010 12:37 AM, Alf P. Steinbach wrote: * Terry Reedy: * Alf P. Steinbach: * Aahz: and sometimes they rebind the original target to the same object. At the Python level that seems to be an undetectable null-operation. If you try t=(1,2,3); t[1]+=3, if very much matters that a rebin

Re: Teaching Programming

2010-05-03 Thread Terry Reedy
On 5/3/2010 9:38 AM, Samuel Williams wrote: Dear Chris, Thanks for reading further into the site. Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback. Please be aware that orange does not mean problem - it simply means take note that there may b

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 15:24, Grant Edwards wrote: On 2010-05-03, Baz Walter wrote: On 03/05/10 14:18, Chris Rebert wrote: Whether or not /home/baz/tmp/xxx/ exists, we know from the very structure and properties of directory paths that its parent directory is, *by definition*, /home/baz/tmp/ (just chop o

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: > i think what i'm asking for is a python function that, given, say, a > valid file descriptor, can return the file's full path. Firstly, a file may have any number of paths (including 0). > would such a thing even be possible? Yes. You have to search the file

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 18:12, Grant Edwards wrote: On 2010-05-03, Baz Walter wrote: Sort of. The file in question _has_ a full path, you just can't tell what it is based on the path you used to open it. yes, that's exactly what i was trying to demonstrate in my OP. i can use python to open a file; but

Re: recommended way to insert data into a one to many relationship using python

2010-05-03 Thread Wolfgang Meiners
Wolfgang Meiners schrieb: [... example of a simple sql-database and relating questions ...] so after reading the hints of Peter Otten and Bryan i played around a bit and got the following solution. Of course it would be much simpler following Bryans idea of natural keys but i think, i will go ste

Re: How to check when OCRing is finished

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 8:44 AM, varnikat t wrote: > Hi, > How to check if OCR engine  like cuneiform,ocropus,ocrad OCRing an image has > completed the job if running it from a  python program? > > I am using a progress bar on the front end to show the OCRing progress > happening in background but

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 18:41, Grant Edwards wrote: On 2010-05-03, Baz Walter wrote: i think what i'm asking for is a python function that, given, say, a valid file descriptor, can return the file's full path. Firstly, a file may have any number of paths (including 0). yes, of course. i forgot about h

Re: strange interaction between open and cwd

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 10:45 AM, Baz Walter wrote: > On 03/05/10 18:12, Grant Edwards wrote: >> On 2010-05-03, Baz Walter  wrote: Sort of.  The file in question _has_ a full path, you just can't tell what it is based on the path you used to open it. >>> >>> yes, that's exactly what i was

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 19:05, Chris Rebert wrote: On Mon, May 3, 2010 at 10:45 AM, Baz Walter wrote: On 03/05/10 18:12, Grant Edwards wrote: On 2010-05-03, Baz Walterwrote: Sort of. The file in question _has_ a full path, you just can't tell what it is based on the path you used to open it. yes,

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: >> You requested something that wasn't possible. It failed. What do >> you think should have happened? > > path = '../abc.txt' > > os.path.realpath(path) -> "OSError: [Errno 2] No such file or directory" > > therefore: > > open(path) -> "IOError: [Errno 2] No su

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Chris Rebert wrote: >> open(path) -> "IOError: [Errno 2] No such file or directory" >> >> i think that if the first of these seemingly "impossible" requests fails, it >> is reasonable to expect that the second one also fails. but the second one >> (sometimes) doesn't. >> >> i think

Re: Teaching Programming

2010-05-03 Thread André
To Samuel Williams:(and other interested ;-) If you want to consider Python in education, I would encourage you have a look at http://www.python.org/community/sigs/current/edu-sig/ I think you will find that there are quite a few resources available - perhaps more than you are aware of. And,

design question

2010-05-03 Thread Tim Arnold
This is a question about system design I guess. I have a django website that allows users to change/view configuration details for documentation builds. The database is very small. The reason I'm using a database in the first place is to make it easy for users to change the configuration of their b

Django as exemplary design

2010-05-03 Thread TomF
I'm interested in improving my python design by studying a large, well-designed codebase. Someone (not a python programmer) suggested Django. I realize that Django is popular, but can someone comment on whether its code is well-designed and worth studying? Thanks, -Tom -- http://mail.python

duplicate temporary file?

2010-05-03 Thread Laszlo Nagy
I try to write an iterator class: class FileIterator(object): def __init__(self,file_object): self.fin = file_object # other initialization code here ... def __iter__(self): return self def next(self): # special code that reads from the file and convert

Re: duplicate temporary file?

2010-05-03 Thread Christian Heimes
Laszlo Nagy wrote: However, it won't work for temporary files. Temporary files are just file-like objects, and their name is ''. I guess I could open a temporary file with os.open, and then use os.dup, but that is low level stuff. Then I have to use os.* methods, and the file object won't be iter

Re: win32 - catch events(wmi?)

2010-05-03 Thread Tim Golden
On 03/05/2010 12:02 PM, Richard Lamboj wrote: i want catch the following events: - registry has chanced - file has chanced - outgoing network connection - programm start and i want to be able to allow, or deny this "requests". Wow. That's quite a list. To do what you want in general te

Re: Django as exemplary design

2010-05-03 Thread Carl Banks
On May 3, 12:24 pm, TomF wrote: > I'm interested in improving my python design by studying a large, > well-designed codebase.  Someone (not a python programmer) suggested > Django.  I realize that Django is popular, but can someone comment on > whether its code is well-designed and worth studying?

new extension generator for C++

2010-05-03 Thread Rouslan Korneychuk
Hi, I'm new here. I'm working on a program that exposes C++ declarations to Python and I was wondering if there is any interest in it. It's a hobby project. I was originally using Boost.Python on another project but found a couple of things I didn't like. Eg: you can't really have private cons

PyQt Ram Usage

2010-05-03 Thread Country Boy
Hi, I am new to Python (and programming so pardon my ignorance) I have a small PyQt program that lives in windows system tray. I am using Suds & ElemetTree to do webservices call and parse XML. I have a QTimer that runs every 30 seconds and fetches the updated data from the server. Finally, the pyt

Re: long int computations

2010-05-03 Thread Victor Eijkhout
Jerry Hill wrote: > >>> from __future__ import division > >>> long1/long2 > 0.5 Beautiful. Thanks so much guys. Victor. -- Victor Eijkhout -- eijkhout at tacc utexas edu -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt Ram Usage

2010-05-03 Thread David Boddie
On Monday 03 May 2010 22:49, Country Boy wrote: > I am new to Python (and programming so pardon my ignorance) > I have a small PyQt program that lives in windows system tray. I am > using Suds & ElemetTree to do webservices call and parse XML. > I have a QTimer that runs every 30 seconds and fetch

Re: strange interaction between open and cwd

2010-05-03 Thread Baz Walter
On 03/05/10 19:12, Grant Edwards wrote: On 2010-05-03, Baz Walter wrote: You requested something that wasn't possible. It failed. What do you think should have happened? path = '../abc.txt' os.path.realpath(path) -> "OSError: [Errno 2] No such file or directory" therefore: open(path) -

Re: win32 - catch events(wmi?)

2010-05-03 Thread Giampaolo Rodolà
Just out of curiosity, is WMI able to list the TCP and UDP connections opened by a process or by the OS? We'll have to do this for psutil (http://code.google.com/p/psutil) and we guess it's not gonna be easy. --- Giampaolo http://code.google.com/p/psutil http://code.google.com/p/pyftpdlib 2010/5/

Re: design question

2010-05-03 Thread Kev
Tim Arnold wrote: > This is a question about system design I guess. I have a django > website that allows users to change/view configuration details for > documentation builds. The database is very small. The reason I'm using > a database in the first place is to make it easy for users to change >

Re: strange interaction between open and cwd

2010-05-03 Thread Lie Ryan
On 05/04/10 07:57, Baz Walter wrote: > On 03/05/10 19:12, Grant Edwards wrote: >> On 2010-05-03, Baz Walter wrote: >> You requested something that wasn't possible. It failed. What do you think should have happened? >>> >>> path = '../abc.txt' >>> >>> os.path.realpath(path) -> "OSError

Re: Teaching Programming

2010-05-03 Thread cjw
On 03-May-10 09:38 AM, Samuel Williams wrote: Dear Chris, Thanks for reading further into the site. Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback. Please be aware that orange does not mean problem - it simply means take note that there m

msg_footer

2010-05-03 Thread kalin m
is there a variable for the member's email address in the msg_footer? the one the message is being sent to? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] strange interaction between open and cwd

2010-05-03 Thread Charles
"Grant Edwards" wrote in message news:hrn3qn$nh...@reader1.panix.com... > On 2010-05-03, Chris Rebert wrote: > >>> open(path) -> "IOError: [Errno 2] No such file or directory" >>> >>> i think that if the first of these seemingly "impossible" requests >>> fails, it >>> is reasonable to expect t

Re: design question

2010-05-03 Thread Alf P. Steinbach
* Tim Arnold: This is a question about system design I guess. I have a django website that allows users to change/view configuration details for documentation builds. The database is very small. The reason I'm using a database in the first place is to make it easy for users to change the configur

Re: strange interaction between open and cwd

2010-05-03 Thread Ben Finney
Baz Walter writes: > On 03/05/10 18:41, Grant Edwards wrote: > > Firstly, a file may have any number of paths (including 0). > > yes, of course. i forgot about hard links Rather, you forgot that *every* entry that references a file is a hard link. To ask for a filesystem entry referencing the f

Re: msg_footer

2010-05-03 Thread kalin m
nevermind...i found it... kalin m wrote: is there a variable for the member's email address in the msg_footer? the one the message is being sent to? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: strange interaction between open and cwd

2010-05-03 Thread Cameron Simpson
On 03May2010 15:23, Baz Walter wrote: | On 03/05/10 14:46, Peter Otten wrote: | >Baz Walter wrote: | > | >>attempting to remove the cwd would produce an error). but how can python | >>determine the parent directory of a directory that no longer exists? | > | >My tentative explanation would be that

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-03, Baz Walter wrote: > On 03/05/10 19:12, Grant Edwards wrote: >>> i think they should always either both succeed, or both fail. >> >> That's not how Unix filesystems work. >> >> Are you saying that Python should add code to it's open() builtin >> which calls realpath() and then refus

Re: [OT] strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-04, Charles wrote: >> I don't see how it's inelegant at all. Perhaps it's >> counter-intuitive if you don't understand how a Unix filesystem >> works, but the underlying filesystem model is very simple, regular, >> and elegant. >> >>> but probably makes some bit of the OS's job slight

Re: strange interaction between open and cwd

2010-05-03 Thread Grant Edwards
On 2010-05-04, Cameron Simpson wrote: > On 03May2010 15:23, Baz Walter wrote: >| so "here" must always be available somehow, even if getcwd() fails > > Well, yeah. Just like an open file handle on a file you have > subsequently removed still exists. Remember that the directory tree > is a digrap

Re: [OT] strange interaction between open and cwd

2010-05-03 Thread Mel
Grant Edwards wrote: > I guess I've been using Unix for too long (almost 30 years). I don't > think I was consciously aware of a "one file, one name" paradigm. Is > that a characteristic of Dos, Windows or Mac filesystems? Older and simpler filesystems used to combine the naming with the space

Re: HTTP server + SQLite?

2010-05-03 Thread John Nagle
Gilles Ganault wrote: Hello I'd like to build a prototype that will combine a web server as front-end (it must support GZIPping data to the remote client when there are a lot of data to return), and SQLite as back-end, call the server from a VB.Net application, and see how well this works. I wan

Re: Teaching Programming

2010-05-03 Thread CM
> Nobody likes indentation at first, it is different.   For what it's worth, I didn't have a programming background, and I liked Python's indentation right from the start. I was used to thinking in terms of indentation from writing and word processing documents with subordinate sections, so I fo

repeat tkinter

2010-05-03 Thread Robin
How can I make a command within a tkinter application repeat itself over and over in intervals of a certain time. Thanks, -Robin -- http://mail.python.org/mailman/listinfo/python-list

Recursive functions not returning lists as expected

2010-05-03 Thread rickhg12hs
Would a kind soul explain something basic to a python noob? Why doesn't this function always return a list? def recur_trace(x,y): print x,y if not x: return y recur_trace(x[1:], y + [x[0]]) Here are a couple sample runs. >>> print(recur_trace([],[1,2,3])) [] [1,2,3] [1,2,3] So that w

Re: print executed query

2010-05-03 Thread Fred C
On Apr 29, 2010, at 9:49 AM, Philip Semanchuk wrote: > > On Apr 29, 2010, at 12:01 PM, someone wrote: > >> Hello! >> >> Is there a way to print a query for logging purpose as it was or will >> be sent to database, if I don't escape values of query by myself? >> >> cursor.execute(query, [id, s

Re: print executed query

2010-05-03 Thread Fred C
On Apr 29, 2010, at 9:49 AM, Philip Semanchuk wrote: > > On Apr 29, 2010, at 12:01 PM, someone wrote: > >> Hello! >> >> Is there a way to print a query for logging purpose as it was or will >> be sent to database, if I don't escape values of query by myself? >> >> cursor.execute(query, [id, s

Re: Recursive functions not returning lists as expected

2010-05-03 Thread Abhishek Mishra
Perhaps you forgot a return, thats fundamental to recursion right - funciton returning itself to itself :) Here's a bit modification needed - def recur_trace(x,y): print x,y if not x: return y return recur_trace(x[1:], y + x[:1]) print ( recur_trace([],[1,2,3]) ) print print ( recur_tr

Re: Recursive functions not returning lists as expected

2010-05-03 Thread Cameron Simpson
On 03May2010 22:02, rickhg12hs wrote: | Would a kind soul explain something basic to a python noob? | | Why doesn't this function always return a list? | | def recur_trace(x,y): | print x,y | if not x: | return y | recur_trace(x[1:], y + [x[0]]) You need: return recur_trace(x[1:],

Re: Recursive functions not returning lists as expected

2010-05-03 Thread Charles
"rickhg12hs" wrote in message news:2ff16113-4f79-4dcf-8310-35d2b91e8...@o11g2000yqj.googlegroups.com... > Would a kind soul explain something basic to a python noob? > > Why doesn't this function always return a list? > > def recur_trace(x,y): > print x,y > if not x: >return y > recur_tra

Re: Recursive functions not returning lists as expected

2010-05-03 Thread rickhg12hs
On May 4, 1:34 am, Cameron Simpson wrote: > On 03May2010 22:02, rickhg12hs wrote: > | Would a kind soul explain something basic to a python noob? > | > | Why doesn't this function always return a list? > | > | def recur_trace(x,y): > |   print x,y > |   if not x: > |     return y > |   recur_trac

Re: new extension generator for C++

2010-05-03 Thread Stefan Behnel
Rouslan Korneychuk, 03.05.2010 22:44: So I looked for other solutions and noticed that Py++ (which simply generates Boost.Python code for you) was based on a seperate program called GCCXML. I figured I could use GCCXML and generate code however I wanted. So I did. My program generates human-read

  1   2   >