How to pass a list by reference?

Lists are already passed by reference, in that all Python names are references, and list objects are mutable. Use slice assignment instead of normal assignment. However, this isn’t a good way to write a function. You should simply return the combined list.

Unable to install boto3

Don’t use sudo in a virtual environment because it ignores the environment’s variables and therefore sudo pip refers to your global pip installation. So with your environment activated, rerun pip install boto3 but without sudo.

Anaconda “failed to create process”

I encountered the exact same error, because my username included a space. (“C:\Users\Ben Ji”) The easiest solution is to install Anaconda to another folder in the Users-folder, e.g. public. (The same error occurs when using pip, check out https://stackoverflow.com/a/35275384/6580199)

How do you switch between python 2 and 3, and vice versa?

Using ‘virtualenv’ you can have different isolated Python environments on a single machine. Also you can switch any-time between the different python interpreter versions. What is virtualenv? A Virtual Environment is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects. It enables multiple side-by-side installations … Read more

Error loading MySQLdb module: No module named ‘MySQLdb’

MySQLdb is only for Python 2.x. You can’t install in Python 3.x versions. Now from your question i can see that you are working with Django. In this case you have three alternatives, from Django mysql notes: mysqldb mysqlclient mysql-connect-python This gives to you two alternatives, mysqlclient and mysql-connect-python, The first one requires compilation from extensions … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)