Feb-01-2021, 09:50 PM
(This post was last modified: Feb-01-2021, 09:51 PM by rachidel07.)
(Feb-01-2021, 08:22 PM)deanhystad Wrote: Let's make sure I understand.
You have a game. It takes input. The input has to have a certain format. You cannot change the game to accept a different format.
You have a website that provides input for your game. The information from the website is not in the correct format for your game.
You want a translator that will take the output from the website and convert it to a format that can be input to the game.
Is that correct?
If that is correct, I would write a really small GUI application (using tkinter for example). There would be a control for pasting text from the website, a function that translates the text, and a control that displays the translated text so it could be copied and pasted into your game.
import tkinter as tk translation = {'[':'(', ']':')', ';':','} def translate(*args): outstr.set(''.join([translation.get(c, c) for c in inpstr.get()])) root = tk.Tk() inpstr = tk.StringVar() outstr = tk.StringVar() inpstr.trace('w', translate) tk.Label(root, text='From Website:').pack(padx=5, pady=5) tk.Entry(root, textvariable=inpstr, width=20).pack(padx=5, pady=5) tk.Label(root, text='To Game:').pack(padx=5, pady=5) tk.Entry(root, textvariable=outstr, width=20).pack(padx=5, pady=5) tk.mainloop()
yes you understood my idea ^^ and that is what i want exactlly. thank you soo much bro i apreciate your help and your time
thank you ^^
thank you ^^