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


Groups > comp.lang.python > #79776 > unrolled thread

Re: Classes and the command line

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2014-10-27 11:26 +0100
Last post2014-10-27 11:26 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#79776 — Re: Classes and the command line

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2014-10-27 11:26 +0100
SubjectRe: Classes and the command line
Message-ID<mailman.15233.1414405563.18130.python-list@python.org>
----- 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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web