-1

I found a program, that uses gi, gi.repository, and Gtk. It seems like a great GUI for my Python script that involves Excel sheet imports and table grids.

I am finally able to import gi after much work, but still not able to import gi.repository or Gtk (No module named "")even though I believe I have them installed correctly.

I tried installing all the Gnome stuff and used the Jhbuild for GTK3 which only screwed all my files up. I uninstalled and reinstalled this stuff like 5 times. I also had to delete and reinstall Python.

I gave up on Jhbuild. Isn't there a simpler way to install GTK? Or is there a better GUI?

I have been using tkinter in Python 3, but the only problem is that a script I found that incorporates a table grid uses ttk while I do not use ttk. I do not understand ttk and excessively definitive (i.e. tkinter.ttk.Label, etc vs tkinter *'s Label). Ttk seems obsolete; please correct me if I am wrong.

For my simple beginner scripts I have been using from tkinter import *, which one would think that importing all (*), would include ttk, but I guess it must be specified. Using ttk messes up everything in my script even when I translate everything from tkinter * to ttk. I am clearly doing something wrong or ttk is obsolete. I receive errors such as unexpected arguments, things are not defined, name errors, __init__ errors, etc. It seems you cannot mesh (newer?) tkinter * modules with (older?) ttk modules.

Again, if anyone knows the best, newest and simplest GUI, I would really appreciate it. I using Python 3 on a Mac (Sierra 10.12.3).

gmonz
  • 252
  • 1
  • 5
  • 17
  • 1
    >>For my simple beginner scripts I have been using `from tkinter import *`, which one would think that importing all (*), would include ttk [look here](http://stackoverflow.com/a/24728212/6634373). – CommonSense Mar 16 '17 at 07:31
  • 1
    _"Ttk seems obsolete; please correct me if I am wrong."_ - you are wrong. Ttk is relatively more modern than tk, and is no more nor less obsolete than tkinter itself. – Bryan Oakley Mar 16 '17 at 08:43
  • If you want help, you should split your question into several questions and include your error messages. And as far as software recommendations are concerned, they're off-topic on Stack Overflow (see [help/on-topic]). – user2314737 Mar 16 '17 at 08:57

1 Answers1

1

Every time tkinter is imported(any way or form), it will search your computer for ttk, which is a requirement for tkinter. On Mac Sierra, the default ttk doesn't work and it's very buggy so you will need to install a custom ttk.

Follow this link to install the recommended version for mac. REMEMBER TO ONLY INSTALL 8.5 not 8.6 python doesn't support 8.6 yet.

Other common GUIs include pyqt and pygame(for games), while built in turtle for drawing. As a side note, I prefer using tkinter since it's easy to use and have most of the functionalities.

importing tkinter like this from tkinter import * isn't the preferred way, since name spaces is a tricky thing, since it's pretty easy to accidentally override something. For example: naming a tkinter.label Label. And the next time you wonder why you can't create a another label. So a better way would be import tkinter as tk.

Taku
  • 31,927
  • 11
  • 74
  • 85
  • Thanks! I am a beginner so have just been having alot of trouble. And did you mean import tkinter as tk or ttk? If so, whats the difference between tk and ttk? Ttk is tkinter.ttk.Label while tk is tkinter.Label? Or ttk.Label vs tk.Label? What is the difference? Sorry I am such a noob and ambitious to get something up and functional. I just read best practice is `import tkinter as tk from tkinter import ttk` – gmonz Mar 16 '17 at 22:37
  • 1
    tk is the same as tkinter while ttk is different. But they have many similarities – Taku Mar 16 '17 at 22:44
  • 1
    As a beginner, I would recommend sticking with import tkinter as tk. A brief summary would be tk is easier to use and easier to configure while ttk is more customizable but harder to use. Check this answer post as well http://stackoverflow.com/questions/19561727/what-is-the-difference-between-the-widgets-of-tkinter-and-tkinter-ttk-in-python – Taku Mar 16 '17 at 22:48
  • 1
    And remember: tk and ttk is two different things so try not to get it messed up. tkinter.Label is not the same as tkinter.ttk.Label but they are very similar. – Taku Mar 16 '17 at 22:53
  • Thanks @abccd! I really appreciate all the help from this community. Sorry if my noobness annoys some people here (which it seems to) lol – gmonz Mar 16 '17 at 22:56
  • 1
    We sometimes hate noob question because it been asked hundreds of times already or asking to do some sort of homework assignment. I think the reason for not liking yours is because you had too many questions in one question. But it doesn't matter, most question deserves to be answered;) – Taku Mar 16 '17 at 23:01
  • I have QT Creator installed but I want to use designer. I have looked everywhere and cannot find a download. I only want to use QT Designer. Any help? @abccd – gmonz Mar 18 '17 at 00:36
  • does https://riverbankcomputing.com/software/pyqt/download5 not include QT Designer as well? The last time I used it was on windows and it does include it, don't know on mac – Taku Mar 18 '17 at 07:58
  • ah im just an idiot, i found it. i was searching qt designer, not "designer". thanks again lol – gmonz Mar 18 '17 at 18:30