mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	al. if already set. Also adds TIX_LIBRARY (just in case). (Note that this is entirely Windows specific.)
		
			
				
	
	
		
			11 lines
		
	
	
	
		
			317 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
	
		
			317 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import sys, os, _tkinter
 | 
						|
 | 
						|
ver = str(_tkinter.TCL_VERSION)
 | 
						|
for t in "tcl", "tk", "tix":
 | 
						|
    key = t.upper() + "_LIBRARY"
 | 
						|
    try:
 | 
						|
        v = os.environ[key]
 | 
						|
    except KeyError:
 | 
						|
        v = os.path.join(sys.prefix, "tcl", t+ver)
 | 
						|
        if os.path.exists(os.path.join(v, "tclIndex")):
 | 
						|
            os.environ[key] = v
 |