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


Groups > comp.lang.python > #79776

Re: Classes and the command line

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=3703a34d2=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.080
X-Spam-Evidence '*H*': 0.84; '*S*': 0.00; 'classes.': 0.09; 'function,': 0.09; 'spaces': 0.09; 'subject:command': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; '2.7': 0.14; 'added.': 0.16; 'magic': 0.16; 'subject:Classes': 0.16; 'trying': 0.19; 'command': 0.22; '>>>': 0.22; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'url:wiki': 0.31; 'indentation': 0.31; 'class': 0.32; 'quite': 0.32; '-----': 0.33; 'monday,': 0.33; 'subject:the': 0.34; 'could': 0.34; 'classes': 0.35; 'there': 0.35; 'really': 0.36; 'url:org': 0.36; 'email addr:python.org': 0.37; 'thank': 0.38; 'same.': 0.38; 'subject:': 0.39; 'commands': 0.60; 'deleting': 0.60; 'lost': 0.61; "you're": 0.61; 'you.': 0.62; 'information': 0.63; 'received:194': 0.64; 'taking': 0.65; 'email name:python-list': 0.65; 'notice:': 0.67; 'person,': 0.68; 'privileged.': 0.69; 'disclose': 0.74; 'pasting': 0.84; 'x):': 0.84; 'medium.': 0.91; 'mistake': 0.91
X-IronPort-AV E=Sophos;i="5.04,794,1406584800"; d="scan'208";a="3509719"
Date Mon, 27 Oct 2014 11:26:01 +0100 (CET)
From Jean-Michel Pichavant <jeanmichel@sequans.com>
To Seymore4Head <Seymore4Head@Hotmail.invalid>
In-Reply-To <8uar4a1pa6d631ktr33h8rau1ilf2rjvi3@4ax.com>
Subject Re: Classes and the command line
MIME-Version 1.0
X-Mailer Zimbra 7.2.7_GA_2942 (ZimbraWebClient - GC37 (Linux)/7.2.7_GA_2942)
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15233.1414405563.18130.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1414405563 news.xs4all.nl 2887 [2001:888:2000:d::a6]:43925
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:79776

Show key headers only | View raw


----- Original Message -----
> From: "Seymore4Head" <Seymore4Head@Hotmail.invalid>
> To: python-list@python.org
> Sent: Monday, 27 October, 2014 3:27:18 AM
> Subject: Classes and the command line
> 
> I am trying to learn classes.
> I am currently using Python 2.7 at the command line.
> If you try to type commands at the command line and make the
> slightest
> mistake you have to start over.
> I was trying to copy and paste these instructions into the command
> prompt.
> 
> http://en.wikibooks.org/wiki/Python_Programming/Classes
> >>> class Foo:
> ...     def setx(self, x):
> ...         self.x = x
> ...     def bar(self):
> ...         print self.x
> 
> There is really no way to do that without pasting line by line is
> there and adding deleting spaces?  And if you use spaces and tabs,
> they are not the same.

You could use Ipython http://ipython.org/, if you're familiar with the python shell you won't get lost as it's quite the same with a lot of features added.
One of them is the %paste magic function, it will paste your clipboard taking care of the indentation for you.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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


Thread

Re: Classes and the command line Jean-Michel Pichavant <jeanmichel@sequans.com> - 2014-10-27 11:26 +0100

csiph-web