BayPIGgies: April 13, 7:30pm (IronPort)

2006-04-10 Thread Aahz
The next meeting of BayPIGgies will be Thurs, April 13 at 7:30pm at IronPort. This meeting features JJ reviewing Professional Software Development with discussion and newbie questions afterward. BayPIGgies meetings alternate between IronPort (San Bruno, California) and Google (Mountain View,

Re: Python-list Digest, Vol 31, Issue 94

2006-04-10 Thread Gary Robinson
I can't see anything called a T2100. I have 3 X2100 servers which are opterons. Right I meant X2100's, sorry. Python cannot use psyco on opterons at all - 32 bit mode or otherwise. Are you sure? I'm not saying I have reason to believe differently, but I just want to be sure. The Psyco

Re: Locate command in Python

2006-04-10 Thread BartlebyScrivener
How about one of these that works on Windows XP? I know there's no files.cache, but I wonder if your script could be combined with another function that would generate a list of paths on a Windows XP machine. Anyway, thanks for the script. -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-10 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], David Rasmussen [EMAIL PROTECTED] wrote: In my everyday work, I am forced to use a C90 only compiler, and everyday I miss some C++ feature that wouldn't make my program any more complex, quite the opposite. These are features like const, no default extern

wiki engine (just engine) available?

2006-04-10 Thread loguser
Hello, I'm thinking about embedding a wiki into one of my project. However, I'm looking just for a wiki-text-processing library, not a complete out-of-box solution. Ideal feature set is ReStructureText, some easy way to add custom commands (to keep my pages integrated in way Trac is doing) and

Re: how relevant is C today?

2006-04-10 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], Daniel Nogradi [EMAIL PROTECTED] wrote: Can anyone shed some light on the secret of Java? Java and C#/CLR I class as instant-software-bloat-just-add-water technologies. That is, they are very popular in corporate circles, where the users don't get to choose what

Re: can't pass command-line arguments

2006-04-10 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], BartlebyScrivener [EMAIL PROTECTED] wrote: I was used to being able to run scripts by just typing the script name, even without the .py extension, but findmyfiles d:/notes notes*.* does not work The MS-DOS foundation on which Windows is built only supports a

Re: a unicode question?

2006-04-10 Thread Serge Orlov
[EMAIL PROTECTED] wrote: Mr. John Machin This question come form the flow codes. I use the PyXml to build a DOM tree. from xml.dom.ext.reader import HtmlLib doc = HtmlLib.FromHtmlUrl('http://stock.business.sohu.com/q/nbcg.php?code=600028') title_elem =

Re: how to pipe to variable of a here document

2006-04-10 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], Dennis Lee Bieber [EMAIL PROTECTED] wrote: Question: Is there a DB-API module that can directly connect to the database server? There certainly is for MySQL, which is what I mostly use. -- http://mail.python.org/mailman/listinfo/python-list

Re: Automated Graph Plotting in Python

2006-04-10 Thread per9000
Dear shrub-makers, if you are want to plot networks (fx. genetic networks) I can recommend Cytoscape: http://cytoscape.org/ (some kind of openware). The in-syntax is clean: node1 linktype1 node2 node2 linktype1 node3 node3 linktype2 node1 etc. But in general you are going to want to change the

Re: Python 2.5 licensing: stop this change

2006-04-10 Thread Flexx
Steve Holden sigh It was an April Fool's joke. It's not actually true. To try and ensure this thread dies for ever, I have added a note to the blog entry at http://pyfound.blogspot.com/2006/04/python-25-licensing-change.html noting the fact that this was indeed an April Fool's joke.

Re: wiki engine (just engine) available?

2006-04-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Ideal feature set is ReStructureText, some easy way to add custom commands (to keep my pages integrated in way Trac is doing) and (ideally) docbook export (althrough I'm ready to write one). What is Trac doing? What kind of commands are you talking about?

Re: can't pass command-line arguments

2006-04-10 Thread Sybren Stuvel
Lawrence D'Oliveiro enlightened us with: The MS-DOS foundation on which Windows is built only supports a small number of extensions for executable files (.COM, .EXE and .BAT), with no provision for any extensions to these. Common misconception: screensavers are simply executable files with a

challenging (?) metaclass problem

2006-04-10 Thread alainpoint
Hi, I have what in my eyes seems a challenging problem. Thanks to Peter Otten, i got the following code to work. It is a sort of named tuple. from operator import itemgetter def constgetter(value): def get(self): return value return get def createTuple(*names): class

Help...TT Python 2.4 decompiler

2006-04-10 Thread 이광진
Title: 메시지 Hello,I am a sofware engineer in Korea.Would you kindly give me the way to receive(take) python deccomplier as an urgent business?Thanks for help..^^ -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-10 Thread Thomas Bellman
Lawrence D'Oliveiro [EMAIL PROTECTED] writes: const is in C89/C90. Although with slightly different semantics from in C++... For instance: static const int n = 5; double a[n]; is valid C++, but not valid C. -- Thomas Bellman, Lysator Computer Club, Linköping University,

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread ChaosKCW
Roger Binns wrote: No. APSW converts it *to* Unicode. SQLite only accepts Unicode so a Unicode string has to be supplied. If you supply a non-Unicode string then conversion has to happen. APSW asks Python to supply the string in Unicode. If Python can't do that (eg it doesn't know the

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread ChaosKCW
There's an Oracle environment variable that appears to make a difference: NLS_CHARSET, perhaps - it's been a while since I've had to deal with Oracle, and I'm not looking for another adventure into Oracle's hideous documentation to find out. That is an EVIL setting which should not be used.

wxPython problem

2006-04-10 Thread Hubert Pitura
Hello, I've installed openSUSE 10 64bit, Python 2.4.3 (from sources) and wxPython 2.6 (from Red Hat's rpms). When I' trying to import wx the error comes up: import wx Traceback (most recent call last): File stdin, line 1, in ? File

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread Serge Orlov
ChaosKCW wrote: Roger Binns wrote: No. APSW converts it *to* Unicode. SQLite only accepts Unicode so a Unicode string has to be supplied. If you supply a non-Unicode string then conversion has to happen. APSW asks Python to supply the string in Unicode. If Python can't do that

Re: can't pass command-line arguments

2006-04-10 Thread Duncan Booth
Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], BartlebyScrivener [EMAIL PROTECTED] wrote: I was used to being able to run scripts by just typing the script name, even without the .py extension, but findmyfiles d:/notes notes*.* does not work The MS-DOS foundation on which

Giving your C/C++ Application a Python Command Line...

2006-04-10 Thread Andrew McCall
Hi Folks, I am building an application under multiple OS's, and I wanted to give my application For example, the test application I am working on is a calculator and I would like to have a menu in the GUI option to open a command line where you can use Python commands to perfom the functions of

GridBagSizer

2006-04-10 Thread ncf
Recently, I came across a presentation about wx.GridBagSizer while trying to look up more info to use it in an application, however, the presentation noted Don't use GridBagSizer. Ever. Can anyone please explain to me why using GridBagSizer would be such a bad idea? Or is this only applicable

Re: Giving your C/C++ Application a Python Command Line...

2006-04-10 Thread Roman Yakovenko
On 10 Apr 2006 02:15:41 -0700, Andrew McCall [EMAIL PROTECTED] wrote: Hi Folks, I am building an application under multiple OS's, and I wanted to give my application For example, the test application I am working on is a calculator and I would like to have a menu in the GUI option to open

Re: wxPython problem

2006-04-10 Thread sillyemperor
Hubert Pitura wrote: Hello, I've installed openSUSE 10 64bit, Python 2.4.3 (from sources) and wxPython 2.6 (from Red Hat's rpms). When I' trying to import wx the error comes up: import wx Traceback (most recent call last): File stdin, line 1, in ? File

Re: [Newbie] Referring to a global variable inside a function

