Starting Python and PyQt - Tutorials, Books, general approaches [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
After doing web development (php/js) for the last few years i thought it is about time to also have a look at something different. I thought it may be always good to have look of different areas in programming to understand some different approaches better, so i now want to have look at GUI development.
As programming language i did choose Python where i now slowly get the basics and i also found this question:
How to learn python
which already contains good links and book proposals. So i am now mainly looking for some infos about PyQt:
Tutorials
Books
General tips for GUI development
I already looked at some tutorials, but didn't find any really good ones. Most were pretty short and didn't really explain anything.
Thanks in advance for advises.

The first thing to realize is that you'll get more mileage out of understanding Qt than understanding PyQt. Most of the good documentation discusses Qt, not PyQt, so getting conversant with them (and how to convert that code to PyQt code) is a lifesaver. Note, I don't actually recommend programming Qt in C++; Python is a fantastic language for Qt programming, since it takes care of a lot of gruntwork, leaving you to actually code application logic.
The best book I've found for working with PyQt is Rapid GUI Programming with Python and Qt. It's got a nice small Python tutorial in the front, then takes you through the basics of building a Qt application. By the end of the book you should have a good idea of how to build an application, and some basic idea of where to start for more advanced topics.
The other critical reference is the bindings documentation for PyQt. Pay particular attention to the "New-style Signal and Slot Support"; it's a huge improvement over the old style. Once you really understand that document (and it's pretty short) you'll be able to navigate the Qt docs pretty easily.

I had this bookmark saved:
http://www.harshj.com/2009/04/26/the-pyqt-intro/

There is a step-by-step guide at popdevelop.com on how to set up Eclipse with PyQT.

My advice would be: have some particular goal in mind, some app that you, or even better someone else, would use in a real world scenario.
I started with the same book Chris B mentioned, i.e. Rapid GUI Programming with Python and Qt and I found it useful and it touched many of the topics you would need in most GUI applications. Additionally, after some time and some confidence gained, you want to have PyQT Classes handy.
Do not avoid C++ examples to explain some problem you'd like to solve, rewriting it in Python is not that hard (depending on the problem, and scope of course).

Related

How different is GDscript from Python? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 21 days ago.
Improve this question
I recently started developing games on Godot after 3 months of Python experience. Is it good to learn Python before jumping into GDscript? If not, how different are the two? Is it okay to first learn Python in preparation?
Thank you! :)
I decided I should watch the official GDscript tutorials that the Godot channel put out, I have not finished it entirely as it is very long, so I was wondering if someone on the forum could answer :)
Is it good to learn Python before jumping into GDscript?
It is not necessary. It is arguably good, but not because of it being Python specifically. Any prior programming experience will transfer well.
If not, how different are the two?
They have similar syntax. Keywords are different.
In general it is easy to translate algorithms from Python to GDScript. However, it might result in a suboptimal GDScript/Godot solution.
A common experience among beginners has been implementing things in GDScript to later discover that Godot already have a built-in way to do it that is both more convenient and more efficient (I'm not saying this is always the case, but that it is very common). Please notice that is not so much learning GDScript, but learning Godot.
Don't expect any advanced Python to work on GDScript. The reason being that GDScript semantics are closer to Java or C#.
I want to mention that in GDScript you are free to specify types or omit them from your code (in which case it behaves as a dynamically typed language). In general I encourage to use types, it allows for static analysis (and starting from Godot 4 it should give you better performance too).
Is it okay to first learn Python in preparation?
You can learn whatever. Learning Python first is OK. It will not hinder your experience with GDScript.
With that said, I want to point out that GDScript is a good entry level programming language. You can jump into GDScript without prior programming knowledge.
Is there any good sources such as books or writing that I should refer to?
While it is off-topic to ask for learning material on this site, it is OK to recommend…
There is a canonical answer: Tutorials and resources.
I decided I should watch the official GDscript tutorials that the Godot channel put out, I have not finished it entirely as it is very long
Do as you wish. People have different preferences for learning.
Some of us rather have a project to motivate us, and learn the things we need to get it done. Other prefer to explore and experiment the options. Others prefer to have tutor that guide them.
It is all valid.
If I were you, I would go with GDScript basics and jump in. But I'm not you.
so I was wondering if someone on the forum could answer :)
This is not a forum. This a Q&A site. Open ended conversations do not work well here.
With that said, I would like to point you to: the official Godot forum. See the Godot's community page.
I would also want to point out that despite GDScript being the intended and preferred way to use Godot, you don't have to. Yes, you might even use Python. And yes people coming from Unity might use C#. See using different programming language in godot game engine?. If you plan to do something like that, I would still encourage to give GDScript a try.
Godot documentation is very clear, well organized and straigthforward.
You definately should take a look at it. If you just casualy read the General and Getting Started section from the navbar you probably gonna learn lots of things. Godot Docs
If somehow you still are doubtfull about GDScript, the docs also have a section under the Scripting link dedicated to it's introduction and other stuff. GDScript Docs
Have fun! :)

