How to add indent in Python 3.4 interactive mode Terminator Linux?

16,956

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

Share:
16,956

Related videos on Youtube

user3895596
Author by

user3895596

Updated on September 18, 2022

Comments

  • user3895596
    user3895596 almost 2 years

    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.

  • Burgi
    Burgi almost 8 years
    Can you provide a source reference for that? Please take our tour and see How to Answer.