2006-04-10 Thread bruno at modulix
Ernesto García García wrote: Hi experts, I've built a class for parsing a user-defined list of files and matching lines with a user-defined list of regular expressions. It looks like this: (snip code) But then, when I try to use my class using actions with memory it will fail: code

Re: Python 3.0 or Python 3000?

2006-04-10 Thread Benjamin Niemann
Dennis Lee Bieber wrote: On Sun, 9 Apr 2006 22:15:15 -0400, Tim Peters [EMAIL PROTECTED] declaimed the following in comp.lang.python: [John Salerno] Is 'Python 3000' just a code name for version 3.0, or will it really be called that when it's released? The smart money is on changing

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread Paul Boddie
ChaosKCW wrote: There's an Oracle environment variable that appears to make a difference: NLS_CHARSET, perhaps - it's been a while since I've had to deal with Oracle, and I'm not looking for another adventure into Oracle's hideous documentation to find out. That is an EVIL setting

Is this code snippet pythonic

2006-04-10 Thread jnair
My Tead Lead my object counter code seen below is not pythonic class E(object): _count = 0 def __init__(self): E._count += 1 count = property(lambda self: E._count ) def test(): if __name__ == __main__: e1 = E() print e1.count e2 = E()

Is this object counter code pythonic

2006-04-10 Thread jnair
My Team Lead says my object counter code seen below is not pythonic class E(object): _count = 0 def __init__(self): E._count += 1 count = property(lambda self: E._count ) def test(): if __name__ == __main__: e1 = E() print e1.count e2 = E()

Re: best way to install python modules on linux

2006-04-10 Thread Fabian Braennstroem
Hi, * Robert Kern [EMAIL PROTECTED] wrote: Fabian Braennstroem wrote: Hi to all, thanks for your ideas! I just figured out a different way using archlinux 'pacman' (package management tool like apt). As a former archlinux user I am more used to adjust those PKDBUILDs (kind of ebuilds

Re: Is this object counter code pythonic

2006-04-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: My Team Lead says my object counter code seen below is not pythonic class E(object): _count = 0 def __init__(self): E._count += 1 count = property(lambda self: E._count ) def test(): if __name__ == __main__: e1 = E() print

Re: how to make a generator use the last yielded value when it regains control

2006-04-10 Thread Azolex
Lonnie Princehouse wrote: Here's my take on the thing. It only prints one term, though. http://www.magicpeacefarm.com/lonnie/code/morris.py.html (a bit too long to post) excerpt : def morris(seed, n): ... if n == 1: return seed else: return

Re: Difference in Python and Ruby interactive shells

2006-04-10 Thread Nick Craig-Wood
Lou Pecora [EMAIL PROTECTED] wrote: Impressive, but YIKES, there ought to be a simpler way to do this. I think during the development phase editing and reloading would be very common and you'd want everything updated. Sorry I missed this thread... This is what I use which is easy and

Re: Is this object counter code pythonic

2006-04-10 Thread jnair
Ok got it . Thanks a Lot -- http://mail.python.org/mailman/listinfo/python-list

Re: Characters contain themselves?

2006-04-10 Thread Azolex
WENDUM Denis 47.76.11 (agent) wrote: While testing recursive algoritms dealing with generic lists I stumbled on infinite loops which were triggered by the fact that (at least for my version of Pyton) characters contain themselves. Note that the empty string is contained in all strings,

Re: how relevant is C today?

2006-04-10 Thread Azolex
Daniel Nogradi wrote: The Dice (find tech jobs) has offerings (last 7 days, U.S. + unrestricted) for: *SQL 14,322 C/C++11,968 Java 10,143 ... Can anyone shed some light on the secret of Java? How is it that they are so high on this list? Sun invented a roundabout

Re: Is this object counter code pythonic

2006-04-10 Thread jnair
Fredrik is then this a valid property use case and pythonic to get/set a common varibale across objects class E(object): _i = 0 def geti(self) : return E._i def seti(self,val) : E._i = val i = property(geti,seti) if __name__ == __main__: e1 = E() e1.i = 100 e2

Re: Automated Graph Plotting in Python

2006-04-10 Thread WEINHANDL Herbert
[EMAIL PROTECTED] schrieb: My python program spits lot of data. I take that data and plot graphs using OfficeOrg spredsheet. I want to automate this task as this takes so much of time. I have some questions. 1. Which is the best graph plotting utility in python or linux. Can I write a code

Re: Is this object counter code pythonic

2006-04-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Fredrik is then this a valid property use case and pythonic to get/set a common varibale across objects No. you do that only if you have some kind of behavior attached - e.g. if there are database queries to be made for returning a property or something like that.

Re: how relevant is C today?

2006-04-10 Thread bruno at modulix
gregarican wrote: Here are a few languages I recommend most programmers should at least have a peek at: (snip) 2) Lisp - Along with FORTRAN, one of the oldest programming languages still in use. Pure functional programming model Err... Even if Lisp is the father of functional programming,

Re: a unicode question?

2006-04-10 Thread John Machin
E, it get's worse: not only is the title written in Chinese, it is encoded as gb2312 -- here is the repr() of the first few chunks: html\nhead\ntitle\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) : \xc4\xd a\xb2\xbf\xc8\xcb\xd4\xb1\xb3\xd6\xb9\xc9 - \xcb\xd1\xba\xfc\xb9\xc9\xc6\xb1/ti

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
That is wrong on so many levels Including the level where I observed that I'd already been running scripts without typing the .py extension for months, it's just that on some scripts (seems to be the ones with functions defined in them) you can't pass arguments unless you type the .py extension.

Re: PC-104 LINUX 512KB 1MB

2006-04-10 Thread [EMAIL PROTECTED]
err...this is chinese.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this object counter code pythonic

2006-04-10 Thread Duncan Booth
[EMAIL PROTECTED] wrote: Fredrik is then this a valid property use case and pythonic to get/set a common varibale across objects A valid poperty use case would be one where you did something that couldn't be done without using a property. In some other languages you cannot simply change

Re: Decorators, Identity functions and execution...

2006-04-10 Thread Christos Georgiou
On Sun, 09 Apr 2006 11:42:34 -0300, rumours say that Jorge Godoy [EMAIL PROTECTED] might have written: Indeed. This is correct. Fredrick's comment was related to the lack of indentation in your code. His code was indented fine, as you maybe noticed later on. The actual problem was that he had

Re: can't pass command-line arguments

2006-04-10 Thread Tim Golden
BartlebyScrivener wrote: I'm still new at this. I can't get this to work as a script. If I just manually insert the values for sys.argv[1] and sys.argv[2] it works fine, but I can't pass the variables from the command line. What am I doing wrong? On windows xp, python 2.4.3 [... snip code

Re: Automated Graph Plotting in Python

2006-04-10 Thread Neal Becker
Felipe Almeida Lessa wrote: Em Sáb, 2006-04-08 às 20:08 -0700, [EMAIL PROTECTED] escreveu: My python program spits lot of data. I take that data and plot graphs using OfficeOrg spredsheet. I want to automate this task as this takes so much of time. I have some questions. You can try

Re: Python 3.0 or Python 3000?

2006-04-10 Thread Christos Georgiou
On 9 Apr 2006 20:32:07 -0700, rumours say that Ray [EMAIL PROTECTED] might have written: Dennis Lee Bieber wrote: Or... just to save 3000 as a time way down the road... The next major version of Python will be: Python PI (and each build will add another digit... 3.1, 3.14, 3.141, ...) I

Re: challenging (?) metaclass problem

2006-04-10 Thread alainpoint
Now, a tab-free version of my previous post. (Sorry for the inconvenience) Hi, I have what in my eyes seems a challenging problem. Thanks to Peter Otten, i got the following code to work. It is a sort of named tuple. from operator import itemgetter def constgetter(value): def get(self):

