Python: How to remove string from string
<p>I have this snippet of code that looks like this:</p>

<pre><code>server_directory = "/Users/storm/server"
def get_directory(self, username):
    home = server_directory + "/" + username
    typic = os.getcwd()
    if typic == server_directory:
        return "/"
    elif typic == home:
        return "~"
    else:
        return typic
</code></pre>

<p>And every-time I change the directory out of the two nice server directory and home directory of the user, it would look like <code>/Users/storm/server/svr_user</code>. How do I make it <code>/svr_user2</code> instead of <code>/Users/storm/server/svr_user</code>, since I would like to emulate a home directory and a virtual "root" directory?</p>
