Jump to content

Search the Community

Showing results for tags 'packages'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • Website Management and Coding
    • Technology and the Internet
    • Philosophy, Politics, and Science
    • Art and Entertainment
    • Other Discussion
  • HelioHost
    • Questions
    • Customer Service
    • How You Can Help
  • HelioNet
    • News
    • Contact HelioNet

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hello Helioids! Just found this service and started poking around. I'm glad HelioHost exists! Determining without command line access which python packages are available was a bit tricky. I'm documenting a solution here so it will show up for others in search. The following script is tested as working on server Johnny, under Python 3.6. Upload it to, for example, /home/USERNAME/public_html/cgi-bin/SCRIPTNAME.py. Don't forget to make it executable (chmod 755 SCRIPTNAME.py). Sending a request to that file from your browser, for example by visiting YOURSUBDOMAIN.heliohost.org/cgi-bin/SCRIPTNAME.py, will return installed module details wrapped in html that should be good enough for your browser to parse. Hope someone else finds this helpful! #!/usr/bin/python3.6 import sys import pip version = sys.version modules = pip.get_installed_distributions() print("Content-type: text/html\n\n", "Python ", version, "<br><br>") for mod in sorted(modules, key=lambda mod: mod.key): try: deets = next(pip.commands.show.search_packages_info([mod.key])) print(deets["name"], "<br>") print(deets["version"], "<br>") print(deets["summary"], "<br>") print(deets["author"], "<br>") print(deets["author-email"], "<br>") print(deets["home-page"], "<br><br>") except: print("<p>", mod.key, "</p>")
×
×
  • Create New...