Re: Newbie : checking semantics

2005-05-07 Thread John Machin
On 7 May 2005 15:05:20 -0700, "LDD" <[EMAIL PROTECTED]> wrote: >Hi everyone, > >I am new to python and was very enthustic about its possibilities when >I discover that python is really what it is : just a scripting >language. > >What disappoints me is that pyton will happily accept and execute thi

Re: New Python regex Doc

2005-05-07 Thread axel
In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> wrote: > Let me expose one another fucking incompetent part of Python doc, in > illustration of the Info Tech industry's masturbation and ignorant > nature. > Note the need to inject the high-brow jargon “greedy” here as a > latch on sentence.

Re: Python Pseudo-Switch

2005-05-07 Thread Jason Mobarak
James Stroud wrote: > Hello All, > > Because of my poorly designing a database, I have recently found it necessary > to explore the wonders of the Python pseudo-switch: > > do_case = { "A" : lambda x: x["bob"], > "B" : lambda x: x["carol"], > "C" : lambda x: "Ted", >

Re: properties vs. eval()

2005-05-07 Thread Jason Mobarak
Bob Rogers wrote: > So you're saying you don't know the answer? The question wasn't > "should I use setattr?" If what you're doing is wrong and backwards then it doesn't matter what the question is. Best practices are best practices for a reason. There's no reason to use eval to do what you want

Re: Newbie : checking semantics

2005-05-07 Thread elbertlev
> I am new to python and was very enthustic about its possibilities when > I discover that python is really what it is : just a scripting > language. .. > The fact that python doesn't check if the symbol ... is defined, is really bad ... 1. For a language like Python full static checking is IM

Re: New Python regex Doc

2005-05-07 Thread Mike Meyer
"Xah Lee" <[EMAIL PROTECTED]> writes: > Let me expose one another fucking incompetent part of Python doc, in > illustration of the Info Tech industry's masturbation and ignorant > nature. What you actually expose is your own ignorance. > Note: “In other words, the "|" operator is never greedy.”

Re: Python Pseudo-Switch

2005-05-07 Thread Dan Bishop
James Stroud wrote: > Hello All, > > Because of my poorly designing a database, I have recently found it necessary > to explore the wonders of the Python pseudo-switch: > > do_case = { "A" : lambda x: x["bob"], > "B" : lambda x: x["carol"], > "C" : lambda x: "Ted", >

[ANN] pysqlite 2.0.beta1

2005-05-07 Thread Gerhard Haering
== pysqlite 2.0.beta1 == I'm glad to announce pysqlite 2.0.beta1. The API is 98 % stable now. And pysqlite itself should be a lot more stable too, now. The most notable changes are a lot of fixed refcount bugs, and the added documentation. Download the release her

Re: Newbie : checking semantics

2005-05-07 Thread George Sakkis
> What disappoints me is that pyton will happily accept and execute this > code : > > if ( aConditionThatIsFalse ): > AFunctionThatIsntDefined() > > print "Hello world" > > The fact that python doesn't check if the symbol > AFunctionThatIsntDefined is defined, is really bad when you develop bi

Re: Trouble saving unicode text to file

2005-05-07 Thread Ivan Van Laningham
Hi All-- John Machin wrote: > > > The general rule in working with Unicode can be expressed something > like "work in Unicode all the time i.e. decode legacy text as early as > possible; encode into legacy text (if absolutely required) as late as > possible (corollary: if forced to communicate w

Re: New Python regex Doc

2005-05-07 Thread Peter Hansen
Ron Adam rote: > I suppose that if you respectfully offer something even a little better > it would be respectfully accepted, after due review of course. You will > probably even get many helpful suggestions along they way because you > will have created a situation where every one wins. Remar

Re: Trouble saving unicode text to file

2005-05-07 Thread John Machin
On Sat, 7 May 2005 17:25:28 -0500, Skip Montanaro <[EMAIL PROTECTED]> wrote: > >Svennglenn> Traceback (most recent call last): >Svennglenn> File "D:\Documents and >Svennglenn> > Settings\Daniel\Desktop\Programmering\aaotest\aaotest2\aaotest2.pyw", >Svennglenn> line 5, in ? >

Out of Office AutoReply: Hello

2005-05-07 Thread Ian Holsman
Title: Out of Office AutoReply: Hello i am currently out of the office until May  23rd. if the matter is urgent, please contact tech-pma or my manager Paul Osterhus -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Pseudo-Switch

2005-05-07 Thread Terry Reedy
"James Stroud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Because of my poorly designing a database, I have recently found it > necessary > to explore the wonders of the Python pseudo-switch: > > do_case = { "A" : lambda x: x["bob"], >"B" : lambda x: x["carol"], >

Re: hard memory limits

2005-05-07 Thread Maurice LING
Bengt Richter wrote: > On Sat, 07 May 2005 14:03:34 +1000, Maurice LING <[EMAIL PROTECTED]> wrote: > > >>John Machin wrote: >> >>>On Sat, 07 May 2005 02:29:48 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >>> >>> >>> On Sat, 07 May 2005 11:08:31 +1000, Maurice LING <[EMAIL PROTECTED]> wrote:

Re: Language documentation ( was Re: Computing Industry shams)

2005-05-07 Thread Måns Rullgård
vermicule <[EMAIL PROTECTED]> writes: > "Xah Lee" <[EMAIL PROTECTED]> writes: [...] > > It seems to me that you want the Python doc to be written for morons. Not for morons, but for trolls. Don't feed them. -- Måns Rullgård [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python

Python Pseudo-Switch

2005-05-07 Thread James Stroud
Hello All, Because of my poorly designing a database, I have recently found it necessary to explore the wonders of the Python pseudo-switch: do_case = { "A" : lambda x: x["bob"], "B" : lambda x: x["carol"], "C" : lambda x: "Ted", "D" : lambda x: do_something(x

Language documentation ( was Re: Computing Industry shams)

2005-05-07 Thread vermicule
"Xah Lee" <[EMAIL PROTECTED]> writes: > A|B, where A and B can be arbitrary REs, creates a regular expression > that will match either A or B. An arbitrary number of REs can be > separated by the "|" in this way. This can be used inside groups (see > below) as well. As the target string is scanned

Re: New Python regex Doc

2005-05-07 Thread Ron Adam
Xah Lee wrote: > Let me expose one another fu Hello Xah, I think you will continue to have difficulty getting respect on this matter as long as you show disrespect to those who have come before you. When you refer to the documentation as being f'ing stupid, and other disrespectful terms, y

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-07 Thread John Bokma
Xah Lee wrote: > Let me expose one another fucking incompetent part of your writing capablities? If you really had a point, there wouldn't be any need of swearing... -- John MexIT: http://johnbokma.com/mexit/ personal page: http://

Re: Trouble saving unicode text to file

2005-05-07 Thread John Machin
On 7 May 2005 14:22:56 -0700, "Svennglenn" <[EMAIL PROTECTED]> wrote: >I'm working on a program that is supposed to save >different information to text files. > >Because the program is in swedish i have to use >unicode text for ÅÄÖ letters. "program is in Swedish": to the extent that this means "

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-07 Thread James Stroud
On Saturday 07 May 2005 04:28 pm, Xah Lee wrote: > Note: âIn other words, the "|" operator is never greedy.â > > Note the need to inject the high-brow jargon âgreedyâ here as a > latch on sentence. The first definition of "jargon" in the Collaborative International Dictionary of English is: "To

Re: Need help subclassing Borg

2005-05-07 Thread Steven D'Aprano
On Sat, 07 May 2005 22:28:34 +1000, Steven D'Aprano wrote: > I've been working with the Borg design pattern from here: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531 Thanks to everyone who took the time to answer. I've learnt a lot from the discussion, not the least of which was

Re: Newbie : checking semantics

2005-05-07 Thread Bengt Richter
On 7 May 2005 15:05:20 -0700, "LDD" <[EMAIL PROTECTED]> wrote: >Hi everyone, > >I am new to python and was very enthustic about its possibilities when >I discover that python is really what it is : just a scripting >language. Not "just." > >What disappoints me is that pyton will happily accept an

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-07 Thread Xah Lee
Let me expose one another fucking incompetent part of Python doc, in illustration of the Info Tech industry's masturbation and ignorant nature. The official Python doc on regex syntax ( http://python.org/doc/2.4/lib/re-syntax.html ) says: --begin quote-- "|" A|B, where A and B can be arbitrary R

Re: Newbie : checking semantics

2005-05-07 Thread Mike Meyer
"LDD" <[EMAIL PROTECTED]> writes: > I am new to python and was very enthustic about its possibilities when > I discover that python is really what it is : just a scripting > language. That "just" covers a *very* big application space. So-called scripting languages are being used in an ever-wideni

Re: plug-ins

2005-05-07 Thread Dave Brueck
Eric Nieuwland wrote: > The app I'm working on keeps getting new transforms and I'm tired of > adding them by hand. So here it goes: > Can anyone provide me with clues/examples/references on how to create a > plug-in framework? The biggest task is defining the interface between your app and the

Re: Newbie : checking semantics

2005-05-07 Thread [EMAIL PROTECTED]
I do not know of a check like the one you desire. But you always can use some clever testing, e.g. facilitated with the unittest module to prevent situations like yours, see http://docs.python.org/lib/module-unittest.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie : checking semantics

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 15:05:20 -0700, LDD wrote: > The fact that python doesn't check if the symbol > AFunctionThatIsntDefined is defined, is really bad when you develop big > pieces of code. You will never be sure that your code is free of this > kind of dummy errors and testing every possible execu

Re: globbing multiple wildcards

2005-05-07 Thread [EMAIL PROTECTED]
Then take a look at os.walk, see http://docs.python.org/lib/os-file-dir.html -- http://mail.python.org/mailman/listinfo/python-list

Re: globbing multiple wildcards

2005-05-07 Thread utabintarbo
Is there any way to make this recursive? That is what I was looking for. Sorry I wasn't too clear before. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble saving unicode text to file

2005-05-07 Thread Skip Montanaro
Svennglenn> Traceback (most recent call last): Svennglenn> File "D:\Documents and Svennglenn> Settings\Daniel\Desktop\Programmering\aaotest\aaotest2\aaotest2.pyw", Svennglenn> line 5, in ? Svennglenn> titel = unicode(titel) Svennglenn> UnicodeDecodeError: 'ascii' cod

Newbie : checking semantics

2005-05-07 Thread LDD
Hi everyone, I am new to python and was very enthustic about its possibilities when I discover that python is really what it is : just a scripting language. What disappoints me is that pyton will happily accept and execute this code : if ( aConditionThatIsFalse ): AFunctionThatIsntDefined()

Trouble saving unicode text to file

2005-05-07 Thread Svennglenn
I'm working on a program that is supposed to save different information to text files. Because the program is in swedish i have to use unicode text for ÅÄÖ letters. When I run the following testscript I get an error message. # -*- coding: cp1252 -*- titel = "åäö" titel = unicode(titel) print "

plug-ins

2005-05-07 Thread Eric Nieuwland
Hi all, The app I'm working on keeps getting new transforms and I'm tired of adding them by hand. So here it goes: Can anyone provide me with clues/examples/references on how to create a plug-in framework? tx, --eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: saving dialog variables

2005-05-07 Thread jeff elkins
On Saturday 07 May 2005 04:39 pm, Jeremy Bowers wrote: > OK, I can't quite directly run this, but assuming you're trying to get the > user to enter some text into the text control, you should be able to add > print dlg.venttypeText.GetValue() > to print what the user entered; this comes a

Re: Newbie: saving dialog variables

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 15:43:08 +, jeff elkins wrote: > === > import wx > > def create(parent): > return vents(parent) > > [wxID_VENTS, wxID_VENTSEXITBUTTON, > wxID_VENTSVENTTYPETEXT, > [snip] > > ] = [wx.NewId() for _init_ctrls in range(14) ] > > class vents(wx.Dialog): >

Re: python and glut

2005-05-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, max(01)* wrote: > Lonnie Princehouse wrote: > >> DRI not working could also be a permissions issue; check to see if it >> works as root. > > that's it! :-) > > now, how can i make it work as "joe user"? I have this in my XF86Config and I'm in the `video` group:: Sect

Re: Newbie: saving dialog variables

2005-05-07 Thread jeff elkins
On Saturday 07 May 2005 02:34 pm, Jeremy Bowers wrote: > On Sat, 07 May 2005 13:24:34 +, jeff elkins wrote: > > Howdy, > > > > I've written a program that calls an imported dialog to gather some > > needed input. What's the common method for passing that data back to the > > caller? I've tried

Re: Need help subclassing Borg

2005-05-07 Thread Bengt Richter
On Sun, 08 May 2005 02:42:09 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Sat, 07 May 2005 08:35:21 -0700, [EMAIL PROTECTED] wrote: > >> See mr Martellis comment of 2001/09/06 in mentiond recipe, you then get >> something like this >> >> -#!/usr/bin/env python >> -class Borg(object): >>

Re: win32- system call - getting results back into python

2005-05-07 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I'm trying to call a system command "svnlook log \arms" from within > python and process the results. However I'm having trouble getting the > results of the command back into python. I'm using windows if that > matters. As "runes" pointed out, you are getting caught b

Re: Q: The `print' statement over Unicode

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 12:10:46 -0400, FranÃois Pinard wrote: > [Martin von LÃwis] > >> FranÃois Pinard wrote: >> >> > Am I looking in the wrong places, or else, should not the standard >> > documentation more handily explain such things? > >> It should, but, alas, it doesn't. Contributions are wel

Re: python and glut

2005-05-07 Thread max(01)*
Lonnie Princehouse wrote: > Welcome to the exciting world of trying to make graphics work on Linux > =) > > DRI is direct rendering. [...] > DRI not working could also be a permissions issue; check to see if it > works as root. that's it! :-) now, how can i make it work as "joe user"? bye max

Re: Newbie: saving dialog variables

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 13:24:34 +, jeff elkins wrote: > Howdy, > > I've written a program that calls an imported dialog to gather some needed > input. What's the common method for passing that data back to the caller? > I've > tried a 'return data' prior to self.Close() ... all that happens t

Re: Need help subclassing Borg

2005-05-07 Thread Jeremy Bowers
On Sun, 08 May 2005 02:42:09 +1000, Steven D'Aprano wrote: > I'm thinking what I might need is a function that generates a Borg-like > class. So I would do something like: > > Rabbit = MakeBorgClass() > # Rabbit is now a class implementing shared state > # all instances of Rabbit share the same st

Re: Listening to changes in a C++ variable from python

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 07:16:58 -0700, lamthierry wrote: > Is there some python method which can do the polling you are talking > about? Or can you send me a link to some existing example? Take a moment to go back to the basics. C++ is, in general, a simple system. The *language* is complicated at t

Re: win32- system call - getting results back into python

2005-05-07 Thread runes
You wil have to use r"svnlook log \arms") or "svnlook log \\arms") to escape the "\". Popen usually return a file-like object, so you maye to use file methods like .read() ex: d = os.popen('dir /b') print d.read() -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption with Python?

2005-05-07 Thread Philippe C. Martin
PS: remmember that single DES has been brocken. If you're also interested in signature, this is an interesting article (a big upsate if true) http://it.slashdot.org/article.pl?sid=05/02/16/0146218&tid=93 Regards, Philippe Philippe C. Martin wrote: > I use http://www.amk.ca/python/code/crypto.

Re: Newbie: saving dialog variables

2005-05-07 Thread jeff elkins
On Saturday 07 May 2005 01:24 pm, jeff elkins wrote: > Howdy, > > I've written a program that calls an imported dialog to gather some needed > input. What's the common method for passing that data back to the caller? > I've tried a 'return data' prior to self.Close() ... all that happens then > is

win32- system call - getting results back into python

2005-05-07 Thread [EMAIL PROTECTED]
Hey everyone, I'm trying to call a system command "svnlook log \arms" from within python and process the results. However I'm having trouble getting the results of the command back into python. I'm using windows if that matters. Here's what I have so far: os.system("svnlook") #works but doesn'

Re: Shell Commands in Python Code

2005-05-07 Thread F. Petitjean
Le Sat, 7 May 2005 08:55:35 -0700 (PDT), Sara Khalatbari a écrit : > There are a lot of commands that I need to use in my > code & I don't know how to do it > > Is there a way to use shell commands in Python code? Python is a scrpting language. So you can substitute most shell scripts idioms with

Newbie: saving dialog variables

2005-05-07 Thread jeff elkins
Howdy, I've written a program that calls an imported dialog to gather some needed input. What's the common method for passing that data back to the caller? I've tried a 'return data' prior to self.Close() ... all that happens then is the dialog won't close. I'm sure this is obvious, but this ne

Re: Shell Commands in Python Code

2005-05-07 Thread Paul Watson
"Sara Khalatbari" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There are a lot of commands that I need to use in my > code & I don't know how to do it > > Is there a way to use shell commands in Python code? Yes, there are many popen() forms that you may wish to investigate. Bel

Re: Q: The `print' statement over Unicode

2005-05-07 Thread "Martin v. Löwis"
François Pinard wrote: > My contributions are not that welcome. If they were, the core team > would not try forcing me into using robots and bug trackers! :-) Ok, then we need to wait for somebody else to contribute a documentation patch. > Thanks. Your kind explanation, above, should make it,

Re: Need help subclassing Borg

2005-05-07 Thread Bengt Richter
On Sat, 07 May 2005 22:28:34 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >I've been working with the Borg design pattern from here: >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531 > >and I'm having problems subclassing it. > >I'm a newbie, so I've probably missed something obv

Re: Reg strip_tags function in Python.

2005-05-07 Thread Dave Benjamin
praba kar wrote: > In Php I can use strip_tags() function to strip out > all html tags. I want to know that strip_tags() > equivalent function in Python. Here's a simple function based on Python's HTMLParser class. If you need to reject only certain tags, you'll probably want to subclass HTMLPar

Re: Need help subclassing Borg

2005-05-07 Thread Steven D'Aprano
On Sat, 07 May 2005 08:35:21 -0700, [EMAIL PROTECTED] wrote: > See mr Martellis comment of 2001/09/06 in mentiond recipe, you then get > something like this > > -#!/usr/bin/env python > -class Borg(object): > -_shared_state = {} > -def __init__(self): > -self.__dict__ = self._shar

Re: python and glut

2005-05-07 Thread max(01)*
Lonnie Princehouse wrote: > DRI not working could also be a permissions issue; check to see if it > works as root. that's it! :-) now, how can i make it work as "joe user"? bye max -- http://mail.python.org/mailman/listinfo/python-list

Re: path(file)

2005-05-07 Thread [EMAIL PROTECTED]
What about start reading http://docs.python.org/lib/module-os.path.html? -- http://mail.python.org/mailman/listinfo/python-list

Re: Shell Commands in Python Code

2005-05-07 Thread [EMAIL PROTECTED]
start to take a look at the call function of the subprocess module - see http://docs.python.org/lib/node231.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Q: The `print' statement over Unicode

2005-05-07 Thread François Pinard
[Martin von Löwis] > François Pinard wrote: > > > Am I looking in the wrong places, or else, should not the standard > > documentation more handily explain such things? > It should, but, alas, it doesn't. Contributions are welcome. My contributions are not that welcome. If they were, the core t

Re: Ask for a tools to protect my .pyc file :)

2005-05-07 Thread utabintarbo
pyobfuscate http://www.lysator.liu.se/~astrand/projects/pyobfuscate/ -- http://mail.python.org/mailman/listinfo/python-list

Re: globbing multiple wildcards

2005-05-07 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > I have a path spec similar to '/home/*/.mozilla/*/*/cache*/*' (this > will probably look familiar to *nix users) with multiple wildcards. I > am finding it difficult gathering ALL file pathnames which match this > spec. Can anyone shed some light on this for a python noob

path(file)

2005-05-07 Thread Sara Khalatbari
Suppose I have a list of files & I wanna know their path. is there a command that helps me do so in python? Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html -- http://mail.python.org/mailman/listinfo/python-list

Re: get file modification time in mm/dd/yyyy format?

2005-05-07 Thread F. Petitjean
Le 7 May 2005 08:23:48 -0700, [EMAIL PROTECTED] a écrit : > Using Python 2.4 on Windows, for me the command > > print os.stat("temp.txt")[stat.ST_MTIME] > > gives > > 1115478343 , > > which is "seconds since the epoch". How can I get the modification time > in a format such as > > 05/07/2005

Re: Encryption with Python?

2005-05-07 Thread Philippe C. Martin
I use http://www.amk.ca/python/code/crypto.html Regards, Philippe Blake T. Garretson wrote: > I want to save some sensitive data (passwords, PIN numbers, etc.) to > disk in a secure manner in one of my programs. What is the > easiest/best way to accomplish strong file encryption in Python?

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-07 Thread Philippe C. Martin
This is nice! I just might understand regex eventually. Xah Lee wrote: > erratum: > > the correct URL is: > http://xahlee.org/perl-python/python_re-write/lib/module-re.html > > Xah > [EMAIL PROTECTED] > â http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: globbing multiple wildcards

2005-05-07 Thread utabintarbo
OK, I guess it WAS that easy. :-P Thanks for the replys. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Ask for a tools to protect my .pyc file :)

2005-05-07 Thread Philippe C. Martin
Is it stable ? I tried it a few months ago and it crashed on my code I do not code that badly ;-) Regards, Philippe [EMAIL PROTECTED] wrote: > pyobfuscate > > http://www.lysator.liu.se/~astrand/projects/pyobfuscate/ -- http://mail.python.org/mailman/listinfo/python-list

