Re: Exec Statement Question

2007-04-08 Thread Gabriel Genellina
7stud wrote: > On Apr 8, 11:31 pm, "Gregory Piñero" <[EMAIL PROTECTED]> wrote: > > Is there a way to call exec such that it won't have access to any more > > objects than I explicitly give it? > > I think the way it works is that when the def is parsed, a function > object is created and assigned t

Re: Exec Statement Question

2007-04-08 Thread Alex Martelli
Gregory Piñero <[EMAIL PROTECTED]> wrote: > I'm curious why this code isn't working how I expect it to: > > import sys > d=3 > > def func1(a,b,c): > print a,b,c,d > print sys.path > > exec "func1(1,2,3)" in {'func1':func1} > > > returns: > 1 2 3 3 > [ sys.path stuff ] > > Sin

Re: Exec Statement Question

2007-04-08 Thread 7stud
On Apr 8, 11:31 pm, "Gregory Piñero" <[EMAIL PROTECTED]> wrote: > I'm curious why this code isn't working how I expect it to: > > import sys > d=3 > > def func1(a,b,c): > print a,b,c,d > print sys.path > > exec "func1(1,2,3)" in {'func1':func1} > > > returns: > 1 2 3 3 > [ sys.path stu

Re: Exec Statement Question

2007-04-08 Thread Georg Brandl
Gregory Piñero schrieb: > I'm curious why this code isn't working how I expect it to: > > import sys > d=3 > > def func1(a,b,c): > print a,b,c,d > print sys.path > > exec "func1(1,2,3)" in {'func1':func1} > > > returns: > 1 2 3 3 > [ sys.path stuff ] > > Since I'm telling exec

Re: Crypto Suggestion/Help

2007-04-08 Thread Thomas Krüger
Jimmy E Touma schrieb: > I need some advise on doing the following. I have a Linux application > that allows users to access it via a code (password). At the end of the > day, I gather a log of activities of the users and zip the file and > would like to encrypt it so that the users can not access

Weekly Python Patch/Bug Summary

2007-04-08 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 349 open ( +7) / 3737 closed (+25) / 4086 total (+32) Bugs: 939 open (-12) / 6648 closed (+60) / 7587 total (+48) RFE : 249 open ( -8) / 278 closed (+12) / 527 total ( +4) New / Reopened Patches __ Python 2.

Exec Statement Question

2007-04-08 Thread Gregory Piñero
I'm curious why this code isn't working how I expect it to: import sys d=3 def func1(a,b,c): print a,b,c,d print sys.path exec "func1(1,2,3)" in {'func1':func1} returns: 1 2 3 3 [ sys.path stuff ] Since I'm telling exec to operate only within the context of the dictionary I gi

Re: tuples are useless???

2007-04-08 Thread James Stroud
Steven D'Aprano wrote: > On Mon, 09 Apr 2007 02:26:37 +, James Stroud wrote: > >> Bart Willems wrote: >>> James Stroud wrote: ... It boils down to the fact that tuples are useless as a result unless you know you really need them--and you never really NEED them. >>> Could you clarify

Re: shelve error

2007-04-08 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: ... > In my opinion, the most valuable thing you could do for a next > printing would be to expand the index to 3 times its current length. Suggest that to O'Reilly: they're the one who prepare the index, not me; I only get to point out errors I may notice on it

Re: shelve error

2007-04-08 Thread 7stud
> Discussion subject changed to "Python universal build, OSX 10.3.9 and > undefined symbols when > linking" by David Pratt What gives? How come you can change the title of my thread? On Apr 8, 8:14 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > But if you open an errata for the missing explana

Re: python, wxpython and Mac OS X

2007-04-08 Thread 7stud
On Apr 8, 8:46 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > Why 2.4.4 instead of the official 2.5 binary fromwww.python.org? > > http://www.python.org/download/ > 1) On some download page that listed both python 2.5 and 2.4, it said that python 2.4 had more packages/modules avail

Re: Crypto Suggestion/Help

2007-04-08 Thread Paul Rubin
Jimmy E Touma <[EMAIL PROTECTED]> writes: > I need some advise on doing the following. I have a Linux application > that allows users to access it via a code (password). At the end of the > day, I gather a log of activities of the users and zip the file and > would like to encrypt it so that the us

Re: tuples are useless???

2007-04-08 Thread Steven D'Aprano
On Mon, 09 Apr 2007 02:26:37 +, James Stroud wrote: > Bart Willems wrote: >> James Stroud wrote: >>> ... It boils down to the fact that tuples are useless as a result >>> unless you know you really need them--and you never really NEED them. >> >> Could you clarify that for me? I use tuples *

Re: Unicode problem

2007-04-08 Thread Martin v. Löwis
> Thanks! That's a nice little stumbling block for a newbie like me ;) Is > there a way to make utf-8 the default encoding for every string, so that > I do not have to encode each string explicitly? You can make sys.stdout encode each string with UTF-8, with sys.stdout = codecs.getwriter('utf-8

Crypto Suggestion/Help

2007-04-08 Thread Jimmy E Touma
Hi all, I need some advise on doing the following. I have a Linux application that allows users to access it via a code (password). At the end of the day, I gather a log of activities of the users and zip the file and would like to encrypt it so that the users can not access it or tamper with it.

Python universal build, OSX 10.3.9 and undefined symbols when linking

2007-04-08 Thread David Pratt
Hi. I am on a PPC and have been getting the same undefined symbols traceback when linking applications after compiling. A few weeks back I posted on a problem to pythonmac-sig@python.org after attempting to build mod_python, today its pylucene - same problem. I initially shrugged off the proble

Re: python, wxpython and Mac OS X

2007-04-08 Thread Robert Kern
7stud wrote: > Hi, > > I'm using an intel imac which came with python 2.3.5 pre-intstalled on > OS 10.4.7. I was able run a hello world wxPython script in Terminal > by typing: > > $pythonw wxPythonTest.py > > Yesterday, I installed python 2.4.4 which I downloaded from the > MacPython website,

Re: Why NOT only one class per file?

2007-04-08 Thread Chris Lasher
On Apr 4, 5:23 pm, "Chris Lasher" <[EMAIL PROTECTED]> wrote: > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file pe

python, wxpython and Mac OS X

2007-04-08 Thread 7stud
Hi, I'm using an intel imac which came with python 2.3.5 pre-intstalled on OS 10.4.7. I was able run a hello world wxPython script in Terminal by typing: $pythonw wxPythonTest.py Yesterday, I installed python 2.4.4 which I downloaded from the MacPython website, and it seems to have installed co

Re: tuples are useless???

2007-04-08 Thread James Stroud
Bart Willems wrote: > James Stroud wrote: >> ... It boils down to the fact that tuples are useless as a result >> unless you know you really need them--and you never really NEED them. > > Could you clarify that for me? I use tuples *a lot* and I really *NEED* > them - I'm building a lot of multi

Re: shelve error

2007-04-08 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: > On Apr 4, 10:22 pm, [EMAIL PROTECTED] wrote: > > how did you generate aaa.txt? > > Ok, I got it to work by supplying a filename that didn't previously > exist. Neither the book I am reading, "Beginning Python: From Novice > to Professional" nor the book I am us

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread Alex Martelli
Lorenzo <[EMAIL PROTECTED]> wrote: ... > > > elapsedTime = mydata[1] > > > index = elapsedTime.find("real") > > > # the index will have a value 0f 110 > > > totaltime = elapsedTime[index:] ... > Oops! I sent the wrong piece of code. The above is actually the work > around which actually

Re: tuples, index method, Python's design

2007-04-08 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I think the problem is that Python developers are split between those who > see tuples as immutable lists, and those who see them as records/structs. I think the construction def f(*a): ... shows that the "immutable list" interpretation is firmly

Re: tuples, index method, Python's design

2007-04-08 Thread Steven D'Aprano
On Sun, 08 Apr 2007 20:10:21 -0400, Carsten Haese wrote: > On Sun, 2007-04-08 at 13:10 -0700, Paul Rubin wrote: >> Carsten Haese <[EMAIL PROTECTED]> writes: >> > > Do you not see the gratuituous inconsistency between tuples and lists >> > > as a useless feature? What is the use case for keeping i

Re: Why does not my wx.html.HtmlWindow work?

2007-04-08 Thread [EMAIL PROTECTED]
On Apr 9, 1:01 am, Rob Williscroft <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote innews:[EMAIL PROTECTED] > comp.lang.python: > > > > > Below are my source code: > > > import wx > > import wx.html > > > class MyHtmlFrame(wx.Frame): > > > def __init__(self, parent, title): > > wx.

Re: tuples, index method, Python's design

2007-04-08 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > Will tuples also get a sort method? What about append and extend? pop? > __iadd__? __delslice__? They are immutable so they won't get .sort() etc. sorted(...) already works on them. > How many brain cells are actually freed up by not having to remember

Re: tuples, index method, Python's design

2007-04-08 Thread Carsten Haese
On Sun, 2007-04-08 at 13:10 -0700, Paul Rubin wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > > Do you not see the gratuituous inconsistency between tuples and lists > > > as a useless feature? What is the use case for keeping it? > > > > When a new feature is requested, the burden of proo

Re: how to remove multiple occurrences of a string within a list?

2007-04-08 Thread Paul McGuire
On Apr 3, 3:47 pm, [EMAIL PROTECTED] wrote: > Beware that converting a list to set and then back to list won't > preserve the order of the items, because the set-type loses the order. Also beware that this conversion will remove duplicates, so that if 'haha' is in the original list multiple times,

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread Lorenzo
In article <[EMAIL PROTECTED]>, Georg Brandl <[EMAIL PROTECTED]> wrote: > Lorenzo schrieb: > > >> > How do I go about it? > >> > >> Do it correctly. Post your actual example that fails > >> and the related error message. Possibnly your indexes > >> were out of range. > >> > >> > I googled this

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread Lorenzo
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 8, 12:29�pm, Lorenzo <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > > > > > > > > > > > >  "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > On Apr 8, 11:34?am, Lorenzo Thurman <[EMAIL P

Re: tuples are useless???

2007-04-08 Thread Bart Willems
James Stroud wrote: > ... It boils down to the fact that tuples are useless as a > result unless you know you really need them--and you never really NEED > them. Could you clarify that for me? I use tuples *a lot* and I really *NEED* them - I'm building a lot of multi-tier reports where detail-

Debugging doctest failures

2007-04-08 Thread Eric Mahurin
Noob here. Just got into python a little over a week ago... One of the (unique?) things I really like about python is the concept of doctesting. But, now I want more! Here's what I'd like to see: * easy debugging. As soon as there is a failure (unexpected exception or mismatch), drop down int

Re: Python Web Servers and Page Retrievers

2007-04-08 Thread Max Erickson
Subscriber123 <[EMAIL PROTECTED]> wrote: > urllib, or urllib2 for advanced users. For example, you can > easily set your own headers when retrieving and serving pages, > such as the User-Agent header which you cannot set in either > urllib or urllib2. Sure you can. See: http://www.diveintopython

Re: how to remove multiple occurrences of a string within a list?

2007-04-08 Thread Alex Martelli
Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: ... > I am getting varying results on my system on repeated runs. What about > itertools.ifilter()? Calling itertools.ifilter returns an iterator; if you never iterate on that iterator, that, of course, is going to be very fast (O(1), since it does no

Python Web Servers and Page Retrievers

2007-04-08 Thread Subscriber123
I wrote most of the following script, useful for retrieving pages from the web and serving web pages. Since it is so low level, it is much more customizable than simpleHTTPserver, cgiHTTPserver, urllib, or urllib2 for advanced users. For example, you can easily set your own headers when retrieving

Re: Unicode problem

2007-04-08 Thread Rehceb Rotkiv
On Sat, 07 Apr 2007 12:46:49 -0700, Gabriel Genellina wrote: > You have to encode the Unicode object explicitely: print > fileString.encode("utf-8") > (or any other suitable one; I said utf-8 just because you read the input > file using that) Thanks! That's a nice little stumbling block for a new

getting button's coordinations

2007-04-08 Thread gslm
Hi, I want to use a button's coordinations for my application.It's necessary for determinig an area for ImageGrab function.Because all widgets are on a button.And I want to have this screenshot and save it as image file. Or is there any command which print all of the view of button(all the compone

Re: RFC: Assignment as expression (pre-PEP)

2007-04-08 Thread Dustan
On Apr 8, 10:56 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Dustan <[EMAIL PROTECTED]> wrote: > > >>> class Wrapper(object): > > def __init__(self, obj): > > self.obj = obj > > def getit(self): > > return self.obj > > def setit(self, obj): > >

Re: What happened to http://www.pythonware.com/daily and http://mechanicalcat.net/pyblagg.html?

2007-04-08 Thread Fuzzyman
On Apr 7, 3:44 pm, "asker" <[EMAIL PROTECTED]> wrote: > These sites are not updated since almost one month. > Does anybody knows why? I assume the pythonware folk are busy. I notice that Fredrik Lundh hasn't blogged for some time either. Fuzzyman http://www.voidspace.org.uk/ironpython/index.shtml

Re: tuples, index method, Python's design

2007-04-08 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > > Do you not see the gratuituous inconsistency between tuples and lists > > as a useless feature? What is the use case for keeping it? > > When a new feature is requested, the burden of proof is on the requester > to show that it has uses. The use case

Re: tuples, index method, Python's design

2007-04-08 Thread Carsten Haese
On Sun, 2007-04-08 at 07:51 -0700, Paul Rubin wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > > Maybe we can add such methods to the PyPy tuples for some time, to > > > experimentally see if they make the language worse :-) > > > > Adding useless features always makes a product worse. What'

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread [EMAIL PROTECTED]
On Apr 8, 12:29�pm, Lorenzo <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > > > > > > �"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > On Apr 8, 11:34?am, Lorenzo Thurman <[EMAIL PROTECTED]> > > wrote: > > > I have tuple which hold a string in tup[0]. I want to get a slice of > >

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread [EMAIL PROTECTED]
On Apr 8, 12:29�pm, Lorenzo <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > > > > > > �"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > On Apr 8, 11:34?am, Lorenzo Thurman <[EMAIL PROTECTED]> > > wrote: > > > I have tuple which hold a string in tup[0]. I want to get a slice of > >

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread Georg Brandl
Lorenzo schrieb: >> > How do I go about it? >> >> Do it correctly. Post your actual example that fails >> and the related error message. Possibnly your indexes >> were out of range. >> >> > I googled this and found a couple >> > of references, but no solution. >> >> Well, there wouldn't be a s

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread Lorenzo
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 8, 11:34?am, Lorenzo Thurman <[EMAIL PROTECTED]> > wrote: > > I have tuple which hold a string in tup[0]. I want to get a slice of > > that string. I thought I would do something like: > > tup[0][start:end] >

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread Lorenzo
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Apr 8, 11:34?am, Lorenzo Thurman <[EMAIL PROTECTED]> > wrote: > > I have tuple which hold a string in tup[0]. I want to get a slice of > > that string. I thought I would do something like: > > tup[0][start:end] >

Re: block scope?

2007-04-08 Thread Georg Brandl
Alex Martelli schrieb: > Paul Rubin wrote: > >> [EMAIL PROTECTED] (Alex Martelli) writes: >> > > exec? >> > option 1: that just runs the compiler a bit later ... >> >> Besides exec, there's also locals(), i.e. >>locals['x'] = 5 >> can shadow a variable. Any bad res

Re: Why does not my wx.html.HtmlWindow work?

2007-04-08 Thread Rob Williscroft
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Below are my source code: > > import wx > import wx.html > > class MyHtmlFrame(wx.Frame): > > def __init__(self, parent, title): > wx.Frame.__init__(self, parent, -1, title, size=(600,400)) > html = wx

Re: How do I get a slice of a string held in a tuple?

2007-04-08 Thread [EMAIL PROTECTED]
On Apr 8, 11:34?am, Lorenzo Thurman <[EMAIL PROTECTED]> wrote: > I have tuple which hold a string in tup[0]. I want to get a slice of > that string. I thought I would do something like: > tup[0][start:end] > But this fails. No, it doesn't. >>> a = ('abcdefg','hijkl') >>> a[0] 'abcdefg' >>> a[0][1

Re: itertools, functools, file enhancement ideas

2007-04-08 Thread Paul Rubin
[EMAIL PROTECTED] writes: > >for block in f.iterchars(n=1024): ... > for block in iter(partial(f.read, 1024), ''): ... Hmm, nice. I keep forgetting about that feature of iter. It also came up in a response to my queue example from another post. > > a) def flip(f): return lambda x

How do I get a slice of a string held in a tuple?

2007-04-08 Thread Lorenzo Thurman
I have tuple which hold a string in tup[0]. I want to get a slice of that string. I thought I would do something like: tup[0][start:end] But this fails. How do I go about it? I googled this and found a couple of references, but no solution. TIA -- http://mail.python.org/mailman/listinfo/python-l

Re: starship.python.net is down

2007-04-08 Thread TimeHorse
On Feb 26, 4:46 pm, Tom Bryan <[EMAIL PROTECTED]> wrote: > Yes. Unfortunately, there may be a hardware problem. Stefan, the admin Any word from the ISP what the hardware problem might be, Tom? Jeffrey. -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools, functools, file enhancement ideas

2007-04-08 Thread rdhettinger
[Paul Rubin] > 1. File iterator for blocks of chars: > >f = open('foo') >for block in f.iterchars(n=1024): ... for block in iter(partial(f.read, 1024), ''): ... > iterates through 1024-character blocks from the file. The default iterator > a) def flip(f): return lambda x

Re: RFC: Assignment as expression (pre-PEP)

2007-04-08 Thread Alex Martelli
Dustan <[EMAIL PROTECTED]> wrote: > >>> class Wrapper(object): > def __init__(self, obj): > self.obj = obj > def getit(self): > return self.obj > def setit(self, obj): > self.obj = obj > return obj Yeah, that's substantialy

Re: tuples, index method, Python's design

2007-04-08 Thread Mel Wilson
7stud wrote: > On Apr 7, 8:27 am, Carsten Haese <[EMAIL PROTECTED]> wrote: >> Adding useless features always makes a product worse. What's your use >> case for tuple.index? > I'll trade you an index method for tuples for the whole complex number > facility. Actually, I've found the use cases for

Re: tuples, index method, Python's design

2007-04-08 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > > Maybe we can add such methods to the PyPy tuples for some time, to > > experimentally see if they make the language worse :-) > > Adding useless features always makes a product worse. What's your use > case for tuple.index? Do you not see the gratuitu

Re: tuples, index method, Python's design

2007-04-08 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Carsten Haese: > > Adding useless features always makes a product worse. What's your use > > case for tuple.index? > > Ruby is a bit younger than Python, it has shown that few things may be > better done in a different way. I think the Ruby way is just to add a ton of me

Re: Custom Python Runtime

2007-04-08 Thread gene tani
On Apr 6, 4:52 pm, "Jack" <[EMAIL PROTECTED]> wrote: > Since the full installation of Python (from either the standard installer or > ActiveState installer) is too big for my intended use, I'd like to build a > custom distribution of Python for Windows platform, omitting some lib files, > such as a

Re: Console UI

2007-04-08 Thread Grant Edwards
On 2007-04-08, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > "Clement" typed: > >> My project is based on console Application. Is there any >> console UI except urwid. If so, can i come to know. > > There is ``curses''. And newt (runs on top of slang). It's not well documented, but it is nice and

Re: RFC: Assignment as expression (pre-PEP)

2007-04-08 Thread Dustan
On Apr 5, 2:51 pm, [EMAIL PROTECTED] wrote: > I would like to gauge interest in the following proposal: > > Problem: > > Assignment statements cannot be used as expressions. > > Performing a list of mutually exclusive checks that require data > processing can cause excessive tabification. For exam

Re: Test Tube Zealots: The American Chemical Society Terminates the Membership of Chemists from Iran

2007-04-08 Thread frank.logullo
Sounds like a good idea to me. ACS is normally a left wing organization but if true, I applaud them for this. The only way the Iranian government problem is going to be rationally solved is from forces within. -- http://mail.python.org/mailman/listinfo/python-list

