python 2.5 (windows) を使用してネットワーク分析ツールを作成しています。これは、scapy を使用してネットワーク トラフィックをキャプチャし、キャプチャ データを *.pcap ファイルに保存します。私が達成しようとしているのは、ユーザーがネットワーク トラフィックを分析できる独自の関数を作成できるようにすることです。だから私がしたことは、ユーザーが関数を書くことを可能にするインターフェースクラスを作成したことです。
#analyzer function class
class date_validator:
def __init__(self,dbh):
#any intializations required for the function.
self.dbHandle=dbh
#All interaction with the database can be done by using this handle.
return
def importer(self):
#contains all the modules that have to be imported for
#execution of the analyzer function.
return
def LogAnalyzer(self):
#Main function that contains the analyzer code.
return data
#this function must return 2D data to populate a table View.
# It can accomadate 1D data also .
今私が直面している問題は、プログラム全体を exe としてパッケージ化した後、上記の構造を持つアナライザー関数をロードし、モジュールをインポートする必要がある場合、「 import nmap 」と言って、そのモジュールがどのように機能するかということです。システムにインストールされていますか?
だから私の質問は、どうすればこのタスクを達成できるかということです。より良い方法はありますか?
前もって感謝します 。