Re: Python Web Servers and Page Retrievers

2007-04-11 Thread Collin Stocks
I tried it, and when checking it using a proxy, saw that it didn't really work, at least in the version that I have (urllib v1.17 and urllib2 v2.5). It just added that header onto the end, therefore making there two User-Agent headers, each with different values. I might add that my script IS able

Re: Can we make a local variable in a function as global variable???

2007-04-05 Thread Collin Stocks
le more like classes. I suppose you wouldn't like me to post my own (somewhat buggy) module that allows you to import modules as new type classes? On 4/5/07, Steve Holden <[EMAIL PROTECTED]> wrote: Collin Stocks wrote: > As for me, I find this problem annoying, but easy to so

Re: way to extract only the message from pop3

2007-04-05 Thread Collin Stocks
I only put None there so that the colon would be more visible: in some browser fonts, [value:] looks the same as [value] On 4/5/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Thu, 05 Apr 2007 15:09:18 -0300, Collin Stocks <[EMAIL PROTECTED]> escribió: > message=whole_mess

Re: Can we make a local variable in a function as global variable???

2007-04-05 Thread Collin Stocks
As for me, I find this problem annoying, but easy to solve. My solution is: this=__import__(__name__) To set global variable spam to 4, I say: this.spam=4 This always works, and is much more convenient than: global spam spam=4 and then worry about local variables also named spam. On

Re: Looping issues

2007-04-05 Thread Collin Stocks
That *shouldn't* be the problem, since files are iterable On 5 Apr 2007 11:18:50 -0700, anglozaxxon <[EMAIL PROTECTED]> wrote: On Apr 5, 2:01 pm, [EMAIL PROTECTED] wrote: > What I am trying to do is compare two files to each other. > > If the 2nd file contains the same line the first file conta

Re: Looping issues

2007-04-05 Thread Collin Stocks
I don't know what is wrong with your code yet, but first you should clean it up. Either replace those backslashes with forward slashes, or put r before the first quote in the path string. This prevents special characters from being evaluated as such. Second, you should debug a little. Feel free t

Re: way to extract only the message from pop3

2007-04-05 Thread Collin Stocks
so get two strings: only headers, and the whole message. find the length of the headers, and chop that off the beginning of the whole message: message=whole_message[len(headers):None] You can omit the word None: it is just there for clarity purposes. On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL

Re: Direct memory access

2007-03-07 Thread Collin Stocks
One last thing. Does anyone know how to take a python object and measure how much space it is taking up in memory? I'm thinking probably not, but it's worth asking. -- http://mail.python.org/mailman/listinfo/python-list

Re: Direct memory access

2007-03-07 Thread Collin Stocks
Thanks. I didn't know about ctypes. -- http://mail.python.org/mailman/listinfo/python-list

Direct memory access

2007-03-06 Thread Collin Stocks
Does anyone know how to directly handle memory using python? I want to be able, for example, to copy the actual contents of a memory address, or set the actual contents of a memory address. Here is an example of what I would like to be able to do: num=12 addr=id(num) contents=(hex(addr)).read(2)

Re: os.popen() not executing command on windows xp

2007-01-11 Thread Collin Stocks
I have no clue what is wrong. If all else fails, use os.system() instead of os.popen(). Pipes tend not to always work in windows. -- http://mail.python.org/mailman/listinfo/python-list

I will be proposing this PEP

2007-01-05 Thread Collin Stocks
Attached is a PEP which I will be proposing soon. If you have any questions, comments, or suggestions, please email them to me with the subject "Adding Built-in Class Attributes PEP" PEP: XXX Title: Adding Built-in Class Attributes Version: $Revision$ Last-Modified: $Date$ Author: Col