Re: Nice "bug" to loose a contest

2007-04-08 Thread aspineux
This code works like the python one, I dont use buffered stdio f... functions, but the more 'system call' read and write int main() { char buf[120]; int len; while (len=read(1, buf, sizeof(buf))) { write(1, buf, len); } return 0; } I dont understand what is appening,

Re: iterator interface for Queue?

2007-04-08 Thread Leo Kislov
On Apr 7, 11:40 pm, Paul Rubin wrote: > Is there any reason Queue shouldn't have an iterator interface? > I.e. instead of > > while True: >item = work_queue.get() >if item is quit_sentinel: ># put sentinel back so other readers can find it

Nice "bug" to loose a contest

2007-04-08 Thread stdazi
Hello, Yesterday, I was at a programming competition. We programmed on Linux liveCD's and Python was one of the allowed languages (among C and Java). I cared just about the algorithmic approach so I used Python. One of the main rules is, that the code reads its standard input and dumps the result

How to set program name in Python : success

2007-04-08 Thread aspineux
here is the trick I found # ( exec -a "pgm.py" python < pgm.py ) & # ps ax | grep pgm.py 22334 pts/2S+ 0:00 pgm.py this solution works on linux and probably all BSD too, but don't let specify any arguments. If someone know a better solution -- http://mail.python.org/mailman/list

