如何将翻译后的数据存储到python中的另一个文件中

nue99wik  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(168)

# Import Wikipedia Module

从wikipedia导入python模块中的googletrans版本3.0.0,从googletrans导入转换器导入*


# Here Make Class Name Data Getter

class Data_Getter:
    def __init__(self):
        while True:
            data_sort=[]
            '''Rule1:Get Data Through Our Interest
            Rule2:Get Information
            Rule3:Translate into Tamil
            Rule4:Save it in File'''
            self.user_name=input("Enter Your User Name:")
            self.user_id=id(self.user_name)
            self.user_birth_year=int(input(f"Enter Which Year You Born\n {self.user_name}"))
            self.user_gmail=input(f"Enter Your G-Mail Id \n{self.user_name}")
            self.data_structure=input(f"What Kind Of Information Do You Want {self.user_name}")
            self.data=wikipedia.summary(self.data_structure)
            value=self.data
            #Here creating translator object by calling the class of Translator()
            translator=Translator()
            se=translator.translate(value,dest='ta')
            f=open("TranslatingData.txt","w")
            f.write(se)

            #Finally We Got The Translation Perfectly
            #Getting Information From Wikipedia Summary
'''It is Possible To Store Data's In Dictionary of the python'''

Answer=Data_Getter()

这里我想翻译数据,我的意思是信息应该复制并粘贴到另一个文件中

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题