我想生成以下python代码的文档。我觉得它工作正常。因为它生成了以下html文档。
问题是当我点击任何模块(argparse,os,sys,zipfile)时,它会给出一个空页面。如何在文档中添加模块的链接,以便当我点击其中的任何模块时,我会被定向到他们的网页?
假设我点击了zipFile,我可以转到https://docs.python.org/2/library/zipfile.html
#!/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("", "", "", "", "")
答案 0 :(得分:0)
尝试启动pydoc服务器
pydoc -p <arbitrary port number>