Shell Commands in Python Code

2005-05-07 Thread Sara Khalatbari
There are a lot of commands that I need to use in my code & I don't know how to do it Is there a way to use shell commands in Python code? __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mai

Re: get file modification time in mm/dd/yyyy format?

2005-05-07 Thread [EMAIL PROTECTED]
Tried this it on linux, should work under windows as well I think [EMAIL PROTECTED]:~$ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. py> import time py> t = time.localtime(111547

Re: get file modification time in mm/dd/yyyy format?

2005-05-07 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Using Python 2.4 on Windows, for me the command > > print os.stat("temp.txt")[stat.ST_MTIME] > > gives > > 1115478343 , > > which is "seconds since the epoch". How can I get the modification time > in a format such as > > 05/07/2005 11:05 AM > > as in Windows with

Re: Need help subclassing Borg

2005-05-07 Thread [EMAIL PROTECTED]
See mr Martellis comment of 2001/09/06 in mentiond recipe, you then get something like this -#!/usr/bin/env python -class Borg(object): -_shared_state = {} -def __init__(self): -self.__dict__ = self._shared_state - -class Duck(Borg): -def __init__(self): -super(Duck, se

get file modification time in mm/dd/yyyy format?

2005-05-07 Thread beliavsky
Using Python 2.4 on Windows, for me the command print os.stat("temp.txt")[stat.ST_MTIME] gives 1115478343 , which is "seconds since the epoch". How can I get the modification time in a format such as 05/07/2005 11:05 AM as in Windows with the dir command? Ideal would be a tuple of 6 values,

Re: globbing multiple wildcards

2005-05-07 Thread [EMAIL PROTECTED]
what about : [EMAIL PROTECTED]:~$ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import glob >>> print glob.glob('/home/*/.mozilla/*/*/Cache*/*') ['/home/martin/.mozilla/firef

Re: hard memory limits

2005-05-07 Thread Bengt Richter
On Sat, 07 May 2005 14:03:34 +1000, Maurice LING <[EMAIL PROTECTED]> wrote: >John Machin wrote: >> On Sat, 07 May 2005 02:29:48 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >> >> >>>On Sat, 07 May 2005 11:08:31 +1000, Maurice LING <[EMAIL PROTECTED]> wrote: >>> It doesn't seems to help. I'm

globbing multiple wildcards

2005-05-07 Thread utabintarbo
I have a path spec similar to '/home/*/.mozilla/*/*/cache*/*' (this will probably look familiar to *nix users) with multiple wildcards. I am finding it difficult gathering ALL file pathnames which match this spec. Can anyone shed some light on this for a python noob? TIA Bob -- http://mail.pytho

Re: Ask for a tool to protect my .pyc file :)

2005-05-07 Thread Steven D'Aprano
On Sat, 07 May 2005 06:45:32 -0700, Robert Kern wrote: > Lily Kakm wrote: >> when I distribute my software, I will give the users .pyc file (maybe I can >> use py2exe, but I think there's no essential different), because I don't >> like them to know my source code. >> >> But actually, through .

Ask for a tools to protect my .pyc file :)

2005-05-07 Thread Lily Kakm
I am sorry, may be I have not explain my mind clearly. But I just want a tool like this : It can change the variable name into meaningless ones. I know it will not be safe enough, but I need one. So I ask for help. Thank you !! Robert Kern wrote: >Lily Kakm wrote: >>when I distribute my software,

Re: Listening to changes in a C++ variable from python

2005-05-07 Thread lamthierry
Is there some python method which can do the polling you are talking about? Or can you send me a link to some existing example? > It is not possible to "listen" to something that is not "emitting" change > notifications. Your variable "val" isn't "talking". > > Some languages let you listen to eve

Re: hard memory limits

2005-05-07 Thread John Roth
"Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I think I've hit a system limit in python when I try to construct a list > of 200,000 elements. My error is > > malloc: vm_allocate (size = 2400256) failed.. > > Just wondering is this specific to my system o

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-07 Thread Skip Montanaro
Xah> I don't know what kind of system is used to generate the Python Xah> docs, but it is quite unpleasant to work with manually, as there Xah> are egregious errors and inconsistencies. The main Python documentation is written in LaTeX. I believe most, if not all, HTML is generated b

Re: hard memory limits

2005-05-07 Thread Robert Kern
Philippe C. Martin wrote: > Hi, > > Why don't you catch the exception and print the trace ? I don't think a Python exception is ever raised. The error message quoted below comes from the system, not Python. > Regards, > > Philippe > > Maurice LING wrote: >>This is the exact error message: >>

Re: Q: The `print' statement over Unicode

2005-05-07 Thread "Martin v. Löwis"
François Pinard wrote: > Am I looking in the wrong places, or else, should not the standard > documentation more handily explain such things? It should, but, alas, it doesn't. Contributions are welcome. The algorithm to set sys.std{in,out}.encoding is in sysmodule.c:_PySys_Init and pythonrun.c:Py

Re: hard memory limits

2005-05-07 Thread Philippe C. Martin
Hi, Why don't you catch the exception and print the trace ? Regards, Philippe Maurice LING wrote: > John Machin wrote: >> On Sat, 07 May 2005 02:29:48 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >> >> >>>On Sat, 07 May 2005 11:08:31 +1000, Maurice LING <[EMAIL PROTECTED]> >>>wrote: >>> >

Re: Ask for a tool to protect my .pyc file :)

2005-05-07 Thread Robert Kern
Lily Kakm wrote: > when I distribute my software, I will give the users .pyc file (maybe I can > use py2exe, but I think there's no essential different), because I don't > like them to know my source code. > > But actually, through .pyc file is not so directly as .py file, but the user > can al

Ask for a tool to protect my .pyc file :)

2005-05-07 Thread Lily Kakm
when I distribute my software, I will give the users .pyc file (maybe I can use py2exe, but I think there's no essential different), because I don't like them to know my source code. But actually, through .pyc file is not so directly as .py file, but the user can also easily guest the detail of

Re: Encryption with Python?

2005-05-07 Thread Robert Kern
Anthra Norell wrote: > Thanks a lot for the feedback. This is certainly a great learning > experience. It's a fascinating topic too. Without wishing to annoy, I'd be > interested in knowing more. I insert questions below. > > - Original Message - > From: "Robert Kern" <[EMAIL PROTECTED]> >

Outlook-Python Issue

2005-05-07 Thread Vijay Chandra Sekhar Parepalli
Hi there,     Can any one please help in getting me Python-Outlook programming issue clarified.   I just wanted to do the following using Python: 1)Open a New Oulook Mail Window 2) Fill the field: to-email address and Write some body to it.(I DON’t want to send it automatically

RE: Array programming

2005-05-07 Thread Vijay Chandra Sekhar Parepalli
Thank you, Sakesun. -Original Message- From: Sakesun Roykiattisak [mailto:[EMAIL PROTECTED] Sent: Saturday, May 07, 2005 12:17 PM To: V.C.Sekhar Cc: python-list@python.org Subject: Re: Array programming V.C.Sekhar wrote: >Hi there, > I couldnt get to do the following task using Pyth

Re: Encryption with Python?

2005-05-07 Thread Sergei Organov
"Anthra Norell" <[EMAIL PROTECTED]> writes: > Thanks a lot for the feedback. This is certainly a great learning > experience. It's a fascinating topic too. Without wishing to annoy, I'd be > interested in knowing more. I insert questions below. There is a lot of information about the issues on th

Need help subclassing Borg

2005-05-07 Thread Steven D'Aprano
I've been working with the Borg design pattern from here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531 and I'm having problems subclassing it. I'm a newbie, so I've probably missed something obvious. I want two Borg-like classes where all instances share state within each class,

Re: Q: The `print' statement over Unicode

2005-05-07 Thread François Pinard
[Thomas Heller] > François Pinard <[EMAIL PROTECTED]> writes: > > [...] given file `question.py' with this contents: > ># -*- coding: UTF-8 -*- > >texte = unicode("Fran\xe7ois", 'latin1') > >print type(texte), repr(texte), texte > >print type(texte), repr(texte), str(texte) > > d

Re: Encryption with Python?

2005-05-07 Thread Jim
What machine did you say that was, again? Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption with Python?

2005-05-07 Thread Anthra Norell
Thanks a lot for the feedback. This is certainly a great learning experience. It's a fascinating topic too. Without wishing to annoy, I'd be interested in knowing more. I insert questions below. - Original Message - From: "Robert Kern" <[EMAIL PROTECTED]> To: Sent: Saturday, May 07, 2005

Re: handling more databases with ZEO

2005-05-07 Thread Simon Percivall
You should take a look at http://www.zope.org/Wikis/ZODB/FrontPage/guide/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption with Python?

2005-05-07 Thread Robert Kern
Anthra Norell wrote: > I rolled my own for relatively short sequences, like passwords. The key is > an integer. To decrypt use the negative encryption key. I consider the > encryption unbreakable, as it is indistinguishable from a random sequence. > > Frederic > > ### > > def crypt (sequence, ke

Re: py2exe + svn - the final drama

2005-05-07 Thread Just
In article <[EMAIL PROTECTED]>, David Bolen <[EMAIL PROTECTED]> wrote: > Just <[EMAIL PROTECTED]> writes: > > > the zipimport module has an attr called _zip_directory_cache, which is a > > dict you can .clear(). Still, reloading modules is hairy at best, its > > probably easiest to relaunch yo

Re: Encryption with Python?

2005-05-07 Thread Paul Rubin
"Anthra Norell" <[EMAIL PROTECTED]> writes: > I rolled my own for relatively short sequences, like passwords. The > key is an integer. To decrypt use the negative encryption key. I > consider the encryption unbreakable, as it is indistinguishable from > a random sequence. You're using the built-in

Re: Encryption with Python?

2005-05-07 Thread Anthra Norell
I rolled my own for relatively short sequences, like passwords. The key is an integer. To decrypt use the negative encryption key. I consider the encryption unbreakable, as it is indistinguishable from a random sequence. Frederic ### def crypt (sequence, key): import random sign = (key > 0

  1   2   >