Re: Regex help needed!

2009-12-21 Thread Johann Spies
> Oltmans wrote: > >I've a string that looks something like > > > >lksjdfls kdjff lsdfs sdjfls >= "amazon_35343433">sdfsdwelcome > > > > > >>From above string I need the digits within the ID attribute. For > >example, required output from above string is > >- 35343433 > >- 345343 > >-

Re: more efficient?

2009-12-21 Thread Gabriel Genellina
En Tue, 22 Dec 2009 03:13:38 -0300, Zubin Mithra escribió: I have the following two implementation techniques in mind. def myfunc(mystring): check = "hello, there " + mystring + "!!!" print check OR structure = ["hello, there",,"!!!"] def myfunc(mystring): structure[2] = mystri

Re: C Structure rebuild with ctypes

2009-12-21 Thread Georg
Hi Mark, many thanks for your valuable help. >>> # numVars contains size of returned arrays. Recast to access. >>> varNamesArray = c.cast(varNames,c.POINTER(PCHAR * numVars.value)) >>> varTypesArray = c.cast(varTypes,c.POINTER(INT * numVars.value)) One last question: You created an object varNa

OT Question

2009-12-21 Thread Victor Subervi
Hi; Back when I worked with Zope, they had this nifty form element where I could select from a list of elements on the right and click an arrow to make them go into a list on the left. I need to add this functionality to the store I am creating. What is it called? TIA, beno -- http://mail.python.o

more efficient?

2009-12-21 Thread Zubin Mithra
I have the following two implementation techniques in mind. def myfunc(mystring): check = "hello, there " + mystring + "!!!" print check OR structure = ["hello, there",,"!!!"] def myfunc(mystring): structure[2] = mystring output = ''.join(mystring) i heard that string concatenat

Re: which pi formula is given in the decimal module documentation?

2009-12-21 Thread Steven D'Aprano
On Tue, 22 Dec 2009 04:04:56 +, Albert van der Horst wrote: > In article <00b967e1$0$15623$c3e8...@news.astraweb.com>, Steven D'Aprano > wrote: >>Nice work! But I have a question... >> >>On Mon, 21 Dec 2009 20:40:40 +, Albert van der Horst wrote: >> >>> def pi4(): >>> ' Calculate pi

Re: How to validate the __init__ parameters

2009-12-21 Thread Steven D'Aprano
On Tue, 22 Dec 2009 00:18:21 +, r0g wrote: > Yikes, glad to be set me straight on that one! Thanks :) It's a pity > though, I really like the way it reads. Is there anything similar with > ISN'T disabled when optimizations are turned on? Yes: an explicit test-and-raise. if not condition:

ScrolledText get xy index of rowheader component?

2009-12-21 Thread J Wolfe
Hi, I tried to get the xycoordinate of a click of the rowheader column of Pmw's ScrolledText...and it returns the xycoordinate of the text portion...even though I supplied it with the rowheader component. self.scrolledtext.component('rowheader').index("@%d,%d" % (event.x,event.y)) What am I doin

Re: which pi formula is given in the decimal module documentation?

2009-12-21 Thread Gabriel Genellina
En Mon, 21 Dec 2009 17:40:40 -0300, Albert van der Horst escribió: In article , Albert van der Horst wrote: In article , Mark Dickinson wrote: After a cup of coffee, it's much clearer: this just comes from the Taylor series for arcsin(x), applied to x = 1/2 to get asin(1/2) = pi/6.

Re: which pi formula is given in the decimal module documentation?

2009-12-21 Thread Steven D'Aprano
Nice work! But I have a question... On Mon, 21 Dec 2009 20:40:40 +, Albert van der Horst wrote: > def pi4(): > ' Calculate pi by a 5th order process, with favorable stop > criterion' > precision = 10e-20 Why do you say 10e-20 instead of 1e-19? -- Steven -- http://mail.pytho

Re: numpy performance and random numbers

2009-12-21 Thread Gib Bogle
David Cournapeau wrote: On Sun, Dec 20, 2009 at 6:47 PM, Lie Ryan wrote: On 12/20/2009 2:53 PM, sturlamolden wrote: On 20 Des, 01:46, Lie Ryan wrote: Not necessarily, you only need to be certain that the two streams don't overlap in any reasonable amount of time. For that purpose, you can u

Re: Python-list Digest, Vol 75, Issue 226

2009-12-21 Thread Gabriel Genellina
En Mon, 21 Dec 2009 16:30:13 -0300, Pulkit Agrawal escribió: I am writing a script wherein I need to merge files into existing tar.gz files. Currently, I am using tarfile module. I extract the tar.gz to a tempdir and copy the new file there and re-compress all the files back into a tar.gz.

Re: Python 3.1.1 installer botches upgrade when installation is not on C drive.

2009-12-21 Thread Gabriel Genellina
En Mon, 21 Dec 2009 15:25:05 -0300, John Nagle escribió: I just installed "python3.1.1.msi" on a system that had "python3.1.msi" installed in "D:/python31". The installer found the old installation in "D:/python31", partially trashed it, and then installed the new version in "C:/pyth

Re: How to validate the __init__ parameters

2009-12-21 Thread Steve Holden
r0g wrote: > Steven D'Aprano wrote: >> On Mon, 21 Dec 2009 21:49:11 +, r0g wrote: >> >>> I use assertions myself e.g. >>> >> foo = "123456" >> assert len(foo) <= 5 >>> Traceback (most recent call last): >>> File "", line 1, in >>> AssertionError >>> >>> >>> Dunno if this would be con

python - fetching, post, cookie question

2009-12-21 Thread bruce
hi... the following sample is an attempt to fetch two subsequent pages from a sameple site. (it's public) the script attempts to implement a request, using the POST method, as well as as cookies. Testing using LiveHttpHeaders/Firefox indicates that the app uses post/cookies, and it doesn't work if

[no subject]

2009-12-21 Thread bruce
hi... the following sample is an attempt to fetch two subsequent pages from a sameple site. (it's public) the script attempts to implement a request, using the POST method, as well as as cookies. Testing using LiveHttpHeaders/Firefox indicates that the app uses post/cookies, and it doesn't work if

Re: C Structure rebuild with ctypes

2009-12-21 Thread Mark Tolonen
"Georg" wrote in message news:7padi2fsm...@mid.individual.net... Hi Mark, many thanks for your help. I tried your code in my program and it worked. I would like to understand what the code is doing and I have some questions to it. Are you passing in these values, or are they being returne

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Stephen Hansen wrote: On Mon, Dec 21, 2009 at 2:57 PM, W. eWatson wrote: This has got to be some sort of IDLE issue then. Huh? How do you figure? When I run a simple program. If I open this program in the IDLE editor: #import math print "hello, math world." print cos(0.5) print sin(0.8) th

how to register with pypi - no such setup.py

2009-12-21 Thread Phlip
And the next question in the series - how to make sure the resulting package has a setup.py file? The basic steps are... - build a python package - create a minimal setup.py - (github it, natch) - throw it at pypi with: python setup.py bdist upload - attempt to install it with: s

PyTrie 0.1

2009-12-21 Thread George Sakkis
I'm pleased to announce the first release of PyTrie, a pure Python implementation of the trie (prefix tree) data structure [1]. Tries extend the mapping interface with methods that facilitate finding the keys/values/items for a given prefix, and vice versa, finding the prefixes (or just the longes

Re: Please Help Publicize PyCon

2009-12-21 Thread Horace Blegg
*Bitten once again by 'reply all', my apologies john.* Brilliant troll :D Well done! I, for one, am looking forward to watching the videos of the talks, since I can not attend myself (hi college education!). On Mon, Dec 21, 2009 at 9:31 AM, John Nagle wrote: > Steve Holden, Chairman, PSF wrot

Re: how to register with pypi

2009-12-21 Thread Phlip
If you have never used PGP before, you *really* shouldn't register a PGP key ID in PyPI. I suppose your key doesn't have any counter signatures, anyway. Nope, thanks, I'm already in. The pypi page could mark the field "optional". I just associated it, conceptually, with the Github SSH key, and

Re: How to validate the __init__ parameters

2009-12-21 Thread r0g
Steven D'Aprano wrote: > On Mon, 21 Dec 2009 21:49:11 +, r0g wrote: > >> I use assertions myself e.g. >> > foo = "123456" > assert len(foo) <= 5 >> Traceback (most recent call last): >> File "", line 1, in >> AssertionError >> >> >> Dunno if this would be considered good or bad prog

Re: how to register with pypi

2009-12-21 Thread Martin v. Loewis
>> The key ID should be an eight-digit string, such as EA5BBD71 (i.e. a >> 32-bit key ID). > > pretend I was someone who had never ever used PGP before. > > pgp -kg, then what? I don't have pgp, only gpg. In gpg --list-keys, it's the 32-bit ID that gets listed. Try -kv. If you have never used P

Re: Beginner question: binary data and socket.send

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 3:31 PM, Boris Epel wrote: > Hi! Please help with the problem: > send over TCPIP data packet organized as 6 bytes of identifier, > integer (LSB) and length of following binary data, binary data > the clear part:  create socket, connect it, use send, close socket > the uncle

Re: Threading with queues

2009-12-21 Thread Gib Bogle
Stephen Hansen wrote: On Mon, Dec 21, 2009 at 3:12 PM, Gib Bogle wrote: #spawn a pool of threads, and pass them queue instance for i in range(5): t = ThreadUrl(queue,i) t.setDaemon(True) t.start() #populate queue with data for host in hosts: queue.put(host) This is indent

Re: numpy performance and random numbers

2009-12-21 Thread Robert Kern
On 2009-12-21 16:57 PM, r0g wrote: sturlamolden wrote: On 19 Des, 16:20, Carl Johan Rehn wrote: How about mulit-core or (perhaps more exciting) GPU and CUDA? I must admit that I am extremely interested in trying the CUDA-alternative. Obviously, cuBLAS is not an option here, so what is the sa

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread Steven D'Aprano
On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: > A programmer that > lacks critical thinking is a bad programmer. The language they use has > no bearing on such human facilities. That's nonsense, and I can demonstrate it by reference to a single programming language, namely Python.

Re: How to validate the __init__ parameters

2009-12-21 Thread Steven D'Aprano
On Mon, 21 Dec 2009 21:49:11 +, r0g wrote: > I use assertions myself e.g. > foo = "123456" assert len(foo) <= 5 > Traceback (most recent call last): > File "", line 1, in > AssertionError > > > Dunno if this would be considered good or bad programming practice by > those more e

Re: Threading with queues

2009-12-21 Thread Gib Bogle
Stephen Hansen wrote: On Mon, Dec 21, 2009 at 3:12 PM, Gib Bogle wrote: #spawn a pool of threads, and pass them queue instance for i in range(5): t = ThreadUrl(queue,i) t.setDaemon(True) t.start() #populate queue with data for host in hosts: queue.put(host) This is indent

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread r0g
J Kenneth King wrote: > c) This has nothing to do with programming languages. A programmer that > lacks critical thinking is a bad programmer. The language they use has > no bearing on such human facilities. The language may well have a bearing on the quality of the programs generated though,

Beginner question: binary data and socket.send

2009-12-21 Thread Boris Epel
Hi! Please help with the problem: send over TCPIP data packet organized as 6 bytes of identifier, integer (LSB) and length of following binary data, binary data the clear part: create socket, connect it, use send, close socket the unclear part: create string with required data to use with send wh

Re: Using Python to Execute a C or FORTRAN Program (Windows)

2009-12-21 Thread Gib Bogle
W. eWatson wrote: Mensanator wrote: On Dec 14, 8:14�pm, "W. eWatson" wrote: I think Python is capable of executing a compiled C or FORTRAN program, Sure, if it was compiled to an .exe file. and maybe even getting some parameters passed back. Sure, if the program prints to stdout. Does

Re: numpy performance and random numbers

2009-12-21 Thread Gib Bogle
sturlamolden wrote: On 19 Des, 22:58, sturlamolden wrote: If you pick two random states (using any PRNG), you need error- checking that states are always unique, i.e. that each PRNG never reaches the starting state of the other(s). Another note on this: Ideally, we would e.g. know how to fi

Re: Threading with queues

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 3:24 PM, Stephen Hansen wrote: > This is indented over one indentation level too much. You want it to > be at the same level as the for above. Here, its at the same level > with "t" -- meaning this entire loop gets repeated five times. Err, "this" in this context meant the

Re: numpy performance and random numbers

2009-12-21 Thread Gib Bogle
sturlamolden wrote: On 19 Des, 16:20, Carl Johan Rehn wrote: How about mulit-core or (perhaps more exciting) GPU and CUDA? I must admit that I am extremely interested in trying the CUDA-alternative. Obviously, cuBLAS is not an option here, so what is the safest route for a novice parallel-pro

Re: numpy performance and random numbers

2009-12-21 Thread Gib Bogle
sturlamolden wrote: On 19 Des, 14:06, Carl Johan Rehn wrote: Matlab and numpy have (by chance?) the exact names for the same functionality, Common ancenstry, NumPy and Matlab borrowed the name from IDL. LabView, Octave and SciLab uses the name randn as well. So the basioc question is, h

Re: Threading with queues

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 3:12 PM, Gib Bogle wrote: >  #spawn a pool of threads, and pass them queue instance >  for i in range(5): >    t = ThreadUrl(queue,i) >    t.setDaemon(True) >    t.start() > >  #populate queue with data >    for host in hosts: >      queue.put(host) This is indented over o

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 2:57 PM, W. eWatson wrote: > This has got to be some sort of IDLE issue then. Huh? How do you figure? > When I run a simple > program. If I open this program in the IDLE editor: > #import math > print "hello, math world." > print cos(0.5) > print sin(0.8) > > then I get >

Threading with queues

2009-12-21 Thread Gib Bogle
Hi, I'm learning Python, jumping in the deep end with a threading application. I came across an authoritative-looking site that recommends using queues for threading in Python. http://www.ibm.com/developerworks/aix/library/au-threadingpython/index.html The author provides example code that fet

Re: C Structure rebuild with ctypes

2009-12-21 Thread Georg
Hi Mark, many thanks for your help. I tried your code in my program and it worked. I would like to understand what the code is doing and I have some questions to it. > Are you passing in these values, or are they being returned? To me the > depth of the pointer references implies numVars, var

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Stephen Hansen wrote: On Mon, Dec 21, 2009 at 1:51 PM, W. eWatson wrote: Lie Ryan wrote: On 12/22/2009 6:39 AM, W. eWatson wrote: Wow, did I get a bad result. I hit Ctrl-P, I think instead of Alt-P, and No, its not true. A built-in module does not mean its available everywhere. It means i

Re: numpy performance and random numbers

2009-12-21 Thread r0g
sturlamolden wrote: > On 19 Des, 16:20, Carl Johan Rehn wrote: > >> How about mulit-core or (perhaps more exciting) GPU and CUDA? I must >> admit that I am extremely interested in trying the CUDA-alternative. >> >> Obviously, cuBLAS is not an option here, so what is the safest route >> for a novi

Re: how to register with pypi

2009-12-21 Thread Phlip
Martin v. Loewis wrote: I'm stuck on the "PGP Key ID". When I whip out my trusty Ubuntu and run pgp -kg, I get a 16-digit "DSA / EIGamal" key. When I enter it into http://pypi.python.org/pypi?%3Aaction=register_form , I get a helpful "PGP Key ID is invalid". Should I try a key of some other alg

Re: how to register with pypi

2009-12-21 Thread Martin v. Loewis
> I'm stuck on the "PGP Key ID". When I whip out my trusty Ubuntu and run > pgp -kg, I get a 16-digit "DSA / EIGamal" key. > > When I enter it into http://pypi.python.org/pypi?%3Aaction=register_form > , I get a helpful "PGP Key ID is invalid". > > Should I try a key of some other algorithm? If

ANN: logbuilder 0.1.0a

2009-12-21 Thread Filip Gruszczyński
This is a one-time post to annouce the creation of logbuilder project, an open source tool for change log creation based on version control commit messages. Using conventions in commit messages logbuilder detects messages that can be imported into the change log and painlessly creates on for every

Re: Class variables static by default?

2009-12-21 Thread Steven D'Aprano
On Mon, 21 Dec 2009 15:03:03 +0100, Daniel Fetchinson wrote: > I don't think Steven cares much, he loves this type of nitpicking and > uber pedantic formulations, but only if he can apply it to other > people's post :) Heh heh :) I actually do care, because (not having a Java/C++ background) I a

