Skip to content

Instantly share code, notes, and snippets.

@nngogol
Created October 30, 2017 13:29
Show Gist options
  • Save nngogol/0ac288047c771b11647ec29aff71fd2b to your computer and use it in GitHub Desktop.
Save nngogol/0ac288047c771b11647ec29aff71fd2b to your computer and use it in GitHub Desktop.
from text_with_newline to cmd_text
# one line, yay!
# print('\n'*30,'\t Awesome!\nNow paste this text to cmd, and be happy! :)\n |\n V\necho', input('enter your text, with \'\\n\' as separator for newline:\n').replace('\\n', ' & echo.'))
# multi-line code
data = input('enter your text, with \'\\n\' as separator for newline:\n');
ui = '\n'*30 + '\tHello! I\'m duck Vladimir. I\'ve just converted your text!\n\nNow paste this text to cmd, and be happy! :)\n |\n V\n\necho'
result = data.replace('\\n', ' & echo.')
print(ui, result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment