1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Small Python Script Modification

Discussion in 'Other Scripting Languages' started by Conor, Mar 28, 2017.

  1. Conor

    Conor Jr. VIP Jr. VIP

    Joined:
    Nov 7, 2012
    Messages:
    3,538
    Likes Received:
    5,856
    Gender:
    Male
    Location:
    South Africa
    Home Page:
    Hi guys,

    So I'm having a bit of trouble with a Python script. Basically, I'd like to modify this script: https://github.com/tanrax/guetzli-recursively/blob/master/guetzli-recursively.py to include the following flag when it runs the gueztli script:

    Code:
    --quality 90
    For some reason, I just can't get it right. I tried modifying line 24 to something like this, but apparently it can't just be that simple:

    Code:
                    call(['guetzli', '--quality 90', url, url_out])
    Any thoughts?

    Edit: To give some background information, I was looking for an elegant solution to recursively run the following program through a whole folder: https://github.com/google/guetzli. The script above works amazingly, except I can't seem to modify the quality settings as I'd like.
     
  2. ghero

    ghero Newbie

    Joined:
    Mar 28, 2017
    Messages:
    3
    Likes Received:
    1
    Gender:
    Male
    Hi, I think this should work:

    Code:
     call(['guetzli', '--quality', '90', url, url_out]) 
     
    • Thanks Thanks x 1
  3. Conor

    Conor Jr. VIP Jr. VIP

    Joined:
    Nov 7, 2012
    Messages:
    3,538
    Likes Received:
    5,856
    Gender:
    Male
    Location:
    South Africa
    Home Page:
    Quick and simple. Works great. Thanks a lot!