Re: Python 3.0 or Python 3000?

2006-04-10 Thread Christos Georgiou
On Sun, 9 Apr 2006 22:15:15 -0400, rumours say that Tim Peters [EMAIL PROTECTED] might have written: [John Salerno] Is 'Python 3000' just a code name for version 3.0, or will it really be called that when it's released? The smart money is on changing the name to Ecstasy, to leverage marketing

Re: can't pass command-line arguments

2006-04-10 Thread Duncan Booth
BartlebyScrivener wrote: That is wrong on so many levels Including the level where I observed that I'd already been running scripts without typing the .py extension for months, it's just that on some scripts (seems to be the ones with functions defined in them) you can't pass arguments

Re: Locate command in Python

2006-04-10 Thread Adonis
BartlebyScrivener wrote: How about one of these that works on Windows XP? I know there's no files.cache, but I wonder if your script could be combined with another function that would generate a list of paths on a Windows XP machine. Anyway, thanks for the script. I wrote it on a Windows

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
Tim, I had not seen the thread you linked to. I learned something, but it still doesn't explain whatever is happening on my machine. When I run assoc and ftype I get exactly the results you say I need to run the scripts properly. However, this simple script (printargs.py) seems to work whether I

Re: how relevant is C today?

2006-04-10 Thread gregarican
bruno wrote: Err... Even if Lisp is the father of functional programming, it is definitively not a 'pure' FPL. True. I couldn't referred to something like Haskell as being pure FP. My bad :-) -- http://mail.python.org/mailman/listinfo/python-list

RE: can't pass command-line arguments

2006-04-10 Thread Tim Golden
[BartlebyScrivener] | I had not seen the thread you linked to. I learned something, but it | still doesn't explain whatever is happening on my machine. When I run | assoc and ftype I get exactly the results you say I need to run the | scripts properly. However, this simple script (printargs.py)

Re: Characters contain themselves?

2006-04-10 Thread WENDUM Denis 47.76.11 (agent)
gry@ll.mit.edu wrote: In fact, not just characters, but strings contain themselves: 'abc' in 'abc' True This is a very nice(i.e. clear and concise) shortcut for: 'the rain in spain stays mainly'.find('rain') != -1 True Which I always found contorted and awkward. Could you

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
Thanks, Duncan Results of my ftype command d:\pythonftype python.file python.file=C:\Python24\python.exe %1 %* See below, the response with examples to Tim. I'm not worried about it. Thank you all for the education. rick -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-04-10 Thread Piet van Oostrum
Steve R. Hastings [EMAIL PROTECTED] (SRH) wrote: [snip] SRH vowels = frozenset(aeiouAEIOU) SRH f = open(a_file.txt) # note that f is an iterator SRH counts = tally(line[0] in vowels for line in f) tally([line[0] in vowels for line in f]) SRH # counts is a dict; counts.keys() == [False, True]

Re: Creating an event loop

2006-04-10 Thread Larry Bates
Fabian Steiner wrote: Hello! I am currently wondering how to write something like an event loop. For example, if I want to write a function that checks whether a file was added or removed in a directory I would think of a while 1: ... construct that checks the mtime of the directory. Is

Re: how relevant is C today?

2006-04-10 Thread Rune Strand
gregarican wrote: 1) Smalltalk - The original object oriented programming language. Influenced anything from Mac/Windows GUI to Java language. No. Simula is the original object oriented programming language. -- http://mail.python.org/mailman/listinfo/python-list

Problem embedding Python...

2006-04-10 Thread Andrew McCall
Hi Folks, I have now managed to work out how to embed Python to allow me to script my application, the only problem is I am getting a compiler error when I try to compile: The error is: Compiler: Default compiler Executing g++.exe... g++.exe C:\Documents and

Re: StringIO.readline() returns ''

2006-04-10 Thread [EMAIL PROTECTED]
You can also just type buf.getvalue() which returns the current StringIO buffer as a python string, without the rewinding -- http://mail.python.org/mailman/listinfo/python-list

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
Tim, No conflicting bat file. Script name cbfindfiles.py import os import fnmatch import sys def all_files(root, patterns='*', single_level=False, yield_folders=False): walks the directory tree starting at root and finds all files matching patterns # Expand patterns from

Re: how relevant is C today?

2006-04-10 Thread John Salerno
Ray wrote: John Salerno wrote: At which level in the 'python challenge' did you get stuck - and why? Ugh, don't remind me! :) I'm stuck on level 12, which is yet another image processing puzzle. I'm getting tired of those, and I think it's really a shame that there is a This is EXACTLY

Re: how relevant is C today?

2006-04-10 Thread Philippe Martin
Hi, It is very hard to avoid C in embedded/low-level/industrial programming. Philippe John Salerno wrote: Because of my 'novice-ness' in programming, I had always thought that C was replaced by C++ and wasn't really used anymore today. I know that's not the case at all now, but I'm still

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread ChaosKCW
When python tries to concatenate a byte string and a unicode string, it assumes that the byte string is encoded ascii and tries to convert from encoded ascii to unicode. It calls ascii decoder to do the decoding. If decoding fails you see message from ascii decoder about the error.

Re: Locate command in Python

2006-04-10 Thread BartlebyScrivener
Adonis, Cool! I'm on it. Thanks again. rpd -- http://mail.python.org/mailman/listinfo/python-list

About classes and OOP in Python

2006-04-10 Thread fyhuang
Hello all, I've been wondering a lot about why Python handles classes and OOP the way it does. From what I understand, there is no concept of class encapsulation in Python, i.e. no such thing as a private variable. Any part of the code is allowed access to any variable in any class, and even

Re: can't pass command-line arguments

2006-04-10 Thread Peter Hansen
BartlebyScrivener wrote: No conflicting bat file. What about a conflicting non-BAT file? Anything in PATHEXT ahead of the .PY extension is a candidate... if __name__ == __main__: print sys.argv for path in all_files(sys.argv[1], sys.argv[2]): print path If I run

Re: Python 2.5 licensing: stop this change

2006-04-10 Thread Aahz
In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: To try and ensure this thread dies for ever, I have added a note to the blog entry at http://pyfound.blogspot.com/2006/04/python-25-licensing-change.html noting the fact that this was indeed an April Fool's joke. That's

Re: Is this code snippet pythonic

2006-04-10 Thread Peter Hansen
[EMAIL PROTECTED] wrote: My Tead Lead my object counter code seen below is not pythonic I'm guessing this was supposed to say My team lead says my (?) class E(object): _count = 0 def __init__(self): E._count += 1 count = property(lambda self: E._count ) Is

Query : sys.excepthook exception in Python

2006-04-10 Thread Pramod, TK
Title: Query : sys.excepthook exception in Python Hi, Sometimes during execution of python scripts below mentioned error string is displayed on the console. Unhandled exception in thread started by Error in sys.excepthook: Original exception was: The scripts are not terminated,

Re: About classes and OOP in Python

2006-04-10 Thread [EMAIL PROTECTED]
You can do this in Python as well. Check out the property built-in function. One can declare a property with a get, set, and delete method. Here's a small example of a read-only property. class Test(object): def getProperty(self): return 0; prop = property(fget = getProperty)

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
print running,__file__ Well, I tried to let this die because I just KNEW I was going to look like an idiot before it was over. It's the .pyc versus the .py file. Obviously I don't understand how that works yet. The .pyc file lags behind the .py file? So when I run cbfindfiles.py I'm running

Re: Query : sys.excepthook exception in Python

2006-04-10 Thread Peter Hansen
Pramod, TK wrote: Sometimes during execution of python scripts below mentioned error string is displayed on the console. *Unhandled exception in thread started by Error in sys.excepthook: * *Original exception was:* The scripts are not terminated, they continue to execute normally.

Re: Is this code snippet pythonic

