[Ask] GUI Python
#1
permisi om brother-brother sekalian, ane mau nanya sedikit tentang python.
ane dapet tugas ttng pemrograman python, yang ane mau tanya ada yg punya tutorial/ebook cara pembuatan aplikasi GUI dengan bahasa python tidak? terimakasih

#2
pake wxPython

#3
pake Tkinter dari python juga bisa bro! tapi ane masih tahap belajar juga ne! masih bloem bisa input kolom ke Tkinternya Big Grin

#4
monggo main kesini group nya coder python indonesia
https://www.facebook.com/groups/IndonesianPython/

#5
pake QT bro,, kalo males hard coding bisa drag&drop pake Qt Creator/QtDesigner
" In the DARK, I can SEE you "

#6
(05-01-2014, 12:46 PM)Rvz_Venom Wrote: pake QT bro,, kalo males hard coding bisa drag&drop pake Qt Creator/QtDesigner

ane udah coba design pake Qt designer trus kan tersimpan filenya jadi .ui nah yang ane mau tanyakan gmn caranya mengeksport jadi berbentuk script? (.py/.pyw) thanx

#7
coba pakek boa-constructor
nih saya sertakan SS-Nya
[Image: ESed7JK.png]

sebagai percobaan coba buka terminal, ketikkan :
Code:
mkdir coba
cd coba
tetep diterminal, ketikkan :
Code:
gedit App1.py
masukkan script python ini :
Code:
#!/usr/bin/env python
#Boa:App:BoaApp

import wx

import Frame1

modules ={'Frame1': [1, 'Main frame of Application', u'Frame1.py']}

class BoaApp(wx.App):
    def OnInit(self):
        self.main = Frame1.create(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    main()
masih tetep diterminal :
Code:
gedit Frame1.py
masukan script ini :
Code:
#Boa:Frame:Frame1

import wx, os, commands
from time import sleep

def create(parent):
    return Frame1(parent)

[wxID_FRAME1, wxID_FRAME1DHCP, wxID_FRAME1IPTABLES, wxID_FRAME1KELUAR,
wxID_FRAME1MON0, wxID_FRAME1PANEL1, wxID_FRAME1WIFI,
] = [wx.NewId() for _init_ctrls in range(7)]

class Frame1(wx.Frame):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
              pos=wx.Point(551, 267), size=wx.Size(206, 208),
              style=wx.DEFAULT_FRAME_STYLE, title=u'Linux Cuy')
        self.SetClientSize(wx.Size(190, 170))

        self.panel1 = wx.Panel(id=wxID_FRAME1PANEL1, name='panel1', parent=self,
              pos=wx.Point(0, 0), size=wx.Size(190, 170),
              style=wx.TAB_TRAVERSAL)

        self.mon0 = wx.Button(id=wxID_FRAME1MON0, label=u'Aktifkan mon0',
              name=u'mon0', parent=self.panel1, pos=wx.Point(8, 8),
              size=wx.Size(104, 23), style=0)
        self.mon0.Bind(wx.EVT_BUTTON, self.OnMon0Button, id=wxID_FRAME1MON0)

        self.wifi = wx.Button(id=wxID_FRAME1WIFI, label=u'Scan Wifi',
              name=u'wifi', parent=self.panel1, pos=wx.Point(8, 40),
              size=wx.Size(104, 23), style=0)
        self.wifi.Bind(wx.EVT_BUTTON, self.OnWifiButton, id=wxID_FRAME1WIFI)

        self.dhcp = wx.Button(id=wxID_FRAME1DHCP, label=u'Config dhcp',
              name=u'dhcp', parent=self.panel1, pos=wx.Point(8, 72),
              size=wx.Size(104, 23), style=0)
        self.dhcp.Bind(wx.EVT_BUTTON, self.OnDhcpButton, id=wxID_FRAME1DHCP)

        self.iptables = wx.Button(id=wxID_FRAME1IPTABLES,
              label=u'Atur iptables', name=u'iptables', parent=self.panel1,
              pos=wx.Point(8, 104), size=wx.Size(104, 23), style=0)
        self.iptables.Bind(wx.EVT_BUTTON, self.OnIptablesButton,
              id=wxID_FRAME1IPTABLES)

        self.keluar = wx.Button(id=wxID_FRAME1KELUAR, label=u'Keluar',
              name=u'keluar', parent=self.panel1, pos=wx.Point(8, 136),
              size=wx.Size(104, 23), style=0)
        self.keluar.Bind(wx.EVT_BUTTON, self.OnKeluarButton,
              id=wxID_FRAME1KELUAR)

    def __init__(self, parent):
        self._init_ctrls(parent)

    def OnMon0Button(self, event):
        os.system('gnome-terminal --command="airmon-ng start wlan0"')

    def OnWifiButton(self, event):
        os.system('gnome-terminal --command="airodump-ng mon0"')

    def OnDhcpButton(self, event):
        event.Skip()

    def OnIptablesButton(self, event):
        os.system('iptables -F && iptables --table nat --flush && iptables --delete-chain \
        && iptables --table nat --delete-chain')

    def OnKeluarButton(self, event):
        exit()
