473,770 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dont know whats wrong?

2 New Member
hi,
I am new and dont know what went wrong.

Expand|Select|Wrap|Line Numbers
  1. from Tkinter import *
  2. import tkMessageBox
  3. from pysqlite2 import dbapi2 as sqlite
  4.  
  5. class door:
  6.     global simpleprint
  7.     def __init__(self,master):
  8.         frame = Frame(master)
  9.  
  10.  
  11.         self.lable1 =Label (frame,text ="ID")
  12.         self.lable1.grid(row =0)
  13.         self.lable2 = Label (frame,text = "Password")
  14.         self.lable2.grid(row=1)
  15.         self.entry1 = Entry(frame)
  16.         self.entry1.grid(row= 0,column =1)
  17.         self.entry2 = Entry(frame , show="*")
  18.         self.entry2.grid(row=1,column=1)
  19.         self.button1 = Button(frame, text="Ok",command=simpleprint(self.entry1.get(),self.entry2.get()))
  20.         self.button1.grid(row=2)
  21.         self.button2 = Button (frame,text="quit",command=frame.quit)
  22.         self.button2.grid(row=2,column=1)
  23.         frame.grid()
  24.  
  25.     def simpleprint(a,b):
  26.         print a,b
  27.  
  28. root = Tk()
  29. ap = door(root)
  30. root.mainloop()
  31.  
when i run this the simpleprint function runs first and then i get a gui part. there is no error. and i am completely new so cant figure out what is wrong with this one. I have tried few things but cant get it working.
Apr 17 '10 #1
2 1721
bvdet
2,851 Recognized Expert Moderator Specialist
You are very close! You cannot assign a function call directly to command because it will execute. Here's one way to get around that:
Expand|Select|Wrap|Line Numbers
  1. self.button1 = Button(frame, text="Ok",command=lambda: simpleprint(self.entry1.get(),self.entry2.get()))
Apr 17 '10 #2
sometingsometing
2 New Member
Thank you. Now its working perfectly.
Apr 17 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3470
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item) Case "Authenticated" Case "CI_CODE" Case "organisation_description" Case "location_description"
3
2395
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."', '".$_POST."')"); ?> <script language="JavaScript"> <!--
24
7692
by: Jazper | last post by:
hi i have this problem. i made a class deverted by CRootItem with implementation of IDisposable-Interface. i made a test-funktion to test my Dispose-Method.... but when set a breakpoint in my Dispose-Method and call the GC nothing happend!!! my Disposemethod has never been called!! so the GC dont call my Dispose-Method although I implemented IDisposable? what am i doing wrong?
4
2433
by: Dan K. | last post by:
Hi NG, first of all i am new to OOP and C# so maybe thats my whole problem :) i wrote a small timer application, like i did if i was starting with programming in vb long time ago. the vb application (few years old) has memory usage around 7.000 K ... my new written C# Application around 18.000 K. after few operations like minimize to tray and then reactivate form memory usage rises higher ... i tried to integrate things like...
7
2231
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell me why? Its probably sooooooo obvious, but it is 1.19 am! Thanks. www.thunderin.co.uk/
2
3950
by: tasiekk | last post by:
I have 1 lil problem. I make simple Win Forms app and i put there a tab control. There i make two pages. In each page i make 1 button. In tabpage1 button1 and in tabpage2 button2. And i make access key for both buttons. &button1 and &button2. They have same access key but they are in diffrent pages. Access key works only in tabpage1 for button1 and access key for second button dont work. BUT! in diffrent comp it works. Same exec run on...
4
1981
by: ryann18 | last post by:
What is wrong with this?? Here are the two classes...SandBox and KittyKitty?? I need to also know what happens if two or more values are equal and if exactly two values are equal, does it matter whether the equal values are lower or higher than the third?? And can somebody please help me answer the questions at the bottom??? //A place to play with your kitty public class SandBox { public static void main(String args) {...
2
2497
by: Tiruak | last post by:
Hi there. Thanks in advance for the people reading and trying to help. I'm very begginer using flash and action script, and I tryed to do this one navigation menu. Since I dont have experience doing this, I did things in a way I thought it should work, to create the onmouseover animation of the buttons of my navigation menu. After a couple days working on it, I managed it to work almost the way I wanted it to, with 2 exceptions that I...
5
2321
by: islayer | last post by:
can someone tell me what is wrong with the bold code? i am just learning perl. the program should create a perl file with a random name (5 letters, followed by a number), but the name is always just the number. whats wrong with my code? #!/usr/bin/perl use Fcntl; @array = (a..z); srand; foreach (1..5) { $name = int(rand scalar(@array));
1
1974
rhitam30111985
by: rhitam30111985 | last post by:
Hi all , I am using a Compaq presario c700 notebook PC with windows vista(32 bit) . the specs are as follows : Intel Dual cpu t2370 1.73 ghz 2 GB ram Now i am having this strange problem . when i select the size of all files in one drive the size is around 65 MB (including hidden files) . But when i see the disk properties, the used space shown is 85 mb . whats wrong ?
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10037
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.