Re: Open source web crawler with mysql integration

2009-04-10 Thread Daniel Fetchinson
On 4/10/09, Philip Semanchuk wrote: > > On Apr 10, 2009, at 10:37 PM, Lawrence D'Oliveiro wrote: > >> In message , >> Philip >> Semanchuk wrote: >> >>> I'd love to open source it and if someone wants to pay me to make >>> it open >>> source-able, let's talk! >> >> Nobody's going to pay you for som

Re: zProblem

2009-04-10 Thread Gabriel Genellina
En Fri, 10 Apr 2009 21:14:01 -0300, norseman escribió: norseman wrote: Gabriel Genellina wrote: En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small as I ca

Re: sharing/swapping items between lists

2009-04-10 Thread Paul Rubin
Ross writes: > Can you guys suggest an approach to this problem...I'm trying to teach > myself python so an outline of how to approach this would probably be > more helpful to me than an explicit solution. I'll cry mercy if I > can't figure it out after your hints. Look at the "set" datatype. Th

sharing/swapping items between lists

2009-04-10 Thread Ross
I'm trying to design an iterator that produces two lists. The first list will be a list of unique pairings and the second will be a list of items that weren't used in the first list. After each round, the items that weren't used in the round before will get put back in and the second list will be p

Re: [rfc] An object that creates (nested) attributes automatically on assignment

2009-04-10 Thread Steven D'Aprano
On Fri, 10 Apr 2009 19:04:38 -0700, Edd wrote: > Hi folks, > > I'd like to use Python itself as the configuration language for my > Python application. I'd like the user to be able to write something like > this in their config file(s): > >cfg.laser.on = True >cfg.laser.colour = 'blue' >

Re: Open source web crawler with mysql integration

2009-04-10 Thread Philip Semanchuk
On Apr 10, 2009, at 10:37 PM, Lawrence D'Oliveiro wrote: In message , Philip Semanchuk wrote: I'd love to open source it and if someone wants to pay me to make it open source-able, let's talk! Nobody's going to pay you for something of doubtful value--it's up to you to prove the valu

Re: How to create a virtual serial port?

2009-04-10 Thread Banibrata Dutta
This might help: http://en.wikipedia.org/wiki/COM_port_redirector On Sat, Apr 11, 2009 at 8:34 AM, Banibrata Dutta wrote: > On Sat, Apr 11, 2009 at 3:17 AM, Stuart Davenport < > stuart.davenp...@gmail.com> wrote: > >> I'm on a OS X, python 2.5. Basically I will have a remote application >> pushin

Re: How to create a virtual serial port?

2009-04-10 Thread Banibrata Dutta
On Sat, Apr 11, 2009 at 3:17 AM, Stuart Davenport < stuart.davenp...@gmail.com> wrote: > I'm on a OS X, python 2.5. Basically I will have a remote application > pushing data (GPS) over the network to a python application I have > running on my Mac, I want this python application to again push the

Re: email in separate thread

2009-04-10 Thread Aahz
In article <66f23ffc-345e-4603-9519-cd122a116...@j12g2000vbl.googlegroups.com>, joeygartin wrote: > >The problem is the page hangs while the emails are sent. My current >hosting situation does not give me direct access to an email queue. >So I have two options (that I can think of): > >1) Write

Re: Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread skip
Terry> I am thinking of getting Ubuntu. Cannot one also download the Terry> sources and compile? (Without replacing the system version!) Sure. I compile it all the time on my Mac. This is just a little bupkis virtual server where I run my personal website. I'd like to just install ve

Re: Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread Lawrence D'Oliveiro
In message , Terry Reedy wrote: > I am thinking of getting Ubuntu. Cannot one also download the sources > and compile? (Without replacing the system version!) Debian Unstable offers about 3 different versions of Python that you can install side-by-side. -- http://mail.python.org/mailman/list

Re: Open source web crawler with mysql integration

2009-04-10 Thread Lawrence D'Oliveiro
In message , Philip Semanchuk wrote: > I'd love to open source it and if someone wants to pay me to make it open > source-able, let's talk! Nobody's going to pay you for something of doubtful value--it's up to you to prove the value of the code first. You must go to the community, the communit

Re: regexp strangeness

2009-04-10 Thread Steven D'Aprano
On Thu, 09 Apr 2009 20:48:11 +0100, Dale Amon wrote: > This finds nothing: ... > DEC029 = re.compile("[^&0-9A-Z/ $*,.\-:#@'=\"[<(+\^!);\\\]%_>?]") > This works correctly: ... > DEC029 = re.compile("[^&0-9A-Z/ $*,.\-:#@'=\"[<(+\^!)\\;\]%_>?]") > They differ only in the positioning of th

[rfc] An object that creates (nested) attributes automatically on assignment

2009-04-10 Thread Edd
Hi folks, I'd like to use Python itself as the configuration language for my Python application. I'd like the user to be able to write something like this in their config file(s): cfg.laser.on = True cfg.laser.colour = 'blue' cfg.discombobulated.vegetables = ['carrots', 'broccoli'] #

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Steven D'Aprano
On Fri, 10 Apr 2009 17:07:38 -0400, Mike H wrote: > Hello all, I have a question about the if/else aspect of list > comprehension: > > I would like to go through a list and place quotes around an item if it > is a string, and keep the item the same if it's anything else: > > e.g.['a',9,'8b'] -->

Re: Get the ipv6 address from a interface

2009-04-10 Thread Дамјан Георгиевски
> In Linux, you can only have one IPv4 address per interface (and you > have to use alias interfaces, such as eth0:0, to assign multiple > addresses to a physical link). that's actually not correct, use the "ip" tool (iproute2 package) to see how easily you can have several addresses to a single

Re: zProblem

2009-04-10 Thread Steven D'Aprano
On Fri, 10 Apr 2009 10:50:57 -0700, norseman wrote: > Moderator: I apologize for attaching anything. This newsgroup has no moderator. > However, in order to explain my problem, I need to control the font > since text graphics only work for a given font. Use the least common denominator avail

Re: Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread Benjamin Kaplan
On Fri, Apr 10, 2009 at 8:29 PM, Terry Reedy wrote: > Benjamin Kaplan wrote: > >> >> >> On Fri, Apr 10, 2009 at 5:15 PM, mailto:s...@pobox.com>> >> wrote: >> >> >> >> Does Ubuntu really not have Python 2.6 or 3.0 packages >> >> Benjamin> Which version of Ubuntu are you using? >> >

Re: safe eval of moderately simple math expressions

2009-04-10 Thread Steven D'Aprano
On Thu, 09 Apr 2009 13:13:50 -0400, Terry Reedy wrote: > Joel Hedlund wrote: >> Hi all! >> >> I'm writing a program that presents a lot of numbers to the user, and I >> want to let the user apply moderately simple arithmentics to these >> numbers. One possibility that comes to mind is to use the

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Terry Reedy
Mike H wrote: Hello all, I have a question about the if/else aspect of list comprehension: I would like to go through a list and place quotes around an item if it is a string, and keep the item the same if it's anything else: e.g.['a',9,'8b'] --> ['"a"', 9, '"8b"'] I understand that if/else li

Re: Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread Terry Reedy
Benjamin Kaplan wrote: On Fri, Apr 10, 2009 at 5:15 PM, > wrote: >> Does Ubuntu really not have Python 2.6 or 3.0 packages Benjamin> Which version of Ubuntu are you using? Benjamin> Hardy: 2.5.2 Benjamin> Intrepid: 2.5.2 and 3.0rc1

Re: Bug tracker off-line?

2009-04-10 Thread Terry Reedy
Aahz wrote: In article , MRAB wrote: Is it just me or is the bug tracker site having problems? I'm not having a problem with other sites. Someone else reported this on python-dev Still down 7 hours later. -- http://mail.python.org/mailman/listinfo/python-list

Re: weird try/finally behaviour

2009-04-10 Thread Terry Reedy
Sylvain Thénault wrote: Hi there, I've encountered the following behaviour which I found surprising: def test(): ... for x in ('test', 'tests'): ... try: ... if True: ... print 'return' ... return 1 ... finally: ...

Re: zProblem

2009-04-10 Thread norseman
norseman wrote: Gabriel Genellina wrote: En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small as I can get it. I didn't understand what your problem is actual

Re: ValueError: I/O operation on closed file

2009-04-10 Thread Vinay Sajip
On Apr 10, 9:25 pm, dj wrote: > I have a handler which I use with a set of log levels for the > pythonloggingmodule. > > --- myhandler.py > > importlogging.handlers > > # create my handler class > class MyHan

Re: how to use logging.config.fileConfig ?

2009-04-10 Thread Vinay Sajip
On Apr 10, 3:51 pm, Alexandru Moșoi wrote: > config.py and I found a big comment saying that old loggers are > disabled! Why? What am I doing wrong? This is by design, because fileConfig is not meant for incremental configuration - it is for complete configuration of the logging system. The old

Re: Adding a Badge to an Icon in Mac OS X

2009-04-10 Thread Miles
On Fri, Apr 10, 2009 at 5:22 PM, bingo wrote: > PyObjc seems to offer the option to add badges to icons in the doc. I > need to add badges to any icon... kinda like SCPlugin and dropbox do. > I think that SCPlugin is doing it through carbon Icon Services. But I > am still trying to figure out how i

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Miles
On Fri, Apr 10, 2009 at 5:26 PM, Mike H wrote: > Thanks to all of you. > > FYI, I'm doing this because I'm working on creating some insert > statements in SQL, where string values need to be quoted, and integer > values need to be unquoted. This is what you should have posted in the first place.

Re: zProblem

2009-04-10 Thread norseman
Gabriel Genellina wrote: En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small as I can get it. I didn't understand what your problem is actually. ===

Re: Open source web crawler with mysql integration

2009-04-10 Thread Philip Semanchuk
On Apr 10, 2009, at 12:33 PM, bruce wrote: phillip... lots of code is opened source "as is"!!! when you get right down to it, a good deal of "open source" code from sourceforge/hotscritps/freshmeat/etc.. is pretty poor, but it is open sourced. you could simply toss your code out into the ope

Re: How to create a virtual serial port?

2009-04-10 Thread Stuart Davenport
On 10 Apr, 20:45, Scott David Daniels wrote: > Stuart Davenport wrote: > > Hi, > > > I am trying to work out if its possible, to create a virtual serial > > port with Python? Would anyone know how to go about this in code? Any > > help would be greatly appreciated! :) > > > I have a had a google a

Re: Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread Benjamin Kaplan
On Fri, Apr 10, 2009 at 5:15 PM, wrote: > >>> Does Ubuntu really not have Python 2.6 or 3.0 packages > >Benjamin> Which version of Ubuntu are you using? > >Benjamin> Hardy: 2.5.2 >Benjamin> Intrepid: 2.5.2 and 3.0rc1 >Benjamin> Jaunty (beta) : 2.6.2rc1 and 3.0.1 > > I'm us

Re: zProblem

2009-04-10 Thread Gabriel Genellina
En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small as I can get it. I didn't understand what your problem is actually. -- Gabriel Genellina -- http://mail.

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Mike H
Thanks to all of you. FYI, I'm doing this because I'm working on creating some insert statements in SQL, where string values need to be quoted, and integer values need to be unquoted. I wanted to be sure that I could pass these values to the list in a normal way e.g. ['test', 1, 'two'] and have a

Re: Adding a Badge to an Icon in Mac OS X

2009-04-10 Thread bingo
Kevin, PyObjc seems to offer the option to add badges to icons in the doc. I need to add badges to any icon... kinda like SCPlugin and dropbox do. I think that SCPlugin is doing it through carbon Icon Services. But I am still trying to figure out how it is done! Thanks, Madi On Apr 10, 4:57 am,

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread MRAB
Mike H wrote: Hello all, I have a question about the if/else aspect of list comprehension: I would like to go through a list and place quotes around an item if it is a string, and keep the item the same if it's anything else: e.g.['a',9,'8b'] --> ['"a"', 9, '"8b"'] I understand that if/else li

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread John Yeung
On Apr 10, 5:07 pm, Mike H wrote: > From playing around with other examples, I get the feeling > that Python is calculating both values (inst and '"'+inst+'"') > before selecting which one to pass to the new list. Am I right? I believe so. (I'm sure the experts here will tell you more definitive

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Gary Herron
Mike H wrote: Hello all, I have a question about the if/else aspect of list comprehension: I would like to go through a list and place quotes around an item if it is a string, and keep the item the same if it's anything else: e.g.['a',9,'8b'] --> ['"a"', 9, '"8b"'] I understand that if/else li

Unsupported operand types in if/else list comprehension

2009-04-10 Thread Mike H
Hello all, I have a question about the if/else aspect of list comprehension: I would like to go through a list and place quotes around an item if it is a string, and keep the item the same if it's anything else: e.g.['a',9,'8b'] --> ['"a"', 9, '"8b"'] I understand that if/else list comprehension

Re: Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread Benjamin Kaplan
On Fri, Apr 10, 2009 at 4:27 PM, wrote: > Does Ubuntu really not have Python 2.6 or 3.0 packages or do I just have my > package list misconfigured? I'm setting up a fresh machine and am not too > Ubuntu-aware. Is there a list of package repositories around somewhere? > > Thx, > Which version o

Re: How to create a virtual serial port?

2009-04-10 Thread Banibrata Dutta
As others have already stated, "Virtual Serial Port" isn't descriptive enough. There are various forms of "Virtual Serial Ports" and different people use the term to mean different things. For example, emulating RS232 communication over Bluetooth, or USB, is also something done using "Virtual Seria

ValueError: I/O operation on closed file

2009-04-10 Thread dj
I have a handler which I use with a set of log levels for the python logging module. --- myhandler.py import logging.handlers # create my handler class class MyHandler(logging.handlers.RotatingFileHandler):

Python 2.6/3.0 packages for Ubuntu?

2009-04-10 Thread skip
Does Ubuntu really not have Python 2.6 or 3.0 packages or do I just have my package list misconfigured? I'm setting up a fresh machine and am not too Ubuntu-aware. Is there a list of package repositories around somewhere? Thx, -- Skip Montanaro - s...@pobox.com - http://www.smontanaro.net/

Re: How to create a virtual serial port?

2009-04-10 Thread Grant Edwards
On 2009-04-10, Stuart Davenport wrote: > I am trying to work out if its possible, to create a virtual serial > port with Python? On Linux: no. On other OSes, I don't know. -- Grant Edwards grante Yow! I'm encased in the at

Re: How to create a virtual serial port?

2009-04-10 Thread Scott David Daniels
Stuart Davenport wrote: Hi, I am trying to work out if its possible, to create a virtual serial port with Python? Would anyone know how to go about this in code? Any help would be greatly appreciated! :) I have a had a google and the topics returned only seem to reflect "reading" serial port da

How to create a virtual serial port?

2009-04-10 Thread Stuart Davenport
Hi, I am trying to work out if its possible, to create a virtual serial port with Python? Would anyone know how to go about this in code? Any help would be greatly appreciated! :) I have a had a google and the topics returned only seem to reflect "reading" serial port data, particularly pySerial

knowing mobile ip

2009-04-10 Thread seham salem
how can i know my mobile ip by bython code or something else i found a code but it does not work with my mobile. Nokia N73,E56>>> thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Crash on msvcrt mismatch?

2009-04-10 Thread Aahz
In article , Lagarde, Jean wrote: > >I'm curious to understand why that matters, but I found out that if I load = >the modules in the inverse order, everything works fine. There's probably a refcount bug hiding in your code. -- Aahz (a...@pythoncraft.com) <*> http://www.pythonc

zProblem

2009-04-10 Thread norseman
Moderator: I apologize for attaching anything. However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small as I can get it. Steve norse...@hughes.net zProblem.pdf Description: Adobe PDF document -- http://mail.python.org

Re: Running an interactive subprocess with Popen

2009-04-10 Thread norseman
David Liang wrote: Hello, Sorry for the newbie question. How do I run a program that could block, waiting for user input, using subprocess.Popen? For example, from subprocess import * def foo(): a = Popen(['python'] ...) I want to be able to get input from the user and send input to the su

RE: Crash on msvcrt mismatch?

2009-04-10 Thread Lagarde, Jean
I'm curious to understand why that matters, but I found out that if I load the modules in the inverse order, everything works fine. -- Jean From: Lagarde, Jean Sent: Friday, April 10, 2009 10:08 AM To: python-list@python.org Subject: Crash on msvcrt mismatch? I

Re: Bug tracker off-line?

2009-04-10 Thread Aahz
In article , MRAB wrote: > >Is it just me or is the bug tracker site having problems? I'm not having >a problem with other sites. Someone else reported this on python-dev -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ Why is this newsgroup different from all o

Re: numpy.where

2009-04-10 Thread Lou Pecora
In article , Robert Kern wrote: > http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html That helps, thanks. So I can RTFWP, too. :-) -- -- Lou Pecora -- http://mail.python.org/mailman/listinfo/python-list

Crash on msvcrt mismatch?

2009-04-10 Thread Lagarde, Jean
I don't have much experience writing extension modules, and am looking for pointers to resolve python crashes on Windows. I've isolated the problem to a python file with the following two lines: import PyQt4.Qwt5 import C13 That causes Python to crash. If I comment out either one of t

python crash

2009-04-10 Thread John Reid
Python crashes in glibc with the following stack trace. I'm using an interface to R (rpy2), ipython, matplotlib, numpy, and scipy with a wx backend. I'm not sure if the stack trace shows which is the culprit. I've probably misconfigured one of their installs but knowing which one to recompile i

Bug tracker off-line?

2009-04-10 Thread MRAB
Is it just me or is the bug tracker site having problems? I'm not having a problem with other sites. -- http://mail.python.org/mailman/listinfo/python-list

RE: Open source web crawler with mysql integration

2009-04-10 Thread bruce
phillip... lots of code is opened source "as is"!!! when you get right down to it, a good deal of "open source" code from sourceforge/hotscritps/freshmeat/etc.. is pretty poor, but it is open sourced. you could simply toss your code out into the open source pool, and not be worried about support

Re: Open source web crawler with mysql integration

2009-04-10 Thread Philip Semanchuk
On Apr 10, 2009, at 10:28 AM, Support Desk wrote: Sounds Interesting. When its done would you care to share it? Hi Michael, The coding has been done (as much as software is ever "done") for a couple of years now. It's mothballed now, sitting on my hard drive. The problem with open sourcin

Re: numpy.where

2009-04-10 Thread Peter Pearson
On Fri, 10 Apr 2009 02:39:46 -0500, Robert Kern wrote: > On 2009-04-09 22:40, Peter Pearson wrote: >> >> Hey, if you find TFM, please tell me where it is. I haven't >> found anything Fine. I even bought Travis Oliphant's book, >> which helps a little, but . . . > > http://docs.scipy.org/doc/nump

Re: I can't get RLock to work (warning, the following code is pretty long)

2009-04-10 Thread grocery_stocker
On Apr 10, 8:39 am, Peter Otten <__pete...@web.de> wrote: > grocery_stocker wrote: > > On Apr 10, 6:48 am, Peter Otten <__pete...@web.de> wrote: > >> grocery_stocker wrote: > >> > When I run the following... > > >> > #!/usr/bin/python > > >> > import time > >> > import thread > >> > import threadin

Re: I can't get RLock to work (warning, the following code is pretty long)

2009-04-10 Thread Peter Otten
grocery_stocker wrote: > On Apr 10, 6:48 am, Peter Otten <__pete...@web.de> wrote: >> grocery_stocker wrote: >> > When I run the following... >> >> > #!/usr/bin/python >> >> > import time >> > import thread >> > import threading >> >> > def get_first_part(string, lock, sleeptime, *args): >> >

Re: loop? maybe?

2009-04-10 Thread Mike Driscoll
On Apr 10, 7:42 am, heidi taynton wrote: > Hey guys, > > Sorry for being such a noob with this stuff and the language is hard for me > to read through with the online manuals...  i can do math speak, and science > speak... not so much programming/code speak... so when you say pickle... i > thin

Re: I can't get RLock to work (warning, the following code is pretty long)

2009-04-10 Thread grocery_stocker
On Apr 10, 6:48 am, Peter Otten <__pete...@web.de> wrote: > grocery_stocker wrote: > > When I run the following... > > > #!/usr/bin/python > > > import time > > import thread > > import threading > > > def get_first_part(string, lock, sleeptime, *args): > > global counter > > lock.a

