install python-mysqldb using python script
Question: I am writing a python script for an application. The application needs python-
mysqldb. In terminal, I can install it with apt-get or pip. How can I install
using python script? I am using python 2.7.


Answer: You could use pip in a python script for installing the package

    
    
    import pip
    
    if __name__ == '__main__':
        pip.main(['install', 'MySQL-python'])
    

Then you can run the script from a terminal.

