On Wed, 22 Jun 2005 15:06:22 -0400
Python <[EMAIL PROTECTED]> wrote:
> On Wed, 2005-06-22 at 14:20 -0400, Don Parris wrote:
> > On Tue, 21 Jun 2005 19:13:43 -0400
> > Python <[EMAIL PROTECTED]> wrote:
> >
> >
Here's my solution, using the code Lloyd provided in a previous post:
The script that
D. Hartley wrote:
> P.S. Kent - thank you for the helpful tutorials on authentication,
> they really cleared up the process a great deal. The only problem is:
>
> When I create an opener to process the cookies, it looks like this:
>
> opener =
> urllib2.build_opener(urllib2.HTTPCookieProcessor(
Smith, Jeff wrote:
> That's what I was looking for. Although I couldn't get the below to
> work, I went with a different mod of the original you gave:
>
> def get_props_as_dict(self):
> d = dict()
> for entry in dir(self.__class__):
> if isinstance(getattr(self.__c
On Thu, 23 Jun 2005, Phillip Hart wrote:
> I've been using lists within lists for several functions, but have been
> unable, in loop form, to extract data from them or, in loop for, apply data
> to them.
[cut]
Hi Phillip,
Can you try checking for indentation? Your code came out indented all o
Hello,
I've been using lists within lists for several
functions, but have been unable, in loop form, to extract data from
them or, in loop for, apply data to them.
Basically, when extracting data, it only runs 1 loop. Likewise, when initially assigning the data, it only runs 1 loop.
In the f
nephish wrote:
> Does anyone know how to strip everything off of an email?
> i have a little app that i am working on to read an email message and
> write the
> body of a message to a log file.
> each email this address gets is only about three to five lines long.
> but i cannot seem to get just t
>From Christian:
> Try subclassing urllib.FancyURLopener and overriding the
> prompt_user_passwd() method. That should get you what you need :-)
Well, I used urllib.FancyURLopener, and can open and look at the url, like this:
import urllib
opener2 = urllib.FancyURLopener({})
f = opener2.open("
That's what I was looking for. Although I couldn't get the below to
work, I went with a different mod of the original you gave:
def get_props_as_dict(self):
d = dict()
for entry in dir(self.__class__):
if isinstance(getattr(self.__class__, entry), property):
> Consider a class with a lt of properties. I would like a member
> function which generates a dictionary where the keys are the
property
> names and the values are the property values?
Use the force... :-)
Since Python uses dictionaries to store all those things
already there must be a suitable
Smith, Jeff wrote:
> Here would be the usage:
>
> myinst = MyClass()
> print myinst.getprops_as_dict()
>
> would print
>
> {'var1': 1, 'var2': 2, 'var3': 3}
>
> Needless to say I want the instance values which might be different for
> each instance. I know that I could code it brute force, but
> -Original Message-
>
> Christian,
>
> > Try subclassing urllib.FancyURLopener and overriding the
> > prompt_user_passwd() method. That should get you what you need :-)
>
> Well, I used urllib.FancyURLopener, and can open and look at
> the url, like this:
>
> import urllib
> open
Here would be the usage:
myinst = MyClass()
print myinst.getprops_as_dict()
would print
{'var1': 1, 'var2': 2, 'var3': 3}
Needless to say I want the instance values which might be different for
each instance. I know that I could code it brute force, but I want to
be able to add properties with
Smith, Jeff wrote:
> I can see I wasn't clear :-)
>
> Here's the basic framework of what I'm looking for. Needless to say,
> this is just an example and not the real problem which is quite
> complicated and includes multiple classes.
>
> What I'm looking for is the actual implementation of get_p
I can see I wasn't clear :-)
Here's the basic framework of what I'm looking for. Needless to say,
this is just an example and not the real problem which is quite
complicated and includes multiple classes.
What I'm looking for is the actual implementation of get_props_as_dict
which I've written h
Smith, Jeff wrote:
> Consider a class with a lt of properties. I would like a member
> function which generates a dictionary where the keys are the property
> names and the values are the property values?
>
> Is this clear?
No, actually :-)
Do you want the properties of the class (which are typ
> -Original Message-
>
> Consider a class with a lt of properties. I would like a member
> function which generates a dictionary where the keys are the property
> names and the values are the property values?
>
> Is this clear?
I think so :-)
> How might I go about this?
I think yo
D. Hartley wrote:
> My problem is, when I plug this url into my sample code above, I get
> an error ("HTTP Error 401: Authorization Required"), because normally
> when you go to this url it makes you enter in a username and a
> password.
>
> (Also, there is lots of documentation on the cookie mo
Smith, Jeff wrote:
>Consider a class with a lt of properties. I would like a member
>function which generates a dictionary where the keys are the property
>names and the values are the property values?
>
>Is this clear?
>
>How might I go about this?
>
>Jeff
>__
> -Original Message-
>
> Hello, everyone!
Hi,
> My problem is, when I plug this url into my sample code above, I get
> an error ("HTTP Error 401: Authorization Required"), because normally
> when you go to this url it makes you enter in a username and a
> password. Does anyone know
Consider a class with a lt of properties. I would like a member
function which generates a dictionary where the keys are the property
names and the values are the property values?
Is this clear?
How might I go about this?
Jeff
___
Tutor maillist - T
Hello, everyone!
I am trying to go to a website, collect any and all cookies I receive
by going to that website, and then look at the cookies/print them.
So I did the following, from the cookie examples in the documentation:
import cookielib, urllib2
myjar = cookielib.CookieJar()
opener = urllib
> -Original Message-
>
> Hey there,
Hi,
> i have used the cgi module and dig it.
> heres the deal,
> my employer wants me to build a dynamic website that will
> access a
> database and display customer
> information on web. ok, easy enough.
Looks like some others have
Well, I've managed to get an image into a postgre database, but now I'm having
trouble getting it out.
#! /usr/bin/env python
from pyPgSQL import PgSQL
def main():
connectdb = PgSQL.connect('server:port:database:username:password')
cur = connectdb.cursor()
sqlStatement = """SELEC
D. Hartley gmail.com> writes:
> code, but it's made up of 46 different .py files, none of which seem
> to be the "main" game (lots of little modules, like an input box, a
> high score list, etc). It's a lot harder for someone new to
> programming to read.
Identify the main file (the one that y
Ron Phillips wrote:
> I believe I've tried every setting known to man, in every script in
> every little scrap of documentation available. XMLRPC requests using
> SimpleXMLRPCRequestHandler -- no problem. But try to run them as a CGI
> script, and I get system lock ups and that's all. No error c
Alan G wrote:
>>This is a neat trick. But can't this also be done with a static
>
> method
>
>>that accesses a static data attribute the same way?
>
>
> I don't think so because the static mehod can only see
> the attributes of Shape not of Line.
Well, it can *see* Point._count and Line._coun
> What I *am* looking for, if you have it or know of anyone who does,
is
> *simple* source code files (preferrably the entire game's code is in
> one .py file),
Thats unlikely to happen because its very bad practice and
Python tries to make it easy NOT to do that. Breaking code
into modules makes
I'm not sure what you're trying to do. But I run cgi scripts and make
xmlrpc requests with xmlrpclib with a connection with
xmlrpclib.Server(server_uri), though I'm only doing this client side.
I'm not running the server as cgi.
On 6/23/05, Ron Phillips <[EMAIL PROTECTED]> wrote:
>
> I believe I
> > Curses comes as standard on linux...
> >
>
> More seriously, I seem to recall that on the contrary, the
> Windows Python distribution does not include the curses module
That's correct.
> have to use msvcrt[?] instead). I wonder why, because I'm pretty
sure
> I saw (C) curses-based applic
> This is a neat trick. But can't this also be done with a static
method
> that accesses a static data attribute the same way?
I don't think so because the static mehod can only see
the attributes of Shape not of Line. It doesn't have
access to the cls value in Kent's code below...
> >> @classm
30 matches
Mail list logo