Skip to content
Snippets Groups Projects

prepare_light.py

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Quentin Bramas
    Edited
    prepare_light.py 540 B
    
    import sys
    
    try:
        import requests
        pass
    except ImportError:
        print('Vous devez installer le package requests pour faire fonctionner ce programme:\n')
        print('   pip3 install requests')
        exit(1)
    
    if '--update' in sys.argv:
        print("Updating 📑")
        r = requests.get('https://git.unistra.fr/-/snippets/132/raw', timeout=6)
        with open(__file__, 'w') as f:
            f.write(r.text)
            print("Done 🎉")
    
        exit(0)
    else:
        print('Please update this program by running: '+str(sys.argv[0]+' --update'))
        exit(1)
    0% or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment