Re: Reading data from a Microsoft Access 2003 database

2010-05-20 Thread Jimoid
Thanks to all for your helpful suggestions. So far I have installed and played around with mdbtools, and it appears that I can use this from the shell to extract the information I need, e.g. mdb-export for dumping an entire table or mdb-sql to run a query. I am also interested by mxODBC and pyodbc

250

2010-05-20 Thread Martin P. Hellwig
On 05/20/10 07:51, cosmeticsafrolatino wrote: hi 250 locahost.local Hello WimaxUser3645-219.wateen.net [110.36.45.219], pleased to meet you -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading data from a Microsoft Access 2003 database

2010-05-20 Thread Jimoid
I've now had a closer look at both pyODBC and mxODBC and it seems to me that they both require the database to be running to be able to query it. Is this correct? If so I think I will have to use mdb-* as the database I want to query is not running. Cheers, Jimmy -- http://mail.python.org/mailma

intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Thomas Lehmann
Hi, I'm wondering about the behavior. Running this example - it looks like - that each rpc call is triggered in a visible interval (about one second). What's wrong? Thomas APPENDIX: import threading from xmlrpc.server import SimpleXMLRPCServer import xmlrpc.client class MyServer(threading.Th

Transferring an exception from one thread to an other.

2010-05-20 Thread Antoon Pardon
I have a numver of tarfiles on a remote host that I need to process and that I fetch via FTP. I wrote the following as a test to see how I would best approach this. (I'm using python 2.5) ftptst1 import tarfile as tar from ftplib im

Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Thomas Lehmann
> What's wrong? > Obviously there's a problem with "localhost". When using the IP of my machine everything is working fast. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with an huge dictionary

2010-05-20 Thread Thomas Lehmann
> > The question is: > Is there a limit on the number of entries a dictionary can have i > jython? > > I wrote a little app where my data is stored in a huge dictionary > (11746 entries) generated with a python script. > When I try to import the dictionary, jython complains with the > following mes

Drawing glyphs based on their index (NOT their character code)

2010-05-20 Thread Christian Stapfer
Here's an interesting little problem: I am given a master.ttf font file and a subset file subset.ttf of that font, and I am asked to map indices of all the glyphs in subset.ttf to the corresponding indices in master.ttf. The subset font file is the result of a pipeline of 3 tools (pdflatex, Adob

Error regarding numpy

2010-05-20 Thread sanam singh
hi, when i import numpy i get following error >>> import numpy Traceback (most recent call last): File "/usr/lib/wingide-personal3.2/src/debug/tserver/_sandbox.py", line 1, in # Used internally for debug sandbox under external interpreter File "/usr/lib/python2.6/dist-packages/numpy/__i

Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Adam Tauno Williams
On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote: > > What's wrong? > Obviously there's a problem with "localhost". When using the IP of my > machine everything is working fast. You box may first be trying to connect to ::1 (ipv6) and when that fails it falls back to 127.0.0.1. Make sure I

Import Module

2010-05-20 Thread Harikrishnan R
Hi , I have a file a.py contains from one.two import abc is there any way to find out "one.two" the import Path of abc. ? I don't want one.two.abc . Any function or attribute which directly give one.two ? -Regards -- Harikrishan R http:/

why struct.pack behave like this

2010-05-20 Thread
Hi When I use struct to pack binary data, I found this interesting behaviour: >>> import struct >>> struct.pack('B', 1) '\x01' >>> struct.pack('H', 200) '\xc8\x00' >>> struct.pack('BH',1, 200) '\x01\x00\xc8\x00' >>> struct.calcsize('BH') 4 Why does "struct.pack('BH',1, 200)" come out with an ext

Re: Drawing glyphs based on their index (NOT their character code)

2010-05-20 Thread Christian Stapfer
"Christian Stapfer" schrieb im Newsbeitrag news:b7256$4bf516e1$544ba447$20...@news.hispeed.ch... Here's an interesting little problem: I am given a master.ttf font file and a subset file subset.ttf of that font, and I am asked to map indices of all the glyphs in subset.ttf to the corresponding

Re: Import Module

2010-05-20 Thread Gary Herron
On 05/19/2010 09:40 AM, Harikrishnan R wrote: Hi , I have a file a.py contains from one.two import abc is there any way to find out "one.two" the import Path of abc. ? I don't want one.two.abc . Any function or attribute which directly

Re: function that counts...

2010-05-20 Thread superpollo
Steven D'Aprano ha scritto: On Wed, 19 May 2010 22:58:22 +0200, superpollo wrote: In [266]: del(sum) del is a statement, not a function, so the brackets are pointless. This is like writing: x = (1) instead of x = 1 `del sum` is all you need. sorry about that, thanks a lot! bye -- ht

Re: function that counts...

2010-05-20 Thread superpollo
Steven D'Aprano ha scritto: On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote: ... how many positive integers less than n have digits that sum up to m: In [197]: def prttn(m, n): Does the name "prttn" mean anything? I'm afraid I keep reading it as a mispelling of "print n". pArtItIOn

Re: function that counts...

2010-05-20 Thread superpollo
Richard Thomas ha scritto: For this kind of problem you should avoid all that stringification. I find it best to deal with sequences of digits of a fixed length and go from there. For example: def count1(m, n, cache={}): """Number of digit sequences of length `n` summing to `m`.""" if n

Re: why struct.pack behave like this

2010-05-20 Thread Dave Angel
Xie&Tian wrote: Hi When I use struct to pack binary data, I found this interesting behaviour: import struct struct.pack('B', 1) '\x01' struct.pack('H', 200) '\xc8\x00' struct.pack('BH',1, 200) '\x01\x00\xc8\x00' struct.calcsize('BH') 4 Wh

Re: Display file names in Tkinter Listbox

2010-05-20 Thread sit
On Thu, 20 May 2010 15:36:59 +1000, John McMonagle wrote: >r...@home.com wrote: >> Hello, >> >> My first attenpt at a simple python Tkinter application. I wanted to >> see how to load file names into a listbox from a menu. This is what I >> got until the part of displaying the file names in a l

Re: function that counts...

2010-05-20 Thread Peter Pearson
On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote: > ... how many positive integers less than n have digits that sum up to m: If it's important for the function to execute quickly for large n, you might get a useful speedup by testing only every ninth integer, since any two integers whose digi

Strange MySQL Problem

2010-05-20 Thread Victor Subervi
Hi; I have this code: #!/usr/bin/python import cgitb; cgitb.enable() import cgi import sys,os sys.path.append(os.getcwd()) import MySQLdb from login import login def create_edit_passengers4(): print "Content-Type: text/html" print print ''' http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.d

Python 2.6.1 + wxPython 2.8.9.1 compiled form source

2010-05-20 Thread Angel
Hi, I have a Red Hat 4.6 machone and I compiled and installed python 2.6.1 from source. Then, I compiled wxPython 2.8.9.1 form source too. And then, when I try to run it: # python Python 2.6.1 (r261:67515, Mar 4 2009, 20:10:49) [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2 Type "help", "co

Re: function that counts...

2010-05-20 Thread superpollo
Peter Pearson ha scritto: On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote: ... how many positive integers less than n have digits that sum up to m: If it's important for the function to execute quickly for large n, you might get a useful speedup by testing only every ninth integer, since

Re: function that counts...

2010-05-20 Thread Grant Edwards
On 2010-05-20, superpollo wrote: > Steven D'Aprano ha scritto: >> On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote: >> >>> ... how many positive integers less than n have digits that sum up to m: >>> >>> In [197]: def prttn(m, n): >> >> Does the name "prttn" mean anything? I'm afraid I keep

Re: Strange MySQL Problem

2010-05-20 Thread MRAB
Victor Subervi wrote: Hi; I have this code: #!/usr/bin/python import cgitb; cgitb.enable() import cgi import sys,os sys.path.append(os.getcwd()) import MySQLdb from login import login def create_edit_passengers4(): print "Content-Type: text/html" print print ''' "http://www.w3.org/TR/xht

Re: Strange MySQL Problem

2010-05-20 Thread Christian Heimes
MRAB wrote: I think you need to 'commit' any changes to do to the database. Yeah, you are right. Also some RDBMS don't support DDL and DML statements inside one transaction. You may need to commit and begin after the create table DDL. Christian -- http://mail.python.org/mailman/listinfo/pyt

Re: Strange MySQL Problem

2010-05-20 Thread Victor Subervi
On Thu, May 20, 2010 at 12:56 PM, MRAB wrote: > > When performing SQL operations, don't insert the values using Python's > string formatting, because that makes it vulnerable to SQL-injection > attacks, ie don't do this: > >cursor.execute(sql_command % values) > > do this: > >cursor.execu

Re: Global variables for python applications

2010-05-20 Thread TomF
On 2010-05-19 07:34:37 -0700, Steven D'Aprano said: # Untested. def verbose_print(arg, level, verbosity=1): if level <= verbosity: print arg def my_function(arg): my_print(arg, level=2) return arg.upper() if __name__ == '__main__': if '--verbose' in sys.argv:

Re: function that counts...

2010-05-20 Thread superpollo
Grant Edwards ha scritto: On 2010-05-20, superpollo wrote: Steven D'Aprano ha scritto: On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote: ... how many positive integers less than n have digits that sum up to m: In [197]: def prttn(m, n): Does the name "prttn" mean anything? I'm afraid I

Re: 250

2010-05-20 Thread Emile van Sebille
On 5/20/2010 12:39 AM Martin P. Hellwig said... On 05/20/10 07:51, cosmeticsafrolatino wrote: hi 250 locahost.local Hello WimaxUser3645-219.wateen.net [110.36.45.219], pleased to meet you :) -- http://mail.python.org/mailman/listinfo/python-list

Re: function that counts...

2010-05-20 Thread Grant Edwards
On 2010-05-20, superpollo wrote: > Grant Edwards ha scritto: >> On 2010-05-20, superpollo wrote: >>> Steven D'Aprano ha scritto: On Wed, 19 May 2010 21:58:04 +0200, superpollo wrote: > ... how many positive integers less than n have digits that sum up to m: Does the name "

Infertility treatment for free

2010-05-20 Thread women
Infertility treatment for free Bearing and speed of fertilization http://echance.info/cj/fb.htm -- http://mail.python.org/mailman/listinfo/python-list

Bearing and speed of fertilization

2010-05-20 Thread women
Infertility treatment for free Bearing and speed of fertilization http://echance.info/cj/fb.htm -- http://mail.python.org/mailman/listinfo/python-list

download youtube free and fast

2010-05-20 Thread women
download youtube free and fast http://echance.info/cj/youtube.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread News123
Hi Adam, Adam Tauno Williams wrote: > On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote: >>> What's wrong? >> Obviously there's a problem with "localhost". When using the IP of my >> machine everything is working fast. I think you're right. localhost with IPV6 was also a problem for me.

Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Adam Tauno Williams
On Thu, 2010-05-20 at 22:46 +0200, News123 wrote: > Hi Adam, > Adam Tauno Williams wrote: > > On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote: > >>> What's wrong? > >> Obviously there's a problem with "localhost". When using the IP of my > >> machine everything is working fast. > I think yo

Re: What's the matter with docs.python.org?

2010-05-20 Thread David Bolen
Christian Mertes writes: > On Mi, 2010-05-19 at 16:42 -0700, Aahz wrote: >> Also, I think you need to pass the host HTTP header to access >> docs.python.org > > Look, I don't really want to read Python docs via telnet. I basically > wanted to point out that there is strange behaviour and someone

Re: Display file names in Tkinter Listbox

2010-05-20 Thread John McMonagle
s...@home.com wrote: > I have made the modifications and it does print inside the listbox, > however they are all printed on the same line. > Sorry, I didn't realize askopenfilenames returned the filenames as a whitespace separated string, on my system they are returned as a tuple of strings.

RE: Picking a license

2010-05-20 Thread Delaney, Timothy (Tim)
From: Ben Finney > This thread is already off-topic and too long. I'm conflicted about my role in that; > I have endeavoured only to address falsehoods that IMO were not otherwise being addressed. > > So I'll try to keep this brief. > > Ethan Furman writes: > >> This doesn't make sense to me, but

Re: Display file names in Tkinter Listbox

2010-05-20 Thread sit
On Fri, 21 May 2010 08:02:30 +1000, John McMonagle wrote: >s...@home.com wrote: > >> I have made the modifications and it does print inside the listbox, >> however they are all printed on the same line. >> > >Sorry, I didn't realize askopenfilenames returned the filenames as a >whitespace sepa

starting repl programmatically

2010-05-20 Thread Brendan Miller
I have a python script that sets up some environmental stuff. I would then like to be able to change back to interactive mode and use that environment. What's the best way to do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: starting repl programmatically

2010-05-20 Thread Brendan Miller
python -i myscript.py almost does what I want. The only problem is if I exit with exit(0) it does *not* enter interactive mode. I have to run off the end of the script as near as I can tell. Is there another way to exit without breaking python -i? On Thu, May 20, 2010 at 4:57 PM, Brendan Miller

Ugly modification of a class, can it be done better ?

2010-05-20 Thread Stef Mientki
hello, This might be a strange question, but as a practical guy, I'm not searching for the best solution, but for a practical solution. I've a class which I've used very extensively. Now I want to extend that class with an action on a double click event, but that action is determined by the main

Re: starting repl programmatically

2010-05-20 Thread Steven D'Aprano
On Thu, 20 May 2010 16:57:40 -0700, Brendan Miller wrote: > I have a python script that sets up some environmental stuff. I would > then like to be able to change back to interactive mode and use that > environment. What's the best way to do that? On most(?) Linux distros, `man python` is your fr

Re: Ugly modification of a class, can it be done better ?

2010-05-20 Thread Jack Diederich
On Thu, May 20, 2010 at 8:13 PM, Stef Mientki wrote: > hello, > > This might be a strange question, but as a practical guy, I'm not searching > for the best solution, but for a practical solution. > > I've a class which I've used very extensively. > Now I want to extend that class with an action o

Re: starting repl programmatically

2010-05-20 Thread Patrick Maupin
On May 20, 6:57 pm, Brendan Miller wrote: > I have a python script that sets up some environmental stuff. I would > then like to be able to change back to interactive mode and use that > environment. What's the best way to do that? >>> import cmd >>> class MyCmd(cmd.Cmd): ... def default(self,

Re: starting repl programmatically

2010-05-20 Thread Steven D'Aprano
On Thu, 20 May 2010 17:11:17 -0700, Brendan Miller wrote: > python -i myscript.py > > almost does what I want. The only problem is if I exit with exit(0) it > does *not* enter interactive mode. I have to run off the end of the > script as near as I can tell. Is there another way to exit without >

Re: Ugly modification of a class, can it be done better ?

2010-05-20 Thread Steven D'Aprano
Sorry for breaking threading, but Stef's original post has not come through to me. > On Thu, May 20, 2010 at 8:13 PM, Stef Mientki > wrote: >> So I want to change the behavior of the class dynamically. I've done it >> by adding a global variable (Base_Grid_Double_Click) in the module, >> initia

Re: function that counts...

2010-05-20 Thread D'Arcy J.M. Cain
On Thu, 20 May 2010 19:53:42 + (UTC) Grant Edwards wrote: > Since Python is interactive, and you don't get charged for each time > you run your deck through the reader, that's easy enough to check: Whoa! For a moment there I thought it was 1969. :-) -- D'Arcy J.M. Cain | Democra

