Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › A couple of questions about my program in python
New Posts  All Forums:Forum Nav:

A couple of questions about my program in python

post #1 of 4
Thread Starter 
Let me explain my current situation. I am making a e-POS system for a takeaway. I have a window, which opens another window which takes some input from the user. Then that window closes and I want to pass the info from the user back to the previous window which was never closed. Both windows are a separate class. I am also using wxPython as the GUI toolkit. Not sure if anyone's able to help but it's worth a shot.

So the window is this: http://pastebin.com/c74THTJ8
The window I open is this: http://pastebin.com/YHvGnsBa

1st Window: The button at line 134 calls the function at line 290 which creates an instance of the 2nd Window.

2nd Window: I created class Result() to pass it back but it doesn't like it. Saying n and p are not global.

If anyone at all could help, I would be so grateful. I'm so close to finishing it's frustrating.
Gaming Beast
(17 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i5 4430 MSI Z87-G41 PC Mate MSI GeForce GTX 660 Twin Frozr OC Corsair Value Select 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Western Digital Caviar Green Seagate Barracuda LiteOn IHAS124-14 24x SATA Internal DVD-RW / DV... 
OSMonitorMonitorKeyboard
Windows 8.1 22" Samsung S22A200B Widescreen LED Monitor Iiyama PLX436S 17" Microsoft SIdewinder X4 
PowerCaseMouseMouse Pad
450W Coolermaster GX 80 Plus EZCOOL Mesh Design Mid Tower Case Razr DeathAdder Razr Goliathus 
Audio
M-Audio Audiophile 2496 
CPUMotherboardGraphicsOS
i7 4700HQ MSI MS-16H2 Intel(R) HD Graphics 4600 Microsoft Windows 8.1 
KeyboardPowerAudio
Steelseries 6-Cell Li-Polymer(4840mAh 52Wh) Sound by Dynaudio, Support 7.1 channel S/PDIF o... 
  hide details  
Reply
Gaming Beast
(17 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i5 4430 MSI Z87-G41 PC Mate MSI GeForce GTX 660 Twin Frozr OC Corsair Value Select 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Western Digital Caviar Green Seagate Barracuda LiteOn IHAS124-14 24x SATA Internal DVD-RW / DV... 
OSMonitorMonitorKeyboard
Windows 8.1 22" Samsung S22A200B Widescreen LED Monitor Iiyama PLX436S 17" Microsoft SIdewinder X4 
PowerCaseMouseMouse Pad
450W Coolermaster GX 80 Plus EZCOOL Mesh Design Mid Tower Case Razr DeathAdder Razr Goliathus 
Audio
M-Audio Audiophile 2496 
CPUMotherboardGraphicsOS
i7 4700HQ MSI MS-16H2 Intel(R) HD Graphics 4600 Microsoft Windows 8.1 
KeyboardPowerAudio
Steelseries 6-Cell Li-Polymer(4840mAh 52Wh) Sound by Dynaudio, Support 7.1 channel S/PDIF o... 
  hide details  
Reply
post #2 of 4
it would be better if you posted the code
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
OverKill
(18 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X6 1055T Gigabyte 890FXA ATI FirePro V3800 ATI FirePro V3800 
RAMHard DriveHard DriveOptical Drive
16gb GSkill 10666 Seagate Western Digital  LG Blue Ray 
CoolingOSMonitorMonitor
stock air 7 Pro 64 bit (2)22" Acer x223w (2)23" Acer G235H 
KeyboardPowerCaseMouse
Microsoft Wireless Antec 900watt Antec 300 Wacom Tablet 
Audio
Logitech Speakers and sub 
  hide details  
Reply
post #3 of 4
Thread Starter 
I did
Gaming Beast
(17 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i5 4430 MSI Z87-G41 PC Mate MSI GeForce GTX 660 Twin Frozr OC Corsair Value Select 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Western Digital Caviar Green Seagate Barracuda LiteOn IHAS124-14 24x SATA Internal DVD-RW / DV... 
OSMonitorMonitorKeyboard
Windows 8.1 22" Samsung S22A200B Widescreen LED Monitor Iiyama PLX436S 17" Microsoft SIdewinder X4 
PowerCaseMouseMouse Pad
450W Coolermaster GX 80 Plus EZCOOL Mesh Design Mid Tower Case Razr DeathAdder Razr Goliathus 
Audio
M-Audio Audiophile 2496 
CPUMotherboardGraphicsOS
i7 4700HQ MSI MS-16H2 Intel(R) HD Graphics 4600 Microsoft Windows 8.1 
KeyboardPowerAudio
Steelseries 6-Cell Li-Polymer(4840mAh 52Wh) Sound by Dynaudio, Support 7.1 channel S/PDIF o... 
  hide details  
Reply
Gaming Beast
(17 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i5 4430 MSI Z87-G41 PC Mate MSI GeForce GTX 660 Twin Frozr OC Corsair Value Select 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Western Digital Caviar Green Seagate Barracuda LiteOn IHAS124-14 24x SATA Internal DVD-RW / DV... 
OSMonitorMonitorKeyboard
Windows 8.1 22" Samsung S22A200B Widescreen LED Monitor Iiyama PLX436S 17" Microsoft SIdewinder X4 
PowerCaseMouseMouse Pad
450W Coolermaster GX 80 Plus EZCOOL Mesh Design Mid Tower Case Razr DeathAdder Razr Goliathus 
Audio
M-Audio Audiophile 2496 
CPUMotherboardGraphicsOS
i7 4700HQ MSI MS-16H2 Intel(R) HD Graphics 4600 Microsoft Windows 8.1 
KeyboardPowerAudio
Steelseries 6-Cell Li-Polymer(4840mAh 52Wh) Sound by Dynaudio, Support 7.1 channel S/PDIF o... 
  hide details  
Reply
post #4 of 4
I see no questions in this post, but I'll ask some.

Code:
class Result():
  def Result(self):
    return n, p
Why would n or p be global?
Why does this class even exist?

You don't actually show where you want to use them in your main form either, and your "pickup" local is not a member so is only in the scope of of OrderFrame.Pickup

If they are local (the values of self.name_box and self.phone_box) then add accessors or get them from the members directly.

Make pickup a member of OrderFrame and use pickup.GetPhone or something similar wherever you want to use it in OrderFrame.
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › A couple of questions about my program in python