Re: block scope?

2007-04-08 Thread Paddy
On Apr 7, 4:48 am, James Stroud <[EMAIL PROTECTED]> wrote: > Neal Becker wrote: > > One thing I sometimes miss, which is common in some other languages (c++), > > is idea of block scope. It would be useful to have variables that did not > > outlive their block, primarily to avoid name clashes. Th

Re: Newbie Question about sequence multiplication

2007-04-08 Thread lancered
On Apr 5, 12:19 am, "Scott" <[EMAIL PROTECTED]> wrote: > Alright, so I've been trying to teach myself Python which, when compared to > my attempt to learn C++, is going pretty well. > But I've come across an issue that I can't figure out, so I figured I'd ask > the pro's. > > Now it looks pretty we

Re: itertools, functools, file enhancement ideas

2007-04-08 Thread Alexander Schmolck
[EMAIL PROTECTED] (Alex Martelli) writes: > > 4. functools enhancements (Haskell-inspired): > >Let f be a function with 2 inputs. Then: > > a) def flip(f): return lambda x,y: f(y,x) > > b) def lsect(x,f): return partial(f,x) > > c) def rsect(f,x): return partial(flip(f), x)

Re: block scope?

2007-04-08 Thread Alexander Schmolck
Neal Becker <[EMAIL PROTECTED]> writes: > One thing I sometimes miss, which is common in some other languages (c++), > is idea of block scope. It would be useful to have variables that did not > outlive their block, primarily to avoid name clashes. This also leads to > more readable code. I h

