Re: [Tutor] Detect the folder of a file

2016-04-26 Thread Oliver Bestwalter
Hi, >>> import sys >>> sys.base_exec_prefix == sys.prefix False In a virtualenv those are different: https://docs.python.org/3/library/sys.html#sys.base_exec_prefix >>> sys.executable '/home/obestwalter/.pyenv/versions/3.4.4/envs/tmp/bin/python3.4' >>> sys.prefix '/home/obestwalter/.pyenv/vers

Re: [Tutor] def __init__(self):

2016-04-26 Thread Oliver Bestwalter
Hi Santanu, without knowing from which level of understanding you are asking, it is hard to say what we should answer here, so let me ask a few questions: Do you understand the concept of classes already? Maybe from other programming languages, or are you a complete beginner? If you are a beginne

Re: [Tutor] Understanding error in recursive function

2016-04-09 Thread Oliver Bestwalter
Hi Tom, You can see what happens for yourself in the Pythontutor: http://goo.gl/YVkh03 - step through the code by clicking on "Forward" and see what happens. You are calling the howMany function from inside the function itself, which is called recursion. This can be practical, but in your case it