cannot import name .....

2007-05-03 Thread HMS Surprise
Greetings. What is the implication of the error message 'cannot import name .'? It occurs when executing the line: from nBaseTest import nBaseTest The file exists and the class within it exists. Changing it to from nBaseTest import x gives me the same result so it is as though th

Re: SonomaSunshine Get's a Little Peppier

2007-05-03 Thread SamFeltus
The TurboGears app from Outer Space... Sam the Gardener http://samfeltus.com/as3/codetalking3.html -- http://mail.python.org/mailman/listinfo/python-list

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, fscked wrote: > The traceback is as follows: > > Traceback (most recent call last): > File "createXMLPackage.py", line 35, in ? > for boxid, mac, activated, hw_ver, sw_ver, heartbeat, name, > address, phone, country, city, in csvreader: > _csv.Error: string with NUL

Re: Organizing code - import question

2007-05-03 Thread Brian Blais
Carlos Hanson wrote: > It looks like you need __init__.py in MyPackage. Then you can import > starting with MyPackage. For example, you might use one of the > following: > > import MyPackage > from MyPackage.Common import * > etc > that means that MyPackage must be in the sys path too?

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread fscked
On May 3, 9:29 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, fscked wrote: > > The traceback is as follows: > > > Traceback (most recent call last): > > File "createXMLPackage.py", line 35, in ? > > for boxid, mac, activated, hw_ver, sw_ver, heartbeat, name

Re: Can I use Python instead of Joomla?

2007-05-03 Thread Bruno Desthuilliers
walterbyrd a écrit : > On May 2, 5:38 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >> You're mixing apples, fishes, and cars here. Joomla is a content >> management system, Django a framework and Python a language. > > Yes, I know, but they are all ways to create a website. If I wanted

Re: relative import broken?

2007-05-03 Thread Alan Isaac
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Very simply, PEP 328 explains: > """ > Relative Imports and __name__ > > Relative imports use a module's __name__ attribute to determine that > module's position in the package hierarchy. If the module's name does > not c

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread dustin
On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > As Larry said, this most likely means there are null bytes in the CSV file. > > > > Ciao, > > Marc 'BlackJack' Rintsch > > How would I go about identifying where it is? A hex editor might be easiest. You could also use Python:

Re: sqlite for mac?

2007-05-03 Thread 7stud
Per the pysqlite installation instructions, this is the test I ran to confirm that pysqlite installed correctly >from pysqlite2 import test >test.test() and I got output similar to what the docs say should happen: >ran 101 tests in 0.182s My python book, "Beginning Python: From Novice to Profes

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread IAmStarsky
On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > As Larry said, this most likely means there are null bytes in the CSV > > > file. > > > > Ciao, > > > Marc 'BlackJack' Rintsch > > > How would I go about identifying where it is? >

Re: How to check if a string is empty in python?

2007-05-03 Thread [EMAIL PROTECTED]
On May 2, 11:59 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >... > > > >>> import gmpy > > >>> gmpy.mpz(11) > > mpz(11) > > >>> gmpy.mpz('11',10) > > mpz(11) > > >>> gmpy.mpz(11,10) > > > Traceback (most recent call last): > > File "", line 1,

Re: Library Naming

2007-05-03 Thread [EMAIL PROTECTED]
On May 3, 9:41 am, Trans <[EMAIL PROTECTED]> wrote: > I'm taking a pole on how best to name programming library packages. Well, the Poles have been wrong before. > If you have a second, please have a look. > > http://7ranscode.blogspot.com/2007/05/library-poll.html > > Thanks, > T. -- http://

Re: sqlite for mac?

2007-05-03 Thread 7stud
On May 3, 8:37 am, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > > If all tests ran fine then pysqlite can see your sqlite installation. > How are you importing sqlite? It's usually something like "from > pysqlite2 import dbapi2 as sqlite" not simply "import sqlite". > I just checked the errata fo

NewB: Glob Question

2007-05-03 Thread J
Greetings Group- I'm trying to put together a pattern matching script that scans a directory tree for tif images contained in similar folder names, but running into a NewB problem already. Is it the way I'm trying to join multiple paths? Any help would be greatly appericated. Thanks, J! import gl

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread dustin
On Thu, May 03, 2007 at 10:28:34AM -0700, [EMAIL PROTECTED] wrote: > On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > > As Larry said, this most likely means there are null bytes in the CSV > > > > file. > > > > > > Ciao, > > > >

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Duncan Booth
[EMAIL PROTECTED] (Alex Martelli) wrote: > Duncan Booth <[EMAIL PROTECTED]> wrote: > >> means in pure Python code the string has python methods, but in >> Python using the CLR it gains the CLR methods. Presumably in Ruby >> code it looks like a Ruby string and so on, but (and this is what's >> ne

Re: how to use Dispatch to open an application in win32com.client

2007-05-03 Thread Peter Fischer
Dear Python/DCOM experts, I just tried to do a remote dispatch of Google Earth in DCOM, but it didn't work: import pythoncom, win32com.client clsctx=pythoncom.CLSCTX_LOCAL_SERVER i = win32com.client.DispatchEx("GoogleEarth.ApplicationGE", "IAD-PC10", clsctx=clsctx)

Re: Library Naming

2007-05-03 Thread Trans
On May 3, 1:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On May 3, 9:41 am, Trans <[EMAIL PROTECTED]> wrote: > > > I'm taking a pole on how best to name programming library packages. > > Well, the Poles have been wrong before. I don't know what's worse, my misspelling or your joke ;-)

Re: My Python annoyances

2007-05-03 Thread John Nagle
Ben Collver wrote: > I rewrote my code in Python and I found myself running into many of the > same hassles that I run into with other languages: inaccurate and > incomplete documentation, a maze of little platform-specific quirks to > work around in the base classes, and a macho community of us

Re: [ANN] Update to Python Quick Reference Card (for Python 2.4) (v0.67)

2007-05-03 Thread Laurent Pointal
Alex Martelli wrote: > Laurent Pointal <[EMAIL PROTECTED]> wrote: > >> Casey Hawthorne wrote: >> >> > PC-cillin flagged this as a dangerous web site. >> >> Maybe PC-cillin tag as dangerous all sites about Python, the famous >> snake. >> >> >> PS. And why does it tag my laboratory work page as

Re: cannot import name .....

2007-05-03 Thread HMS Surprise
Thanks for posting. pythonpath = .;c:\maxq\bin\testScripts; c:\maxq\bin;c:\maxq\jython Both files are in c:\maxq\bin\testScripts. Also I do not get the message "no module named...: File nCreateIncident.py, the importer: from PyHttpTestCase import PyH

problem with py2exe and microsoft speech SDK 5.1

2007-05-03 Thread Dave Lim
Hello, this is my first time in the mailing list so bear with me. Basically what I did was I followed this site: http://surguy.net/articles/speechrecognition.xml So I installed microsoft speech SDK 5.1 and then used pythonwin COM MakePy utility for it and it worked out fine. However, I need to c

Re: NewB: Glob Question

2007-05-03 Thread kyosohma
On May 3, 12:38 pm, J <[EMAIL PROTECTED]> wrote: > Greetings Group- > > I'm trying to put together a pattern matching script that scans a > directory tree for tif images contained in similar folder names, but > running into a NewB problem already. Is it the way I'm trying to join > multiple paths?

Re: Slicing Arrays in this way

2007-05-03 Thread Tobiah
John Machin wrote: > On May 3, 8:55 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Wed, 02 May 2007 15:03:24 -0700, Tobiah wrote: >> >>> >>> elegant_solution([1,2,3,4,5,6,7,8,9,10]) >>> [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] >> Wow! That's impressive. What version of Python are you usin

Re: My Python annoyances

2007-05-03 Thread John Salerno
André wrote: > Fortunately, Python has incorporated some newbie-unfriendly features, > like metaclasses and, to a lesser extent, decorators which, at last, > make use of a special character. There should be more of these, to > make Python something more challenging to learn. After reading the en

Re: problem with py2exe and microsoft speech SDK 5.1

2007-05-03 Thread kyosohma
On May 3, 1:29 pm, Dave Lim <[EMAIL PROTECTED]> wrote: > Hello, this is my first time in the mailing list so > bear with me. > > Basically what I did was I followed this > site:http://surguy.net/articles/speechrecognition.xml > > So I installed microsoft speech SDK 5.1 and then used > pythonwin CO

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm guessing that your file is in UTF-16, then -- Windows seems to do > that a lot. It kind of makes it *not* a CSV file, but oh well. Try > > print open("test.csv").decode('utf-16').read().replace("\0", > ">>>NUL<<<") > > I'm not terribly unicode-savvy, so I'll

Re: How to check if a string is empty in python?

2007-05-03 Thread John Salerno
[EMAIL PROTECTED] wrote: > On May 2, 3:49 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: >> A simple >> >> if s: >> print "not empty" >> else: >> print "empty" >> >> will do. > > How do you know that s is a string? Seems like a fair assumption given the OP's question and example. -- http://ma

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Xah Lee
Nameless wrote: « Python has readable syntax, a huge library, and bindings for what seems like every major in linux. Perl has CPAN. It seems with those languages if you want to do something all you have to do is import functionality from a library someone had written and use that. In lisp you'd ha

Real Time Battle and Python

2007-05-03 Thread hg
Hi, I have started to work on a python-based robot, and am interested in your feedback: http://realtimebattle.sourceforge.net/ www.snakecard.com/rtb hg -- http://mail.python.org/mailman/listinfo/python-list

How do I get type methods?

2007-05-03 Thread yavannadil
Hello! If I do import uno localContext=uno.getComponentContext() then localContext is of type I guess it's a new type provided by PyUNO extension. localContext.__class__ is None Is there any way to list all methods of that new type, via Python C API or through interpreter (other then dir(localC

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
miah_gbg wrote: > Hi there! > > Just wanted to let people know in this group that I have recently > (April 24th) published an introductory article on wxPython and Mac OS > X. It is available here: http://www.macdevcenter.com/ > > Hope someone finds it useful. > > Regards, > > Jeremiah > F

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Markus E Leypold
Xah Lee <[EMAIL PROTECTED]> writes: > (if there is some demand, i will add a concrept, little programing No. There ain't. - M -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
miah_gbg wrote: > Hi there! > > Just wanted to let people know in this group that I have recently > (April 24th) published an introductory article on wxPython and Mac OS > X. It is available here: http://www.macdevcenter.com/ > > Hope someone finds it useful. > > Regards, > > Jeremiah > N

adding methods at runtime and lambda

2007-05-03 Thread Mike
I was messing around with adding methods to a class instance at runtime and saw the usual code one finds online for this. All the examples I saw say, of course, to make sure that for your method that you have 'self' as the first parameter. I got to thinking and thought "I have a lot of arbitrary me

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
James Stroud wrote: > miah_gbg wrote: > >> Hi there! >> >> Just wanted to let people know in this group that I have recently >> (April 24th) published an introductory article on wxPython and Mac OS >> X. It is available here: http://www.macdevcenter.com/ >> >> Hope someone finds it useful. >> >> R

Re: Using python with MySQL

2007-05-03 Thread hlubenow
HMS Surprise wrote: > Greetings, > > I need to peform some simple queries via MySQL. Searching the list I > see that folks are accessing it with python. I am very new to python > and pretty new to MySQL too. Would appreciate it if you could point me > to some documentation for accessing MySQL via

Re: adding methods at runtime and lambda

2007-05-03 Thread Mike
In the above example 'addm' should be 'AddMethod' superdict = AddMethod(dict(), lambda self, d: myUtils.HasDrive(d),"hasdrive") -- http://mail.python.org/mailman/listinfo/python-list

Re: adding methods at runtime and lambda

2007-05-03 Thread James Stroud
Mike wrote: > I was messing around with adding methods to a class instance at > runtime and saw the usual code one finds online for this. All the > examples I saw say, of course, to make sure that for your method that > you have 'self' as the first parameter. I got to thinking and thought > "I have

Re: Using python with MySQL

2007-05-03 Thread hlubenow
hlubenow wrote: > There's even another approach: ... On the other hand you may be better off with the "mysql-python"-module. Anyway, here's a nice overview over the most commonly used MySQL-commands (The commands should speak for themselves, even if the explanations are in German): http://www.l

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Dave Borne
> Let's suppose > s='12345 4343 454' > How can I replace the last '4' character? If the last '4' will not always be the last character in the string, you could do: 'X'.join(s.rsplit('4',1)) -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check if a string is empty in python?

2007-05-03 Thread [EMAIL PROTECTED]
On May 3, 2:03 pm, John Salerno <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On May 2, 3:49 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: > >> A simple > > >> if s: > >> print "not empty" > >> else: > >> print "empty" > > >> will do. > > > How do you know that s is a string? > > Se

Re: Real Time Battle and Python

2007-05-03 Thread Matimus
On May 3, 5:20 am, hg <[EMAIL PROTECTED]> wrote: > Hi, > > I have started to work on a python-based robot, and am interested in your > feedback: > > http://realtimebattle.sourceforge.net/www.snakecard.com/rtb > > hg This is not necessarily a response to your effort, but just a note (rant) about re

Re: My Python annoyances

2007-05-03 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Ben Collver wrote: || > from the person who closed it. I get the unspoken message: bug reports | > are not welcome. | | That's the problem with bug reporting systems which let developers | close bugs arbitrarily. I

Re: My Python annoyances

2007-05-03 Thread Terry Reedy
"Ben Collver" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I rewrote my code in Python and I found myself running into many of the | same hassles that I run into with other languages: inaccurate and | incomplete documentation, a maze of little platform-specific quirks to | work ar

Re: My Python annoyances

2007-05-03 Thread Thorsten Kampe
* Paul Boddie (3 May 2007 07:27:11 -0700) > On 3 Mai, 15:49, Ben Collver <[EMAIL PROTECTED]> wrote: > > I installed Cygwin on a Windows machine. I try to quit from an > > interactive Python session. It tells me that on my platform, I must > > press Control-Z to exit. I press Control-Z and it mak

PyGTK and Window Size

2007-05-03 Thread Flavio Preto
Hi, Currently i am developing a python script that will be executed in Gnome. This script uses the PyGTK library, however i have a question: How can I make my application to remember the last window size when it was closed? This behavior is natural for the majority of Gnome applications (i think)

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread kyosohma
On May 3, 9:44 am, Johny <[EMAIL PROTECTED]> wrote: > On May 3, 4:37 pm, [EMAIL PROTECTED] wrote: > > > > > On May 3, 9:27 am, Johny <[EMAIL PROTECTED]> wrote: > > > > Let's suppose > > > s='12345 4343 454' > > > How can I replace the last '4' character? > > > I tried > > > string.replace(s,s[len(s

Re: 32 OS on 64-bit machine

2007-05-03 Thread king kikapu
At Amd Turion 64, it gives: ('32bit', 'ELF') -- http://mail.python.org/mailman/listinfo/python-list

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread Gib Bogle
Ah, so the firefighters were in on the conspiracy! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Steven Howe
Dave Borne wrote: Let's suppose s='12345 4343 454' How can I replace the last '4' character? If the last '4' will not always be the last character in the string, you could do: 'X'.join(s.rsplit('4',1)) from string import rfind def replaceLast_X_with_Y( s, x, y ): lastX =

Re: cannot import name .....

2007-05-03 Thread Matimus
I do see one problem there... if __name__ == 'main': t = nBaseTest('nBaseTest') t.logon() That should be: if __name__ == "__main__": t = nBaseTest('nBaseTest') t.logon() It should be like that in both files. -- http://mail.python.org/mailman/listinfo/python-list

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get > my python executable created and run it, I get the error: > > "import site failed" > OverflowError: signed integer is greater than the maximum. Are you sure about the error message? That error is

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Martin v. Löwis
>>> "import site failed" >>> OverflowError: signed integer is greater than the maximum. >> - what is the value of ival? > ival: 4294967295 I see. This is 0x, which would be -1 if it were of type int. So perhaps some value got cast incorrectly at some point, breaking subsequent computation

Re: My Python annoyances

2007-05-03 Thread John Nagle
Terry Reedy wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Ben Collver wrote: > || > from the person who closed it. I get the unspoken message: bug > reports > | > are not welcome. > > | Getting through the process requires a year or so. > > Ben got a

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread John Machin
On May 4, 3:40 am, [EMAIL PROTECTED] wrote: > On Thu, May 03, 2007 at 10:28:34AM -0700, [EMAIL PROTECTED] wrote: > > On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > > > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > > > As Larry said, this most likely means there are null bytes in the

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread quasi
On Fri, 04 May 2007 09:37:37 +1200, Gib Bogle <[EMAIL PROTECTED]> wrote: >Ah, so the firefighters were in on the conspiracy! No, but the firefighters are very much aware that there is more to 9/11 than has been officially revealed. This is even more true at Pentagon. The firefighters there broug

Re: adding methods at runtime and lambda

2007-05-03 Thread ici
On May 3, 10:52 pm, Mike <[EMAIL PROTECTED]> wrote: > I was messing around with adding methods to a class instance at > runtime and saw the usual code one finds online for this. All the > examples I saw say, of course, to make sure that for your method that > you have 'self' as the first parameter.

Re: getmtime in 2.5 reports GMT instead of local time

2007-05-03 Thread John Machin
On May 4, 12:26 am, Josef Dalcolmo <[EMAIL PROTECTED]> wrote: > Hello, > > I have tried this only on Windows XP. > > in Python 2.4 os.path.getmtime() used to return an integer representing > the local time. The docs say "seconds since the epoch". Noting that the epoch is usually defined with refer

Re: How do I get type methods?

2007-05-03 Thread Stargaming
[EMAIL PROTECTED] schrieb: > Hello! > > If I do > > import uno > localContext=uno.getComponentContext() > > then localContext is of type > I guess it's a new type provided by PyUNO extension. > localContext.__class__ is None > Is there any way to list all methods of that new type, via Python C

When does input() return an empty string?

2007-05-03 Thread noagbodjivictor
I'm filling an array with user input, I want an empty string to be returned when nothing is entered; ie return key hit twice... How do I do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: When does input() return an empty string?

2007-05-03 Thread André
On May 3, 8:43 pm, [EMAIL PROTECTED] wrote: > I'm filling an array with user input, I want an empty string to be > returned when nothing is entered; ie return key hit twice... How do I > do that? use raw_input(), not input(). input() attempts to evaluate the result, assuming it is a valid python

Re: When does input() return an empty string?

2007-05-03 Thread noagbodjivictor
On May 3, 7:50 pm, André <[EMAIL PROTECTED]> wrote: > On May 3, 8:43 pm, [EMAIL PROTECTED] wrote: > > > I'm filling an array with user input, I want an empty string to be > > returned when nothing is entered; ie return key hit twice... How do I > > do that? > > use raw_input(), not input(). input(

Re: 32 OS on 64-bit machine

2007-05-03 Thread Joshua J. Kugler
On Thursday 03 May 2007 01:10, SamG wrote: > If anyone has a x86_64 machine and is running a 32bit OS on top of > that could you tell me what output would you get for the following > program > > #== > import platform > print platform.processor() > print platform.architectu

How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
>>> s = ['a','b'] >>> s ['a', 'b'] >>> This is what I want so that I can put it in a module then import that module to work with my variable. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
On May 3, 8:00 pm, [EMAIL PROTECTED] wrote: > >>> s = ['a','b'] > >>> s > ['a', 'b'] > > This is what I want so that I can put it in a module then import that > module to work with my variable. Sorry for that typo in the title... -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
On May 3, 8:01 pm, [EMAIL PROTECTED] wrote: > On May 3, 8:00 pm, [EMAIL PROTECTED] wrote: > > > >>> s = ['a','b'] > > >>> s > > ['a', 'b'] > > > This is what I want so that I can put it in a module then import that > > module to work with my variable. > > Sorry for that typo in the title... I foun

Replacement for HTMLGen?

2007-05-03 Thread Joshua J. Kugler
I realize that in today's MVC-everything world, the mere mention of generating HTML in the script is near heresy, but for now, it's what I ened to do. :) That said, can someone recommend a good replacement for HTMLGen? I've found good words about it (http://www.linuxjournal.com/article/2986), but

Re: How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
On May 3, 8:24 pm, [EMAIL PROTECTED] wrote: > On May 3, 8:01 pm, [EMAIL PROTECTED] wrote: > > > On May 3, 8:00 pm, [EMAIL PROTECTED] wrote: > > > > >>> s = ['a','b'] > > > >>> s > > > ['a', 'b'] > > > > This is what I want so that I can put it in a module then import that > > > module to work with

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread The Great Attractor
On Thu, 03 May 2007 13:53:39 +0100, Eeyore <[EMAIL PROTECTED]> wrote: > > >Peter Webb wrote: > >> > Ask yourself WHY havn't I seen this footage before? >> > >> > >> >> OK, why haven't you seen this footage before? > >Nice response ! > >Graham > You're an utter retard

Re: NewB: Glob Question

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 10:38:31 -0700, J wrote: > Greetings Group- > > I'm trying to put together a pattern matching script that scans a > directory tree for tif images contained in similar folder names, but > running into a NewB problem already. Is it the way I'm trying to join > multiple paths? An

Decorating class member functions

2007-05-03 Thread Andy Terrel
Okay does anyone know how to decorate class member functions? The following code gives me an error: Traceback (most recent call last): File "decorators2.py", line 33, in s.update() File "decorators2.py", line 13, in __call__ retval = self.fn.__call__(*args,**kws) TypeError: update()

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-03 Thread The Great Attractor
On 3 May 2007 08:53:39 -0700, malibu <[EMAIL PROTECTED]> wrote: >On May 3, 12:18 am, Eric Gisse <[EMAIL PROTECTED]> wrote: >> On May 2, 10:14 pm, malibu <[EMAIL PROTECTED]> wrote: >> >> > On May 2, 9:46 pm, Eric Gisse <[EMAIL PROTECTED]> wrote: >> >> > > On May 2, 7:10 pm, Midex <[EMAIL PROTECTED]

How do I import a variable from another module?

2007-05-03 Thread noagbodjivictor
I have a variable names actions in a module named qt_actions.py Well this is what I get: >>> import qt_actions >>> qt_actions.actions Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'actions' -- http://mail.python.org/mailman/listinfo/py

Re: Decorating class member functions

2007-05-03 Thread Andy Terrel
Oh I should mention the decorator needs to have some notion of state (such as with the above class) -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

Re: How do I import a variable from another module?

2007-05-03 Thread Andy Terrel
are you sure your variable isn't in some code block that wouldn't be read on import? Such as: if __name__ == "__main___": actions = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread The Great Attractor
On Thu, 03 May 2007 18:08:31 -0500, quasi <[EMAIL PROTECTED]> wrote: >On Fri, 04 May 2007 09:37:37 +1200, Gib Bogle ><[EMAIL PROTECTED]> wrote: > >>Ah, so the firefighters were in on the conspiracy! > >No, but the firefighters are very much aware that there is more to >9/11 than has been officiall

Re: How do I import a variable from another module?

2007-05-03 Thread noagbodjivictor
On May 3, 9:36 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > are you sure your variable isn't in some code block that wouldn't be > read on import? Such as: > > if __name__ == "__main___": > actions = 1 No Andy, I have not put the variable in any code block -- http://mail.python.org/mailman

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:33 pm, Virgil Dupras <[EMAIL PROTECTED]> wrote: > On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > > > > > Okay does anyone know how to decorate class member functions? > > > The following code gives me an error: > > > Traceback (most recent call last): > > File "decorators

Re: Can I use Python instead of Joomla?

2007-05-03 Thread John Draper
walterbyrd wrote: >If I wanted to build a website with forums, news feeds, galleries, >event calander, document managment, etc. I do so in Joomla easily. > >But, I would perfer to use django/python, if that would be at all >practical. > >I suppose I could put python scripts into django, if those s

Re: Can I use Python instead of Joomla?

2007-05-03 Thread walterbyrd
On May 3, 11:08 am, Bruno Desthuilliers wrote: > I'm not sure integrating CakePHP stuff into something like Joomla or > Drupal will be that easy. I don't know either. But, there are projects called "jake" and "drake" which are specifically geared toward intergrating cakephp with joomla and drupa

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

Re: Can I use Python instead of Joomla?

2007-05-03 Thread walterbyrd
On May 3, 7:49 pm, John Draper <[EMAIL PROTECTED]> wrote: > I admit, Joomla is easy to use I admit, but very easy to vector into > a root exploit. I had no idea. Thank you for posting that. One thing I really like about joomla is the 1600+ extensions. But, I don't need those kinds of security

Re: 4 quadrant atan

2007-05-03 Thread Charles Sanders
Roel Schroeven wrote: > > I might be wrong of course, but can't you just use atan2? Only problem > is that it returns negative angles for quadrants 3 and 4, but that is > easily solved. In Python: > > from math import atan2, pi, fmod > def vectorAngle(x, y): > return fmod(atan2(y, x) + 2*pi

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Jon Harrop
Nameless wrote: > Why should I keep on learning lisp when there are python and perl? Lisp compilers are much more advanced, for one thing. Xah Lee wrote: > (if there is some demand, i will add a concrept, little programing > example, that shows, how lisp's symbols and macros concepts, set it > ap

Re: Decorating class member functions

2007-05-03 Thread Andy Terrel
I just need to keep the state around. I make a call to some function that is pretty expensive so I want to save it as a member during the __init__ of the decorator. Yeah I'm afraid it can't be done either, that's why I asked the group. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorating class member functions

2007-05-03 Thread Jorge Godoy
Andy Terrel <[EMAIL PROTECTED]> writes: > I just need to keep the state around. I make a call to some function > that is pretty expensive so I want to save it as a member during the > __init__ of the decorator. > > Yeah I'm afraid it can't be done either, that's why I asked the group. Have you lo

Re: Decorating class member functions

2007-05-03 Thread Andy Terrel
not quite as elegant but here is a workaround... Thanks Virgil for taking some time to think about it. --- class Bugger (object): def __init__ (self, module): print "Entering __init__" self.module = module self.verb = 0 def instrument (module_name): def wrapper(f)

Re: How do I import a variable from another module?

2007-05-03 Thread sykora
On May 4, 6:39 am, [EMAIL PROTECTED] wrote: > On May 3, 9:36 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > > > are you sure your variable isn't in some code block that wouldn't be > > read on import? Such as: > > > if __name__ == "__main___": > > actions = 1 > > No Andy, I have not put the var

Re: How do I import a variable from another module?

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 18:27:12 -0700, noagbodjivictor wrote: > I have a variable names actions in a module named qt_actions.py > > Well this is what I get: import qt_actions qt_actions.actions > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object

Re: adding methods at runtime and lambda

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 16:52:55 -0300, Mike <[EMAIL PROTECTED]> escribió: > I was messing around with adding methods to a class instance at > runtime and saw the usual code one finds online for this. All the > examples I saw say, of course, to make sure that for your method that > you have 'self' as

tkinter listboxes

2007-05-03 Thread rahulnag22
I will give a simplified example of the problem at hand -- I have a case in which I have two listboxes - listbox1 and listbox2, if I click on an item in listbox1 the item gets highlighted as expected. Now if I click on an item in listbox2 the selected item in listbox1 loses its highlight. My quest

Re: [ANN] Update to Python Quick Reference Card (for Python 2.4) (v0.67)

2007-05-03 Thread Alex Martelli
Laurent Pointal <[EMAIL PROTECTED]> wrote: ... > > It's an excellent quick-reference card, BTW (though I don't quite > > understand why even-numbered pages are flipped upside-down). > > At work I print it on horizontal A4/USLetter, with recto-back, and with > binding (reliure in french) on smal

Re: file Error

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 10:15:52 -0300, <[EMAIL PROTECTED]> escribió: > Thanks for the replyHow do i accept the filename is a > parameter and avoid the error.Can you elaborate. To get the arguments passed to the script, use sys.argv[] Most introductory texts should cover it, like the Python t

Re: Decorating class member functions

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 19:28:52 -0700, Andy Terrel wrote: > I just need to keep the state around. I make a call to some function > that is pretty expensive so I want to save it as a member during the > __init__ of the decorator. > > Yeah I'm afraid it can't be done either, that's why I asked the gro

Re: tkinter listboxes

2007-05-03 Thread James Stroud
[EMAIL PROTECTED] wrote: > I will give a simplified example of the problem at hand -- > > I have a case in which I have two listboxes - listbox1 and listbox2, > if I click on an item in listbox1 the item gets highlighted as > expected. Now if I click on an item in listbox2 the selected item in > l

New EasyExtend release is out

2007-05-03 Thread Kay Schluehr
Hi folks, EasyExtend is a grammar based preprocessor generator and metaprogramming system for Python written in Python. After reworking an initial release for 11 months (!) it's time to present now EasyExtend 2.0-alpha1. You find EasyExtend on the projects homepage: http://www.fiber-space.de/Eas

Re: My Python annoyances

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 10:49:26 -0300, Ben Collver <[EMAIL PROTECTED]> escribió: > I tried to write portable Python code. The zlib CRC function returned > different results on architectures between 32 bit and 64 bit > architectures. I filed a bug report. It was closed, without a comment >

Re: Decorating class member functions

2007-05-03 Thread Peter Otten
Andy Terrel wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in __call__ > retval = self.fn.__ca

<    1   2   3   >