Starting Python development

Contribute code to SolydXK and make it even better.
Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 18 May 2014 07:52

Success! For anyone that wants to test it:

1. Go to my tutorial site: http://cgi.bytebin.net/linux/dev/pythonglade.php

2. Follow the instructions on how to compile. Best to do this in a separate VM from what you'll be installing the .deb file in.

3. Install the .deb file in another fresh machine.

4. Download the tarball I posted previously and extract it.

5. Delete the .glade file.

6. Set up a new tutorial-1.glade file following this tutorial: http://gnipsel.com/glade/glade01a.html
NOTE: When you get to the window signal item, 'destroy' is in GtkWidgets as there is no GtkObject.

7. Save the glade file and then at the command line, run the tutorial-1.py

It should work! This will give you glade version 3.16 and you must use Python 3 (as noted in the "Python Useage Notes" area of my page. My tutorial-1.py file is already adjusted to reflect this.

Let me know if it works (it did for me, at least). Hopefully now we have a suitable setup.

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 18 May 2014 08:00

@Schoelje: Our posts crossed. :) I will have to test out your suggestion tomorrow (it's nearly 4:00 am - I did it again! :lol: ) and I'll update my web page accordingly. Thanks for this info!

I think eventually I'll write a Python3/Glade3 tutorial that would work with 3.16. For now, what I have up currently does work (guess it'll be good for learning until I can change it soon).

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 18 May 2014 20:13

I've updated my tutorial: http://cgi.bytebin.net/linux/dev/pythonglade.php

Attached is the code I tested with. It seems to all work well. Thank you to everyone for your suggestions and help! Now I can get back to work learning Python and Glade. :)
Attachments
tutorial-glade.tgz
Updated Tutorial Files
(1.7 KiB) Downloaded 155 times

User avatar
ScottQuier
Posts: 1781
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 25 Jul 2014 16:27

@Schoelje - I've found what I think is a pretty straight-forward Python tutorial ... for those that don't need a step-by-step. Anyone who has something of a foundation in OO programming can use this right off as it approached the language from the standpoint of language features, almost like a language reference manual (but not that rigorous) with lots of embedded examples of the features being discussed at the moment.

I've found it to be very, very useful as a reference while I'm coding. I have a problem, I know the language can do it ... I just go there and find it.

There are also links to standard libraries, etc that I'm still exploring.

Anyway, here's the link --> https://docs.python.org/release/3.4.0/t ... index.html
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 25 Jul 2014 16:58

Scott - Thank you for this link! I bookmarked it and hope to learn it as well.

User avatar
Arjen Balfoort
Site Admin
Posts: 9310
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Starting Python development

Postby Arjen Balfoort » 28 Jul 2014 13:09

ScottQuier wrote:@Schoelje - I've found what I think is a pretty straight-forward Python tutorial ... for those that don't need a step-by-step. Anyone who has something of a foundation in OO programming can use this right off as it approached the language from the standpoint of language features, almost like a language reference manual (but not that rigorous) with lots of embedded examples of the features being discussed at the moment.

I've found it to be very, very useful as a reference while I'm coding. I have a problem, I know the language can do it ... I just go there and find it.

There are also links to standard libraries, etc that I'm still exploring.

Anyway, here's the link --> https://docs.python.org/release/3.4.0/t ... index.html
Great! Added to the OP.


SolydXK needs you!
Development | Testing | Translations

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 04 Aug 2014 16:08

Here's another potential Python learning resource: http://www.tutorialspoint.com/python/index.htm

This one even covers things like multithreading, which I didn't see covered in the Python.org link. This may go into more debth and be a good additional learning site.

User avatar
ScottQuier
Posts: 1781
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 04 Aug 2014 16:16

@RavenLX - Oh, yeah. On quick inspection that looks to be a real nice site! I think I'm going to be spending some time there! Thanks for sharing that link!
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 04 Aug 2014 18:21

No problem. :) I plan to learn from there as well as the other link you gave. Maybe a combination of the two.

User avatar
ScottQuier
Posts: 1781
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 04 Aug 2014 19:35

RavenLX wrote:No problem. :) I plan to learn from there as well as the other link you gave. Maybe a combination of the two.
Definitely a combination of the two. I've just started through it and found that it's not Python 3.4 compliant ... I think it's a bit older ... python 2.7 maybe?
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 05 Aug 2014 00:47

Didn't notice that. Sorry about that. I wonder how much IS 3.4 compliant though?

User avatar
ScottQuier
Posts: 1781
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 05 Aug 2014 01:26

Quite a bit .... Most in fact. It's a good resource as long as one knows about this. In learning a lot reading through it.
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 06 Aug 2014 14:49

I found where you can download the Python Docs for 3.4 in PDF format. I guess that would be kinda like a tutorial. Also TutorialPoint has a pdf download of their tutorial as well. Here's Python.org's 3.4 docs in pdf, html and other formats:

https://docs.python.org/3.4/download.html

User avatar
grizzler
Posts: 2175
Joined: 04 Mar 2013 15:45
Location: The Hague, NL

Re: Starting Python development

Postby grizzler » 17 Aug 2014 08:59

That's probably the most useful bit.

Has the Think Python book/site been mentioned? I'm not sure how useful it is yet.

The last time I had a more or less serious go at Python was in 2010, when Python 2 had just been declared end-of-life. At that point, it made sense that most of the documentation found on line was based on 2. Four years and a quick look around later, I get the impression things haven't really changed that much. Which I find both surprising and somewhat disappointing. Is this the fear of change that seems to creep in almost everywhere? I've even seen a remark by one of the authors (Zed Shaw, the guy who wrote the 'hard way' book) that seems to suggest he doesn't plan to switch to 3, ever. Weird.

My main mistake in 2010 was using Tkinter as a GUI tool. The result looked like it was from 1985, which kind of put me off using Python. Funny thing is, even today Tkinter still appears to be used far more often than Glade/GTK in Python circles (the Think Python book only mentions Tkinter as well, unfortunately...).

I am going to try again now, with Glade this time...
Frank

SolydX EE 64 - tracking Debian Testing

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 18 Aug 2014 14:23

Thanks for the link. I downloaded that as well. I'm collecting what I can to learn Python.

I think the one reason people hate to change things is because of the large amount of deprecation that can creep into new versions, and the messages that go with it that can really break things and make things confusing, especially if you're trying to teach total beginners.

As for me, I try to use whatever Python is in the distro, that way I know everyone has it or can obtain it and install it easily.

pamfeuer
Posts: 29
Joined: 04 Apr 2014 04:19

Re: Starting Python development

Postby pamfeuer » 21 Aug 2014 09:58

In my quest to learn/develop stuff using python/glade, this topic has the most practical resource around.
With gnome 3.12 the tutorial from gnipsel.com is a bit dated but still noob and intermediate friendly and will help you become an expert. Most are aware some stuff from 3.8 may not work with 3.12.

With RavenLX's method above I am successful in building Glade interfaces on gnome-shell 3.12....
Need to add the line: gi.repository import Gtk
and also making all the main to Gtk instead of small case gtk.
Also adding the line #!/usr/bin/python3 at the top.

Thank You RavenLX.

Looking forward to learn some more....s i g h ... :roll: :lol:

You can also view all the modules present in your system using pydoc.
In the terminal type:

Code: Select all

pydoc3 -p 8888
The above will open up pydoc for python version 3. If you want for 2 just type python or want just use tab completion to see your options.

Now all you have to do is open your web browser and use your loopback and the port number you entered like below:
localhost:8888
fx-6300@ 4.5ghz kooled by zalman cnps10x performa+As5, 970fx extreme4, 16GB ddr3 1600mhz, various hdd, various OS(linux's, win, OSx mavericks, pcbsd10, androidx86(but useless)), various wifi cards and usb dongles, zotac 650ti boost 2gb.

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 21 Aug 2014 15:30

Thank you for the additional info! :) This is a great thread for learning Python. I have to get started with that myself when I have time. I been endeavering to make a more updated Python/Glade tutorial but haven't had time, unfortunately. Hopefully some day in the future. As I learn, I try to share with others.

User avatar
ScottQuier
Posts: 1781
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 07 Sep 2014 19:54

OK, I don't think I've seen this mentioned - 325 page PDF entitled Python GTK+3 Tutorial Documentation Rel 1.0 by Andrew Steele. You can find it here --> http://learngtk.org/tutorials/python_gt ... torial.pdf
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"

Deleted User 2764

Re: Starting Python development

Postby Deleted User 2764 » 07 Sep 2014 23:30

Thanks for this, Scott! Definitely a great resource. I grabbed the PDF. I have to get with it and learn Python. Unfortunately things have been keeping me busy and my health appointments as well. So I haven't even had time to get started yet.

User avatar
ScottQuier
Posts: 1781
Joined: 18 Jul 2013 15:55
Location: Newport News, VA

Re: Starting Python development

Postby ScottQuier » 07 Sep 2014 23:35

I've been working on my project almost all day today. One of the things I've been trying to do is to replace a couple of glade windows with code generated dialogs (so that I can more easily assign parentage). One of the things I needed was to be able to set the shadowing effect on a ScolledWindow widget. I spent the better part of two hours trying different things and googling and still nothing. Then, just by chance I stumbled across this PDF. Two minutes later I had the solution and had it tested.

Getting the names of various widget setting constants has been proving to be a real bother. I should have ignored Schoelje and just written this whole thing in C - would have been much easier I think .....
Scott
Quoting zerozero, "The usage of PPA's in debian-based
systems is risky at best and entails serious compatibility
problems; usually it's the best way to destroy an install"


Return to “Code”

Who is online

Users browsing this forum: No registered users and 4 guests