モジュールの関数 ================== fileOpenDlg(tryFilePath='', tryFileName='', prompt=u'Select file to open', allowed=None) ----------------------------------------------------------------------------------------------- 「ファイルを開く」ダイアログを開き、開くファイル名を取得する。 =============== =================================================== パラメータ =============== =================================================== tryFilePath デフォルトのパスを指定する。 tryFileName デフォルトのファイル名を指定する。 prompt ダイアログ上に表示する短いテキストを指定する。 allowed ダイアログに表示するファイルを制限する。 指定方法については下記の訳注参照。 =============== =================================================== tryFilePathまたはtryFileNameが空白又は無効な場合は、カレントパスと空白のファイル名が使用される。 ユーザーがダイアログをキャンセルするとNoneが返される。 (訳注:バックエンドがQtの場合とWxの場合で指定方法が異なる。Qtならば"Text files (\*.txt) ;; Image files (\*.bmp \*.gif)"のようにファイルの種類の説明文とその拡張子を記述した文字列を;;で区切った文字列で指定する。Wxならば"BMP files (\*.bmp)|\*.bmp|GIF files (\*.gif)|\*.gif"のようにファイルの種類の説明文とその拡張子を | で区切りながら列挙する。詳しくは以下のURLを参考にせよ。) - http://pyqt.sourceforge.net/Docs/PyQt4/qfiledialog.html (Qt) - http://www.wxpython.org/docs/api/wx.FileDialog-class.html (Wx) .. A simple dialogue allowing read access to the file system. .. Parameters: .. tryFilePath: string .. default file path on which to open the dialog .. tryFileName: string .. default file name, as suggested file .. prompt: string (default “Select file to open”) .. can be set to custom prompts .. allowed: string (available since v1.62.01) .. a string to specify file filters. e.g. "Text files (*.txt) ;; Image files (*.bmp *.gif)" See http://pyqt.sourceforge.net/Docs/PyQt4/qfiledialog.html #getOpenFileNames for further details .. If tryFilePath or tryFileName are empty or invalid then current path and empty names are used to start search. .. If user cancels, then None is returned. fileSaveDlg(initFilePath='', initFileName='', prompt=u'Select file to save', allowed=None) --------------------------------------------------------------------------------------------------------------- 「ファイルを保存」ダイアログを開き、保存先のファイル名を取得する。 =============== =================================================== パラメータ =============== =================================================== tryFilePath デフォルトのパスを指定する。 tryFileName デフォルトのファイル名を指定する。 prompt ダイアログ上に表示する短いテキストを指定する。 allowed ダイアログに表示するファイルを制限する。 指定方法については下記の訳注参照。 =============== =================================================== tryFilePathまたはtryFileNameが空白又は無効な場合は、カレントパスと空白のファイル名が使用される。 ユーザーがダイアログをキャンセルするとNoneが返される。 (訳注:バックエンドがQtの場合とWxの場合で指定方法が異なる。Qtならば"Text files (\*.txt) ;; Image files (\*.bmp \*.gif)"のようにファイルの種類の説明文とその拡張子を記述した文字列を;;で区切った文字列で指定する。Wxならば"BMP files (\*.bmp)|\*.bmp|GIF files (\*.gif)|\*.gif"のようにファイルの種類の説明文とその拡張子を | で区切りながら列挙する。詳しくは以下のURLを参考にせよ。) - http://pyqt.sourceforge.net/Docs/PyQt4/qfiledialog.html (Qt) - http://www.wxpython.org/docs/api/wx.FileDialog-class.html (Wx) .. A simple dialogue allowing write access to the file system. (Useful in case you collect an hour of data and then try to save to a non-existent directory!!) .. Parameters: .. tryFilePath: string .. default file path on which to open the dialog .. tryFileName: string .. default file name, as suggested file .. prompt: string (default “Select file to open”) .. can be set to custom prompts .. allowed: string (available since v1.62.01) .. a string to specify file filters. e.g. "Text files (*.txt) ;; Image files (*.bmp *.gif)" See http://pyqt.sourceforge.net/Docs/PyQt4/qfiledialog.html #getOpenFileNames for further details .. If tryFilePath or tryFileName are empty or invalid then current path and empty names are used to start search. .. If user cancels, then None is returned.