2017-02-18 79 views
0

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

当前选项通过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 

我需要在一个新的Excel文件从本地路径读取文件,允许用户通过某种网络界面的设置选项,并返回结果。

任何想法将不胜感激。

+0

Jupyter可能被罚款,不熟悉它,但它是否适合你的要求给它一个旋风。它似乎有一个专门的焦点,可能适合你。无论如何 - 对于StackOverflow的问题,我们的努力是没有偏见的,所以像“什么是好工具”这样的更一般的问题并不是这里回答的问题,而是更具体的问题,比如关于Jupyter问题的具体问题等 – michaelok

回答

0

我认为你正在寻找一些轻量级的入门知识,即尝试一些想法,你不打算在你的Python应用上运行亚马逊。因此,有助于缩小选择范围像瓶简单的东西: http://flask.pocoo.org/

有关Excel的问题,这是一个使用瓶的由send_file一个例子:how to output xlsx generated by Openpyxl to browser?

+0

当然不希望运行亚马逊。烧瓶应用程序可以像jupyter,github甚至dropbox一样运行吗?我甚至没有网络服务器。 – agf1997

+0

GitHub和DropBox更多用于存储,我想你是指像Amazon AWS或Heroku这样的托管服务提供商?一般来说,这些提供商很善于支持。我熟悉AWS和Heroku,所以这里是一个例子:https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world – michaelok