Posts: 21
Joined: Thu Sep 27, 2018 4:33 pm

what's wrong ?

Sat Sep 25, 2021 5:26 pm

can someone tells me what's wrong with this code?

Code: Select all

import tkinter as tk
from tkinter import *
from tkinter import ttk
from tkinter.messagebox import showinfo
#from PIL import ImageTk, Image

class Application(Frame):
	"""Build the basic window frame template"""

	def __init__(self, master):
		super(Application, self).__init__(master)

	def notdone(self):
		showinfo(title='Not implemented', message='Not yet available') 

	def about(self):
		showinfo(title='About', message='Application developed by Xcaixa LLC\nPh: (941)726-6632\nemail: aqs.mro@gmail.com') 

	def create_widgets(self):
		menubar = Menu(self)
#		self.config(menu=menubar)

		# add a submenu
		sessionmenu = Menu(menubar)
		menubar.add_cascade(label="Work Session", menu=sessionmenu)
		helpmenu = Menu(menubar)
		menubar.add_cascade(label='Help', menu=helpmenu)

		sessionmenu.add_command(label='New', menu=self.clear)	
		sessionmenu.add_command(label='Old', command=self.clear)
		helpmenu.add_command(label='Help', command=self.clear)
		helpmenu.add_command(label='About', command=self.clear)		
		subsessionmenu = Menu(sessionmenu)#, tearoff=0)
		subsessionmenu.add_command(label='LCD CDU 174101_Series')
		subsessionmenu.add_command(label='DCP 622-8590_Series')
		subsessionmenu.add_command(label='SI-800 4039891_Series')
		subsessionmenu.add_command(label='ISDU CG1135_Series')
		subsessionmenu.add_command(label='ISDU CG1136_Series')	
		sessionmenu.add_cascade( menu=subsessionmenu)
#		Label(self, text="").grid(row=12, column=14, sticky='e')
	def clear(self):
		"""Clear the Entry forms"""
root = Tk()
root.title('Air Accessories and Avionics')
app = Application(root)

thanks in advance

[moderator added code tags]

Posts: 12228
Joined: Wed Jan 25, 2012 6:39 pm

Re: what's wrong ?

Sat Sep 25, 2021 5:33 pm

1. Please repost the code within Code tags so that the indentations are preserved.

2. Please post the error message(s) when run.
Quis custodiet ipsos custodes?

User avatar
Posts: 12973
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: what's wrong ?

Sat Sep 25, 2021 5:37 pm

juliolop wrote:
Sat Sep 25, 2021 5:26 pm
can someone tells me what's wrong with this code?

[ script suppressed from this response ]

thanks in advance

"can someone tells me what's wrong with this code? "

It looks a bit like Python. But it can't be, because Python relies on indentation (left hand whitespace) for the syntax of loops and function definitions.

(You can retrospectively edit your post to use the forum [ CODE ] tag markup.)

{Formatting rectified by Moderator}

But genuinely - what do YOU think is wrong with the code? Why the question?

{Edit: unintended echo of the same issues raised as I was typing.... }
Last edited by B.Goode on Sun Sep 26, 2021 5:39 am, edited 1 time in total.

User avatar
Posts: 6477
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: what's wrong ?

Sat Sep 25, 2021 5:41 pm

Last edited by Burngate on Sun Sep 26, 2021 10:00 am, edited 1 time in total.

User avatar
Posts: 5767
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: what's wrong ?

Sat Sep 25, 2021 9:44 pm

I suggest you go back to your employer
Application developed by Xcaixa LLC\nPh: (941)726-6632\nemail: aqs.mro@gmail.com
and admit that your skills aren't up to the task.

The first step in fixing any issue is to identify the problem. That means knowing what exception your python code is throwing.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Return to “Python”