Here I am using askopenfile to upload a (text)file, I also wanted to display the file name next to the upload button and then I want to read its contents and convert it to another language. Say for example if the document is in English I want to convert it into some other language, I had already created a dictionary for it so I need to tell the compiler to compare both the Input file (.txt) and the dictionary values to replace the text file with the dictionary values. So after the user clicks the convert button the text in the (.txt) must be converted into the other language and the same must be saved automatically. Is this possible to do?
Varunkrishna 0 Junior Poster in Training
Recommended Answers
Jump to PostFor starters you will have to load/open and read the file Post back when you have this coded (whether it works or not) with a sample of input and the output you would …
Jump to PostAll widgets have config options, config options for the Label Click Here or Click Here Your code modified to show some other techniques.
import Tkinter as tk from tkFileDialog import askopenfilename import os class En2De(): def __init__(self): self.master=tk.Tk() self.master.geometry("+300+10") self.master.title('A Translater …
Jump to PostDuplicate of this post
Jump to PostYour question was already answered in this post with a demo of converting some words using a dictionary. You insist on using re which produces the undesired results, instead of a dictionary lookup. There is nothing that anyone can do to make bad code work.
All 15 Replies
woooee 814 Nearly a Posting Maven
Varunkrishna 0 Junior Poster in Training
WolfShield 32 Posting Whiz in Training
Varunkrishna 0 Junior Poster in Training
WolfShield 32 Posting Whiz in Training
Varunkrishna 0 Junior Poster in Training
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
woooee 814 Nearly a Posting Maven
Varunkrishna 0 Junior Poster in Training
woooee 814 Nearly a Posting Maven
Varunkrishna 0 Junior Poster in Training
Varunkrishna 0 Junior Poster in Training
WolfShield 32 Posting Whiz in Training
Varunkrishna 0 Junior Poster in Training
woooee 814 Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.