8

I'm starting Python from basics.

The Python 3.4 Tutorial has an example for interactive mode:

>>> the_world_is_flat = True
>>> if the_world_is_flat:
...    print("Be careful not to fall off!")
blablabla

I'm on Linux, using Terminator, default Python 3.4 installation. The problem is indent before print. Actually, problem is any indent.

Google says that, by default, I should have indent there with Tab key. And I can change that with changes in ~./inputrc file for Tab - complete (autofill) - I hope you know what I mean. So... I have different default.

My interpreter's line-editing include interactive editing (emacs commands like C-p, C-f, C-b etc. - work - YAY!) so maybe because of that, my Tab by default have autofill feature (YAY! I love autofill!).

Great. But if Tab is already occupied, how do I indent? Following the "emacs commands" track, I was trying to do it like I do in Emacs when Python file edit - 'C-c >'. But C-c (Ctrl+C) in shell, even when Python interpreter is on, is the interrupt keyboard shortcut, so it does not work.

If Tab doesn't work and C-c > doesn't work, how do I make an indent in Python 3.4, Terminator?

I don't want to 'turn off' Tab-autofill, even if it's possible. I really like this feature.

2 Answers 2

9

It took me lots of time to figure it out, but it was obvious. Instead of Tab I just need one Space.

0

Actually, each 4 Space is understood as a Tab in Python.

1
  • Can you provide a source reference for that? Please take our tour and see How to Answer.
    – Burgi
    Commented Sep 8, 2016 at 7:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .