Question

Existe-t-il un moyen d'utiliser raw_input sans laisser de signe dans l'historique readline, afin qu'il ne s'affiche pas lors de la complétion par une tabulation?

Était-ce utile?

La solution

Vous pouvez créer une fonction comme

import readline

def raw_input_no_history():
    input = raw_input()
    readline.remove_history_item(readline.get_current_history_length()-1)
    return input

et appelez cette fonction à la place de raw_input. Vous n’avez peut-être pas besoin du moins 1 en fonction de votre lieu d’appel.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top