Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-24 Thread Mensanator
On Dec 24, 10:18 pm, Benjamin Kaplan wrote: > On Thu, Dec 24, 2009 at 9:11 PM, Mensanator wrote: > > Ok, so I got a MacBook Air. > > > Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed. > > > So I install Xcode, download macports and download gmpy-1.11rc1. > > > Following the instru

[wxPy] Why I can not change a ListItem property?

2009-12-24 Thread David
I have la ListCtrl in LC_REPORT mode and i need to change the color of a single cell. I tried to set the ListItem properties like this item = wx.ListItem() item.SetId(currId) item.SetColumn(currCol) item.SetText(text) item.SetTextColour(wx.RED) mylistctrl.SetItem(item) but the .SetTextColor doesn

Re: Testing for empty list

2009-12-24 Thread Benjamin Kaplan
On Thu, Dec 24, 2009 at 11:56 PM, Rodrick Brown wrote: p=[] if p is None: > ...   print 'yes' > ... > This doesn't work as expected. That probably means that what you expect is wrong. >>>p = [] # p is now a list object at a certain location >>> if p is None: #check to see if p (a l

Testing for empty list

2009-12-24 Thread Rodrick Brown
>>> p=[] >>> if p is None: ... print 'yes' ... >>> This doesn't work as expected. -- [ Rodrick R. Brown ] http://www.rodrickbrown.com http://www.linkedin.com/in/rodrickbrown -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 .mode option to create HTML table automatically?

2009-12-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 davidj411 wrote: > the CLI for sqlite3 shows .mode of "html", which formats the output in > HTML format that is good to add to . > > BUT i have not yet found anything for sqlite in python that does this. The CLI is extra code (in C) that wraps the SQ

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-24 Thread Benjamin Kaplan
On Thu, Dec 24, 2009 at 9:11 PM, Mensanator wrote: > Ok, so I got a MacBook Air. > > Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed. > > So I install Xcode, download macports and download gmpy-1.11rc1. > > Following the instructions in mac_build.txt, I do the following: > > - sudo

Mechanize - Click a table row to navigate to detail page

2009-12-24 Thread Brian D
A search form returns a list of records embedded in a table. The user has to click on a table row to call a Javascript call that opens up the detail page. It's the detail page, of course, that really contains the useful information. How can I use Mechanize to click a row? Any ideas? -- http:/

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-24 Thread Jonathan Hartley
On Dec 21, 2:56 pm, Ross Ridge wrote: > Jonathan Hartley   wrote: > > >Many thanks for that, but my issue is that my programs work fine for > >me on my computer - but then fail on other people's computers. I'd > >very strongly prefer for my users to not have to install the MSVCR > >redistributable

How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-24 Thread Mensanator
Ok, so I got a MacBook Air. Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed. So I install Xcode, download macports and download gmpy-1.11rc1. Following the instructions in mac_build.txt, I do the following: - sudo /opt/local/bin/port install gmp This works fine. Then I do - p

Re: getlist question

2009-12-24 Thread MRAB
Victor Subervi wrote: On Thu, Dec 24, 2009 at 3:28 PM, MRAB > wrote: Victor Subervi wrote: Hi; I have the following code: try: trueVal = form.getlist(storeColNames[i]) colNames.append(storeColName

Re: python 2.x and running shell command

2009-12-24 Thread Sean DiZazzo
On Dec 24, 5:34 am, tekion wrote: > On Dec 23, 5:22 pm, Sean DiZazzo wrote: > > > > > On Dec 23, 1:57 pm, tekion wrote: > > > > All, > > > some of the servers I have run python 2.2, which is a drag because I > > > can't use subprocess module.  My options that I know of is popen2 > > > module.  H

Re: getlist question

2009-12-24 Thread Victor Subervi
On Thu, Dec 24, 2009 at 3:28 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >> try: >>trueVal = form.getlist(storeColNames[i]) >>colNames.append(storeColNames[i]) >>if len(trueVal) > 1: >> trueVal = string.join(trueVal, ',')

Re: getlist question

2009-12-24 Thread MRAB
Victor Subervi wrote: Hi; I have the following code: try: trueVal = form.getlist(storeColNames[i]) colNames.append(storeColNames[i]) if len(trueVal) > 1: trueVal = string.join(trueVal, ',') Unless you're using a very old version of Python, you should be

Re: getlist question

2009-12-24 Thread Emile van Sebille
On 12/24/2009 12:05 PM Victor Subervi said... Hi; I have the following code: try: trueVal = form.getlist(storeColNames[i]) colNames.append(storeColNames[i]) if len(trueVal) > 1: trueVal = string.join(trueVal, ',') values.append(trueVal)

getlist question

2009-12-24 Thread Victor Subervi
Hi; I have the following code: try: trueVal = form.getlist(storeColNames[i]) colNames.append(storeColNames[i]) if len(trueVal) > 1: trueVal = string.join(trueVal, ',') values.append(trueVal) elif len(trueVal) == 1: print storeColN

Re: Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-24 Thread Brian D
On Dec 23, 8:33 am, Brian D wrote: > All, > > I'm hoping to implement a project that will be historically > transformational by mapping inequalities in property assessments. > > I'm stuck at step one: Scrape data fromhttp://www.opboa.org. > > The site uses a bunch of hidden controls. I can't find

Re: ORM's are evil. Was: Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-24 Thread Brian D
On Dec 24, 8:20 am, Brian D wrote: > Just kidding. That was a fascinating discussion. > > Now I'd like to see if anyone would rather procrastinate than finish > last-minute shopping. > > This problem remains untouched. Anyone want to give it a try? Please? > > I'm hoping to implement a project tha

Re: OT: Broadband TV

2009-12-24 Thread Victor Subervi
On Thu, Dec 24, 2009 at 2:13 PM, MRAB wrote: > Victor Subervi wrote: > >> My professional background before programming was media and I got into >> this because I saw where the industry was eventually headed. I'd like to >> find out what the people in the know have to say about when broadband >>

Re: OT: Broadband TV

2009-12-24 Thread MRAB
Victor Subervi wrote: My professional background before programming was media and I got into this because I saw where the industry was eventually headed. I'd like to find out what the people in the know have to say about when broadband quality is high enough to reliably stream video and the pen

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-24 Thread Jonas Geiregat
I'm using Python 3 on my Mac running Snow Leopard. I run it alongside the standard python that comes with leopard wich is 2.6 , if I remember correctely. This setup hasn't given me any trouble so far ! I've downloaded the binary version of Python3000 from the python.org website. Good luck with it

Re: Threading with queues

2009-12-24 Thread Lie Ryan
On 12/24/2009 2:11 PM, Gib Bogle wrote: Lie Ryan wrote: On 12/22/2009 10:47 AM, Gib Bogle wrote: It turns out that this code isn't a great demo of the advantages of threading, on my system anyway. The time taken to execute doesn't vary much when the number of threads is set anywhere from 1 to 6

Re: Join a thread and get the return value of a function

2009-12-24 Thread Lie Ryan
On 12/25/2009 2:02 AM, mattia wrote: Il Fri, 25 Dec 2009 00:35:55 +1100, Lie Ryan ha scritto: On 12/25/2009 12:23 AM, mattia wrote: Hi all, is there a way in python to get back the value of the function passed to a thread once the thread is finished? Something like pthread_join() in C? Thanks

OT: Broadband TV

2009-12-24 Thread Victor Subervi
Hi; My professional background before programming was media and I got into this because I saw where the industry was eventually headed. I'd like to find out what the people in the know have to say about when broadband quality is high enough to reliably stream video and the penetration of such broad

Re: How to tailor output of help()

2009-12-24 Thread Steve Holden
Kyle wrote: > Hi all, > I'm a graduate student in the physical sciences and still new to > Python. I'm writing a module of often-used code and have included > several math functions in my module via > > from math import cos > > and similarly for other functions. When I input help(mymodule) into >

How to tailor output of help()

2009-12-24 Thread Kyle
Hi all, I'm a graduate student in the physical sciences and still new to Python. I'm writing a module of often-used code and have included several math functions in my module via from math import cos and similarly for other functions. When I input help(mymodule) into the console, cos() and its do

Attributions (was Re: switch)

2009-12-24 Thread Aahz
In article , Tim Chase wrote: >On 12/10/2009 09:22 PM, John Bokma wrote: >> >> Please don't delete attribution line(s), added: >> >> Asun Friere writes: > >I tend to prune them because a good newsreader will thread messages >and put my reply in the context of the message to which I'm repl

python 2.x and running shell command

2009-12-24 Thread Boris Arloff
>On Dec 23, 5:22 pm, Sean DiZazzo wrote: > On Dec 23, 1:57 pm, tekion wrote: > > > > > All, > > some of the servers I have run python 2.2, which is a drag because I > > can't use subprocess module.  My options that I know of is popen2 > > module.  However, it seems it does not have io blocking >

PYO versus PYC Behavior

2009-12-24 Thread Boris Arloff
All python docs and description indicate that optimization (-OO) does not do much anything except the removal off pydoc. A single "O" removes comments and asserts, and with the removal of pydoc with double "O" option the *.pyo byte compile is left with pure executable code.  I am experiencing a

Re: Join a thread and get the return value of a function

2009-12-24 Thread mattia
Il Fri, 25 Dec 2009 00:35:55 +1100, Lie Ryan ha scritto: > On 12/25/2009 12:23 AM, mattia wrote: >> Hi all, is there a way in python to get back the value of the function >> passed to a thread once the thread is finished? Something like >> pthread_join() in C? >> >> Thanks, Mattia > > use a Queue

ORM's are evil. Was: Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-24 Thread Brian D
Just kidding. That was a fascinating discussion. Now I'd like to see if anyone would rather procrastinate than finish last-minute shopping. This problem remains untouched. Anyone want to give it a try? Please? I'm hoping to implement a project that will be historically transformational by mappin

Re: Doesn't MS-Windows likes Python ? (or: why more than 20 sec delaywhen running a program from Python)

2009-12-24 Thread Jim Carlock
"Stef Mientki" wrote... : : I've an AutoIt program that set some switches in the LAN settings. : : When I launch the AutoIt executable, the settings are changed : immediately. : : When I launch the AutoIt executable from python (which is the : intention), it hangs for about 20 seconds, before any

Re: Problem with Dynamically unloading a module

2009-12-24 Thread Lie Ryan
On 12/24/2009 11:51 PM, Jean-Michel Pichavant wrote: But what he *can* do is to learn how importing works. I'm not sure it's terribly helpful to tell somebody all the things they can't do instead of what they can. Hacking python imports would not be in the top of the list of things I would tea

Re: Join a thread and get the return value of a function

2009-12-24 Thread Lie Ryan
On 12/25/2009 12:23 AM, mattia wrote: Hi all, is there a way in python to get back the value of the function passed to a thread once the thread is finished? Something like pthread_join() in C? Thanks, Mattia use a Queue to pass the value out? -- http://mail.python.org/mailman/listinfo/python-l

Re: python 2.x and running shell command

2009-12-24 Thread tekion
On Dec 23, 5:22 pm, Sean DiZazzo wrote: > On Dec 23, 1:57 pm, tekion wrote: > > > > > All, > > some of the servers I have run python 2.2, which is a drag because I > > can't use subprocess module.  My options that I know of is popen2 > > module.  However, it seems it does not have io blocking > >

Join a thread and get the return value of a function

2009-12-24 Thread mattia
Hi all, is there a way in python to get back the value of the function passed to a thread once the thread is finished? Something like pthread_join() in C? Thanks, Mattia -- http://mail.python.org/mailman/listinfo/python-list

Extra fields for logging

2009-12-24 Thread Joan Miller
I'm trying to add some extra fields to logging, I'm following this information [1] but it faills in my case. # module logger.py import logging class ExtraInfo(object): def __getitem__(self, name): if name == 'host': result = 'foo' def __iter__(self

Re: Problem with Dynamically unloading a module

2009-12-24 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Wed, 23 Dec 2009 15:31:53 +0100, Jean-Michel Pichavant wrote: Steven D'Aprano wrote: On Wed, 23 Dec 2009 13:37:06 +0100, Jean-Michel Pichavant wrote: But believe me, you don't want to mess up with the python import mechanism. Unle

Re: Regex help needed!

2009-12-24 Thread F.R.
On 21.12.2009 12:38, Oltmans wrote: Hello,. everyone. I've a string that looks something like lksjdfls kdjff lsdfs sdjflssdfsdwelcome > From above string I need the digits within the ID attribute. For example, required output from above string is - 35343433 - 345343 - 8898 I've w

Re: how to register with pypi - no such setup.py

2009-12-24 Thread Martin v. Loewis
> Any tips? A binary distribution won't have a setup.py, because you can install it by other means (such as Windows Installer), instead of running setup.py What you want is a source distribution (sdist). Even if you want to create a binary distribution, don't use the bdist command, but some spec

Re: Object Relational Mappers are evil (a meditation)

2009-12-24 Thread Lie Ryan
On 12/24/2009 12:11 PM, Terry Reedy wrote: This buggy idiom survived many years of Python development, missed by virtually everyone. The last statement is false. The hazard of using and/or was well-known back in '97 or so when I discovered or learned it and I believe it was mentioned in the FAQ

Re: wave robot notes

2009-12-24 Thread Duncan Booth
Aaron Watters wrote: > I implemented a Google Wave Robot which annotates > BNF syntax rules using railroad diagram images. > I put notes about the implementation process > here for the benefit of posterity. > > http://listtree.appspot.com/firstWaveRobot > > The robot Id is > > whiff-ga