@JosephEaorle: Hum? In what way? What feature are you referring to? I'm using VIM, and mostly the default settings on Linux Mint/Ubuntu, but they may not be the default setting on all systems.
You can setup the space tabs, with "set tabstop=4" now you can use tabs and ever be 4 spaces in your vim session, you can configurate in your vimrc too
tabs are ok for indenting code but not for aligning code. Every one can set the tab width to there preferred width. The important thing is consistency, so to not mix up spaces with tabs.
@metalx1000 Your last base.main can't be indented, I tried that, and got an errorr, unexpected indent, so whne you modify this video, have it not indented.
@rick8028: It should be indented. You must have indented differently then you did with the line before it. If you don't indent it will work, but it isn't part of the "if" statement any more. If it isn't part of the 'if' statement then if your if statement fails you will get an error on the base.main() line because you never created base. So, check your indenting so that it is done properly to avoid errors in the future.
This, (Linux) has only changed, drastically, the world, by 10% so far. The real change is yet to come. i predict even more fantastic things are going to be created for us, by users (and devolpoers) in the future. we have the basics now; and that is great.
@analyzingfunny: I would say 10% of the seen world. Most of the world already runs on Linux You just don't see it. Most GPS Devices, Webservers, ebook readers, Newer TV's, and DVRs run Linux. My new 32" LCD TV is running on Linux, Kindle and Nook Ebook Readers. Garmin and TOM TOM GPS also are running Linux.
Also, a lot of video camera and digital camera run Linux. Android has about 26% of the market share on Cellphones right now and Android is Linux. Android is also on most Tablets.
Whitespace is important in Python. Mixing spaces and tabs is the real thing to avoid, you can use spaces, or you can use tabs if you want to. Most people prefer to use spaces, so it's usually better to get used to doing that, so you can edit their code without any issues.. I wish I knew exactly how to get Vim to replace tabs with spaces, but I haven't figured it out as of yet.
@elnegrobembon: Well, it kinda is. I would suggest learning Python, before jumping into GUI. What is it you don't get. It's only 10 lines of code. Really, there are only 2 lines that really pertain to making the window.
@Majortws: Do you get any errors? Did you use win.show()? Post your code in the forums on my site so we can look at it, other wise I could sit here and guess all day and not have a clue what is wrong.
I ALWAYS use tab to indent. for VIM set TS to 4 by edit "/etc/vim/vimrc" and add ":set tabstop=4" And for nano fin the row "set tabsize 8" and change it to 4, dont forget to uncomment if it is comment out.
the /usr/bin/python sometimes doesnt work for me when i move to another computer with the source. /usr/bin/env python, however, i have had 100% success with so far. thanks for the tutorial.
Very good tutorial, I don't know Python and this is all clear to me.
I like how simple it is to open the window. :)
SamyFOM 3 months ago
Lol @ hitting space 4 times. xD
You have to tell vim to write 4 spaces when hitting tab. That's how it work in other text editors and IDEs.
SamyFOM 3 months ago
how do you get your text editor to work that way?
JosephEaorle 3 months ago
@JosephEaorle: Hum? In what way? What feature are you referring to? I'm using VIM, and mostly the default settings on Linux Mint/Ubuntu, but they may not be the default setting on all systems.
metalx1000 3 months ago
I don't understand why QT is so much more complex than say WPF. In windows forms everything is so simple and natural.
kotapaka 4 months ago
@kotapaka i hate windows and microsoft.
Open source software is free and 1000 times better (and more bugfree!).
plutgamer 4 months ago in playlist Python GTK 3
You can setup the space tabs, with "set tabstop=4" now you can use tabs and ever be 4 spaces in your vim session, you can configurate in your vimrc too
julixrevolutions 4 months ago
__init__ is not integer. It's the function too initialize the class.
kurniasan 4 months ago
@kurniasan: I know that. If I said something in this video I apologise.
metalx1000 4 months ago
@metalx1000 you probably mistakenly say "integer" at 3:16, or I heard wrong. Anyhow, good tutorials.
kurniasan 4 months ago
@kurniasan: I'm sure I did. Thanks for watching.
metalx1000 4 months ago
This has been flagged as spam show
thnx for the tutorial! Now I love Python again! I like your website as well, great stuff over there!
halabihazem 6 months ago
Comment removed
halabihazem 6 months ago
tabs are ok for indenting code but not for aligning code. Every one can set the tab width to there preferred width. The important thing is consistency, so to not mix up spaces with tabs.
Julien1345 8 months ago
@Julien1345: Agreed
metalx1000 8 months ago
Make sure that you are either using python 2.x and pygtk >2.22 or python 3.x and pygtk 2.26 or else it will not find the right modules.
TWILisawesome 1 year ago
thanks for the tutorials great stuff!!!!
iiixiayyy 1 year ago
I did all this exactly and all i get when i run the program is the terminal opens for a second and goes away and I don't get any window.
electroman6913 1 year ago
@electroman6913: What is the output you get in the terminal? Can you post that, and your code in the forum so we can look at it?
metalx1000 1 year ago
@metalx1000 Your last base.main can't be indented, I tried that, and got an errorr, unexpected indent, so whne you modify this video, have it not indented.
So the last part looks like this: base = Base()
base.main()
Best regards, =)
rick8028 1 year ago
@rick8028: It should be indented. You must have indented differently then you did with the line before it. If you don't indent it will work, but it isn't part of the "if" statement any more. If it isn't part of the 'if' statement then if your if statement fails you will get an error on the base.main() line because you never created base. So, check your indenting so that it is done properly to avoid errors in the future.
metalx1000 1 year ago
@metalx1000 Yeah, sorry, I got more errors, I'm not sure where I went wrong.
rick8028 1 year ago
This, (Linux) has only changed, drastically, the world, by 10% so far. The real change is yet to come. i predict even more fantastic things are going to be created for us, by users (and devolpoers) in the future. we have the basics now; and that is great.
analyzingfunny 1 year ago
@analyzingfunny: I would say 10% of the seen world. Most of the world already runs on Linux You just don't see it. Most GPS Devices, Webservers, ebook readers, Newer TV's, and DVRs run Linux. My new 32" LCD TV is running on Linux, Kindle and Nook Ebook Readers. Garmin and TOM TOM GPS also are running Linux.
Also, a lot of video camera and digital camera run Linux. Android has about 26% of the market share on Cellphones right now and Android is Linux. Android is also on most Tablets.
metalx1000 1 year ago
Whitespace is important in Python. Mixing spaces and tabs is the real thing to avoid, you can use spaces, or you can use tabs if you want to. Most people prefer to use spaces, so it's usually better to get used to doing that, so you can edit their code without any issues.. I wish I knew exactly how to get Vim to replace tabs with spaces, but I haven't figured it out as of yet.
squirrelthetireMOAG 1 year ago
@squirrelthetireMOAG: in your vimrc file add this:
:set tabstop=4
:set shiftwidth=4
:set expandtab
metalx1000 1 year ago
hmmm... i guess this isn't an intro for noobs, because i didn't understand anything.. :(
elnegrobembon 1 year ago
@elnegrobembon: Well, it kinda is. I would suggest learning Python, before jumping into GUI. What is it you don't get. It's only 10 lines of code. Really, there are only 2 lines that really pertain to making the window.
win = gtk.Window()
win.show()
Feel free to ask any questions.
metalx1000 1 year ago
@metalx1000
yea, i didn't know that you had to know python first..
i thought this was a python tutorial... but it's cool. i found some python tutorials and i'll probably come back to check this out afterwards..
thanx..
elnegrobembon 1 year ago
@elnegrobembon: I also have a basic Python tutorial play list on my site. Let me know if you have any questions.
metalx1000 1 year ago
@metalx1000
ok, thanx... i'll check it out right now..
elnegrobembon 1 year ago
My ./win.py isn't launching.. it seems to run the process but then returns to the terminal as if it's been killed.
I'm on Linux Mint 8.
Help?
Majortws 1 year ago
@Majortws: Do you get any errors? Did you use win.show()? Post your code in the forums on my site so we can look at it, other wise I could sit here and guess all day and not have a clue what is wrong.
Thanks
metalx1000 1 year ago
Awesome! I will propagate to your channel and specifically to this list of tutorials...
Thank you
benghaith 1 year ago
@benghaith: Thank you, that will help.
metalx1000 1 year ago
I ALWAYS use tab to indent. for VIM set TS to 4 by edit "/etc/vim/vimrc" and add ":set tabstop=4" And for nano fin the row "set tabsize 8" and change it to 4, dont forget to uncomment if it is comment out.
acollsen 1 year ago
@acollsen: Thanks, I knew this could be done, and I've been meaning to. But, I hadn't looked up how to do it. I will do that now. Thanks
metalx1000 1 year ago
Is Qt4 already ported to Python 3 so I can use it, as I currently use Tkinter to design GUI's?
ACPCalin 1 year ago
@ACPCalin: I have not used Python 3 yet, so I can't answer that right now. Sorry.
metalx1000 1 year ago
hahaha maybe i should have watched this before my previous question on the intro vid. look forward to the qt and python stuffs.
alesbythepint 1 year ago
the /usr/bin/python sometimes doesnt work for me when i move to another computer with the source. /usr/bin/env python, however, i have had 100% success with so far. thanks for the tutorial.
acollsen 1 year ago
python is always welcome. i'd love to see more gtk stuff, but that's just me. thank you for taking the time to make these videos.
bamdadkhan 1 year ago
Thanks! I look forward to the rest of these tutorials!
russjr08 1 year ago