Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'class,': 0.07; 'python': 0.09; ':-)': 0.13; 'passing': 0.15; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:class': 0.16; 'wrote:': 0.17; "shouldn't": 0.17; 'variables': 0.17; 'thanks,': 0.18; 'variable': 0.20; 'all,': 0.21; 'trying': 0.21; 'java': 0.21; 'sends': 0.22; 'work.': 0.23; "haven't": 0.23; 'seems': 0.23; 'long,': 0.24; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'wondering': 0.26; 'appreciated.': 0.26; 'language.': 0.27; 'connects': 0.27; 'questions?': 0.29; 'received:192.168.1.3': 0.29; 'class': 0.29; 'this.': 0.29; "i'm": 0.29; 'classes': 0.30; 'at:': 0.31; 'server.': 0.32; 'received:84': 0.32; 'could': 0.32; 'to:addr:python-list': 0.33; 'tutorial': 0.33; 'another': 0.33; 'done': 0.34; 'doing': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'programmers': 0.36; 'method': 0.36; 'anything': 0.36; 'should': 0.36; 'too': 0.36; 'problems': 0.36; 'correctly': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'back': 0.62; 'information': 0.63; 'url:main': 0.65; 'header :Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'different.': 0.84; 'reply-to:addr:python.org': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=IekFqBWa c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=lR6CHUT36vYA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=hx0ayZV_fMwA:10 a=rTvXzjoOAAAA:8 a=rlFRPA0VG4Un54PU4JEA:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Thu, 06 Sep 2012 13:20:24 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Setting up a class References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346934020 news.xs4all.nl 6859 [2001:888:2000:d::a6]:47259 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28585 On 06/09/2012 13:00, shaun 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 > You should have a look as a Python tutorial to help you get used to the language. It shouldn't take you long, provided that you remember that Python isn't Java and don't try to write Java in Python. :-) Here's one you could look at: Python for Java programmers http://python4java.necaiseweb.org/Main/TableOfContents