2006-04-10 Thread Kent Johnson
Peter Hansen wrote: [EMAIL PROTECTED] wrote: class E(object): _count = 0 def __init__(self): E._count += 1 count = property(lambda self: E._count ) 2. You don't need the self in the lambda, since you're not using it anyway. Yes he does, it's a property getter, it

Re: Locate command in Python

2006-04-10 Thread BartlebyScrivener
This script is COOL. It should be in the next cookbook. Maybe with some tweaks and switches. Thanks again. Rick -- http://mail.python.org/mailman/listinfo/python-list

Re: can't pass command-line arguments

2006-04-10 Thread Peter Hansen
BartlebyScrivener wrote: Well, I tried to let this die because I just KNEW I was going to look like an idiot before it was over. It's the .pyc versus the .py file. Obviously I don't understand how that works yet. The .pyc file lags behind the .py file? So when I run cbfindfiles.py I'm running

newbie: Need Help Moving Data from Kirbybase to Gadfly

2006-04-10 Thread dc
I am fairly new to python and SQL. I have been trying to move data from Kirbybase table to a Gadfly table and cannot get it to work. Win XP with python 2.4, Kirbase 1.9, Gadfly B5. Complete script shown here, with python traceback. # get global modules for python import os import sys #get

Re: About classes and OOP in Python

2006-04-10 Thread Roy Smith
fyhuang [EMAIL PROTECTED] wrote: I've been wondering a lot about why Python handles classes and OOP the way it does. From what I understand, there is no concept of class encapsulation in Python, i.e. no such thing as a private variable. Any part of the code is allowed access to any variable in

python + access + odbc + linux

2006-04-10 Thread Philippe Martin
Hi, I understand that access can be accessed through an ODBC driver under windows (instead of Jet). I am wondering if the same can be done under Linux. Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

python interpreter widget for Tkinter?

2006-04-10 Thread Alexandre Guimond
Hi i was wondering if there already existed a simple python interpreter widget for tkinter? Basically, i would like to be able to lauch a python interpreter in a seperate window from my tkinter app for debugging purposes. I would assume that this would be possible using idlelib, but i can't figure

Re: can't pass command-line arguments

