Author: Csanyi Pal
Posted: 2012-08-03 04:06:07 Link
Hi,
I'm running Dabo on my Debian GNU/Linux testing/sid system.
I made my first application by following the tutorial
'Hello_msgBox_DaboClassDesigner_Tutorial_V1-02.pdf'.
I wish to get automatically (or by setup in the Dabo Class Designer) the
line:
#!/usr/bin/python
in the first line of the application so I can run it just by clicking
on the myApp.py filename, or just by running it in its directory by the
command:
./myApp.py
At present this behavior can't one get in Dabo Class Designer, right?
--
Regards from Pal
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/20120803110607.2b2718fb@debian-asztal
Author: Ed Leafe
Posted: 2012-08-03 07:53:55 Link
On Aug 3, 2012, at 4:06 AM, Csanyi Pal wrote:
> I wish to get automatically (or by setup in the Dabo Class Designer) the
> line:
>
> #!/usr/bin/python
>
> in the first line of the application so I can run it just by clicking
> on the myApp.py filename, or just by running it in its directory by the
> command:
>
> ./myApp.py
>
> At present this behavior can't one get in Dabo Class Designer, right?
The Class Designer creates classes, not entire applications. Normally you would start an application by running Dabo's quickStart:
[ed@MGM6AEDV7M ~/projects]$ python
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dabo
>>> dabo.quickStart()
Enter the name for your application: testing
Application 'testing' has been created for you
>>>
This has now created a skeleton application called 'testing'. If you look at the directory listing you will see the following:
[ed@MGM6AEDV7M ~/projects]$ cd testing
[ed@MGM6AEDV7M ~/projects/testing]$ ll
total 8
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 biz
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 cache
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 db
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 lib
-rwxr--r-- 1 ed staff 282B Aug 3 07:49 main.py
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 reports
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 resources
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 test
drwxr-xr-x 3 ed staff 102B Aug 3 07:49 ui
The script that launches the app is 'main.py', and it looks like this:
[ed@MGM6AEDV7M ~/projects/testing]$ cat main.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dabo
dabo.ui.loadUI("wx")
app = dabo.dApp()
# IMPORTANT! Change app.MainFormClass value to the name
# of the form class that you want to run when your
# application starts up.
app.MainFormClass = dabo.ui.dFormMain
app.start()
[ed@MGM6AEDV7M ~/projects/testing]$
Note that it has the #! line at the top. Now all you need to do is design your main form in the Class Designer, and then change the next-to-last line of main.py to the name of the cdxml file containing your main form.
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/1F9B3E5E-5487-476A-A9E4-DE6924CA141B@leafe.com