Search code examples
inputunicodespyder

using greek letters as variable names


How would I enter greek letters to be used e.g. as variable names in Python 3 under Spyder? Currently I'm using the following Python code on the console:

s = '\u03B1'
print(s)

α is printed on the console and I can copy it into my source. I was wondering if there is a way to directly enter it into my console, perhaps even some macro that automatically replaces \alpha with α.


Solution

  • In the Spyder IPython console, typing \alpha followed by a tab gives you α. You can then copy paste it into the Python editor. I am searching for a better solution.