Python到Web应用程序

2024-04-25 11:36:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经编写了一个python应用程序,该应用程序提取一些excel文件,进行一些数据分析,然后将结果写入excel文件中,在该文件中创建绘图。在

当前选项是通过argparse使用输入参数设置的。我想知道是否有一种好的、低开销的方法可以使它成为一个web应用程序。在

jupyter笔记本是通过jupyter.org网站好主意?在

我需要和django做点什么吗?在

目前我的argparse代码如下所示。我使用Gooey来处理我的GUI。在

def get_args():
    """Get CLI arguments and options"""
    parser = GooeyParser(description='AngioTool File Analyzer - Version ' + __version__,
                         formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument('Path',
                        help="Path to the AngioTool output files (.xls).",
                        widget='DirChooser')

    parser.add_argument('--Norm_Interval',
                        help='Name of the interval to which all the other intervals will be normalized.'
                             '\r\"auto\" tries to find the smallest interval and normalizes to that',
                        default='auto')

    parser.add_argument('--Control_Device',
                        help='Name of the control device to which all devices should be ratioed',
                        default='D1')


    parser.add_argument('--Ratio_to_Control_Device', dest='Ratio_to_Control_Device',
                        widget='CheckBox',
                        help='Check to ratio to the control device',
                        action='store_true', default='False')

    parser.add_argument('--Plot_Measurements',
                        help="List of measurements to plot",
                        default=('Total Vessels Length', 'Total Number of End Points', 'Total Number of Junctions'))

    parser.add_argument('--Chart_Titles', help='List of titles to be placed on plot',
                        default=('Total Vessels Length', 'Total Number of End Points', 'Total Number of Junctions'))

    args = parser.parse_args()

    return args

我需要从本地路径读取文件,允许用户通过某种webui设置选项,并在新的excel文件中返回结果。在

任何想法都将不胜感激。在


Tags: 文件ofthetoadd应用程序defaultparser
1条回答
网友
1楼 · 发布于 2024-04-25 11:36:41

我认为你正在寻找一些轻量级的东西来开始,也就是说,尝试一些想法,你还不想在你的Python应用程序上运行Amazon。因此,这有助于将选择范围缩小到像烧瓶这样简单的东西上: http://flask.pocoo.org/

关于Excel的问题,下面是一个使用Flask的send_文件的示例:how to output xlsx generated by Openpyxl to browser?

相关问题 更多 >