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


Groups > comp.lang.python > #28584

Re: Setting up a class

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'class,': 0.07; 'python': 0.09; 'fails.': 0.09; 'sep': 0.09; 'cc:addr:python-list': 0.10; 'passing': 0.15; 'subject:class': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'variables': 0.17; 'thanks,': 0.18; 'variable': 0.20; 'all,': 0.21; 'trying': 0.21; 'java': 0.21; 'sends': 0.22; 'smallest': 0.22; 'received:74.125.82.174': 0.23; 'cc:2**0': 0.23; 'work.': 0.23; "haven't": 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'wondering': 0.26; 'appreciated.': 0.26; 'am,': 0.27; 'connects': 0.27; 'message-id:@mail.gmail.com': 0.27; 'questions?': 0.29; 'url:mailman': 0.29; 'class': 0.29; 'this.': 0.29; "i'm": 0.29; 'classes': 0.30; 'code': 0.31; 'server.': 0.32; 'url:python': 0.32; 'could': 0.32; 'url:listinfo': 0.32; 'received:74.125.82': 0.33; 'traceback': 0.33; 'problem': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'along': 0.35; 'doing': 0.35; 'there': 0.35; 'but': 0.36; 'received:74.125': 0.36; 'url:org': 0.36; 'method': 0.36; 'anything': 0.36; 'should': 0.36; 'too': 0.36; 'problems': 0.36; 'correctly': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'shows': 0.38; 'where': 0.40; 'header:Received:5': 0.40; 'help': 0.40; 'url:mail': 0.40; 'your': 0.60; 'back': 0.62; 'information': 0.63; 'here': 0.65; 'different.': 0.84; 'joel': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=b5PkN0QDAJ3C2xVvo6Ju7eyIOLBXYFp7fjWVPCgvt3g=; b=jqgH/YOWSrt7Re0milEMz+V2OyiyvfdiGmDanJoxQjvrz/A64j7DJNdXB3WBwWnYVn M2hvNISb9XFwnqavbcKdNHwI+TL9ucQd09YA0M47vyO9CZ7t995+mAXAh0GXd7mMASDV KYmiyVtBXxHZEA94KQXnPaGMrgoGS8tmYhUxL/iqp/2uUgb4BbkJ8PJNfiUrjCFjgwej IsZ/uY4LpIODisyscs3D/rm2NWDk2Cw+uyb5mpaKuaYbFAwXfScMQvM4BIpxKoBJ/IYo N74mH55CuhUaR5fCpRAtNXCTQ9DSZHxkEqEgyNbQMy7kIoSNLgCQypKftdc4b9afcyGD vsyw==
MIME-Version 1.0
In-Reply-To <a451e907-5167-4e3e-a7f2-d63ffa0f2821@googlegroups.com>
References <a451e907-5167-4e3e-a7f2-d63ffa0f2821@googlegroups.com>
Date Thu, 6 Sep 2012 08:16:58 -0400
Subject Re: Setting up a class
From Joel Goldstick <joel.goldstick@gmail.com>
To shaun <shaun.wiseman91@gmail.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
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.297.1346933826.27098.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1346933826 news.xs4all.nl 6978 [2001:888:2000:d::a6]:45051
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28584

Show key headers only | View raw


On Thu, Sep 6, 2012 at 8:00 AM, shaun <shaun.wiseman91@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

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