Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
ambda expression that calculates a constant based on an expression, rather than referring to the object itself? Can it be done? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
might be handy in certain situations. Suppose you need to provide a callback function with a fixed signature to some library routine. But you want to add extra contextual data to your callback. This just might be the ticket. Michael -- http://mail.python.org/mailman/listinfo/python-list

'normal' shell with curses

2008-03-03 Thread Michael Goerz
: \n"); sys.stderr.write(str(data)); finally: sleep(5) curses.endwin() Instead of scrolling, the program throws an exception. Any hints? Also, is there a way leave the curses output on the screen after curses.endwin(), instead of returning to the normal terminal without a trac

Re: 'normal' shell with curses

2008-03-03 Thread Michael Goerz
Miki wrote, on 03/03/2008 11:14 PM: > Hello Michael, > >> I'm trying to print out text in color. As far as I know, curses is the >> only way to do that (or not?). > On unix, every XTerm compatible terminal will be able to display color > using escape sequence. &

Re: 'normal' shell with curses

2008-03-04 Thread Michael Goerz
Thynnus wrote, on 03/04/2008 08:48 AM: > On 3/3/2008 9:57 PM, Michael Goerz wrote: >> Hi, >> >> I'm trying to print out text in color. As far as I know, curses is the >> only way to do that (or not?). So, what I ultimately want is a curses >> terminal th

Re: 'normal' shell with curses

2008-03-04 Thread Michael Goerz
Michael Goerz wrote, on 03/04/2008 12:05 PM: > Thynnus wrote, on 03/04/2008 08:48 AM: >> On 3/3/2008 9:57 PM, Michael Goerz wrote: >>> Hi, >>> >>> I'm trying to print out text in color. As far as I know, curses is >>> the only way to do that (or

popening a process in a specific working directory

2008-03-04 Thread Michael Torrie
pts the working directory as a parameter, changes the directory, then spawns the original program with the arguments. This works, but I'd like a better way. Michael -- http://mail.python.org/mailman/listinfo/python-list

Protocol for thread communication

2008-03-04 Thread Michael Torrie
ited. Are there any pythonic patterns people have developed for this. thanks. Michael -- http://mail.python.org/mailman/listinfo/python-list

ActiveX in Webpage?

2008-03-05 Thread Michael Wieher
Hello, I'm trying to design a python-based web-app from scratch, based on a standalone MFC application. Obviously I'll be wrapping a lot of C++ functionality in custom extensions, but is anyone aware of any documentation/techniques that could help me "drop" an ActiveX control into a webpage, and j

re: What is a class?

2008-03-05 Thread Michael Wieher
You import classes from modules. -- http://mail.python.org/mailman/listinfo/python-list

Py-Extension Irregularity

2008-03-06 Thread Michael Wieher
Observe. Python Code Snippet: ... 66 while i < (self.nPCodes): 67# print "%s:%s" % (self.nPCodes,i) 68 (c,l,sn,f,fn,sz) = tabmodule.getQuestion(i,self.mx3Path) 69 if _debug and sz>0: 70 _newPtrLoc = tabmodule.get

Re: Py-Extension Irregularity

2008-03-06 Thread Michael Wieher
ry time I call the funct. Thanks for pointing out that bit of confusion =) 2008/3/6, Gabriel Genellina <[EMAIL PROTECTED]>: > > En Thu, 06 Mar 2008 13:54:44 -0200, Michael Wieher > <[EMAIL PROTECTED]> escribi�: > > > > Observe. > > > > Python

Fwd: OT: Failed saving throw

2008-03-06 Thread Michael Wieher
build a tomb? ...or raid one? -- Forwarded message -- From: Aahz <[EMAIL PROTECTED]> Date: 5 Mar 2008 07:36:37 -0800 Subject: OT: Failed saving throw To: [email protected] For anyone who hasn't heard, E. Gary Gygax died yesterday. Some people think we should build a tomb in

Re: Please keep the full address

2008-03-07 Thread Michael Wieher
I normally find this kind of back & forth useless and annoying spam but the irony is too much to avoid commenting. (read the following, then ...) > > > > "His" posts? > > > > Whatever. I'm too old to worry about searching for politically correct, > > gender neutral pronouns. > > > I'm pretty sur

Re: hidden built-in module

2008-03-07 Thread Michael Wieher
2008/3/7, koara <[EMAIL PROTECTED]>: > > On Mar 5, 1:39 pm, gigs <[EMAIL PROTECTED]> wrote: > > koara wrote: > > > Hello, is there a way to access a module that is hidden because > > > another module (of the same name) is found first? > > > > > More specifically, i have my own logging.py module, an

Re: Regarding coding style

2008-03-07 Thread Michael Wieher
Placing 2 spaces after a period is standard, grammatically correct English, at least as I was taught... I don't know who Strunk or White are. Maybe Mr. Pink has a book you can refer to instead. 2008/3/7, K Viltersten <[EMAIL PROTECTED]>: > > I've been recommended reading of: > http://www.python.

Re: I cannot evaluate this statement...

2008-03-07 Thread Michael Wieher
The parentheses are there for a reason 2008/3/7, Steven D'Aprano <[EMAIL PROTECTED]>: > > On Fri, 07 Mar 2008 12:38:11 -0800, waltbrad wrote: > > > The script comes from Mark Lutz's Programming Python. It is the second > > line of a script that will launch a python program on any platform. > > >

Re: os.chdir

2008-03-07 Thread Michael Wieher
/listinfo/python-list > >>> os.getcwd() '/home/michael' >>> os.chdir("/home/") >>> os.getcwd() '/home I guess just be sure your user account has rights to the directory you're trying to change to and don't screw up the quotes? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Help Building PythonQt on Windows

2008-03-09 Thread Michael Wieher
2008/3/9, Jeff Schiller <[EMAIL PROTECTED]>: > > Hello, I'm creating an application using Qt (4.4 Beta atm). I have pretty > close to zero experience with Python (consisting of installing the > Python interpreter, downloading a python programming and executing it > on the command-line). > > I

BitVector read-from-file Question

2008-03-10 Thread Michael Wieher
I'm trying to read in data from large binary files using BitVector (thanks btw, for whoever mentioned it on the list, its nice) I'll be reading the data in as requested by the user, in (relatively) small chunks as needed. Problem is I can't read the whole file in at once (its ridiculously large)

Re: Obtaining the PyObject * of a class

2008-03-11 Thread Michael Wieher
2 things: 1st. there is a python mailing list for people interested in C++ extension type stuff 2nd. SWIG is useless and overly complicated, its much easier to just generate your own C++ code by hand, less confusion, and much more clarity. I find no value in using anything else. People complain ab

Re: List Combinations

2008-03-12 Thread Michael Wieher
2008/3/12, Gerdus van Zyl <[EMAIL PROTECTED]>: > > I have a list that looks like this: > [['3'], ['9', '1'], ['5'], ['4'], ['2', '5', '8']] > > how can I get all the combinations thereof that looks like as follows: > 3,9,5,4,2 > 3,1,5,4,2 > 3,9,5,4,5 > 3,1,5,4,5 > etc. > > Thank You, > Gerdus > > -

Re: Does __import__ require a module to have a .py suffix?

2008-03-12 Thread Michael Wieher
2008/3/12, mrstephengross <[EMAIL PROTECTED]>: > > Hi all. I've got a python file called 'foo' (no extension). I want to > be able to load it as a module, like so: > > m = __import__('foo') > > However, the interpreter tells me "No module named foo". If I rename > it foo.py, I can indeed import i

string / split method on ASCII code?

2008-03-12 Thread Michael Wieher
Hey all, I have these annoying textilfes that are delimited by the ASCII char for << (only its a single character) and >> (again a single character) Their codes are 174 and 175, respectively. My datafiles are in the moronic form X<>Z I need to split on those freaking characters. Any tips on h

(off-topic) JS/DHTML export to XLS format?

2008-03-13 Thread Michael Wieher
Anyone use/know of anything looks like a spreadsheet, lives in a web-browser and can export to XLS format? -- http://mail.python.org/mailman/listinfo/python-list

Re: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Michael Wieher
2008/3/13, Robert Rawlins <[EMAIL PROTECTED]>: > > Hi Guys, > > Well thanks for the response, I followed your advice and chopped out all > the > crap from my class, right down to the bare __init__ and the setter method, > however, the problem continued to persist. > > However, Robert mentioned some

Re: find string in file

2008-03-14 Thread Michael Wieher
2008/3/14, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Hi friends !! > > I'm neophite about python, my target is to create a programa that > find a specific string in text file. > How can do it? > > Thanks > fel > > -- > http://mail.python.org/mailman/listinfo/python-list > If your only goal is to

Re: request for Details about Dictionaries in Python

2008-03-14 Thread Michael Wieher
2008/3/14, Gerardo Herzig <[EMAIL PROTECTED]>: > > Saideep A V S wrote: > > >Hello Sir, > > > > Thank You a ton. I was looking for this function. As far what I've > >understood from the "Shelve" module is that, there would be no memory > >wastage and the whole transactions would be done from and

Re: Urgent : How to do memory leaks detection in python ?

2008-03-14 Thread Michael Wieher
2008/3/14, Pradeep Rai <[EMAIL PROTECTED]>: > > Dear All, > > I am working on the python tools that process a huge amount of GIS data. > These tools encountering the problem of memory leaks. > > Please suggest what are the different ways to detect the memory leaks in > python ? > > This is very cri

Re: Why doesn't xmlrpclib.dumps just dump an empty value instead of ?

2008-03-16 Thread Michael Wieher
2008/3/16, martin f krafft <[EMAIL PROTECTED]>: > > Hi, > > xmlrpclib.dumps((None,), allow_none=True) yields > > '\n\n\n\n' > > Why doesn't it just yield > > '\n\n\n\n' > > Or even just > > '\n\n\n' > > Those are valid XML and valid XML-RPC, but isn't. > > Thanks for any thoughts... > > > --

Re: Cannot build Python 2.4 SRPM on x64 platform

2008-03-16 Thread Michael Wieher
Sorry I don't have much of a better idea, but if I had this kind of problem with an RPM, I'd just grab the tarball and start hacking away at ./configure pre-requirements, trying to use --options to trim it down to the bare minimal and see if I can get it to load up. 2008/3/16, Eric B. <[EMAIL PROT

Re: Advantage of the array module over lists?

2008-03-16 Thread Michael Wieher
I believe the array module provides more functionality than lists. Perhaps this extra functionality comes with... overhead? C'est possible. For example, you can declare an array to contain all items of a type, ie: >>array.array('f')#array of floats So, they might be efficient, in that they'r

Re: Pycon disappointment

2008-03-16 Thread Michael Wieher
2008/3/16, Aaron <[EMAIL PROTECTED]>: > > > > In my opinion, open spaces should have had greater status and billing, > > with eyes-forward talks and vendor sessions offered only as possible > > alternatives. Especially, vendor sessions should not be presented as > > "keynotes" during plenary sessi

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread Michael Wieher
try twiddling the unpack prefix, they're probably stored in different binary formats on the disk... on the struct helppage, is a list of prefixes, can be like unpack('=HI',data) unpack('@HI',data) etc... find out which one works on each machine 2008/3/16, jasonwiener <[EMAIL PROTECTED]>: > > H

Re: Strange problem with structs Linux vs. Mac

2008-03-16 Thread Michael Wieher
you can specifify which encoding when you unpack the struct, so just try them till it works, or read the specs on the mac.. i find it quicker to try, there's only 4-5 2008/3/16, sturlamolden <[EMAIL PROTECTED]>: > > On 16 Mar, 18:23, "Martin Blume" <[EMAIL PROTECTED]> wrote: > > > This seems to im

Re: Pycon disappointment

2008-03-16 Thread Michael Wieher
well, like, at least he left a free copy of his book on the web, that was kinda decent. 2008/3/16, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > On Mar 16, 2:43 pm, Robert Hicks <[EMAIL PROTECTED]> wrote: > > On Mar 16, 12:38 pm, [EMAIL PROTECTED] wrote: > > > > > On Mar 16, 6:10 am, Bruce Eckel <[EM

Apache binary error?

2008-03-17 Thread Michael Wieher
have simple webpage running apache, mod_python the error is binary ...binary as in "every other" time I load the page, Firefox keeps telling me I'm downloading a python script, and asks to open it in WINE, which is really strange. then, alternately, it loads the page just fine. any clues as

Re: Missing PyObject definition

2008-03-17 Thread Michael Wieher
2008/3/17, James Whetstone <[EMAIL PROTECTED]>: > > I'm trying to access a PyObject directly from C++ for the purpose of > calling > method on a Python object that is an intance of a derived C++ class. My > problem is that the compiler is complaining about not PyObject not being > defined. Has any

Re: Missing PyObject definition

2008-03-17 Thread Michael Wieher
2008/3/17, James Whetstone <[EMAIL PROTECTED]>: > > Hi, > > Yeah, I've included python.h and object.h but the compiler still complain > about not finding PyObject. It's weird.So I'm developing and App on > windows using VS 8.0. I've intalled Python 2.5 and have added the include > directory t

Re: struct unpack

2008-03-17 Thread Michael Wieher
> > testValue = '\x02\x00' > junk = struct.unpack('h', testValue) #Works > > testValue = raw_input("Enter Binary Code..:") inputting at the > console '\x02\x00' > junk = struct.unpack('h', testValue) > > error: unpack requires a string argument of length 2 Well, it thinks the length of the test

Re: placing a Python com object into Excel

2008-03-17 Thread Michael Wieher
2008/3/17, Mathew <[EMAIL PROTECTED]>: > > Hi > I have seen examples from Mark Hammonds book where a Python COM object > is accessed from Excel with a VBA script. But, what if I want to Insert > a Python COM into the Sheet itself? > > When I try this, a list of available objects appear. But my obje

Re: Apache binary error?

2008-03-17 Thread Michael Wieher
17, Graham Dumpleton <[EMAIL PROTECTED]>: > > On Mar 18, 4:43 am, Sean Allen <[EMAIL PROTECTED]> wrote: > > On Mar 17, 2008, at 10:55 AM, Michael Wieher wrote: > > > > > have simple webpage running > > > > > apache,mod_python > > > > >

Re: Need Help Starting Out

2008-03-18 Thread Michael Mabin
Pylons is a Ruby on Rails-like web framework that allows you build dynamic web applications with a database backend. Here is a link to the Pylons web site: http://pylonshq.com/ On Tue, Mar 18, 2008 at 11:10 AM, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I would like to start using Python, but

Re: finding items that occur more than once in a list

2008-03-18 Thread Michael Mabin
How about using list comprehension? l1 = ["apples","apples","bananas","oranges","oranges","peaches"] s1 = set([x for x in l1 if l1.count(x) > 1]) On Tue, Mar 18, 2008 at 4:56 PM, sturlamolden <[EMAIL PROTECTED]> wrote: > On 18 Mar, 22:25, sturlamolden <[EMAIL PROTECTED]> wrote: > > > def nonun

Re: Python to C/C++

2008-03-19 Thread Michael Wieher
I think py2exe does this, but it might be a bit bloated 2008/3/19, Blubaugh, David A. <[EMAIL PROTECTED]>: > > To All, > > Has anyone worked with a translator that will translate python to c/c++ > source code? I know that there is already one translator of this nature > (shedskin > compiler) ou

Re: Deleting Microsoft access database

2008-03-20 Thread Michael Wieher
Are you going to be replacing it with a new database? Problem: Users are accessing the file. (as you said, users are opening in read-only) Solution: (assuming you will be using a new, better... anything is better than M$, database) --- put the new database online, redirect your users to hit the n

Re: Can I run a python program from within emacs?

2008-03-20 Thread Michael Wieher
Well, I suppose you could. But why bother with learing emacs when you'll have to switch to vim later anyway? 2008/3/20, jmDesktop <[EMAIL PROTECTED]>: > > Hi, I'm trying to learn Python. I using Aquamac an emac > implementation with mac os x. I have a program. If I go to the > command prompt a

Re: if __name__ == '__main__':

2008-03-20 Thread Michael Wieher
Well, consider this: you have a file named .py, built like this: ~ #!/usr/bin/python def : return if __name__=="__main__": print "Unit test" else: pass #module imported by another module/script ~~ If you type, on command line, >pytho

Issues with XMLTreeBuilder in cElementTree and ElementTree

2008-03-20 Thread Michael Becker
I had some xmls being output by an application whose formating did not allow for easy editing by humans so I was trying to write a short python app to pretty print xml files. Most of the data in these xml files is in the attributes so I wanted each attribute on its own line. I wrote a short app usi

Haskell vs ??

2008-03-20 Thread Michael Wieher
Just to help clear up my own understanding of this discussion, this is basically a language that obfuscates details and makes low-level decisions in a "average-best" way, and thus allows for lazy people to write kind of decent code quickly? -- http://mail.python.org/mailman/listinfo/python-list

putting text through pager

2008-03-20 Thread Michael Goerz
hat doesn't work however: first of all, it only flashes the text for a fraction of a second, and secondly, after I run the program my terminal is broken, not echoing whatever I type back to me. Any suggestions for putting text through a pager from Python? This is strictly on a linux sy

Re: Code folder with Emacs

2008-03-20 Thread Michael Wieher
I don't use emucks, but in vim its very simple. :set foldmethod=indent and instantly anything indented (ie: all python blocks) are folded. to unfold a fold zo to close an opened fold zc that outta be enough to get any fellow vim-heads going =) 2008/3/20, Grant Edwards <[EMAIL PROTECTED]>: > >

Re: putting text through pager

2008-03-20 Thread Michael Goerz
Michael Goerz wrote, on 03/20/2008 04:43 PM: > Hi, > > I'm trying to print some variable through a pager (i.e. 'less') on a > linux system. My attempt was this: > > > == snip here == > import subprocess > > def put_through_pager(displ

Re: How can I make a function equal to 0?

2008-03-21 Thread Michael Wieher
Well, you could have a variable f that points at a memory address, such that >>> def x(): ... return ... >>> x >>> x=0 >>> x 0 >>> but I don't really understand why/what you're trying to do 2008/3/21, Martin Manns <[EMAIL PROTECTED]>: > > Hi, > > Is there a way to create a function that is equ

Re: List question

2008-03-22 Thread Michael Wieher
If you can't laugh at your own stupidity, being a programmer will lead directly to insanity. =) 2008/3/22, Zentrader <[EMAIL PROTECTED]>: > > > No one meant to laugh at you. Your naivete was not obvious. FWIW, a > > sense of humor is a valuable possession in most Python-related > > conversations

Re: Does python hate cathy?

2008-03-23 Thread Michael Wieher
I changed the last few lines to read: 37 kalam.howMany() 38 c = Person('Catherine', 'F') 39 #cathy.sayHi() 40 #cathy.howMany() 41 #swaroop.sayHi() 42 #swaroop.howMany() 43 And I don't get the error. However if I change line 38 to read ca = Person('Catherine','F') It again initializes a

Re: Does python hate cathy?

2008-03-23 Thread Michael Wieher
> > > is that farnarkeling about in a __del__ method is *not* a good idea. Ok that having been said, is accessing an unbound variable of a class and using it to coordinate between instances of that class common practice? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dimensions of Arrays, Matrices

2008-03-26 Thread Michael Wieher
Google -> "matrix python" 1st response: http://www.python.org/community/sigs/retired/matrix-sig/ "The purpose of this SIG was to continue development of a Python matrix type. This effort succeeded and resulted in Numerical Python, a high-speed array language for Python" by f

Re: memory allocation for Python list

2008-03-26 Thread Michael Wieher
Just write it in C and compile it into a .so/pyd =) 2008/3/26, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > dmitrey: > > > As I have mentioned, I don't know final length of the list, but > > usually I know a good approximation, for example 400. > > > There is no reserve()-like method, but this is a

ANN: python-ldap-2.3.2

2008-03-26 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g.

Re: Some notes on a high-performance Python application.

2008-03-26 Thread Michael Ströder
ed systems at least since 1992, but I'd guess much longer... And in one of my projects a RDBMS-based queue was used for a PKI registration server (e.g. for handling the outbound CMP queue). IIRC Microsoft's Biztalk Server also stores inbound and outbound queues in its internal MS-SQ

Re: what does ^ do in python

2008-03-26 Thread Michael Wieher
On Wed, Mar 26, 2008 at 1:36 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson <[EMAIL PROTECTED]> > escribió: > > > HOw can we use express pointers as in C or python? > > File "english.py", line 345, in parse_sentence > raise ParserError,

How to convert latex-based docs written with Python 2.5 to 2.6 framework

2008-03-26 Thread Michael Ströder
HI! I had a look on how Doc/ is organized with Python 2.6. There are files with suffix .rst. Hmm... I'm maintaing existing docs for python-ldap which I might have to convert to the new concept in the long run. What's the recommended procedure for doing so? Any pointer? Cia

PyODBC Stored proc calling

2008-03-26 Thread Michael Owings
This is probably pretty late to be replying but I had the same problem. As it turns out, you just need to be sure you use the correct syntax to call the sproc: db_cur.execute( "{call test_bed(?)}", ('test data string') ) -- Teleoperate a roving mobile robot from the web: http://www.swampgas.com

Re: Help me on function definition

2008-03-28 Thread Michael Wieher
No problem... your def needs a colon.. def function(params): yours lacks it =) thats all On Fri, Mar 28, 2008 at 8:47 PM, aeneng <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I am just starting to use python in numerical cacluation. > I need you to help me to see what's wrong with the follo

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Michael Torrie
[email protected] wrote: > Thanks for the link but I don't want to do a make a python script as > an applicatin, I want to embedd python into a C++ app so thats the > reason why I have to compile Python. If you are embedding python, then all you have to do is stick the python mo

Re: Python 2.6.1 @executable_path

2009-01-11 Thread Michael Torrie
[email protected] wrote: > Thank you, I found PySys_SetPythonHome() to set the path where the lib > folder of Python is, but I guess they are not really implemented > because they are fixed compiled with an absolute path, aren't they? I'm afraid I'm not following you here. What

Re: Python 2.6.1 @executable_path

2009-01-11 Thread Michael Torrie
[email protected] wrote: > yeap, okay, its just the beginning so I didn't know that the framework > is still the dylib file. > Well, I only want to compile python and put the framework in the > subdirectory. Thats all. > And the current state is, that the framework is not found be

Re: can someone tell me why this doesn't work please python 3

2009-01-14 Thread Michael Hartl
garywood schrieb: def ask_ok(prompt, retries=4, complaint="Yes or no, please!"): while True: password = input("enter something") if password in ('y', 'ye', 'yes'): return True if password in ('n', 'no', 'nope'): return False retries = retries - 1 if ret

Re: lazy evaluation is sometimes too lazy... help please.

2009-01-16 Thread Michael Hartl
James Stroud schrieb: Ken Pu wrote: Hi, below is the code I thought should create two generates, it[0] = 0,1,2,3,4,5, and it[1] = 0,10,20,30,..., but they turn out to be the same!!! from itertools import * itlist = [0,0] for i in range(2): itlist[i] = (x+(i*10) for x in count()) print "what

Finding the full path of an executable

2009-01-16 Thread Michael Hoffman
Is there a portable way to find the full path of a filename that would be called by os.execvp()? Thanks, Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the full path of an executable

2009-01-16 Thread Michael Hoffman
Unknown wrote: On 2009-01-16, Michael Hoffman <[email protected]> wrote: Is there a portable way to find the full path of a filename that would be called by os.execvp()? Yes. Use os.path.abspath() on the name before you call it with os.execvp() That doesn't work: Python

python3.0 base64 error

2009-01-17 Thread yang michael
I use base64 module on python3.0 like: import base64 b="hello world" a=base64.b64encode(b) print(a) but when i run it,it catch a error: Traceback (most recent call last): File "/home/jackie-yang/yd5m19/pythonstudy/test.py", line 4, in a=base64.b64encode(b) File "/usr/local/lib/python3.0/

Re: Can I run an operation on an object's attribute when reading?

2009-01-19 Thread Michael Hartl
Phillip B Oldham schrieb: On Mon, Jan 19, 2009 at 12:15 PM, Chris Rebert wrote: Assuming I'm interpreting you correctly (you're going to have to use something like a getter): Thanks, but I'm looking for a way to do it *without* using a getter as I don't have easy access to the class (

Re: Dynamic methods and lambda functions

2009-01-24 Thread Michael Torrie
[email protected] wrote: > The attributes are right, but the getter are not working. The problem > is that the lambda function always execute the last parameter passed > for all instances of the methods. How could it be done the right way? Basically, don't use a lambda. Create a real, local clos

Re: Pythonic list/tuple/dict layout?

2009-01-25 Thread Michael Iatrou
nsider it more "clean", according to my personal aesthetic criteria. :> -- Michael Iatrou (yxzb) -- http://mail.python.org/mailman/listinfo/python-list

Re: Monitor a FTP site for arrival of new/updated files

2009-01-25 Thread Michael Iatrou
ge.net/ -- Michael Iatrou (idyz) -- http://mail.python.org/mailman/listinfo/python-list

Re: Ldap Extended Operation python

2009-01-26 Thread Michael Ströder
ject.whoami_s http://python-ldap.sourceforge.net/doc/html/ldap.html#ldap.LDAPObject.passwd There's no generic interface for ext. ops. yet. Feel free to contribute something like this. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Michael Torrie
jefm wrote: >> Hmm this works for me, >> it's a self compiled version: >> ~ $ python3 >> Python 3.0 (r30:67503, Dec 29 2008, 21:35:15) >> [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 > > You are running on Linux. Mine is on Windows. > Anyone else have this issue on Windows ? As Benjamin Kaplin

Re: is python Object oriented??

2009-01-29 Thread Michael Torrie
M Kumar wrote: > but still I am not clear of the execution of the code, when we write or > execute a piece of python code without defining class, predefined class > attributes are available (not all but __name__ and __doc__ are available). > does it mean anything to this topic. Is it necessory to h

Re: is python Object oriented??

2009-01-30 Thread Michael Torrie
Hung Vo wrote: > I'm new to Python and also wondering about OOP in Python. > > I want to justify the above question (is Python Object-Oriented?). > Does Python follow the concepts/practices of Encapsulation, > Polymorphism and Interface, which are quite familiar to Java > programmers? I'd say tha

Re: is python Object oriented??

2009-01-30 Thread Michael Torrie
Veerendra Ganiger wrote: > Python is not purely object oriented programming, because we can write > functions without any class. > You are right, predefined class attributes are available when we write or > execute a piece of python code without defining class, that means it's just > using objects

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
[email protected] wrote >> This allows people to meddle with internals, at their own risk, >> if it ends up being absolutely necessary. > > If it ends up being necessary, the class's design is flawed. (Though > in this case, the flaw is easily solved by simply providing a getter.) No the class

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
[email protected] wrote: >> To be clear, python does not force you to lay out your code according to >> some strict object-oriented paradigm. But Python itself is still purely >> object-oriented, as is your script when parsed. > > But it's only a faking, and things such as inheritance and > pol

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
Steve Holden wrote: > You can think what you like, but there is a fundamental difference > between methods of a class and functions of a module. Until you > appreciate that you will likely make mistakes. Don't worry, though, we > all learn from our mistakes. And this fundamental difference is? >F

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
[email protected] wrote: > More interestingly, though, most compilers translate C and C++ code to > assembler first. Does that mean that you can do object-oriented > programming, generic programming, and procedural programming in > assembler? > > Answer: No, but you can probably -- very clumsily

wxPython vs Glade?

2009-02-09 Thread Michael Pobega
I'm looking for opinions on the best toolkit for a beginner to use with wxPython. It doesn't necessarily need to be the most efficient toolkit, but something I can use for basic programs (a Twitter client, Wordpress blogging client, etc) just to learn Python. wxWidgets seems nice because it's port

Re: wxPython vs Glade?

2009-02-09 Thread Michael Pobega
On Mon, Feb 09, 2009 at 08:30:13AM -0500, Benjamin Kaplan wrote: > On Mon, Feb 9, 2009 at 8:23 AM, Michael Pobega wrote: > > > I'm looking for opinions on the best toolkit for a beginner to use with > > wxPython. It doesn't necessarily need to be the most efficient

Re: wxPython vs Glade?

2009-02-09 Thread Michael Torrie
Michael Pobega wrote: > I'm looking for opinions on the best toolkit for a beginner to use with > wxPython. It doesn't necessarily need to be the most efficient toolkit, > but something I can use for basic programs (a Twitter client, Wordpress > blogging client, etc

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Michael Crute
eful as of revision 27241 (2002-06-15). [1] http://www.python.org/dev/peps/pep-3108/ -mike -- Michael E. Crute http://mike.crute.org God put me on this earth to accomplish a certain number of things. Right now I am so far behind that I will never die. --Bill

building an extension module with autotools?

2008-12-03 Thread Michael George
Hello, (Please CC me in replies, as I am off-list) I'm building an application (a game) in python, with a single C module containing some performance-critical code. I'm trying to figure out the best way to set it up to build. Distutils seems to be designed only for building and distributing

Re: building an extension module with autotools?

2008-12-03 Thread Michael George
Gerhard Häring wrote: Michael George wrote: I've tried using automake, In my opinion, this is serious overkill. automake is good for making stuff work on a herd of different Unixen with various combinations of libc functions available etc. But for developing a Python extension, it do

Re: building an extension module with autotools?

2008-12-03 Thread Michael George
Martin v. Löwis wrote: I've tried using automake, however I'm worried about libtool not getting the options right while building my module. You should use python-config(1) to obtain the command line options necessary to build and link extension modules. HTH, Martin Sweet, I think th

Re: EBCDIC <--> ASCII

2008-12-04 Thread Michael Ströder
just trying to be a little more Pythonic and use that built in table. It's pythonic to implement a Unicode codec for unknown character tables. I've put these two on my web site: http://www.stroeder.com/pylib/encodings/ebcdicatde.py http://www.stroeder.com/pylib/encodi

using distutils to cross-compile extensions?

2008-12-04 Thread Michael George
Hi, Please CC me in replying as I am off list. I have an extension module that I've built using distutils. I wonder if it's possible to use distutils to cross-compile it for windows on my linux box, and whether the pain involved is great. Can anyone point me in the right direction? Thanks

Importing Version Specific Modules

2008-12-04 Thread Michael Crute
eferable? -- ____ Michael E. Crute http://mike.crute.org God put me on this earth to accomplish a certain number of things. Right now I am so far behind that I will never die. --Bill Watterson -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing Version Specific Modules

2008-12-04 Thread Michael Crute
On Thu, Dec 4, 2008 at 7:33 PM, <[EMAIL PROTECTED]> wrote: > Michael> try: >Michael> from string import Template >Michael> except ImportError: >Michael> from our.compat.string import Template > > This is "easier to ask forgivenes

Re: EBCDIC <--> ASCII

2008-12-05 Thread Michael Ströder
[EMAIL PROTECTED] wrote: On Dec 4, 4:45 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: I'm having a problem trying to use the codecs package to aid me in converting some bytes from EBCDIC into ASCII. Which EBCDIC variant? sEBCDIC = unicode(sSource, '

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-05 Thread Michael Mabin
Warren, weren't you aware that Python.org is now a church. So you can never live up to the standards of the Pythonista high priests. You can only ask a question or submit your comment then cower, hoping the pythonista high priests don't beat you with clubs for heresy. ;) 2008/12/4 Warren DeLa

Re: just got the g1

2008-12-11 Thread Michael Torrie
garywood wrote: > Hi > > Just got the G1, is their any way to get python running on the andriod > platform ? Nope. But some day when other languages are supported, Python will be high on the list. In the meantime, Android is java only. And no you can't use Jython because Android statically c

<    34   35   36   37   38   39   40   41   42   43   >