Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


python_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
python_notes [2019/09/16 15:08] juckinspython_notes [2019/09/30 14:09] juckins
Line 1: Line 1:
 ==== Python Notes ==== ==== Python Notes ====
      
-Install Python 3.6 on CentOS 7:+With CentOS7.7, python3 can load from base.  Do the following to fix previously-installed IUS release: 
 + 
 +  # yum remove python36u 
 +  # yum install python3 
 +  # yum remove ius-release 
 + 
 +Then follow instructions for installing local python packages to ensure all still work. 
 + 
 +__Install Python 3.6 on CentOS 7__:
   * https://linuxhint.com/install_python3_centos7/   * https://linuxhint.com/install_python3_centos7/
   * https://janikarhunen.fi/how-to-install-python-3-6-1-on-centos-7.html   * https://janikarhunen.fi/how-to-install-python-3-6-1-on-centos-7.html
Line 24: Line 32:
 Download and install geckodriver (see https://github.com/mozilla/geckodriver/releases) Download and install geckodriver (see https://github.com/mozilla/geckodriver/releases)
  
-As root, copy geckodriver to /usr/local/bin+As root, copy geckodriver to /usr/local/bin and ensure permissions are 755
  
 Notes at https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path Notes at https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path
Line 45: Line 53:
      
 [[https://docs.python.org/3/howto/logging.html|Logging in python]] [[https://docs.python.org/3/howto/logging.html|Logging in python]]
 +
 +  logging.basicConfig(format='%(asctime)s %(message)s', filename=log_file, level=logging.DEBUG)
 +  logging.debug('This message should go to the log file')
 +  logging.info('So should this')
 +  logging.warning('And this, too')
  
  
 +[[https://realpython.com/python-pep8/|Write beautiful python code with PEP-8]]
python_notes.txt · Last modified: 2023/04/05 08:56 by juckins