Re: How to validate the __init__ parameters

2009-12-21 Thread Lie Ryan
On 12/22/2009 4:41 AM, Denis Doria wrote: Hi; I'm checking the best way to validate attributes inside a class. Of course I can use property to check it, but I really want to do it inside the __init__: class A: def __init__(self, foo, bar): self.foo = foo #check if foo is correct

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 1:51 PM, W. eWatson wrote: > Lie Ryan wrote: >> >> On 12/22/2009 6:39 AM, W. eWatson wrote: >>> >>> Wow, did I get a bad result. I hit Ctrl-P, I think instead of Alt-P, and >>> a little window came up showing it was about to print hundreds of pages. >>> I can canceled it, b

Re: Line indexing in Python

2009-12-21 Thread r0g
seafoid wrote: > Hi Guys, > > When python reads in a file, can lines be referred to via an index? > > Example: > > for line in file: > if line[0] == '0': > a.write(line) > > This works, however, I am unsure if line[0] refers only to the first line or > the first character in all l

Re: converting string to a date format

2009-12-21 Thread Ben Finney
tekion writes: > Ben, > I do not have python 2.6 install, my version of Python is 2.4. Ouch :-( Upgrade as soon as possible, 2.4 is no longer receiving bug fixes http://www.python.org/download/releases/2.4.6/>. > So I guess I am stuck on parsing the string "24/Nov/2009:12:00:00 > -0500" using r

Re: converting string to a date format

2009-12-21 Thread tekion
On Dec 21, 3:05 pm, MRAB wrote: > tekionwrote: > > Ben, > > I do not have python 2.6 install, my version of Python is 2.4. > > Because of my version of Python I believe I have to perform what you > > have suggested: > > > This should, ideally, consist of two separate operations: > > >   * parse th

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Lie Ryan wrote: On 12/22/2009 6:39 AM, W. eWatson wrote: Wow, did I get a bad result. I hit Ctrl-P, I think instead of Alt-P, and a little window came up showing it was about to print hundreds of pages. I can canceled it, but too late. I turned off my printer quickly and eventually stopped the o

Re: How to validate the __init__ parameters

2009-12-21 Thread Steven D'Aprano
On Mon, 21 Dec 2009 09:41:22 -0800, Denis Doria wrote: > Hi; > > I'm checking the best way to validate attributes inside a class. There is no "best way", since it depends on personal taste. > Of > course I can use property to check it, but I really want to do it inside > the __init__: If you

Re: How to validate the __init__ parameters

2009-12-21 Thread r0g
Denis Doria wrote: > Hi; > > I'm checking the best way to validate attributes inside a class. Of > course I can use property to check it, but I really want to do it > inside the __init__: > > class A: > def __init__(self, foo, bar): > self.foo = foo #check if foo is correct >

Re: Ch 3 of my writings, first few sections posted

2009-12-21 Thread Alf P. Steinbach
This is an introduction to programming based on Python 3.x in Windows. It's posted as PDFs on Google Docs. Currently 2 full chapters plus a little of chapter 3, about 120 pages in total; chapters 1 and 2 reviewed by [comp.programming] and [comp.lang.python] residents (although I have no doubt

RotatingFileHandler key error when parsing a logging config file

2009-12-21 Thread jordilin
Hi, I've a config for logging where I set up a file rotation with handlers.RotatingFileHandler and when the app parses the logging config it says keyError when trying to parse that section ('RotatingFileHandler' is not defined). Curiously enough, I can do import logging and from logging.handlers i

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread Lie Ryan
On 12/22/2009 6:39 AM, W. eWatson wrote: Wow, did I get a bad result. I hit Ctrl-P, I think instead of Alt-P, and a little window came up showing it was about to print hundreds of pages. I can canceled it, but too late. I turned off my printer quickly and eventually stopped the onslaught. I coul

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

2009-12-21 Thread Ross Ridge
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 installer as well as my program - it would be much

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

2009-12-21 Thread Jonathan Hartley
On Dec 17, 11:16 pm, Mark Hammond wrote: > On 18/12/2009 7:44 AM, Ross Ridge wrote: > > > The "P" DLL is for C++ and so the original poster may not actually need > > it.  I'm pretty sure Python itself doesn't need it, and py2exe shouldn't > > either, but wxPython, or more precisely wxWidgets, almo

Re: Anybody use web2py?

2009-12-21 Thread Yarko
On Dec 21, 2:50 am, Bruno Desthuilliers wrote: > mdipierro a écrit : ... > > This means you do not need to import > > basic web2py symbols. They are already defined in the environment that > > executes the models and controllers > > Ok. As far as I'm concerned : show stops here. Sorry- I don't _t

Re: which pi formula is given in the decimal module documentation?

2009-12-21 Thread Albert van der Horst
In article , Albert van der Horst wrote: >In article , >Mark Dickinson wrote: >>On Dec 11, 10:30=A0am, Mark Dickinson wrote: >>> > It looks like an infinite series with term `t`, where`n` =3D (2k-1)^2 >>> > and `d` =3D d =3D 4k(4k+2) for k =3D 1... Does it have a name? >>> >>> Interesting. =A0

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

2009-12-21 Thread Jonathan Hartley
On Dec 17, 8:39 pm, Christian Heimes wrote: > Jonathan Hartley wrote: > > Only this week I sent a py2exe-derived executable to someone else (a > > non-developer) and it would not run on their WinXP machine ("'The > > system cannot execute the specified program'") - my current favourite > > hypothe

Re: converting string to a date format

2009-12-21 Thread MRAB
tekion wrote: Ben, I do not have python 2.6 install, my version of Python is 2.4. Because of my version of Python I believe I have to perform what you have suggested: This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘datetime’

ANN: eGenix mx Base Distribution 3.1.3

2009-12-21 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mx Base Distribution Version 3.1.3 for Python 2.3 - 2.6 Open Source Python extensions providing important and useful services

Re: Live Video Capture using Python

2009-12-21 Thread W. eWatson
David Lyon wrote: Also try.. http://www.unixuser.org/~euske/python/vnc2flv/index.html On Mon, 21 Dec 2009 11:15:32 +0530, Banibrata Dutta wrote: Have you searched the archives of this list ? I remember seeing a related discussion 5-6 months back. On Mon, Dec 21, 2009 at 2:35 AM, aditya shukl

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread W. eWatson
Lie Ryan wrote: On 12/21/2009 1:19 PM, W. eWatson wrote: When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3.

Re: converting string to a date format

2009-12-21 Thread tekion
Ben, I do not have python 2.6 install, my version of Python is 2.4. Because of my version of Python I believe I have to perform what you have suggested: This should, ideally, consist of two separate operations: * parse the string, using a specific format, to create a ‘datetime’ object *

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 11:09 AM, Simon Moses wrote: > so python 2.6, mysql 5.0, apache 2.2, mod_wsgi, > MySQL-python-1.2.2.win32-py2.6 and Django should be sufficient for my > requirement. I don't know for certain; you're asking a bit too much specific detail here :) Just go to http://docs.djan

