Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Mass-update pip pkgs
#1
Here is a program I wrote to mass-update pip packages. It relies on pip-review and another module I wrote to make numbered lists.

import numli
import os


def pkg_update():
    """Update pip packages."""
    options = ['Yes', 'Exit']
    numli.addnum(options)
    check = input('Check for updates? ')

    if check in '1':
        print('Checking for updates.')
        os.system('pip list -o')

        os.system('pip-review --local --interactive')
        pkg_update()

    elif check in '2':
        raise SystemExit

    else:
        pkg_update()


if __name__ == "__main__":
    pkg_update()
Here is the list numbering module. I got tired of typing out the for loop every time.
def addnum(num):
    """Add numbers to a list"""
    for c, value in enumerate(num, 1):
        print(c, value)

if __name__ == "__main__":
    addnum(num)

Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  I made a package to quickly create live-update GUIs for Python using Markdown SimonBiggs 4 1,355 Mar-02-2018, 09:22 PM
Last Post: SimonBiggs

Forum Jump:


Users browsing this thread: 1 Guest(s)