Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28585

Re: Setting up a class

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 <python@mrabarnett.plus.com>
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 <python@mrabarnett.plus.com>
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 <a451e907-5167-4e3e-a7f2-d63ffa0f2821@googlegroups.com>
In-Reply-To <a451e907-5167-4e3e-a7f2-d63ffa0f2821@googlegroups.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.298.1346934020.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Setting up a class shaun <shaun.wiseman91@gmail.com> - 2012-09-06 05:00 -0700
  Re: Setting up a class Joel Goldstick <joel.goldstick@gmail.com> - 2012-09-06 08:16 -0400
  Re: Setting up a class MRAB <python@mrabarnett.plus.com> - 2012-09-06 13:20 +0100
    Re: Setting up a class "Colin J. Williams" <cjw@ncf.ca> - 2012-09-06 09:41 -0400
  Re: Setting up a class Dave Angel <d@davea.name> - 2012-09-06 09:41 -0400
  Re: Setting up a class Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-06 17:23 -0400

csiph-web