RE: Does altering a private member decouple the property's value?

2007-06-22 Thread Ethan Kennerly
Thanks for the help! Using the "class name (object)" syntax fixed my problem. Usually, I don't need properties, but in the case of a dependent attribute, I used a set method of a property to update that dependent attribute. I have a stopwatch class with a time limit property. When the time limi

Retrieving a stacktrace from an exception object / forwarding an exception

2007-06-22 Thread Samuel
Hi, I am trying to wrap a function that throws an exeption in such a way that the stacktrace is logged into a file and the exception is forwarded after that. For example: --- def my_func(): raise Exception("hello") def wrapper(): try: my_func() except Exceptio

Re: why __repr__ affected after __getattr__ overloaded?

2007-06-22 Thread Gabriel Genellina
En Fri, 22 Jun 2007 02:48:50 -0300, Roc Zhou <[EMAIL PROTECTED]> escribió: > I know what's wrong. Thank you. And I think > try: > return self.__dict__[attr_name] > is unnecessary, because python will do it itself for us. Exactly; by the time __getattr__ is called, you already know attr_name

Re: why __repr__ affected after __getattr__ overloaded?

2007-06-22 Thread Gabriel Genellina
En Fri, 22 Jun 2007 03:43:26 -0300, Roc Zhou <[EMAIL PROTECTED]> escribió: > I'm sorry but I still have a question, look at this example: class test: > ... def __init__(self): > ... self.x = 1 > ... def __getattr__(self, attr_name): > ... print attr_name > ...

Re: Packing a simple dictionary into a string - extending struct?

2007-06-22 Thread Jonathan Fine
Jonathan Fine wrote: > Thank you for this suggestion. The growing adoption of JSON in Ajax > programming is a strong argument for my using it in my application, although > I think I'd prefer something a little more binary. > > So it looks like I'll be using JSON. Well, I tried. But I came acro

Re: why __repr__ affected after __getattr__ overloaded?

2007-06-22 Thread Peter Otten
Roc Zhou wrote: > I'm sorry but I still have a question, look at this example: class test: > ... def __init__(self): > ... self.x = 1 > ... def __getattr__(self, attr_name): > ... print attr_name > ... if attr_name == 'y': > ... return 2 > ...

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > What we need are better implementations than CPython, not > hokey attribute schemes bolted onto the language. We're seeing > stuff go in that's easy to add to CPython, but not necessarily > good for the language as a whole. I think it was a real loss t

Re: Internationalised email subjects

2007-06-22 Thread bugmagnet
Thanks Martin, The "Some Chinese characters" are loaded from a MySQL table and are encoded in GB2312 format. I've added the following line at the top of the code: # -*- coding: GB2312 -*- I've also added the following line into the code: h = Header(subject.encode('GB2312'), 'GB2312') Note tha

Re: "assert" annoyance

2007-06-22 Thread Miles
On Jun 22, 2:45 am, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 6/21/07, Miles <[EMAIL PROTECTED]> wrote: > > > On Jun 22, 1:31 am, Paul Rubin wrote: > > > What I really want is for any assertion failure, anywhere in the > > > program, to trap to the debugger WITHOUT b

Re: "assert" annoyance

2007-06-22 Thread Thomas Heller
Paul Rubin schrieb: > So I have some assert statements in my code to verify the absence of > some "impossible" conditions. They were useful in debugging and of > course I left them in place for "real" runs of the program. Umpteen > hours into a run, an assertion failed, and of course since failur

Thanks a lot Gabriel :) :: unable to execute to a python script

2007-06-22 Thread Bala Subramanyam vemu
-- http://mail.python.org/mailman/listinfo/python-list

configparser shuffles all sections ?

2007-06-22 Thread stef
hello, I just used configparser for the first time and discovered that it shuffled all my sections, and the contents of the sections too. This makes human manipulation of the file impossible. Is there a way to prevent this shuffling, or are there other libraries that can handle windows ini-file

Re: sqlite newbie questions

2007-06-22 Thread [EMAIL PROTECTED]
On Jun 21, 11:54 am, Luis M. González <[EMAIL PROTECTED]> wrote: > You need to learn sql if you want to deal with databases. > Don't worry, it's very easy, and here is a very good resource to get > you up and running in a few minutes:http://www.sqlcourse.com > > Good luck! > Luis Thanks Luis, will

Re: "assert" annoyance

2007-06-22 Thread Evan Klitzke
On 6/22/07, Miles <[EMAIL PROTECTED]> wrote: > On Jun 22, 2:45 am, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > > On 6/21/07, Miles <[EMAIL PROTECTED]> wrote: > > > > > On Jun 22, 1:31 am, Paul Rubin wrote: > > > > What I really want is for any assertion failure, anywhere

Why Pay For Cable? Turn Your Computer Into A TV

2007-06-22 Thread edcwealth1
3000 Channels delivered straight to your desktop! Stop the monthly Cable bills for mediocre TV and get high quality streaming satellite TV directly on your PC! http://cgeer319.ipodpsp.hop.clickbank.net/ -- http://mail.python.org/mailman/listinfo/python-list

sqlite newbie question - how to know if a table exists?

2007-06-22 Thread [EMAIL PROTECTED]
Hello, Another newbie question: How do I know if there is a table with certain name in a sqlite database? What i'm doing now is just create the table with that name, if exception occurs, that means the table is already created. Am i correct? Any better way? Thank you. kelie -- http://mail.pytho

header intact

2007-06-22 Thread datulaida ali
hai.. -- http://mail.python.org/mailman/listinfo/python-list

Apple Pie Parser with Python?

2007-06-22 Thread datulaida ali
Hi, How to integrate Apple Pie Parser with Python? Any suggestion to parsed text with Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: configparser shuffles all sections ?

2007-06-22 Thread stef
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, stef wrote: > > >> I just used configparser for the first time and discovered that it >> shuffled all my sections, and the contents of the sections too. >> > > The data is stored in dictionaries. > So there should be some way to

Re: configparser shuffles all sections ?

2007-06-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, stef wrote: > I just used configparser for the first time and discovered that it > shuffled all my sections, and the contents of the sections too. The data is stored in dictionaries. > This makes human manipulation of the file impossible. Why so? Ciao, Marc 'Bl

Re: "assert" annoyance

2007-06-22 Thread Ben Finney
Paul Rubin writes: > So I have some assert statements in my code to verify the absence of > some "impossible" conditions. They were useful in debugging and of > course I left them in place for "real" runs of the program. Umpteen > hours into a run, an assertion failed,

Vilnius/Post EuroPython PyPy Sprint 12-14th of July

2007-06-22 Thread Michael Hudson
The PyPy team is sprinting at EuroPython again and we invite you to participate in our 3 day long sprint at the conference hotel - Reval Hotel Lietuva. If you plan to attend the sprint we recommend you to listen to the PyPy technical talks (`EuroPython schedule`_) during the conference since it wi

Re: Indenting in Emacs

2007-06-22 Thread Michael Hoffman
John J. Lee wrote: > Eugene Morozov <[EMAIL PROTECTED]> writes: > >> Steven W. Orr пишет: >> > Ok. I'm not stupid but I do not see a 4.78 anywhere even though I >> see refs >>> from google. I have 4.75 The SVN tree doesn't seem to even have >>> that. >>> >>> I checked the latest copy out from so

Re: Internationalised email subjects

2007-06-22 Thread bugmagnet
Thanks Richie, I've tried removing the encode('GB2312') line, so the code looks like this: h = Header(subject, 'GB2312') However, this line still causes the following error message: Traceback (most recent call last): File "/home/web88/html/app/sendmail.py", line 314, in h = Header(subject, 'GB2

Re: sqlite newbie question - how to know if a table exists?

2007-06-22 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: > Hello, > > Another newbie question: How do I know if there is a table with > certain name in a sqlite database? What i'm doing now is just create > the table with that name, if exception occurs, that means the table is > already created. Am i correct? Any better way? Tha

Re: Retrieving a stacktrace from an exception object / forwarding an exception

2007-06-22 Thread alg
Use the traceback module: def log_exception(): """This function will log the current exception's traceback to logfile """ import traceback f = open("logfile", 'a') traceback.print_exc(32, f) f.close() def my_func(): raise Exception def wrapper(): try:

Re: Retrieving a stacktrace from an exception object / forwarding an exception

2007-06-22 Thread Gabriel Genellina
En Fri, 22 Jun 2007 03:54:12 -0300, Samuel <[EMAIL PROTECTED]> escribió: > I am trying to wrap a function that throws an exeption in such a way > that the stacktrace is logged into a file and the exception is > forwarded after that. For example: > > --- > def my_func(): > raise

Re: configparser shuffles all sections ?

2007-06-22 Thread Nick Craig-Wood
stef <[EMAIL PROTECTED]> wrote: > I just used configparser for the first time and discovered that it > shuffled all my sections, > and the contents of the sections too. > > This makes human manipulation of the file impossible. > > Is there a way to prevent this shuffling, You could try get

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread Dave Baum
In article <[EMAIL PROTECTED]>, kaens <[EMAIL PROTECTED]> wrote: > On 6/20/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > That is exactly the problem - there is no "some more" static typing. > > There is static typing - or not. You can't have it "just a bit". > > Couldn't a language be m

Re: string formatter %x and a class instance with __int__ cannot handle long

2007-06-22 Thread Gabriel Genellina
En Thu, 21 Jun 2007 05:36:42 -0300, Kenji Noguchi <[EMAIL PROTECTED]> escribió: > I confirmed that "%08x" % int(y) works. And yes, I'm hoping so. > It actually works that way if the v is less than or equal to 0x7. > >> It is a bug, at least for me, and I have half of a patch addressing i

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread Ben Finney
Paul Rubin writes: > I think it was a real loss that Python 3.0 proposals were closed > before PyPy was widely deployed and we had a chance to get more > experience with it. I think it's great that we're going to get Python 3.0 soon, and that Python 4.0 proposals will b

Re: Retrieving a stacktrace from an exception object / forwarding an exception

2007-06-22 Thread Samuel
Thanks, Guys, this works as expected. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Type of __builtins__ changes from module import to execution?

2007-06-22 Thread Marc Christiansen
Adam Hupp <[EMAIL PROTECTED]> wrote: > I've noticed some unexpected behavior with __builtins__ during module > import. It seems that during module import __builtins__ is a dict > but at all other times it is a module. > > For example, if the file testmod.py has these contents: > > print type(__

Re: Does altering a private member decouple the property's value?

2007-06-22 Thread Bruno Desthuilliers
Ethan Kennerly a écrit : > Thanks for the help! Using the "class name (object)" syntax fixed my > problem. > (snip) > > I am having to unteach myself some of the defensive programming techniques > in C++, such as using name mangling to ensure privacy, when privacy is not > the most important cri

Re: configparser shuffles all sections ?

2007-06-22 Thread Steven D'Aprano
On Fri, 22 Jun 2007 09:28:42 +0200, stef wrote: > hello, > > I just used configparser for the first time and discovered that it > shuffled all my sections, > and the contents of the sections too. > > This makes human manipulation of the file impossible. Having read the rest of this thread, I t

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Michal Nazarewicz
Twisted <[EMAIL PROTECTED]> writes: > On Jun 20, 5:03 pm, Kaldrenon <[EMAIL PROTECTED]> wrote: >> I still have a good deal to learn, even of the basics, but I've toyed >> with it casually for a little bit (a total of two hours at most, but >> almost certainly less) and I already know enough that f

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Neil Cerutti
On 2007-06-21, Douglas Alan <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> writes: >> Seriously, maybe Python looks like 'blub' (thanks, Paul >> Graham), to the skilled Lisp user, but it makes a lot of other >> languages look like 'blub', too, including, sometimes, Lisp: >> Lisp has

Re: Packing a simple dictionary into a string - extending struct?

2007-06-22 Thread John Machin
On Jun 22, 5:08 pm, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Jonathan Fine wrote: > > Thank you for this suggestion. The growing adoption of JSON in Ajax > > programming is a strong argument for my using it in my application, although > > I think I'd prefer something a little more binary. > > >

Re: something similar to shutil.copytree that can overwrite?

2007-06-22 Thread Ben Sizer
On 22 Jun, 02:34, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > def copytree(src, dst, symlinks=False): > """Recursively copy a directory tree using copy2(). > > The destination directory must not already exist. > > XXX Consider this example code rather than the ultimate tool. > > ""

Re: subprocess.popen question

2007-06-22 Thread [EMAIL PROTECTED]
On Jun 22, 12:10 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 22 Jun 2007 01:05:36 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > > > > >> >> >> cmd = ["gawk", "-f", "altertime.awk", "-v", "time_offset=4", "-v", > >> >> >> "outfile=testdat.sco", "i1.sco"] > >> >> >

RE: Changing the names of python keywords

2007-06-22 Thread vedrandekovic
Hello again, Thanks for everything previously, I was change the grammar and Lib/ keyword.py, now Python recognize "koristiti" as a keyword, but that is not enough: when I write in my python shell: >>> koristiti os # "koristiti" get keyword "color", but I get >>> error: File

Re: eggs considered harmful

2007-06-22 Thread Harry George
[EMAIL PROTECTED] (John J. Lee) writes: > Harry George <[EMAIL PROTECTED]> writes: > [...] > > These are unacceptable behaviors. I am therefore dropping ZODB3, and > > am considering dropping TurboGears and ZSI. If the egg paradigm > > spreads, yet more packages will be dropped (or will never ge

Discovery of unpickleables in class heirarchies.

2007-06-22 Thread Brian L. Troutwine
I've a need to pickle arbitrary class hierarchies, which, luckily, can be made to conform to the pickle protocol. At the moment, however, I'm having a rather hard time discovering which classes in a heirarchy cannot be pickles. For instance, say class A has class B in it's __dict__ and let class B

Re: rsync module?

2007-06-22 Thread kyosohma
On Jun 21, 7:40 pm, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > Are there any python modules for accessing rsync from python? I would > like to be able to rsync files from a python script to a remote server > running an rsync daemon. I'm well aware that I can invoke rsync using > subprocess, os.sys

What was that web interaction library called again?

2007-06-22 Thread Harald Korneliussen
Hi, I remember I came across a python library that made it radically simple to interact with web sites, connecting to gmail and logging in with four or five lines, for example. I thought, "that's interesting, I must look into it sometime". Now there's this child I know who asked me about programmi

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Bjorn Borud
[Twisted <[EMAIL PROTECTED]>] | | I think it is quite relevant. Clunky computer interfaces may not be so | dramatically dangerous, but they certainly can hamper productivity. | Between Windows bugs and gratuitous misfeatures (e.g. DRM) and Unix | clunkiness, billions of dollars of potential produc

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Bjorn Borud
[Robert Uhl <[EMAIL PROTECTED]>] | | Why should the ignorant decide? Do you leave the decision of what great | art is to 3 year olds and their doting parents? Do you leave the | decision of what great food is to the ignorant, unwashed, | McDonald's-devouring masses? Why then do you leave the de

Re: What was that web interaction library called again?

2007-06-22 Thread Michael Hoffman
Harald Korneliussen wrote: > Hi, > > I remember I came across a python library that made it radically > simple to interact with web sites, connecting to gmail and logging in > with four or five lines, for example. I thought, "that's interesting, > I must look into it sometime". Now there's this ch

Re: eggs considered harmful

2007-06-22 Thread Harry George
Robert Kern <[EMAIL PROTECTED]> writes: > Harry George wrote: > > ...at least around here. > > > > I run a corporate Open Source Software Toolkit, which makes hundreds > > of libraries and apps available to thousands of technical employees. > > The rules are that a) a very few authorized download

Re: "assert" annoyance

2007-06-22 Thread Paul Rubin
Ben Finney <[EMAIL PROTECTED]> writes: > > So I have some assert statements in my code to verify the absence of > > some "impossible" conditions. They were useful in debugging and of > > course I left them in place for "real" runs of the program. Umpteen > > hours into a run, an assertion failed,

Re: "assert" annoyance

2007-06-22 Thread Paul Rubin
Thomas Heller <[EMAIL PROTECTED]> writes: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65287 Thanks! This looks very useful. -- http://mail.python.org/mailman/listinfo/python-list

EMBEDDING > Run Python & Run C Function

2007-06-22 Thread anonymisiert85
At the moment i can run python-string-code from C (MinGW, WinXP) But how can i register a C-function in python-RUNTIME and call this C function from python - without wrapper dll's or libs??? STEPS: initialize python regsiter foo() ### don't know how to do this run python-script "c=foo(a

Re: What was that web interaction library called again?

2007-06-22 Thread Rob De Almeida
On Jun 22, 11:19 am, Harald Korneliussen <[EMAIL PROTECTED]> wrote: > Hi, > > I remember I came across a python library that made it radically > simple to interact with web sites, connecting to gmail and logging in > with four or five lines, for example. I thought, "that's interesting, > I must loo

Re: Thunderbird access to this newsgroup

2007-06-22 Thread anonymisiert85
hm i have the same problem with thunderbird + comp.lang.python so that i decided to use google for first time -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Bjorn Borud
[Falcolas <[EMAIL PROTECTED]>] | | I took a moment to look at the gui editor which has been made | available to me, and short of the "remove leading spaces" commands, I | do not need to remove my hands from the keyboard if I do not want | to. well, that depends on the editing features you use. I

Re: Changing the names of python keywords and functions

2007-06-22 Thread Stargaming
[EMAIL PROTECTED] schrieb: > Hello, > > I am trying to make a program for 3D modelling with "programming".And > I want make my own program commands, > > for example when user type code in my program: > > "<> OS"- (THIS IS MY IMAGINARY EXAMPLE OF KEYWORD), > > my program must write this code in

Re: newbie question: parsing street name from address

2007-06-22 Thread Eric
On Jun 21, 6:03 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 22, 4:43 am, Eric <[EMAIL PROTECTED]> wrote: > > > > > On Jun 21, 9:47 am, cjl <[EMAIL PROTECTED]> wrote: > > > > P: > > > > I am working on a project that requires geocoding, and have written a > > > very simple geocoder that uses

Re: try/except with multiple files

2007-06-22 Thread Stargaming
Matimus wrote: > It depends, what are you going to do if there is an exception? If you > are just going to exit the program, then that works fine. If you are > going to just skip that file, then the above wont work. If you are > going to return to some other state in your program, but abort the > f

Re: The Modernization of Emacs

2007-06-22 Thread Bjorn Borud
[Martin Gregorie <[EMAIL PROTECTED]>] | | Yep, and the same people think a command line is to be avoided at all | costs. "I mean, its so /last century/ and you can't do anything useful | with it anyway". I have a friend who is a carpenter. he switched to Linux a few years ago because he was tired

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread Alex Martelli
Dave Baum <[EMAIL PROTECTED]> wrote: ... > I still think it would be handy to easily specify the expected types of > function arguments. I sometimes write code in this pattern: > > def foo(a, b): > "a, b - instances of Bar" > assert isinstance(a, Bar) > assert isinstance(b, Bar) >

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Bjorn Borud
[Kaldrenon <[EMAIL PROTECTED]>] | | I don't think anyone can make the argument that any (past or current) | graphics-based editor is as efficient when being used to its fullest | as a text-based editor. It's basic math - it takes measurably more | time to move a hand to the mouse, move/click the m

I need some cleanings tips and advice.

2007-06-22 Thread CleaningTips
Me and my buddy made a website called www.CleaningTips.com, its basically a free forum and free blog driven web site dedicated as a source people can goto to find out how to clean and remove stains from pretty much anything. Problem is, as of yet, you couldn't find out how to clean anything right

Re: howto run a function w/o text output?

2007-06-22 Thread Stargaming
dmitrey schrieb: > hi all, > I have a > y = some_func(args) > statement, and the some_func() produces lots of text output. Can I > somehow to suppress the one? > Thx in advance, D. > Either rewrite it or pipe sys.stdout to some other file-like object but your console while running it. The String

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Giorgos Keramidas
On 21 Jun 2007 16:52:17 +0200, Bjorn Borud <[EMAIL PROTECTED]> wrote: > on my tombstone will say > "here lies the last Emacs user on earth. M-x rip". Hahaha! Very good one :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Neil Cerutti
On 2007-06-22, Douglas Alan <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> writes: >> That said, I wouldn't give up the summer I spent studying _Simply >> Scheme_. > > Sounds like fun. Is this like a kinder, gentler version of SICP? No, it is a prequel. Along with "How to Design Pr

Re: I need some cleanings tips and advice.

2007-06-22 Thread Neil Cerutti
["Followup-To:" header set to comp.lang.python.] On 2007-06-22, Colin B. <[EMAIL PROTECTED]> wrote: > In comp.lang.perl.misc [EMAIL PROTECTED] wrote: >> Me and my buddy made a website called www.stupidpinheads.com, its >> basically a free forum and free blog driven web site dedicated as a >> sourc

Re: The Modernization of Emacs

2007-06-22 Thread Joost Kremers
[Followup-To: header set to comp.emacs] Bjorn Borud wrote: > sure, but often it is just simpler, while you are fiddling around in a > shell, to just fire up vi to do some quick editing than to bounce back > and forth between windows. it is usually quicker too if you have to > navigate deep directo

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
Neil Cerutti <[EMAIL PROTECTED]> writes: > That said, I wouldn't give up the summer I spent studying _Simply > Scheme_. Sounds like fun. Is this like a kinder, gentler version of SICP? I'm not sure, though, that I could have learned computer science properly without the immortal characters of B

Re: The Modernization of Emacs

2007-06-22 Thread Bjorn Borud
[David Kastrup <[EMAIL PROTECTED]>] | | The idea is to start Emacs once and use it for everything. ...which is fine as long as you are only fiddling around on one machine or you have emacs windows running on all your machines. for my main use, I do start Emacs just once though. for instance at

Re: Changing the names of python keywords

2007-06-22 Thread Ognjen Bezanov
[EMAIL PROTECTED] escribió: > Hello again, > > Thanks for everything previously, I was change the grammar and Lib/ > keyword.py, now > Python recognize "koristiti" as a keyword, but that is not enough: > > when I write in my python shell: > koristiti os # "koristiti" get

howto run a function w/o text output?

2007-06-22 Thread dmitrey
hi all, I have a y = some_func(args) statement, and the some_func() produces lots of text output. Can I somehow to suppress the one? Thx in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs

2007-06-22 Thread Joel J. Adamson
Martin Gregorie <[EMAIL PROTECTED]> writes: > Bjorn Borud wrote: > Yep, and the same people think a command line is to be avoided at all > costs. "I mean, its so /last century/ and you can't do anything useful > with it anyway". Funny ;) It's funny that people consider typing commands to be "old

Re: sqlite newbie question - how to know if a table exists?

2007-06-22 Thread [EMAIL PROTECTED]
On Jun 22, 12:07 am, Gerhard Häring <[EMAIL PROTECTED]> wrote: > That approach is ok. If your SQLite library is recent enough (I don't > know the exact version), you can use "create table if not exists ...". > > -- Gerhard Thanks Gerhard. I'm using sqlite3 that came with Python2.5 installation.

Re: Setuptools, build and install dependencies (was: eggs considered harmful)

2007-06-22 Thread Harry George
Ben Finney <[EMAIL PROTECTED]> writes: > Harry George <[EMAIL PROTECTED]> writes: > > > Historically, python packages played well in this context. Install > > was a simple download, untar, setup.py build/install. > > > > Eggs and with other setuptools-inspired install processes break this > > pa

Re: I need some cleanings tips and advice.

2007-06-22 Thread Colin B.
In comp.lang.perl.misc [EMAIL PROTECTED] wrote: > Me and my buddy made a website called www.stupidpinheads.com, its > basically a free forum and free blog driven web site dedicated as a > source people can goto to find out how to clean and remove stains from > pretty much anything. Problem is, as

Python plain-text database or library that supports joins?

2007-06-22 Thread felciano
Hello -- Is there a convention, library or Pythonic idiom for performing lightweight relational operations on flatfiles? I frequently find myself writing code to do simple SQL-like operations between flat files, such as appending columns from one file to another, linked through a common id. For ex

Re: SimplePrograms challenge

2007-06-22 Thread [EMAIL PROTECTED]
Ah, I mistook you for someone who gives a shit. - You DID see my post on comp.lang.python and deliberately ignored it. - You then lied and claimed there was no discussion. - You then lied and claimed my example merely duplicated other examples. - You claimed to be offended by my characteriz

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread Paul Boddie
On 22 Jun, 12:41, Ben Finney <[EMAIL PROTECTED]> wrote: > > I think it's great that we're going to get Python 3.0 soon, and that > Python 4.0 proposals will benefit from a long period of familiarity > with widely-deployed PyPy :-) I'm not going to name and shame anyone, but here's part of a genuin

Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
On Jun 22, 2:16 am, hiro <[EMAIL PROTECTED]> wrote: > On Jun 22, 1:46 am, Charles Sanders <[EMAIL PROTECTED]> > wrote: > > > Paul Rubin wrote: > > > > from itertools import izip > > > pos = map(dict(izip(l2, count())).__getitem__, l1) > > > or probably less efficiently ... > > > >>> l1 = [ 'abc',

Re: Promijena imena pythonovim kljucnim rijecima

2007-06-22 Thread vedrandekovic
Ognjen Bezanov je napisao/la: > [EMAIL PROTECTED] escribió: > > Hello again, > > > > Thanks for everything previously, I was change the grammar and Lib/ > > keyword.py, now > > Python recognize "koristiti" as a keyword, but that is not enough: > > > > when I write in my python shell: > > > k

Re: howto run a function w/o text output?

2007-06-22 Thread Matimus
On Jun 22, 9:56 am, dmitrey <[EMAIL PROTECTED]> wrote: > hi all, > I have a > y = some_func(args) > statement, and the some_func() produces lots of text output. Can I > somehow to suppress the one? > Thx in advance, D. [code] import sys import os sys.stdout = open(os.devnull,"w") [/code] -- htt

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 21 Jun 2007 15:25:37 -0400, Douglas Alan wrote: >> You are imagining something very different from what is proposed. >> Lisp-like macros don't allow "anything goes". > Provided people avoid doing anything "which would be considered very > ru

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Robert Uhl
Falcolas <[EMAIL PROTECTED]> writes: > > Being a primarily windows user, I have to question your assertion that > using ctrl-f for find causes a "mental context switch". For me, in 90% > of the windows applications, finding something is as simple as ctrl-f, > the phrase, hit enter. Not terribly dif

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Douglas Alan" <[EMAIL PROTECTED]> wrote in message > | > But why is the ability to abstract syntax good? > | It allows the community to develop language features in a modular way > | without having to sully the code base for the language itself. > A

Re: comparing two lists and returning "position"

2007-06-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, hiro wrote: > Hi once again, Charles.. I have tried your approach in my data set l2 > and it keeps crashing on me, > bare in mind that I have a little over 10 million objects in my list > (l2) and l1 contains around 4 thousand > objects.. (i have enough ram in my computer s

Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
On Jun 22, 1:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, hiro wrote: > > Hi once again, Charles.. I have tried your approach in my data set l2 > > and it keeps crashing on me, > > bare in mind that I have a little over 10 million objects in my list > > (l2)

Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
On Jun 22, 1:58 pm, hiro <[EMAIL PROTECTED]> wrote: > On Jun 22, 1:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > In <[EMAIL PROTECTED]>, hiro wrote: > > > Hi once again, Charles.. I have tried your approach in my data set l2 > > > and it keeps crashing on me, > > > bare in mi

Re: What was that web interaction library called again?

2007-06-22 Thread felciano
Maybe http://twill.idyll.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-22 Thread Falcolas
On Jun 22, 11:28 am, Robert Uhl <[EMAIL PROTECTED]> wrote: > That's the advantage of a well-organised set of commands. If you want > to use regexp search, you have to look at the dialogue box and click on > a checkbox--which would be a context switch. Again, you are assuming that the editor isn't

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-22 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > | But why is the ability to abstract syntax good? > I think this points to where Sussman went wrong in his footnote and > Alan in his defense thereof. Flexibility of function -- being able > to do many different things -- is quite different from flexib

Re: Python IDE

2007-06-22 Thread com4
On 6/19/07, Tom Gur <[EMAIL PROTECTED]> wrote: Hi, which IDE would you recommend for a python ? I also use VIM, but I use a couple plugins to make it more ide-esque (If you can call it that). The first is the project plugin: http://vim.sourceforge.net/scripts/script.php?script_id=69 This wil

Tailing a log file?

2007-06-22 Thread Evan Klitzke
Everyone, I'm interested in writing a python program that reads from a log file and then executes actions based on the lines. I effectively want to write a loop that does something like this: while True: log_line = log_file.readline() do_something(log_line) Where the readline() method bl

Re: EMBEDDING > Run Python & Run C Function

2007-06-22 Thread Farshid Lashkari
[EMAIL PROTECTED] wrote: > At the moment i can run python-string-code from C (MinGW, WinXP) > > But how can i register a C-function in python-RUNTIME and call this C > function from python - without wrapper dll's or libs??? Have a look at the following documentation page on extending/embedding p

Re: howto run a function w/o text output?

2007-06-22 Thread Evan Klitzke
On 6/22/07, dmitrey <[EMAIL PROTECTED]> wrote: > hi all, > I have a > y = some_func(args) > statement, and the some_func() produces lots of text output. Can I > somehow to suppress the one? > Thx in advance, D. In addition to the other solutions proposed, on a *nix system you can do os.close(1); o

Re: I need some cleanings tips and advice.

2007-06-22 Thread Kaldrenon
On Jun 22, 1:09 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Maybe they lost the business plan. It's not surprising, since it > was probably written on a napkin. Or perhaps they HAD a bunch of good cleaning tips, but accidentally threw them out while cleaning? Tip: don't throw stuff out unless y

Re: Tailing a log file?

2007-06-22 Thread Evan Klitzke
On 6/22/07, Evan Klitzke <[EMAIL PROTECTED]> wrote: > Everyone, > > I'm interested in writing a python program that reads from a log file > and then executes actions based on the lines. I effectively want to > write a loop that does something like this: > > while True: > log_line = log_file.rea

Re: Tailing a log file?

2007-06-22 Thread Kenji Noguchi
something like this? unix tail command does more fancy stuff like it waits for timeout, and check if the file is truncated or depending on incoming data it sleeps seconds , etc etc. #!/usr/bin/env python import sys, select while True: ins, outs, errs = select.select([sys.stdin],[],[]) for

Re: Tailing a log file?

2007-06-22 Thread Stephen R Laniel
On Fri, Jun 22, 2007 at 11:46:56AM -0700, Evan Klitzke wrote: > I checked the source code for tail and they actually poll the file by > using fstat and sleep to check for changes in the file size. This > didn't seem right so I thought about it more and realized I ought to > be using inotify. So I g

Re: Tailing a log file?

2007-06-22 Thread Falcolas
On Jun 22, 12:50 pm, "Kenji Noguchi" <[EMAIL PROTECTED]> wrote: > > I checked the source code for tail and they actually poll the file by > > using fstat and sleep to check for changes in the file size. This > > didn't seem right so I thought about it more and realized I ought to > > be using inoti

Adding method to a class on the fly

2007-06-22 Thread John Henry
Hi list, I have a need to create class methods on the fly. For example, if I do: class Dummy: def __init__(self): exec '''def method_dynamic(self):\n\treturn self.method_static("it's me")''' return def method_static(self, text): print text return I like

  1   2   3   >