How to activate an Anaconda environment

If this happens you would need to set the PATH for your environment (so that it gets the right Python from the environment and Scripts\ on Windows). Imagine you have created an environment called py33 by using: Here the folders are created by default in Anaconda\envs, so you need to set the PATH as: Now … Read more

Python strip with \n [duplicate]

You should be able to use line.strip(‘\n’) and line.strip(‘\t’). But these don’t modify the line variable…they just return the string with the \n and \t stripped. So you’ll have to do something like That should work for removing from the start and end. If you have \n and \t in the middle of the string, you need to do to replace the \n and \t with nothingness.

What does pythonic mean?

Exploiting the features of the Python language to produce code that is clear, concise and maintainable. Pythonic means code that doesn’t just get the syntax right but that follows the conventions of the Python community and uses the language in the way it is intended to be used. This is maybe easiest to explain by … Read more