1

I am trying to make a GUI app but have found that the simplest bit of code is giving me a error. I cannot seem to figure out what I am doing wrong.

This is the section of code causing the error:

container = tk.Frame(self)
container.pack(side="top", fill="both", expand=True)
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)

self.frames = {}

for F in (Teams, Final):
    frame = F(container)
    self.frames[F] = frame
    frame.grid(row=0, column=0, sticky="nsew")

self.show_frame(Teams)

Here is the traceback:

Traceback (most recent call last):  
File "D:/Files/Code/Python/SPI/Beta/GUI/SPIgui.py", line 47, in <module>
     app = SPI()  
File "D:/Files/Code/Python/SPI/Beta/GUI/SPIgui.py", line 36, in __init__  
    frame.grid(row=0, column=0, sticky="nsew")  
File "C:\Users\dsull\AppData\Local\Programs\Python\Python35\lib\tkinter\__init__.py", line 2074, in grid_configure + self._options(cnf, kw))  
_tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack

You can find the full source code for my program here: http://pastebin.com/SD7x0EnE

Michael0x2a
  • 58,192
  • 30
  • 175
  • 224
Jack Sullivan
  • 199
  • 1
  • 1
  • 10
  • http://stackoverflow.com/q/40574608/7432. Also, please read [How to create a Minimal, Complete and Verifiable Example](http://www.stackoverflow.com/help/mcve). The code you posted isn't sufficient to reproduce the problem. – Bryan Oakley Dec 27 '16 at 22:42
  • You should show the complete traceback or at least the last pair of lines that show where the exception occurred. – Terry Jan Reedy Dec 29 '16 at 00:35
  • ok I will add that – Jack Sullivan Dec 29 '16 at 02:40
  • What is inside ncaam.csv? Please post a sample ncaam.csv. – Eddie Dec 31 '16 at 04:01
  • sample ncaam.csv- Abilene Christian, 732, 143, 335, 31, 79, 0.6, 49.6, 53.4, -4.21, 0.5, 10 – Jack Sullivan Dec 31 '16 at 04:46
  • I fixed the error i was receiving but i am now getting a new one, by any chance could you help me with this new one? TypeError: Can't convert 'int' object to str implicitly. The line causing the error is ppg2 = float(result[self.controller.teams['away team'][0].get()]) – Jack Sullivan Dec 31 '16 at 05:07
  • Possible duplicate of [Cannot use geometry manager pack inside](https://stackoverflow.com/questions/23584325/cannot-use-geometry-manager-pack-inside) – Stevoisiak Feb 14 '18 at 21:13

0 Answers0