Posts

Showing posts with the label destroy

How to destroy the First Window?

How to destroy the First Window? I am making the GUI Chat Program using the following Steps as following: After the Login is successful, the First Window has not been destroyed. (OS : window 7, Python 2.7) Please, help me to destroy the First Window successfully!! chat_login.py: from socket import * import thread, time import msvcrt as m from tkinter import * from tkinter import scrolledtext import os import sys login_w = Tk() login_w.title("The SCH Chat-Client V0.1") login_w.geometry('400x100') s = socket(AF_INET, SOCK_STREAM) id_label = Label(login_w,text=" I D : " ) id_label.grid(column=0, row=0) id_txt = Entry(login_w) id_txt.grid(row=0, column=1) pass_label = Label(login_w,text="Password : " ) pass_label.grid(column=0, row=1) pass_txt = Entry(login_w) pass_txt.grid(row=1, column=1) def recvMsg(sock): while True: recvmsg = sock.recv(1024) def Con_Clicked(): host = "127.0.0.1" port = 8008 print host try:...

How to destroy a class object in PHP?

How to destroy a class object in PHP? I wrote a little class for storing global variables/functions. My question is - is it necessary to destroy the class object after the script has finished? or will PHP destroy that object itself? Here's my code: $web=new c_web("myWeb"); $web->loadTemplate("/!framework/admin/template.htm"); $web->doStuff(); // script has finished - destroying required here? In case I need to destroy it, how can I do that? 3 Answers 3 If the script finishes, the memory is released. You're ready as is :) great - thanks! and what about if a script will will be terminated by an error? will all variables (database ..) be destroyed aswell? – Fuxi Apr 8 '11 at 11:34 Well, the d...