need advise on python or language selection for Qt app

I am just starting down the road to make a hazel knockoff for KDE and want to use Qt for the front end. I really have no experience so I need some suggestions on what language to use on the back end. I have some limited experience with python 2.6 and was considering using Python as the code that does all the hard work. I also wonder if QML would be a viable alternative? Does anyone know if Python or QML has all the abilities needed to do what hazel does?

So essentially this language needs to be able to do the following:

  1. I have to be able to write/understand it without professional training ( to me python fits this bill but QML may be within my grasp)
  2. monitor a folder for changes without a ton of cpu usage (maybe kde has an api which python/QML can use)?
  3. use metadata to figure out which files to move and maybe move by time stamps
  4. variable substitution — have not figured this out yet but when the different rules are changed in the GUI they need to be easily changed in the running backend.??

I am thinking this could be a plasmoid or maybe a full app type thing, I have not decided.
Also, can Qt Quick be used as the front end?

Perhaps find an existing application that is similar to what you are describing and look over it’s source code. You can use Qt with Python using PyQt4. Riverbank | Software | PyQt | What is PyQt?

On 2013-01-23, anika200 <anika200@no-mx.forums.opensuse.org> wrote:
>
> I am just starting down the road to make a ‘hazel’
> (Noodlesoft – Noodlesoft – Simply Useful Software) knockoff for KDE and want to use
> Qt for the front end. I really have no experience so I need some
> suggestions on what language to use on the back end. I have some limited
> experience with python 2.6 and was considering using Python as the code
> that does all the hard work.

Stop! If you’re considering python 2.6, install python 2.7.3 (though not
3.X). There are several bug-fixes in Python 2.7 and if you want your Qt
(version 4) bindings to play nicely with Python, don’t use 2.6.

> I also wonder if QML would be a viable
> alternative? Does anyone know if Python or QML has all the abilities
> needed to do what hazel does?

I don’t know what is needed for hazel but if you know Python, stick to
Python.

> So essentially this language needs to be able to do the following:
>
> 1) I have to be able to write/understand it without professional
> training ( to me python fits this bill but QML may be within my grasp)

In the U.K., they teach Python to kids, so you shouldn’t have a problem.
If you want to quickly become reasonably adept in a short space of time,
try going through Zed Shaw’s book:
Learn Python the Hard Way - but if you use KDE, use kate
rather than gedit as a code editor (although he recommends gedit)

> 2) monitor a folder for changes without a ton of cpu usage (maybe kde
> has an api which python/QML can use)?

I don’t know know what you mean by `monitoring’. If you are looking to
write a program to check whether any data within one of 1,000,000 files
within a single directory has changed slightly, then you’re probably up
to no good anyway. You need to log file changes rather perform interval
sweeps. Interval sweeps are fine for integrity checks.

  1. use metadata to figure out which files to move and maybe move by
    time stamps

Python can set and get file attributes using its `os’ module.

> 4) variable substitution — have not figured this out yet but when the
> different rules are changed in the GUI they need to be easily changed in
> the running backend.??

I have no idea what you mean by variable substitution'. You might find Python dictionaries’ provide a nice way of being able to map one group
variables onto others but I’m only guessing.

> I am thinking this could be a plasmoid or maybe a full app type thing,
> I have not decided.

Constructing the front-end and back-end are two entirely different
processes. I start with the back-end before worrying about the
front-end, because it’s easier that way round. Also bear in mind you
don’t have to code the front-end and back-end in the same language, and
the back-end (not so much the front-end) can be coded using a mixture of
languages.

> Also, can Qt Quick be used as the front end?

I’m not sure; I’ve never seen it in PyQT4.

> On 2013-01-23, anika200 <anika200@no-mx.forums.opensuse.org> wrote:

>> 2) monitor a folder for changes without a ton of cpu usage (maybe kde
>> has an api which python/QML can use)?

http://en.wikipedia.org/wiki/Inotify