Re: Hide the python-script from user

2007-04-08 Thread Sherm Pendley
[EMAIL PROTECTED] (Jason F. McBrayer) writes: > A determined and technically savvy user will surely find > the key (not least by debugging the start-script). ... and then write a patch that disables the key, and distribute that to a few million of his not so determined or savvy friends. > Basica

Re: Comments in ConfigParser module

2007-04-08 Thread Joel Granados
On 7 Apr 2007 13:19:06 -0700, Gabriel Genellina <[EMAIL PROTECTED]> wrote: Joel Andres Granados wrote: > The module also allows the comments to appear in the same line as the > "name = value" constructs. The only difference being that this is only > possible with ";" and not with "#" character

Re: Console UI

2007-04-08 Thread Ayaz Ahmed Khan
"Clement" typed: > My project is based on console Application. Is there any console UI > except urwid. If so, can i come to know. There is ``curses''. -- Ayaz Ahmed Khan Do what comes naturally now. Seethe and fume and throw a tantrum. -- http://mail.python.org/mailman/listinfo/python-list

Re: defining functions

2007-04-08 Thread rweth
Andre P.S Duarte wrote: > How do I define a function, then import it, without having to save it > in lib; like "C:\python25\lib". ? > The best way I have found (in windows ) for permanently extending your search path for modules is to create the file: package.pth and put your path/s in a line

Re: Hide the python-script from user

2007-04-08 Thread Jason F. McBrayer
hlubenow <[EMAIL PROTECTED]> writes: > Ok, but now I can offer a real secure solution: Nope. [snip] > Then you have to program a start-script, that reads in your script and the > decryption-key. The decryption-key must be encrypted too. Such a encrypted > key can be generated by the modules if

Re: Why does not my wx.html.HtmlWindow work?

2007-04-08 Thread [EMAIL PROTECTED]
On 4月8日, 下午2时29分, Thomas Krüger <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > html.LoadPage("http://www.pythonthreads.com/articles/python/incorporating-into-wxpyt...";) > > Quickshot: There's a space at the start of your URI. > > Thomas It seems it's not the problem. I

Re: How to tell when a file is opened

2007-04-08 Thread Tim Golden
momobear wrote: >> Will look into NTFS change journals when I get some spare time. > How can we get NTFS change journals? Is there any API for this purpose > or we could implement our own? > there're an api in windows help us montior file changes. > win32file.ReadDirectoryChangesW Don't know what

Re: Cant access http://cheeseshop.python.org/ or wiki

2007-04-08 Thread rweth
cyb wrote: > For some reason I can ping these two sites fine, but when I try to go to > them I cannot get to them. Normal python.org homepage works just fine. > This is preventing me from getting setuptools and using pyOpenGL =( > > I'm using COmcast in savannah, GA "It's the finest cheese sho