私はPythonで次を実装したい、Cでは、それは以下のようなものです、構造があります
struct xyz {
char name[50];
char type[50];
char link[50];
char level[50];
}XYZ;
そして、次のようにこの構造体 xyz の配列を作成しました。
XYZ array[] =
{ {"Mac", "char", "list","one"},
{"John", "char", "list","three"},
...
...
};
配列[0]、配列[1]などでこれらにアクセスします。Pythonスクリプトで、これらの配列要素を以下のようなテキストファイルにリストしたとします。たとえば、file.txt
Mac, char, list, one
John, char, list, three
...
...
ここで、file.txt を読み取り、それらを構造体の配列と同様の Python スクリプトに格納し、それに応じてアクセスする必要があります。