Re: a simple keypress sensor

2009-04-10 Thread cassiope
On Apr 9, 6:55 pm, Soumen banerjee wrote: > Hello, > I am writing a little program where i have an array the elements of > which i want to display upon keypresses by the user. The only way on > linux seems like using getch() from the curses library. I wanted a > simpler solution than having to use

Re: Adding a Badge to an Icon in Mac OS X

2009-04-10 Thread Kevin Walzer
bingo wrote: Hi all, I have been, now for daysm trying to figure out how to add a badge to an Icon in Mac OS X. Carbon Icon Services is not documented and I new to Mac programming. Any help would be greatly appreciated! Cheers, Look at PyObjC--there should be methods in there to do it. -- Kev

how to use logging.config.fileConfig ?

2009-04-10 Thread Alexandru Moșoi
Hello, I have a problem using logging the library. I copied and modified the example from PEP 282 [0], [1], [2], [3]. If I use logging.basicConfig() everything works fine. If I use logging.config.fileConfig() my loggers get disabled. I checked logging/ config.py and I found a big comment saying th

email in separate thread

2009-04-10 Thread joeygartin
Greetings, Disclosure: I am a total newbie! I am building an application Django and come to a dilemna when sending off emails. I have an application that sends off an email after a customer has filled out a form, actually it sends off 7 emails. The problem is the page hangs while the emails ar

RE: Open source web crawler with mysql integration

2009-04-10 Thread Support Desk
Sounds Interesting. When its done would you care to share it? Sincerely, Michael H. -Original Message- From: Philip Semanchuk [mailto:phi...@semanchuk.com] Sent: Thursday, April 09, 2009 9:46 PM To: Python Subject: Re: Open source web crawler with mysql integration On Apr 9, 2009, at

Re: I can't get RLock to work (warning, the following code is pretty long)

2009-04-10 Thread Peter Otten
grocery_stocker wrote: > When I run the following... > > #!/usr/bin/python > > import time > import thread > import threading > > def get_first_part(string, lock, sleeptime, *args): > global counter > lock.acquire() > try: > counter = counter + 1 >

Re: writing array

2009-04-10 Thread Piet van Oostrum
> heidi taynton (ht) wrote: >ht> Hey guys, >ht> I'm trying to write a new array from the one i already have >ht> but here is the catch: >ht> I want an array where n=# of data points used in previous point (rounded >down) >ht> in every spot, I want to take 1.1**n data points and

I can't get RLock to work (warning, the following code is pretty long)

2009-04-10 Thread grocery_stocker
When I run the following... #!/usr/bin/python import time import thread import threading def get_first_part(string, lock, sleeptime, *args): global counter lock.acquire() try: counter = counter + 1 data = counter print "%s v

Re: Can't create list of dictionaries

2009-04-10 Thread Piet van Oostrum
> sophie_newbie (sn) wrote: >sn> Hi there, >sn> I've got a function that returns a dictionary, I need to loop and >sn> return 1000 dictionaries and append them to a list, but the thing is >sn> that when I do the list.append(funtThatReturnsDict()) the resulting >sn> only ever has 1 dictionary

save error with embedded python 2.5

2009-04-10 Thread eric_dex...@msn.com
I seem to be getting one extra value when I create my values with for yy in range(1, maxy): for xx in range(1, maxx): count = count + 1 #squaret.append[count] squaret.append( square(xx * 20, yy * 20)) and saving boxes with if squaresave.state == '1':

loop? maybe?

2009-04-10 Thread heidi taynton
Hey guys, Sorry for being such a noob with this stuff and the language is hard for me to read through with the online manuals... i can do math speak, and science speak... not so much programming/code speak... so when you say pickle... i think food Anyways, I have an array and I want t

ANN: python-ldap-2.3.7

2009-04-10 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. p

Re: Running an interactive subprocess with Popen

2009-04-10 Thread edexter
On Apr 10, 2:56 am, "Diez B. Roggisch" wrote: > David Liang schrieb: > > > > > > > Hello, > > Sorry for the newbie question. How do I run a program that could > > block, waiting for user input, using subprocess.Popen? For example, > > > from subprocess import * > > > def foo(): > >     a = Popen([

Re: is this possible (getting info off web page)

2009-04-10 Thread Esmail
bruce wrote: Hi Esmail. I've not looked at the site. however, i can give you some general pointers that might help you in solving your issue. Excellent advice, thanks for pointing me in those directions. I am not familiar with curl but will take this as an opportunty to learn about it. I think

Re: Can't create list of dictionaries

2009-04-10 Thread Peter Otten
sophie_newbie wrote: > Hi there, > > I've got a function that returns a dictionary, I need to loop and > return 1000 dictionaries and append them to a list, but the thing is > that when I do the list.append(funtThatReturnsDict()) the resulting > only ever has 1 dictionary attached to it, even aft

Re: weird try/finally behaviour

2009-04-10 Thread Tim Hoffman
Hi Sylvain You should have a read of the python docs, specifically on try: finally: excerpt from docs. -- When a return, break or continue statement is executed in the try suite of a try...finally statement, the finally clause is also executed `on the way out.' A continue statement is illegal in

Re: Can't create list of dictionaries

2009-04-10 Thread John Machin
On Apr 10, 9:49 pm, sophie_newbie wrote: > Scratch everything I said, copy() does work. Made a wee mistake > somewhere else. > > Apologies if I've wasted anyones time! U ... if think you need a dict.copy() *after* the function has returned, then you are likely to be doing it in a way that per

Re: Can't create list of dictionaries

2009-04-10 Thread John Machin
On Apr 10, 9:36 pm, sophie_newbie wrote: > Hi there, > > I've got a function that returns a dictionary, I need to loop and > return 1000 dictionaries and append them to a list, but the thing is > that when I do the list.append(funtThatReturnsDict()) the resulting > only ever has 1 dictionary attac

weird try/finally behaviour

2009-04-10 Thread Sylvain Thénault
Hi there, I've encountered the following behaviour which I found surprising: >>> def test(): ... for x in ('test', 'tests'): ... try: ... if True: ... print 'return' ... return 1 ... finally: ... print 'break' ...

Re: Can't create list of dictionaries

2009-04-10 Thread sophie_newbie
Scratch everything I said, copy() does work. Made a wee mistake somewhere else. Apologies if I've wasted anyones time! On Apr 10, 12:36 pm, sophie_newbie wrote: > Hi there, > > I've got a function that returns a dictionary, I need to loop and > return 1000 dictionaries and append them to a list

Can't create list of dictionaries

2009-04-10 Thread sophie_newbie
Hi there, I've got a function that returns a dictionary, I need to loop and return 1000 dictionaries and append them to a list, but the thing is that when I do the list.append(funtThatReturnsDict()) the resulting only ever has 1 dictionary attached to it, even after running the append function 100

Re: Request For Comment

2009-04-10 Thread Esmail
Aahz wrote: How RFC1 got created: http://www.nytimes.com/2009/04/07/opinion/07crocker.html That was great, thanks for posting the link. Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C API String Memory Consumption

2009-04-10 Thread Hrvoje Niksic
Carl Banks writes: > On Apr 9, 11:23 pm, Hrvoje Niksic wrote: >> a...@pythoncraft.com (Aahz) writes: >> > BTW, note that if you're using Python 2.x, range(100) will cause >> > a "leak" because ints are never freed.  Instead, use xrange(). >> >> Note that using xrange() won't help with that p

Adding a Badge to an Icon in Mac OS X

2009-04-10 Thread bingo
Hi all, I have been, now for daysm trying to figure out how to add a badge to an Icon in Mac OS X. Carbon Icon Services is not documented and I new to Mac programming. Any help would be greatly appreciated! Cheers, -- http://mail.python.org/mailman/listinfo/python-list

Re: communication between objects - help

2009-04-10 Thread Dave Angel
Murali kumar wrote: hi all.. I'm posted in a word doc becoz to add a image to explain my problem.. also I think gmail automatically scans for attachments.. anyway.. here's my problem...( see the image) http://www.2shared.com/file/5299759/45e4c614/load.html Using : Python 2.6 , wxPython 2.8.9

Generating User Search Queries

2009-04-10 Thread Lawrence D'Oliveiro
I implemented a form in a Web-based database-management application that lets the user search on a whole lot of different fields. I hate writing repetitive code. But here's part of the sequence I came up with for translating entered field values into MySQL query phrases: condition = \ (

Re: Python C API String Memory Consumption

2009-04-10 Thread Carl Banks
On Apr 9, 11:23 pm, Hrvoje Niksic wrote: > a...@pythoncraft.com (Aahz) writes: > > BTW, note that if you're using Python 2.x, range(100) will cause > > a "leak" because ints are never freed.  Instead, use xrange(). > > Note that using xrange() won't help with that particular problem. I think

Multiprocessing module

2009-04-10 Thread Deepak Rokade
Hi All, I have decided to use multiprocessing module in my application. In brief, my application fetches files from multiple remote directories and distributes the received files to one or more remote directories using SFTP. Since this application is going to be commercial one I want to know at

Re: XMLRPC - persistent object state on server

2009-04-10 Thread Brian Quinlan
Demidov Andrey wrote: class MyClass: def __init__(self, a): self.a = a # and some heavy works which I would like to do once def say(self): return a Change: def say(self): return a to: def say(self): return self.a Cheers, Brian -

Re: XMLRPC - persistent object state on server

2009-04-10 Thread Demidov Andrey
Thank you. Of course, it is my stupid mistake. Change: > def say(self): > return a > > to: > def say(self): > return self.a > > Cheers, > Brian > -- http://mail.python.org/mailman/listinfo/python-list

XMLRPC - persistent object state on server

2009-04-10 Thread Demidov Andrey
Hi, all I need a XMLRPC server, which works with database and returns data to the clients. But I can not find any possibility to keep the object state on server between the clients calls. Here is my code: 1. Server: from SimpleXMLRPCServer import SimpleXMLRPCServer from Simple

Re: calculate field in ARCGIS

2009-04-10 Thread Duncan Booth
MRAB wrote: > You might also want to try a triple-quoted string, which makes it > clearer: > > codeblock = """def codefun(code): > if code == 0: > return "B" > else: > return "" > """ > Possibly the clearest way to do something like that is to use a single backslas

communication between objects - help

2009-04-10 Thread Murali kumar
hi all.. I'm posted in a word doc becoz to add a image to explain my problem.. also I think gmail automatically scans for attachments.. anyway.. here's my problem...( see the image) http://www.2shared.com/file/5299759/45e4c614/load.html Using : Python 2.6 , wxPython 2.8.9 *Scenario: *In my app

Re: Running an interactive subprocess with Popen

2009-04-10 Thread Diez B. Roggisch
David Liang schrieb: Hello, Sorry for the newbie question. How do I run a program that could block, waiting for user input, using subprocess.Popen? For example, from subprocess import * def foo(): a = Popen(['python'] ...) I want to be able to get input from the user and send input to the

Re: Scrap Posts

2009-04-10 Thread Aaron Brady
On Apr 9, 1:28 pm, Grant Edwards wrote: > On 2009-04-09, Avi wrote: >   2. Filter out everything posted from google groups. > >   3. Read the group via the mailing list (which has much better >      filtering). The mailing list is gatewayed by gmane.org if >      you prefer web or NNTP access ins

Re: numpy.where

2009-04-10 Thread Robert Kern
On 2009-04-09 22:40, Peter Pearson wrote: On Thu, 09 Apr 2009 09:09:18 -0400, Lou Pecora wrote: Thanks, Neil. Always something to learn. I've used Numpy for several years, but still have not plumbed the depths. Just tried this script and, yep, it works. arr=array([-1,1.0,2.2,-10.0,1.1

Re: Jython on Google AppEngine.

2009-04-10 Thread Aurélien Campéas
Le 9/04/09 23:51, Tino Wildenhain a écrit : Jason Scheirer wrote: On Apr 9, 9:12 am, Alan Kennedy wrote: Hi all, You may be interested to know that you can now run jython 2.2 out of the box on Google AppEngine, thanks to their new java support. ... Finally! A way to run Python on App Engin

  1   2   >