I made an FTP server-client in C.
I connected them using GUI made in glade !
I want to know how to use text entered in a text box as a command line argument.
This the code for Client.glade
Code:
#!/usr/bin/env python
"""client.pyw"""
import os
import sys
try:
import pygtk
pygtk.require("2.0")
except:
pass
try:
import gtk
import gtk.glade
except:
sys.exit(1)
class HellowWorldGTK:
def __init__(self):
#Set the Glade file
self.gladefile = "Client.glade"
self.wTree = gtk.glade.XML(self.gladefile)
#Create our dictionay and connect it
dic = {
"on_btnHelloWorld_clicked" : self.btnHelloWorld_clicked,
"on_MainWindow_destroy" : gtk.main_quit
}
self.wTree.signal_autoconnect(dic)
dic = {
"on_btnHelloWorld1_clicked" : self.btnHelloWorld1_clicked,
"on_MainWindow_destroy" : gtk.main_quit
}
self.wTree.signal_autoconnect(dic)
def btnHelloWorld1_clicked(self, widget):
os.system('clear && gcc -o c ftpcli.c && ./c <Server IP Address>')
def btnHelloWorld_clicked(self, widget):
sys.exit(1)
if __name__ == "__main__":
hwg = HellowWorldGTK()
gtk.main()
I have attached a snap shot for your convenience.
The buttons work correctly.
I just want the IP address to be entered in the box and it be used as in the
bold portion in the code above !
Please help !
Thanx !