Student Seeking Programming Advice [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am a high school student, and I have just finished 4 free youtube courses on python, along with a "beginners guide to python" book, and I am a little lost. I understood the language quite well and enjoyed learning it. My question is: what do I have to learn in order for me to start designing and building things with python. Just to be clear, I am not talking about complicated things such as websites or machine learning applications. I am talking about simple games and apps so that I can form a better understanding of software development through practical experience. I honestly thought this is where the course and book would get me by now. I feel like my understanding of python is great (for a beginner). I understand all of the fundamental terms and definitions of the language, and I can answer questions other students may have about directories, methods, strings and so on without trouble. I just have no idea where to begin designing and building real things that can test my knowledge as a programmer.
I understand that I have a lot to learn. I just have no discernible vision as to how I can become better without practicing what I learn.
I am grateful for any advice you can provide on how I can resolve this issue, as well as any book recommendations or helpful links for learning resources.
Thank you for your time.
There are lots of fun ways! Try some of Swagart's books (Automate the Boring Stuff with Python, etc). By all means try making a basic web application with Flask. Try making a game with Pygame (Al Swagart's pygame book is good for that). Try interfacing a database directly with sqlite3. The possibilities are endless. Don't stick to just raw python, the best way to get experience is to use external modules and apply your knowledge to them. If you need to write Python for a job they will want you to be using something or other to do something or other and the only way to be able to say "Oh yes I can learn this module you're using for webdev/game/anything" is to have experience learning new modules and use cases.