Merging files into tar.gz archives

2009-12-21 Thread Pulkit Agrawal
Hi, I am writing a script wherein I need to merge files into existing tar.gz archives. Currently, I am using tarfile module. I extract the tar.gz to a tempdir and copy the new file there and re-compress all the files back into a tar.gz. Is there a better way to do it? Thanks Pulkit (Sorry for t

Re: Python-list Digest, Vol 75, Issue 226

2009-12-21 Thread Pulkit Agrawal
Hi, I am writing a script wherein I need to merge files into existing tar.gz files. Currently, I am using tarfile module. I extract the tar.gz to a tempdir and copy the new file there and re-compress all the files back into a tar.gz. Is there a better way to do it? Thanks Pulkit -- http://mail.

linking error after swig

2009-12-21 Thread whatazor
Hi All, I have a mac os x, and I try to replicate the sample in swig tutorial but when I try to link, I have these linking errors: ld example.o example_wrap.o -o _example.so Undefined symbols: "_PyType_Type", referenced from: _PyType_Type$non_lazy_ptr in example_wrap.o "_PyExc_SystemErr

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Simon Moses
so python 2.6, mysql 5.0, apache 2.2, mod_wsgi, MySQL-python-1.2.2.win32-py2.6 and Django should be sufficient for my requirement. The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/-- http://mail.python.org/mailman/listinfo/python-list

Re: I need your opinion...

2009-12-21 Thread logan tag
Thanks for the answer, it's perfect for my purposes. See you in other thread!!! On Mon, Dec 21, 2009 at 6:47 PM, Stephen Hansen wrote: > On Mon, Dec 21, 2009 at 8:23 AM, logan tag wrote: > >> It should be interesting to add new funcionality to "copytree" function >> into a "shutil.py" module?, I

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 10:34 AM, Simon Moses wrote: > > to code a web page which connects to a database and displays some rows, what > minimum software and libraries i should install? > > python 2.6, mysql 5.0, apache 2.2 and Django? thats enough? Depending on your requirements, you might not n

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Simon Moses
to code a web page which connects to a database and displays some rows, what minimum software and libraries i should install? python 2.6, mysql 5.0, apache 2.2 and Django? thats enough? From: Stephen Hansen To: Simon Moses Cc: python-list@python.org Sent: M

Re: (unknown)

2009-12-21 Thread GilJohnson
brc.hu> writes: > > petro, I think you need to use e-mail, not IMP Gil -- http://mail.python.org/mailman/listinfo/python-list

Python 3.1.1 installer botches upgrade when installation is not on C drive.

2009-12-21 Thread John Nagle
I just installed "python3.1.1.msi" on a system that had "python3.1.msi" installed in "D:/python31". The installer found the old installation in "D:/python31", partially trashed it, and then installed the new version in "C:/python31". I uninstalled the failed install, and reinstalled. On

Re: How to validate the __init__ parameters

2009-12-21 Thread Alf P. Steinbach
* Denis Doria: I thought in something like: class A: def __init__(self, foo = None, bar = None): set_foo(foo) self._bar = bar def set_foo(self, foo): if len(foo) > 5: raise _foo = foo foo = property(setter = set_foo) But looks too much

Re: Opening File Object

2009-12-21 Thread Benjamin Kaplan
On Mon, Dec 21, 2009 at 11:48 AM, Ray Holt wrote: > I use the following code: > fileobject = open("e:\\Ray Holts Documents\\Word Documents\\1850 Warren MS > Jenkins", 'y') > line = fileobject.readline() > > I get the following error message:Traceback (most recent call last): >   File "C:/Python26/

Re: How to validate the __init__ parameters

2009-12-21 Thread Jean-Michel Pichavant
Denis Doria wrote: Hi; I'm checking the best way to validate attributes inside a class. Of course I can use property to check it, but I really want to do it inside the __init__: class A: def __init__(self, foo, bar): self.foo = foo #check if foo is correct self.bar = bar Al

Re: difflib get_close_matches improvement?

2009-12-21 Thread Peter Otten
Neal Becker wrote: > difflib.get_close_matches looks useful. But, I don't see where it defines > 'close'. Besides that, wouldn't it be much more useful if one could > supply their own distance metric? If you have a distance function you can find the N best matches with >>> from heapq import ns

Re: How to validate the __init__ parameters

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 9:41 AM, Denis Doria wrote: > All examples that I saw with property didn't show a way to do it in > the __init__. Just to clarify, I don't want to check if the parameter > is an int, or something like that, I want to know if the parameter do > not use more than X chars; an

Re: I need your opinion...

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 8:23 AM, logan tag wrote: > It should be interesting to add new funcionality to "copytree" function > into a "shutil.py" module?, I mean...I have developed a very silly function > "copytree" with a different fourth argument. I have modified the "ignore" > parameter to "tar

Re: Please Help Publicize PyCon

2009-12-21 Thread mdipierro
There is huge difference between what Steve is asking and spam. Spam is "Unsolicited e-mail, often of a commercial nature, sent indiscriminately to multiple mailing lists, individuals, or newsgroups". Steve is asking us help him to identify communities that we may be part of and that we believe m

How to validate the __init__ parameters

2009-12-21 Thread Denis Doria
Hi; I'm checking the best way to validate attributes inside a class. Of course I can use property to check it, but I really want to do it inside the __init__: class A: def __init__(self, foo, bar): self.foo = foo #check if foo is correct self.bar = bar All examples that I saw

Re: For...in statement and generators

2009-12-21 Thread Gabriel Genellina
En Mon, 21 Dec 2009 11:39:46 -0300, Lucas Prado Melo escribió: Is there a way to send() information back to a generator while using the for...in statement? No. You have to write the iteration as a while loop. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: web development in python 2.6 and 3.0

2009-12-21 Thread Stephen Hansen
On Mon, Dec 21, 2009 at 9:22 AM, Simon Moses wrote: > hi, > > i am new to python but have programming experience in few other languages. > i am trying to start with python 2.6 or 3.0. my requirement is accessing > database (mysql and/or postgresql) and web development. > > what all i should insta

web development in python 2.6 and 3.0

2009-12-21 Thread Simon Moses
hi, i am new to python but have programming experience in few other languages. i am trying to start with python 2.6 or 3.0. my requirement is accessing database (mysql and/or postgresql) and web development. what all i should install for my requirement? to connect to database (mysql and/or pos

Re: Please Help Publicize PyCon

2009-12-21 Thread John Nagle
Steve Holden, Chairman, PSF wrote: Hi,everyone. This year I hope all readers of this list will assist me in crass commercial promotion of next year's PyCon. ... One particularly effective way for you prodigious email producers to assist is to something to your signature (as you will see I hav

py2exe "for loop" hangs in compiled program

2009-12-21 Thread p_tierchen
Dear reader, the application is an interface to a sqlite database and stores image metadata (such as year, event, photographer, people on image etc.). i use pyqt4 for the interface and developed this application on a linux platform (python 2.5.4). friends of mine liked what i have done an want it

Re: Opening File Object

2009-12-21 Thread MRAB
Ray Holt wrote: I use the following code: fileobject = open("e:\\Ray Holts Documents\\Word Documents\\1850 Warren MS Jenkins", 'y') line = fileobject.readline() I get the following error message:Traceback (most recent call last): File "C:/Python26/Reading_and_Writing_Files", line 5, in

Ch 3 of my writings, first few sections posted

2009-12-21 Thread Alf P. Steinbach
Tentatively titled "Foundations". Also, these first 2/3 sections may be moved to some later point, i.e. even the structure is tentative, but I'd value comments! http://tinyurl.com/programmingbookP3> Table of contents: 3 Foundations 1 3.1 Some necessary math notation & terminology. 2 3.1.

Opening File Object

2009-12-21 Thread Ray Holt
I use the following code: fileobject = open("e:\\Ray Holts Documents\\Word Documents\\1850 Warren MS Jenkins", 'y') line = fileobject.readline() I get the following error message:Traceback (most recent call last): File "C:/Python26/Reading_and_Writing_Files", line 5, in fileobject = open("

Re: numpy performance and random numbers

2009-12-21 Thread Robert Kern
On 2009-12-19 09:14 AM, Carl Johan Rehn wrote: On Dec 19, 2:49 pm, sturlamolden wrote: On 19 Des, 11:05, Carl Johan Rehn wrote: I plan to port a Monte Carlo engine from Matlab to Python. However, when I timed randn(N1, N2) in Python and compared it with Matlab's randn, Matlab came out as a c

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread J Kenneth King
Lie Ryan writes: > On 12/17/2009 3:17 PM, J Kenneth King wrote: >> A language is a thing. It may have syntax and semantics that bias it >> towards the conventions and philosophies of its designers. But in the >> end, a language by itself would have a hard time convincing a human >> being to ado

how to register with pypi

2009-12-21 Thread Phlip
Pythonistas: I'm stuck on the "PGP Key ID". When I whip out my trusty Ubuntu and run pgp -kg, I get a 16-digit "DSA / EIGamal" key. When I enter it into http://pypi.python.org/pypi?%3Aaction=register_form , I get a helpful "PGP Key ID is invalid". Should I try a key of some other algorithm?

I need your opinion...

2009-12-21 Thread logan tag
It should be interesting to add new funcionality to "copytree" function into a "shutil.py" module?, I mean...I have developed a very silly function "copytree" with a different fourth argument. I have modified the "ignore" parameter to "target" parameter; this new one is used to copy the files wich

Re: For...in statement and generators

2009-12-21 Thread Mark Tolonen
"Lucas Prado Melo" wrote in message news:9f4be2240912210639g58da0549jb0c81450947ef...@mail.gmail.com... Is there a way to send() information back to a generator while using the for...in statement? Thanks in advance. Yes, see "send(), (generator method)" or "yield expressions" in the help.

Re: Sending ^C

2009-12-21 Thread Grant Edwards
On 2009-12-21, Rick wrote: > I am to write script which is to read data from log file which > resides on remote host. It's a simple text file but grows to > couple of MBytes. I want to do ssh connection to remote, and > run 'tail -f _some_file_' command to read only new coming data > and process

  1   2   >