In python-3.x
with tkinter
GUI, I developed a program with a regular simple window.
I want to show a markdown format string saved in a string called markdownText
on program window:
markdownText='_italic_ or **bold**'
desired output is:
italic or bold
Is there any solution?
You use the open() function to open the Picnic.md file; passing the value 'r' to the mode parameter to signify that Python should open it for reading. You save the file object in a variable called f , which you can use to reference the file. Then you read the file and save its contents inside the text variable.
To add a Python code chunk to an R Markdown document, you can use the chunk header ```{python} , e.g., ```{python} print("Hello Python!") ```
Markdown is a lightweight markup language. It is used to add formatting elements to plain text documents. It is one of the most popular markup languages in the world. When creating a Markdown string, you add Markdown syntax to your text to indicate which words and phrases should look different.
The tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as well as on Windows systems.
I was just searching for a similar solution, and it does indeed not seem like there is a default module/class/library for the combination of Python, TkInter and markdown. However a continued search revealed the following options:
In other words, if you are willing to use an intermediate step of converting into html that might be a viable route for you to display markdown strings within a tkinter GUI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With