Python TUI libs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
The community reviewed whether to reopen this question 7 months ago and left it closed:
Opinion-based Update the question so it can be answered with facts and citations by editing this post.
Improve this question
I'm writing a small sudoku game/solver in Linux using python with TUI (not GUI, that's just lame) just for fun. My question is, which lib is better (by that I mean easier to handle, better support, more straight-forward and understandable), the choices are curses or urwid or if anyone have better suggention, and why? I have some Tkinter and wxPython experiences.
Any help or information will be appreciated.
You might want to check out Unicurses, which wraps the python core curses module in UNIX systems and wraps the free pdcurses library on windows-based machines.
This library is designed to emulate the syntax and style of the original ncurses library, so if you're interested in learning TUI design using curses-style programming, then check it out.
Urwid is, from what little documentation I've read, a very interesting library which uses event loops (the reactor pattern) as a basis for application design, much like tkinter or Twisted. Also, urwid has an event loop class specifically designed for use with Twisted, so if your aim is to created TUIs for use over networks, its a good choice. Twisted also uses the reactor pattern, so if you want to learn that style, I'd recommend it.
Finally, if you do go with an ncurses-style library, check out Dan Gookin's book on ncurses. A very good resource, and the only one I know of which is in print today.
There are other options such as newt, pygcurses, and so on, but this should get you started. Best of luck, TUI programming today is one of those technological fetishes that can be hard to break into, but it's rewarding.
While the above is a perfectly reasonable solution for Linux, The OP asked for other suggestions and a justification for them.
Who wants to use a low level API like curses in a modern OO language like Python? Let alone if you are stuck inside Windows (which the OP isn't, but is a problem for a lot of people out there)... There must be a better way.
To try to resolve this, I have put together a simple cross platform class (yup - Windows is included without falling back to PDcurses) to do all the things most people want from their terminal/console. If you're on Linux this is a more human way to program curses. If you're on Windows, the same class works as is with no external binary dependencies. You can find the Screen class in asciimatics.
In addition, I've created a load of highr level objects to create animations and TUIs. For example, this is a recording of a sample using the TUI widgets:
If there's an extra feature you need, let me know and I'll see what I can do.
If your game will run inside a console, then just pick curses.
If your game will run as a GUI application, then just pick PySide.

What good homework style tutorials are recommended for learning functional programming in Python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I recommended to a friend to learn some functional programming using Python to expand his knowledge and overcome programmer's fatigue.
I chose Python because that way there's a good chance he'll be able to use the new knowledge in practical daily work.
I tried to find him some tutorials, and found a lot of guides - diving deep into how to use map, reduce, filter, etc., but don't provide exercises where he can learn while coding.
Where can I find a tutorial that uses functional python to solve problems while teaching?
An optimal answer for me would be homework from a functional programming course, that needs to be written in Python. Such a thing is probably rare because an academic course will usually prefer a purer functional language for such work.
Maybe http://diveintopython.net/functional_programming/index.html helps.
Some other useful links are:
Functional Programming HOWTO
Functional Programming with Python (by Pramode C.E.)
Functional programming with Python (by CHRISTIAN HARMS)
I was told about this website when I first started learning. It is a collection of riddles you need to solve using Python. It can be fun.
http://www.pythonchallenge.com/
It's not a literal answer to your question, but I'd recommend to your friend to practice in Javascript instead of python. With python you can do some functional programming, but most projects don't need to do much if any. Javascript really requires doing this, and is at least as common/useful of a language these days. You'll find a lot more useful educational material on closures in javascript than python.

Where can I find good python Twisted framework documentation, blog entries, articles, etc? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm playing around with Twisted and documentation found on their homepage doesn't answer all my questions.
The topic I am most interested at the moment is Twisted Application Framework. Also some open source servers using twisted framework would provide nice material for studying how it's all tied up together in a bigger project.
So far I've checked out iCal and read documentation on twisted website (3x) and few good articles I found in google.
I think you need to get your concepts right to start with. I found this blog post to be helpful.
Introduction to Asynchronous Programming and Twisted
The published book is pretty useless, in my opinion.
I recommend starting with the "deferred" docs online, and making absolutely sure you understand what asynchronous means and what deferreds are for. The best online docs that I've found are on the official site, though they could surely use some polishing:
http://twistedmatrix.com/trac/wiki/Documentation
The developers recommend reading the source as well, though if you have specific questions, I've found that the devs hang out and respond on both the IRC channel (#twisted on the freenode network) and the online mailing lists (There's a general and a twisted-web specific list)
As for blogs, there's at least the two below (both blogs are by twisted developers). I bet if you asked this same question on the twisted-python mailing list, you'd get a much better and more comprehensive answer than I could possibly give. :-)
http://oubiwann.blogspot.com/
http://glyph.twistedmatrix.com/
Divmod has some medium sized projects which use Twisted and might make good additions to your reading list. Additionally, the Twisted Community Code in Launchpad will give you a much longer list of Twisted-based projects to look at.
I found the Twisted Network Programming Essentials book to be a useful guide when first learning Twisted. Although it is more of a Twisted "cookbook". Some of its "recipes" are useful.
There's an overview here: The Twisted Network Framework.
Bruce Eckel wrote a nice article that points out some of the weird names Twisted uses: Grokking Twisted. According to that article, there are some good examples in The Python Cookbook, 2nd Ed (O'Reilly).
This unofficial tutorial is, in my opinion, the absolute definitive way to learn Twisted.
It contains step by step examples on how to use everything from super basic to advanced features. Everything is motivated by first doing it the hard way so that you really understand what problem each part of the Twisted solves.
I've used software based on Twisted for five years but it was only after working this tutorial that I now really understand it and use it from scratch for my own programs.
This is not self-promotion. I do not know the author of the tutorial to which I linked.

Categories