optional argument to a subclass of a class

2010-05-20 Thread Alex Hall
Hi all, I am now trying to allow my classes, all of which subclass a single class (if that is the term), to provide optional arguments. Here is some of my code: class Craft(): def __init__(self, name, isAircraft=False, id=helpers.id(), hits=0, weapons=[]): self.name=name self.id=id sel

Re: optional argument to a subclass of a class

2010-05-20 Thread Patrick Maupin
On May 20, 9:56 pm, Alex Hall wrote: > Hi all, > I am now trying to allow my classes, all of which subclass a single > class (if that is the term), to provide optional arguments. Here is > some of my code: > > class Craft(): >  def __init__(self, >  name, >  isAircraft=False, >  id=helpers.id(), >

Re: optional argument to a subclass of a class

2010-05-20 Thread Alex Hall
On 5/20/10, Patrick Maupin wrote: > On May 20, 9:56 pm, Alex Hall wrote: >> Hi all, >> I am now trying to allow my classes, all of which subclass a single >> class (if that is the term), to provide optional arguments. Here is >> some of my code: >> >> class Craft(): >> def __init__(self, >> nam

Re: optional argument to a subclass of a class

2010-05-20 Thread alex23
Patrick Maupin wrote: > One thing you can do is in battleship, you can accept additional > keyword arguments: > >     def __init__(self, name, ..., **kw): > > Then you could invoke the superclass's init: > >     Craft.__init__(self, name, **kw) _All_ of which is covered in the tutorial. At what p

Re: optional argument to a subclass of a class

2010-05-20 Thread Patrick Maupin
On May 20, 10:35 pm, Alex Hall wrote: > So how do I get at anything inside **kw? Is it a list? It's a dictionary. Use *args for a list. (As with self, the name is whatever you want to use, but some sort of consistency is nice.) One of the cool things about Python is how easy it is to play at

Re: optional argument to a subclass of a class

2010-05-20 Thread Alex Hall
On 5/20/10, alex23 wrote: > Patrick Maupin wrote: >> One thing you can do is in battleship, you can accept additional >> keyword arguments: >> >> def __init__(self, name, ..., **kw): >> >> Then you could invoke the superclass's init: >> >> Craft.__init__(self, name, **kw) > > _All_ of whi

Help with PyQt4 tabwidget setup

2010-05-20 Thread dpalmboom
I am creating an application and I'm busy designing the main layout on the main window. What I would like to do is the following: Create a QTabWidget with a QVBoxLayout already inside it and also a scrollbar inside it. When a user triggers a menu item, a QDockWidget must be created and inserted in

socket.getsockopt() and SO_ORIGINAL_DST

2010-05-20 Thread chris
Hi guys, On netfilter-based NAT systems there is theoretically a possibility to retrieve the original address *after* NAT'ing a connection. In C, this can be done as in squid, a transparent HTTP proxy: http://paste.pocoo.org/show/216495/ I'd like to do the same in Python. So I started with a