Setting up a class

Joel Goldstick joel.goldstick at gmail.com
Thu Sep 6 08:16:58 EDT 2012


On Thu, Sep 6, 2012 at 8:00 AM, shaun <shaun.wiseman91 at gmail.com> wrote:
> Hi all,
>
> So I'm trying to to OO a script which is currently in place on work. It connects to the database and makes multiple strings and sends them to a server.
>
> But I'm having major problems since I am new to python I keep trying to do it as I would do it in Java but classes seem to be very different. I was wondering could someone answer a few questions?
>
> 1) Is there anything I should know about passing in variables from another script to the class?
>
> 2) When I'm passing variables back to the script they seem to come back blank as if I haven't done it correctly (I declare the empty variable at the top of the class, I use the information I get from the database to fill it and I send it back) Is there anything I'm not doing right with this.
>
> 3)When I want to use a method from a class in another class method it never seems to work for me, I have a feeling this is to do with "self" but im not too sure??
>
> Any help would be appreciated.
> Thanks,
> Shaun
> --
> http://mail.python.org/mailman/listinfo/python-list

You should take the smallest snippit of your code that shows your
problem and copy it here along with traceback where it fails.  Java is
not python and vice versa, so some of your ideas will be confused for
a while


-- 
Joel Goldstick



More information about the Python-list mailing list