2017-02-18 85 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