I decided to start using Eclipse to code in python, but I am having problems getting the filename of the current script. To get the current filenam I use:
#!/usr/bin/env python2.7
import os
os.path.basename(__file__)
My code works flawlessly when using the bash terminal or Geany, but with Eclipse Interactive Console I get:
 name '__file__' is not defined
Any ideas?
UPDATE
When I run my code using python filename.py it works perfectly, but when I try running it from the python or ipython consoles I get the same error
 
    