Re: html DOM

2008-03-29 Thread Michael Wieher
Was this not of any use? http://www.boddie.org.uk/python/HTML.html I think, since HTML is a sub-set of XML, any XML parser could be adapted to do this... I doubt there's an HTML-specific version, but I would imagine you could wrap any XML parser, or really, create your own that derives from the X

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Michael Wieher
to me it seems simple. C uses != why does C use != because its kind of hard to type the "equal with a slash" so if python is supposed to be a simple and easy to use language, use the simple and easy to understand, standard 'not-equal' operator... Idk, maybe there's more to it but simple is

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: 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,

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

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: 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: 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: 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: 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: 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]>: > >

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

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

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: 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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: "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

(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

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

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

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: 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

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: 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

Re: os.chdir

2008-03-07 Thread Michael Wieher
2008/3/7, Maryam Saeedi <[EMAIL PROTECTED]>: > > I have a problem using os.chdir on linux. What should I do if I want to > change to root directory? The below does not work: > > os.chdir("~/dir1") > > Thanks > > -- > http://mail.python.org/mailman/listinfo/python-list > >>> os.getcwd() '/home/micha

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: 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: 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: 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

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: python-list@python.org For anyone who hasn't heard, E. Gary Gygax died yesterday. Some people think we should build a tomb in

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

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: What is a class?

2008-03-05 Thread Michael Wieher
You import classes from modules. -- 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