Hani Gotc
Hani Gotc

Reputation: 900

How to add a link to python libraries using pydoc

I want to generate a documentation for the following python code. It worked ok I guess. Because it generated the following html documentation.

enter image description here


Problem

The problem is that when I click on any of the Modules (argparse, os, sys, zipfile) it gives an empty page. How can I add links for the modules in the documentation in order for when I click on any of them i get directed to their webpage?

Suppose I click on zipFile can I be directed to https://docs.python.org/2/library/zipfile.html


source code"

#!/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("", "", "", "", "")

Upvotes: 0

Views: 1316

Answers (1)

Gribouillis
Gribouillis

Reputation: 2220

Try to start the pydoc server

pydoc -p <arbitrary port number>

Upvotes: 1

Related Questions