Writing a lockscreen for Linux? - python

I've been looking around for a nice lockscreen to use with my XFCE system, but it seems like there are any slim lock screens around. I'm currently using slock, but it's just a blank screen with absolutely no interface whatsoever.
I'm looking to code a lockscreen in Python. I looked at the source code for slock, and it seems like I have to interface with Xorg somehow.
Does anybody know anything about writing lockscreens?

If you want to go low-level, you can use python xcb bindings.
If you want to use higher level bindings, you may find this tutorial on writing a screen saver with Qt useful. Porting it to PyQt should be quite straightforward. I'm pretty sure similar resources exist for GTK.

Related

GUI builder Python for Linux and OSX

I just want something that is easiest to use for building a relatively simple GUI that
ports easily to OSX and Ubuntu Linux.
More than anything, I just want to get cracking on the App rather than getting caught up in
making something super polished, etc.
GLADE comes up a lot but doesn't strike me as the easiest, though, if someone suggests otherwise I'm open.
Again, main criteria is ease of use and portability to OSX and Linux.
There a quite a few options that you have:
PyQt is one : here is an intro : http://www.rkblog.rk.edu.pl/w/p/introduction-pyqt4/
PyGTK http://pygtk.org/ heard some good reviews for it but have not played with it.
wxPython is another : http://wxpython.org/what.php
I would suggest the wxPython but its totally up to you.
Have a look at their documentation and then pick.
Enjoy

Is there a way to debug a python script using the python4delphi components?

I want to add scripting capabilities to my application and I just came across python4delphi http://code.google.com/p/python4delphi/, which seems to be stable.
At first sight it looks very easy to use on the developers side, but I couldn't find a way to debug a script. Would be great if I could embed the IDLE IDE in my application, I just have no idea how to do it.
Is there a easy way to add debugging capabilities with python4delphi? Should I use other script engines like pascalScript (seems to have been discontinued)?
Edit: After having a look at PySctipt and pdb I realized that what I am looking is more like a visual editor with embedded debugging and the capability to read python4delphi custom modules (the ones where I export my delphi objects. Being a python noob I have no idea how p4d does this). I am probably asking too much, but would be great to find an implementation of that and not having to code it all from scratch.
Python is really a great language.
But if you need to embed script, with debug, in a Delphi application you should considere Pascal scripting, which is more available in Delphi.
I use the excellent PascalScipt, in the exemples you will see editor, debugger and a lot of other functions.

Python custom GUI

I googled and search stackoverflow before asking this question
Answers that I don't expect:
wxWidgets is the best Python GUIUse TkInter (BIM) for GUI development.
Q. How to make a GUI without using any module/library? i.e make a GUI from scratch. Modules like tkinter not allowed.
I've made several GUIs from scratch using SDL which is a low level drawing library. The advantage of doing that is that it will look exactly the same on any platform down to the pixel and you can get it to work on embedded systems. Full screen GUIs are really easy too. Disadvantages are that it is a lot of work.
In python the pygame library wraps SDL so you would use that, and in fact that is how I made the GUI for a lab instrument which had a large colour LCD screen. The controller ran linux, but not X-windows.
pygame is an extra library, yes, but I can't think of a way of making a GUI with only what python provides.
The easiest GUI to make without "module/library" is a web-based one. I.e. generate HTML with Javascript from your Python code, and let the Javascript interact via AJAX with your Python app. This can be implemented without too much effort with just the standard Python library (and some JS code, of course), or with modules that don't require "heavy" installation of platform-specific extensions.

wxPython GUI - can it be compared to Java GUI or Visual Studio GUI?

I have a two years of experience in programming of enterprise application's with Java and Visual Studio, and I'm new in Python and wxPython. So my question is: Can wxPython provide me enough rich GUI to create those same app's? My reason if using Python is in it's diversity, simplicity and fast development of app's. Thank you!
I think it depends on your definition of "rich." I use it and like to think it can make some fairly useful GUIs. Here's a screenshot of a wxPython app to work with sensor data I'm writing right now - not the most elaborate or complicated in the world, but so far it seems fairly intuitive for users:
I find the wxPython docs to be a little sparse at times, but as long as you've got the demo installed and the wxWidgets docs open it's a good toolkit to use.
wxGlade will give you the GUI skeleton. You will still need a separate text editor (I recommend Geany) to fill in the handlers.
I would certainly suggest using Python and its GUI libraries, but only you can really make the decision as to wether you think its better than visual studio or Java. The syntax of Python is very basic and I think many people can agree its a plesure to use when you get your head around it (no curly brackets etc). Python Tkinter is quite a simple GUI library and its ideal for making a basic application. WxPython on the other hand is far more advanced than Tkinter hence a richer user experience. The only problem I have had while using Wx is not being able to find suitable examples on the web to demonstarte how some things are done. Good luck, hope you find what your looking for. Karl
The wxPython demo shows most of the widgets that are available. I suggest that you take a look at this and see whether it will do what you need.

Python PyQT gestures

I want to enable use of PyQT gestures in my application. Anybody has an example or some short code that could demonstrate use of gesture control in PyQT application?
I tried googling around but could find only one post about customizing the gesture... I am not that far yet at all, I just want to see how to bind the gesture and callback in Python QT app.
thanks
I'm working the same problem. No reason why it shouldn't work, by simply translating some of the C++ examples, but its bleeding edge.
For example, won't work on Linux desktop (just Windows) without Qt 5 or a lot of work. See http://qt-project.org/forums/viewthread/12664. If I get Qt 5 installed, I hope to post a Python example.
I am using PySide, and the QtGraphicsFramework and have a small test program. Another more sophisticated test, of custom gestures, is crashing, not just throwing exceptions, and I'm suspecting the Python binding.
There are plenty of nuances. If any platform is good for learning, it should be Qt and Python. Go figure why there are no examples yet.

Categories