2017-07-28 7 views
0

Ich möchte eine Dokumentation für den folgenden Python-Code generieren. Es hat gut funktioniert, denke ich. Weil es die folgende HTML-Dokumentation erzeugt hat.So fügen Sie einen Link zu Python-Bibliotheken mit pydoc

enter image description here


Problem

Das Problem ist, dass, wenn ich auf einem der Module, (argparse, os, sys, zipfile) eine leere Seite gibt. Wie kann ich Links zu den Modulen in der Dokumentation hinzufügen, damit ich, wenn ich auf eines von ihnen klicke, auf ihre Webseite geleitet werde?

nehme ich auf ZipFile klicken kann ich https://docs.python.org/2/library/zipfile.html


Quellcode“

#!/usr/bin/env python 

import os 
import sys 
import argparse 
import zipfile 

from ftplib import FTP 
from os.path import basename 



def is_route(record, routes): 
    """ 
     Check if route belongs to any of the 14 routes 
     :param record: name of route 
     :param routes: list of routes 
     :return: True if routes exists else False 

    """ 
    for route in routes: 
     if route in record: 
      return True 

    return False 

def download(username, password, searchDate, routes, output): 
    """ 
     Download files from FTP server 

     :param username: username of FTP server 
     :param password: password of FTP server 
     :param searchDate: date of previous day 
     :param routes: list of routes 
     :output: directory where downloaded files are saved 
     :return: returns nothing 
    """ 

if __name__ == "__main__": 

    #download routes 
    download("", "", "", "", "") 

Antwort

0

Versuchen gerichtet werden, um dem pydoc Server

pydoc -p <arbitrary port number> 
zu starten
Verwandte Themen