页: 1 我把这种str改成dict。
这里的法典
data_dict = {}
filter_dict = {}
for each in text.split("
"):
temp = each.split( = )
if len(temp) == 2:
data_dict[temp[0]] = temp[1]
data = dict((k.strip(), v.strip()) for k, v in data_dict.iteritems())
Here is output which is convert from text to dict
{ producer : Sailadhar Baruah ,
image : paporithefilm.jpg ,
distributor : ,
alt : ,
image size : ,
gross : ,
writer : Jahnu Barua ,
cinematography : Binod Pradhan ,
music : Satya Baruah P. P. Vidyanathan ,
followed by : ,
narrator : ,
director : Jahnu Barua ,
released : 1986 ,
studio : Dolphin s Pvt. Ltd ,
starring : Gopi Desai Biju Phukan Sushil Goswami Chetana Das Dulal Roy ,
editing : ,
name : Papori ,
language : Assamese languageAssamese ,
country : Assam, IND , budget : ,
caption : A Screenshot ,
preceded by : ,
runtime : 144 minutes }
我只想知道我的最后一段是什么? Can 我将最后一段的案文储存在任何可能之处? 感谢