Home > OS >  Script with ttk theme doesn't open in VSC
Script with ttk theme doesn't open in VSC

Time:09-22

I'm trying out Azure theme from https://github.com/rdbende/Azure-ttk-theme. When i just double click example file(Azure-ttk-theme-main\azure dark\example.py) it works perfectly, but if I open the script in VSC and try to run it i get an error: root.tk.call('source', 'azure dark.tcl') _tkinter.TclError: couldn't read file "azure dark.tcl": no such file or directory

What is the problem?

CodePudding user response:

The problem is in your code. You do:

root.tk.call('source', 'azure dark.tcl')

but the documentation says to do:

root.tk.call("source", "azure.tcl")
root.tk.call("set_theme", "dark")

Looking at the source of the theme, all the other things involved (all subsidiary scripts and resources) are designed to be relative to the location of the azure.tcl script. That main script (which includes some critical pieces) can be loaded with any path… so long as it is actually there (along with all the other pieces).

But you were just giving a wrong path to only part of the theme.

  • Related