Thanks Oliver and Alex, I didnt know about these commands :D Oliver, When i typed print filename print sys.executable print sys.prefix print os.path.split(sys.prefix)[-1]
my output was /home/kanikaa/pydsa7/venv/lib/python2.7/site-packages/ipython_genutils/tests/test_tempdir.py /usr/bin/python /usr usr but i want to know weather file belongs to 'venv' folder or not. Alex, Yup, that was helpful, but I want to do it without activating the environment. Thanks Again Kanika On 27 April 2016 at 07:45, Alex Kleider <aklei...@sonic.net> wrote: > > > On 2016-04-26 16:16, Oliver Bestwalter wrote: > > sys.executable >>>>> >>>> '/home/obestwalter/.pyenv/versions/3.4.4/envs/tmp/bin/python3.4' >> > > Not sure if this helps but perhaps: > > alex@X301:~/Py$ which python > /usr/bin/python > alex@X301:~/Py$ . venv/bin/activate > (venv)alex@X301:~/Py$ which python > /home/alex/Py/venv/bin/python > (venv)alex@X301:~/Py$ > > [Ubuntu 14.04 LTS] > > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor