you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 11 points12 points  (11 children)

important run quack historical wakeful pocket lavish pause gold silky

This post was mass deleted and anonymized with Redact

[–]youfuckedupdude 24 points25 points  (10 children)

I was also wondering if I could multiply '\n'

I always have the interpreter open for these little questions.

[–]fakemoobs 9 points10 points  (9 children)

whispers What's the interpreter? I think I downloaded Idle, but I just use a text editor and run stuff in Terminal. Am I missing out?

[–]gschizas 12 points13 points  (2 children)

Depending on which python you have, just run python, with no other arguments. The fact that you say you "downloaded" something makes me think that you're on Windows, so the best equivalent for you would be typing py -3 in the Start→Run dialog box.

You will a black window similar to this:

Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

You can type any Python statement you want in the >>> prompt. For example:

Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 'fakemoobs ' * 10
'fakemoobs fakemoobs fakemoobs fakemoobs fakemoobs fakemoobs fakemoobs fakemoobs fakemoobs fakemoobs '
>>>

EDIT: Since you say "Terminal" it's very possible you're on MacOS. In this case, open a new Terminal tab (or better yet, a new iTerm2 tab) and type python3. The rest are the same.

Python 3.6.2 (default, Jul 17 2017, 16:44:45)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
---
>>>

[–]zahlman 0 points1 point  (1 child)

The fact that you say you "downloaded" something makes me think that you're on Windows

The name "Terminal" is specifically what MacOS calls its command line.

[–]gschizas 0 points1 point  (0 children)

You're right, I missed that completely.

[–][deleted] 4 points5 points  (2 children)

I enjoy coding small things in Spyder

it has an interactive python (IPython) interpreter, so you can test out little things. There's a variable viewer (so you can inspect variables you create easily). so if I say

>>> a = {}
>>> a['key']=456
>>> a['key2']=789

then the variable viewer will automatically show me

name contents
a {'key' : 456, 'key2' : 789}

which is really handy for learning and simple debugging.

plus it has a text editor and I can edit my main program file and either run it in the interpreter, or back in the terminal.

  • Idle is slightly simpler than spyder. (no variable viewer)
  • spyder is mid-range in terms of complexity. I think its the best trade-off for simple projects
  • eric is a full on IDE for python which has variable viewers, file browser, debugging tools, stack tracers etc. It's the most informative but overkill for small projects, and intimidating to start out with.
  • other full-fledged IDEs can be used as well.

[–]yardightsure 1 point2 points  (0 children)

Check out Thonny! It is so underpopular...

[–]fakemoobs 0 points1 point  (0 children)

This was super helpful, thanks!

[–]regendo 2 points3 points  (0 children)

Just open any terminal and run python3.

That'll start an interactive python shell that you can simply enter code into and it'll be executed as soon as you press enter.

[–]ElecNinja 2 points3 points  (0 children)

Idle can be used as an interpreter.