2006-04-10 Thread Duncan Booth
Peter Hansen wrote: I thought of that one, of course, but it can't cause exactly the trouble you describe above. If there's a .py in the same folder as the .pyc, it will not use the .pyc unless the timestamp encoded in it matches the one on the .py file (which, unless you go to

Re: python + access + odbc + linux

2006-04-10 Thread Felipe Almeida Lessa
Em Seg, 2006-04-10 às 10:38 -0500, Philippe Martin escreveu: I understand that access can be accessed through an ODBC driver under windows (instead of Jet). I am wondering if the same can be done under Linux. As far as I know, no. But there is that http://mdbtools.sourceforge.net/ that may

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
Running the script you recommended, I get d:\pythonhansen.py cbfindfiles .\cbfindfiles.pyc .\cbfindfiles.py d:\python\cbfindfiles.pyc d:\python\cbfindfiles.py If I use XP search, searching all drives for any file with cbfindfiles in the name, I get just the two in d:\python. It has something to

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
You missed the other option: if PATHEXT has .pyc in front of .py then you get exactly the described behaviour. That's it!! Trust me, I didn't do it. It was either ActiveState, Wing, or Komodo Dragon, or some combination thereof. So remove .pyc from pathext? Rick --

RE: python + access + odbc + linux

2006-04-10 Thread Tim Golden
[Philippe Martin] | I understand that access can be accessed through an ODBC driver under | windows (instead of Jet). | | I am wondering if the same can be done under Linux. You need to look at the mdbtools packages http://mdbtools.sourceforge.net/ which includes a Jet-ODBC driver which can

RE: can't pass command-line arguments

2006-04-10 Thread Tim Golden
[BartlebyScrivener] | You missed the other option: if PATHEXT has .pyc in front | of .py then you | get exactly the described behaviour. | | That's it!! | | Trust me, I didn't do it. It was either ActiveState, Wing, or Komodo | Dragon, or some combination thereof. Amazing. I had a look, and

Re: About classes and OOP in Python

2006-04-10 Thread Felipe Almeida Lessa
Em Seg, 2006-04-10 às 07:19 -0700, fyhuang escreveu: class PythonClass: private foo = bar private var = 42 allow_readwrite( [ foo, var ] ) You are aware that foo and var would become class-variables, not instance-variables, right? But you can always do: class PythonClass(object):

Re: can't pass command-line arguments

2006-04-10 Thread Peter Hansen
BartlebyScrivener wrote: You missed the other option: if PATHEXT has .pyc in front of .py then you get exactly the described behaviour. That's it!! Trust me, I didn't do it. It was either ActiveState, Wing, or Komodo Dragon, or some combination thereof. So remove .pyc from pathext?

Re: About classes and OOP in Python

2006-04-10 Thread Sion Arrowsmith
fyhuang [EMAIL PROTECTED] wrote: [ ... ] no such thing as a private variable. Any part of the code is allowed access to any variable in any class, and even non-existant variables can be accessed: they are simply created. You're confusing two issues: encapsulation and dynamic name binding. You

Re: Is this code snippet pythonic

2006-04-10 Thread Felipe Almeida Lessa
Em Seg, 2006-04-10 às 03:52 -0700, [EMAIL PROTECTED] escreveu: My Tead Lead my object counter code seen below is not pythonic As Peter said, you should really ask your Tead Lead, but what about: class E(object): Holds a class-wide counter incremented when it's instantiated. count =

Re: can't pass command-line arguments

2006-04-10 Thread Peter Hansen
BartlebyScrivener wrote: It has something to do with importing the cbfindfiles.py file as a module, right? Because I just did that, and now the .py and .pyc files are synchronized, and I'm getting the same result when I run cbfindfiles or cbfindfiles.py, whereas before I was not. Yes! That's

Re: python + access + odbc + linux

2006-04-10 Thread Philippe Martin
Thanks a lot Felipe. Regards, Philippe Felipe Almeida Lessa wrote: Em Seg, 2006-04-10 às 10:38 -0500, Philippe Martin escreveu: I understand that access can be accessed through an ODBC driver under windows (instead of Jet). I am wondering if the same can be done under Linux. As far

twisted.web and a

2006-04-10 Thread Fabian Steiner
Hello! I am currently working on a quite complicated application (at least for me) and unfortunately I don't know how to go on. I wrapped a Windows-dll by using the ctypes module so that I can access different functions that are used to control a network device (open, close, write/read values).

Re: can't pass command-line arguments

2006-04-10 Thread BartlebyScrivener
It's ActiveState. I just did a fresh install on an old machine. It appends pyo;pyc;pyw;py in that order to PATHEXT Thanks again to everyone for the generous help. Rick -- http://mail.python.org/mailman/listinfo/python-list

Is there a Python MVC that works just as well with just CGI, or FCGI?

2006-04-10 Thread walterbyrd
As I understand it, django works with fcgi, but it's a pain to setup. Are there any python MVCs that are optimized to work without mod_python. Or any other module that isn't likely to be loaded by standard python hosters? -- http://mail.python.org/mailman/listinfo/python-list

Re: Characters contain themselves?

2006-04-10 Thread Scott David Daniels
WENDUM Denis 47.76.11 (agent) wrote: ... From the answers I've got it seems I'll have to check if I'm iterating on a string or on another kind of list import sys sys.setrecursionlimit(10) def f(List): ... try: # assuming List supports iteration ... new=[f(item) for item

Re: how relevant is C today?

2006-04-10 Thread Scott David Daniels
gregarican wrote: Here are a few languages I recommend most programmers should at least have a peek at: 1) Smalltalk - The original object oriented programming language. Influenced anything from Mac/Windows GUI to Java language. Terse, clean syntax. IDE rolled into an operating system

  1   2   3   >