sekaran coba kita jalankan
Code:
python App1.py

Semoga berhasil Smile
Calon manusia sukses tidak akan pernah mengeluh, tapi akan sibuk memperbaiki diri dari semua kesalahan yang pernah dibuatnya
My Facebook
My Twitter

#8
pake pyside brow,, ane udah coba,, bisa kok,, file ui nya jadi py

cek aja di synaptic ,, pyside
" In the DARK, I can SEE you "

#9
makasih banyak bro infonya...
baru tau saya hehe buat GUI nya....

#10
(05-09-2014, 01:19 PM)faizul amali Wrote: coba pakek boa-constructor
nih saya sertakan SS-Nya


sebagai percobaan coba buka terminal, ketikkan :
Code:
mkdir coba
cd coba
tetep diterminal, ketikkan :
Code:
gedit App1.py
masukkan script python ini :
Code:
#!/usr/bin/env python
#Boa:App:BoaApp

import wx

import Frame1

modules ={'Frame1': [1, 'Main frame of Application', u'Frame1.py']}

class BoaApp(wx.App):
    def OnInit(self):
        self.main = Frame1.create(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    main()
masih tetep diterminal :
Code:
gedit Frame1.py
masukan script ini :
Code:
#Boa:Frame:Frame1

import wx, os, commands
from time import sleep

def create(parent):
    return Frame1(parent)

[wxID_FRAME1, wxID_FRAME1DHCP, wxID_FRAME1IPTABLES, wxID_FRAME1KELUAR,
wxID_FRAME1MON0, wxID_FRAME1PANEL1, wxID_FRAME1WIFI,
] = [wx.NewId() for _init_ctrls in range(7)]

class Frame1(wx.Frame):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
              pos=wx.Point(551, 267), size=wx.Size(206, 208),
              style=wx.DEFAULT_FRAME_STYLE, title=u'Linux Cuy')
        self.SetClientSize(wx.Size(190, 170))

        self.panel1 = wx.Panel(id=wxID_FRAME1PANEL1, name='panel1', parent=self,
              pos=wx.Point(0, 0), size=wx.Size(190, 170),
              style=wx.TAB_TRAVERSAL)

        self.mon0 = wx.Button(id=wxID_FRAME1MON0, label=u'Aktifkan mon0',
              name=u'mon0', parent=self.panel1, pos=wx.Point(8, 8),
              size=wx.Size(104, 23), style=0)
        self.mon0.Bind(wx.EVT_BUTTON, self.OnMon0Button, id=wxID_FRAME1MON0)

        self.wifi = wx.Button(id=wxID_FRAME1WIFI, label=u'Scan Wifi',
              name=u'wifi', parent=self.panel1, pos=wx.Point(8, 40),
              size=wx.Size(104, 23), style=0)
        self.wifi.Bind(wx.EVT_BUTTON, self.OnWifiButton, id=wxID_FRAME1WIFI)

        self.dhcp = wx.Button(id=wxID_FRAME1DHCP, label=u'Config dhcp',
              name=u'dhcp', parent=self.panel1, pos=wx.Point(8, 72),
              size=wx.Size(104, 23), style=0)
        self.dhcp.Bind(wx.EVT_BUTTON, self.OnDhcpButton, id=wxID_FRAME1DHCP)

        self.iptables = wx.Button(id=wxID_FRAME1IPTABLES,
              label=u'Atur iptables', name=u'iptables', parent=self.panel1,
              pos=wx.Point(8, 104), size=wx.Size(104, 23), style=0)
        self.iptables.Bind(wx.EVT_BUTTON, self.OnIptablesButton,
              id=wxID_FRAME1IPTABLES)

        self.keluar = wx.Button(id=wxID_FRAME1KELUAR, label=u'Keluar',
              name=u'keluar', parent=self.panel1, pos=wx.Point(8, 136),
              size=wx.Size(104, 23), style=0)
        self.keluar.Bind(wx.EVT_BUTTON, self.OnKeluarButton,
              id=wxID_FRAME1KELUAR)

    def __init__(self, parent):
        self._init_ctrls(parent)

    def OnMon0Button(self, event):
        os.system('gnome-terminal --command="airmon-ng start wlan0"')

    def OnWifiButton(self, event):
        os.system('gnome-terminal --command="airodump-ng mon0"')

    def OnDhcpButton(self, event):
        event.Skip()

    def OnIptablesButton(self, event):
        os.system('iptables -F && iptables --table nat --flush && iptables --delete-chain \
        && iptables --table nat --delete-chain')

    def OnKeluarButton(self, event):
        exit()
sekaran coba kita jalankan
Code:
python App1.py

Semoga berhasil Smile

makasih atas infonya om Big Grin
saya pake python yg window based, kmrn udah coba yg boa-cons tp ternyata g support

(05-09-2014, 03:48 PM)Rvz_Venom Wrote: pake pyside brow,, ane udah coba,, bisa kok,, file ui nya jadi py

cek aja di synaptic ,, pyside
ajarin brow make pyside di sistem operasi window, maklum bru belajar






Users browsing this thread: 1 Guest(s)