100,150 would mean the upper left corner of the button is 100 pixels to the right, and 150 pixels down. just play around with it, change the numbers and execute the program a few times to get a feeling for it.
Gives me a Depreciated Class warning, and it seams to be the reason my window is always loading and never finishing(also jet black with no name), I am using python 2.7 so i think that might be it, but I do not know were to look to find the proper code to fix this error, its the first real error science I picked up this Tutorial, and its stopping my progression. dos anyone know were or how to fix this?
i somehow managed to make a dialog box for the exit button work.
only problem is,it pops up again after choosing either options.
heres the code:
def closebutton(self,event): box=wx.MessageDialog(None,'Are you sure you want to exit?','Are you sure you want to exit?',wx.YES_NO) if box.ShowModal()==wx.ID_YES: self.Close(True) if box.ShowModal()==wx.ID_NO: box.Destroy
@noobjesss remove the true from the () marks we must be using a differnt version that needs true to be identfied. it works perfect with out the true statement.
lol I imported wx into IDLE and then did the directory command dir(wx) just to see what commands I can enter for various buttons, and I got like a million different commands. Try it yourself ;)
@louisrocks40 Nvm, i used task manager. What i did was i made it re-open after it closed somehow....cool! I dont even know how to do that and i did X-D
On a Mac 10.6 it doesn't seem that the button size changes. Well, the horizontal size changes, but not the vertical size. Not sure why... *scratches chin*
First of all Thanks Bucky. I went through the 43 tutorials of Python and it had a playlist and link to next episodes below each videos. But i am finding the search for next video in this wxPython tutorials little difficult. Is there other place which contains same videos but with link to the next episodes ..
alright, i sat here trynna figure it out for the longest of times, i made sure i got my caps where you have yours and it still wont work. however it popped uo when i finished just the window its self?
would it be possible to get someone to read over what i have typed out and see where i went wrong?
I got the box, the frame, the button and everything. But, nothing happens when I click on exist or the X. It says 'bucky' object has no attribute 'Destory'. Somebody Help !
Hi! I get a problem when I lauch this program. The frame doesn't show the button but appears on the screen. It shows the warning; "This window might be busy and is not responding. Do you want to terminate the application?". I use eee pc for Python programming with Xubuntu. What am I doing wrong :( ? Please help.
Noooo I spent hours trying to figure out where I stuffed up and it turned out to be that I missed the equals sign on ln6 between 'size' and the '(value)' essentially making Python think I was making a function call there. Now it all works smooth as a big fat smooth thing.
Big thanks to Holiverh from the New Boston Board for pointing this out.
Thanks for the great tutorials, man! I am trying to create an interface to access 2 dictionaries I have. I wanna create like a drop-down menu with possible keys and then get the respective values in the dictionaries. So the user chooses the keys and gets the value in a window or sth.
There are two letter 'T's in the word 'button' .... could you learn to pronounce at least one of them, please? [hey just kidding -- I have the same regional accent]
In Autohotkey program there is SmartGui creator or Lil builder that you design you gui by simple drag and drop of elements and it writes most of the code for you, which you then adjust. Does python have such a utility?
how do you make a button spit out static tex, open a file, save a file, save as a file, and open new window. if any one can help me that would be a big help.
AttributeError: 'bucky' object has no attribute 'closebutton'
^ Im getting that error for some reason, cant seem to find out why, code should be identical to the one in the vid, any idea where I might have messed up?
Damnn. I just can't learn this wxpython... The previous 44 vids were easy, but now if I try to use these new things on my own, I can't remember absolutely anything of these codes.
Wow, Killed my streak, i did 48 Python tutorials in a row before i got stuck on this one, time to stop working on this one and call it a night. GREAT TUTORIALS! I love all your video's please keep making them.
Hello Spazm6 , its actually Python 2.6 that has a syntax error for no apparent reason and you then have to rewrite the script again.Python 3.0 fixed this problem
so far I have found all of these tutorials to be very helpful. but now I'm having trouble replicating the results. could this have anything to do with my working on Mac OS X instead of Windows?
Hello faltru , if you want to work on Windows for your work to be better , download a free program called virtual pc where you can install a Window OS on it and basically having 2 pcs running on one screen.
hey can you help me out my computer is telling me my firewall is blocking my idle can you email me any suggestions to help with my problem i would realy appreciate it dude
When I'm writing python programs my code is all pretty and different colours at first..then I run it once and thereafter (unless I restart the IDLE) the code is just black. I want the prettiness back :(
I need help with coordinates. I can't picture where 60,70 would be, or 100,150 would be. Does anyone have any advice?
starwarsfan09225 2 weeks ago
100,150 would mean the upper left corner of the button is 100 pixels to the right, and 150 pixels down. just play around with it, change the numbers and execute the program a few times to get a feeling for it.
XGazudin 1 week ago
to dodododis dododa
XoRr0WBi7ch 1 month ago
app=ex.PySimpleApp()
Gives me a Depreciated Class warning, and it seams to be the reason my window is always loading and never finishing(also jet black with no name), I am using python 2.7 so i think that might be it, but I do not know were to look to find the proper code to fix this error, its the first real error science I picked up this Tutorial, and its stopping my progression. dos anyone know were or how to fix this?
nomoreHen 1 month ago in playlist More videos from thenewboston
Where I can find your blog or website for more information? Thanks, Greetings from Mexico.
AlberthN95 2 months ago
@AlberthN95 His website is thenewboston . com
CakeAndPi3 1 month ago
@CakeAndPi3 Thank you very much... :)
AlberthN95 1 month ago
Comment removed
snypton 2 months ago
@SickSonido The button you want it to affect is the third parameter. Say I had a button called Bucky.
self.Bind(wx.EVT_BUTTON, wahteverfunction(params), Bucky)
Lachy2901 2 months ago
MainLoop has a capital L in it rrrrr lol
pythman 4 months ago
i somehow managed to make a dialog box for the exit button work.
only problem is,it pops up again after choosing either options.
heres the code:
def closebutton(self,event): box=wx.MessageDialog(None,'Are you sure you want to exit?','Are you sure you want to exit?',wx.YES_NO) if box.ShowModal()==wx.ID_YES: self.Close(True) if box.ShowModal()==wx.ID_NO: box.Destroy
help please?
noobjesss 5 months ago
@noobjesss remove the true from the () marks we must be using a differnt version that needs true to be identfied. it works perfect with out the true statement.
MrBodeci 5 months ago
wxPython
Zuckyit 5 months ago
lol I imported wx into IDLE and then did the directory command dir(wx) just to see what commands I can enter for various buttons, and I got like a million different commands. Try it yourself ;)
Kamilk12l 6 months ago 4
@Kamilk12l More like 3500~ commands.
Zeldakitteh 4 months ago
Understand this stuff so much more now getting more interesting, thanks Bucky.
jimmybobs999 6 months ago
Is this 2.6 or 2.7 python?
AMcKeeCT 7 months ago
This has been flagged as spam show
THUMBS UP SO EVERY ONE CAN SEE!!
The keyword arg error fix add a bracket
wx.Frame.__init__(self,parent,id,'Frame aka Window',size=(300,200)) panel=wx.Panel(self) button=wx.Button(panel,label="exit",pos=(130,10),size=(60,30)) self.Bind(wx.EVT_BUTTON, self.closebutton, button) self.Bind(wx.EVT_CLOSE, self.closewindow)
TheNeweN24 7 months ago
I understand! Since self is a placeholder, when you close self, you close the programe ITself. IM LEARNING!
louisrocks40 8 months ago
umm...i accidentally made an unclosable program....how do i close it o.O
louisrocks40 8 months ago
@louisrocks40 Nvm, i used task manager. What i did was i made it re-open after it closed somehow....cool! I dont even know how to do that and i did X-D
louisrocks40 8 months ago
i put exactly what bucky put up there and it gave me an error and wouldnt even run the window! HELP PLEASE!!!
TheGeekTraining 8 months ago 3
@TheGeekTraining i found the answer you dont need the closewindow part if your using python 2.7.1
TheGeekTraining 8 months ago 3
finnaly it works I forgot the space before size=(300,200).
so everyone do the cabs AND the spaces exact the same
francis123222 8 months ago
On a Mac 10.6 it doesn't seem that the button size changes. Well, the horizontal size changes, but not the vertical size. Not sure why... *scratches chin*
derangedmind 8 months ago
First of all Thanks Bucky. I went through the 43 tutorials of Python and it had a playlist and link to next episodes below each videos. But i am finding the search for next video in this wxPython tutorials little difficult. Is there other place which contains same videos but with link to the next episodes ..
Shri7hari 9 months ago
alright, i sat here trynna figure it out for the longest of times, i made sure i got my caps where you have yours and it still wont work. however it popped uo when i finished just the window its self?
would it be possible to get someone to read over what i have typed out and see where i went wrong?
9mankaido3 9 months ago in playlist wxPython Tutorials: thenewboston
Alright....this is emberassing, i'm gonna stop putting comments asking for a bit of help if this keeps up. lol
just fixed my own issue, how i couldn't tell you.
9mankaido3 9 months ago in playlist wxPython Tutorials: thenewboston
it's not work =(
Pigge4ever 10 months ago
are there any tools for creating GUIs in python by dragging and dropping components? (like netbeans does with java)
scullshot 10 months ago
@scullshot wxGlade
Xplosive24 10 months ago
know i came make fake apps that people will download and make me money muajjajajajajjajajaja no am not going to do that
loko95ftp 10 months ago
I got the box, the frame, the button and everything. But, nothing happens when I click on exist or the X. It says 'bucky' object has no attribute 'Destory'. Somebody Help !
nyanpaingtin 10 months ago
@nyanpaingtin you typed destroy wrong
OldSqlGaming 10 months ago
@OldSqlGaming Thank you so much.....
nyanpaingtin 10 months ago
Hi! I get a problem when I lauch this program. The frame doesn't show the button but appears on the screen. It shows the warning; "This window might be busy and is not responding. Do you want to terminate the application?". I use eee pc for Python programming with Xubuntu. What am I doing wrong :( ? Please help.
agfaclan 10 months ago
man you rock
74SteveG 11 months ago
Come on keyboard!
GROOVEMASTER24 11 months ago
Noooo I spent hours trying to figure out where I stuffed up and it turned out to be that I missed the equals sign on ln6 between 'size' and the '(value)' essentially making Python think I was making a function call there. Now it all works smooth as a big fat smooth thing.
Big thanks to Holiverh from the New Boston Board for pointing this out.
burpwind 1 year ago
The keyword arg error fix add a bracket
wx.Frame.__init__(self,parent,id,'Frame aka Window',size=(300,200)) panel=wx.Panel(self) button=wx.Button(panel,label="exit",pos=(130,10),size=(60,30)) self.Bind(wx.EVT_BUTTON, self.closebutton, button) self.Bind(wx.EVT_CLOSE, self.closewindow)
virman123 1 year ago 6
@virman123 thanks man you should whrite thumbs up so everyone can see
TheNeweN24 7 months ago
To those got : “ 'bucky' object has no attribute 'closebutton'”
Try this: put all the ‘def' at exactly same column.
Penny4270 1 year ago 3
@Penny4270 thank you so much :)
OldSqlGaming 10 months ago
Thanks a lot , your tutorials are really awesome , it's all I need and searching for now . Thanks again \m/
cutithongtin 1 year ago
Thanks for the great tutorials, man! I am trying to create an interface to access 2 dictionaries I have. I wanna create like a drop-down menu with possible keys and then get the respective values in the dictionaries. So the user chooses the keys and gets the value in a window or sth.
victorlinguist 1 year ago
Everytime I run the python code, it opens a window but it freezes. Help, please.
newman30000010 1 year ago 2
@newman30000010 I have the same problem, dunno what would help, please tell me if you find the answer :)
agfaclan 10 months ago
when are new videos coming??
ps you are AWESOME! great tuts!!
Raotor123 1 year ago
I hate how whenever I do this in IDLE 2.6.6, I only get the window, but no button.
Running on Mac OS X 10.6.6 Snow Leopard, by the way, but everything in wx worked before, then for some reason I had to reinstall. =/
NukaColaQuantumVault 1 year ago
Bucky You Should Apply For A Teacher Job I Think They Will Pay You A LOT !
Damn UR GREAT !
hitman106 1 year ago
5:18 How to close that button? :D
sijmenjan 1 year ago
When you call self.Close() it sends the EVT_CLOSE event so clicking the button calls both closebutton and then closewindow.
dhaddox 1 year ago
100th like. Yay. Keep up the good work. Ever heard of Game Maker? Its an amateur way to make games... but this is better!
youknowwho52 1 year ago
There are two letter 'T's in the word 'button' .... could you learn to pronounce at least one of them, please? [hey just kidding -- I have the same regional accent]
holzpusher 1 year ago
In Autohotkey program there is SmartGui creator or Lil builder that you design you gui by simple drag and drop of elements and it writes most of the code for you, which you then adjust. Does python have such a utility?
elwoodetubes 1 year ago
@elwoodetubes if you dont wanna right code for your buttons etc try VB 2010 its exactly like that but probly even easyer
Digby0907 1 year ago
i clicked on the button, and it said
"alright, your clicking on me, now what?"
pivotofpower 1 year ago 2
everytime i try to run it it gives me this error message - theres an error in your program:
unindent does not match any outer indentation level! please tell me how to fix this!!!!!!
mariomodguy 1 year ago
why does it just stay a grey box
zechariahi 1 year ago
Getting syntax error
*** non-keyword arg after keyword arg
Line 8
Yxaky 1 year ago
Learn to say button. not Bah ahn!
michieltjuhh 1 year ago
You should probably change "self.Bind" for "button.Bind", otherwise, every button you click will the same action, close the window.
Just an advice
Your tuts are great bucky. I've been watching every one of them, from java to python. Keep'em up!
JukJuca 1 year ago
yottabite ?
omg , super mass storage device
didagoal 1 year ago
syntax error
There's an error in your program:
***non-keyword arg after keyword arg (new,line 8) what is this ?
didagoal 1 year ago
@didagoal yeah got the same. Just found this to help me out a little but I still can't get the button to close.
(doubleux3).java2s.com/Tutorial/Python/0380__wxPython/Setlabelinbuttonaction.htm
burpwind 1 year ago
if i wanted to add this and also i want to add the menu bar so how would i put it in?
MrCelloman21 1 year ago
I made a mistake and IT WON'T SHUT DOWN!
TheBBrickS 1 year ago
@TheBBrickS alt f4
didagoal 1 year ago
You don't really need the close function over the x do you? i mean, it closes itself without it when you click it.
HASHlRAMA 1 year ago
Remember its capa nd lowercase sensitive
eoVertical5 1 year ago
shit, it doest'n work!!!
annakoiher 1 year ago
@annakoiher Check capital letters, it always happen to me.
MrSaggat 1 year ago
how do you make a button spit out static tex, open a file, save a file, save as a file, and open new window. if any one can help me that would be a big help.
101094mike 1 year ago
Thank you v.much. Enjoying my first foray into a GUI programming.
gaatutube 1 year ago
thank you very much. helped a lot
xninjasFTWx 1 year ago
ttributeError: 'module' object has no attribute 'frame'
there is error duing the run of wxpython code..............please solve it
3dmad1 1 year ago
@3dmad1 Print your code.
Jonte135 1 year ago
i have a problem with my one, when i try to run it there is an error where the def in the section: def closewindow(self, event): self.Destroy()
what have i done wrong??
axxaxaxx 1 year ago
lol i get no errors, but it wont start?
moderator555 2 years ago
why did he put the "=" in the arguments again?, I must have missed that tutorial
supergenius1994 2 years ago
difficult stuff too understand :(
henkyxxx 2 years ago
Thank you.
How would I go about setting the maximum size?
Example
Maximum Size (300,200)
SlurpBrigade 2 years ago
i am getting a syntax error..any suggestions?
kgpgotenks 2 years ago
@kgpgotenks look for those stupid typos...i.e. not capitalized. if not wait for someone else lol
happymerc 2 years ago
Thanks a lot Bucky
Keep up the good work
pushashapu 2 years ago
how come you cannot use self.close(True) for both the window and button? or using the Destroy for both?
gatorkea 2 years ago
AttributeError: 'bucky' object has no attribute 'closebutton'
^ Im getting that error for some reason, cant seem to find out why, code should be identical to the one in the vid, any idea where I might have messed up?
Jiveina 2 years ago
Comment removed
Snazzydog333 2 years ago
You havent defined the closebutton function correctly or not at all
add this inside the bucky class
def closebutton(self,event): self.Close(True)
Snazzydog333 2 years ago
I am getting that same problem, sometimes mine will make errors even when the code is absolutely perfect
supergenius1994 2 years ago
@Jiveina i got the same error checked everything no typ faults and still.
you already found a solution to the problem?
grobbednonk 1 year ago
Damnn. I just can't learn this wxpython... The previous 44 vids were easy, but now if I try to use these new things on my own, I can't remember absolutely anything of these codes.
Nikotiini69 2 years ago
it works just fine by me
GerbrandThunder1 2 years ago
Wow, Killed my streak, i did 48 Python tutorials in a row before i got stuck on this one, time to stop working on this one and call it a night. GREAT TUTORIALS! I love all your video's please keep making them.
bobthesaler 2 years ago
If you can't fix a syntax error
and you'r this far into the videos,
don't think you should carry on watching...
unless you didn't watch the previous 44 vidz
Spazm6 2 years ago
Hello Spazm6 , its actually Python 2.6 that has a syntax error for no apparent reason and you then have to rewrite the script again.Python 3.0 fixed this problem
AndrewEpicWins 2 years ago
the class bucky is not defined
bunnyz324 2 years ago
it says 'x' is not defined and help me?
bunnyz324 2 years ago
i got a syntax error on line 9
bunnyz324 2 years ago
what's a bu-on?lol
shaggydaplaya 2 years ago
ty for tutorial!
awesome
GerbrandThunder1 2 years ago 16
so far I have found all of these tutorials to be very helpful. but now I'm having trouble replicating the results. could this have anything to do with my working on Mac OS X instead of Windows?
faltru 2 years ago
Hello faltru , if you want to work on Windows for your work to be better , download a free program called virtual pc where you can install a Window OS on it and basically having 2 pcs running on one screen.
AndrewEpicWins 2 years ago
hey can you help me out my computer is telling me my firewall is blocking my idle can you email me any suggestions to help with my problem i would realy appreciate it dude
32penn 2 years ago
there's a list of programs that firewall appect. you can add python to that list
GerbrandThunder1 2 years ago
repair the internet connections
bunnyz324 2 years ago
thanks dude
zamliman 2 years ago
When I'm writing python programs my code is all pretty and different colours at first..then I run it once and thereafter (unless I restart the IDLE) the code is just black. I want the prettiness back :(
Awesome tutorials as always, thankyou :D
funkyewan 2 years ago
Same. Lol.
XarcZai 2 years ago
i sleep one night and u have 4 more tutorials UR AWSOME!!!!
theorderoforange 2 years ago 47
kewl
iOwnzthee 2 years ago
sweet
cameronvikes12 2 years ago
cool!
MexicanRufus 2 years ago