Run Python Script at OS X Startup

后端 未结 3 908
陌清茗
陌清茗 2020-12-13 07:35

I am very new to python as well as MAC OSX. For my academic project I need to download a bunch of tweets from twitter using twitter streaming API. I need to download atleast

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 08:19

    Here's the full solution I am using on Mojave:

    Plist: ~/Library/LaunchAgents/play.with.mpv.plist

    
    
    
    
        Disabled
        
        EnvironmentVariables
        
            PATH
            /Users/e/Library/Python/3.7/bin:/usr/local/bin
        
        KeepAlive
        
        Label
        play.with.mpv
        ProgramArguments
        
            /usr/local/bin/python3
            /Users/e/Library/Python/3.7/bin/play-with-mpv
        
        RunAtLoad
        
        StandardErrorPath
        /tmp/play.with.mpv.stderr
        StandardOutPath
        /tmp/play.with.mpv.stdout
    
    
    

    Mind the PATH to python3 - find it with which python3 and the play-with-mpv python script!

    Load plist:

    launchctl load ~/Library/LaunchAgents/play.with.mpv.plist
    

    If your video is dropping frames as hell, create mpv config in ~/.config/mpv/mpv.conf and put there this:

    video-sync=display-resample
    

    if that do doesn't help, try this instead

    opengl-early-flush=no
    

提交回复
热议问题