By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

[RFC] How to implement command line tool integrating parsing engine

P: n/a
Hi all,

I'd like to have some advices about how to implement a program that has
the following requirements:
- it must run both on linux and windows PC
- it must interact with an electronic device connected to the PC through
serial cable by sending/receiving some command strings and taking
different actions depending on device responses; these strings and
actions must be described in a text file (a sort of script) editable by
user with a simple text editor; the language used to described this
algorithm should be as simple as possible
- initially the program must be written in the form of simple command
line tool that is invoked like this:
program <script_file.txt>
- in the future, it must be possible to develop a graphical frontend on
top of it; the resulting look&feel should be similar on linux and windows.

In this mailing list I was adviced to use python:
http://thread.gmane.org/gmane.comp.b...s.u-boot/37939

As I never used python, I ask you:
1) about the script file, which language - for which a parsing engine is
already available in python - do you suggest?
2) about the graphical frontend, which graphical libraries do you recommend?
Thanks a lot in advance,
llandre

DAVE Electronics System House - R&D Department
web: http://www.dave.eu
email: r&**@dave-tech.it
Mar 22 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
llandre schrieb:
Hi all,

I'd like to have some advices about how to implement a program that has
the following requirements:
- it must run both on linux and windows PC
- it must interact with an electronic device connected to the PC through
serial cable by sending/receiving some command strings and taking
different actions depending on device responses; these strings and
actions must be described in a text file (a sort of script) editable by
user with a simple text editor; the language used to described this
algorithm should be as simple as possible
- initially the program must be written in the form of simple command
line tool that is invoked like this:
program <script_file.txt>
- in the future, it must be possible to develop a graphical frontend on
top of it; the resulting look&feel should be similar on linux and windows.

In this mailing list I was adviced to use python:
http://thread.gmane.org/gmane.comp.b...s.u-boot/37939

As I never used python, I ask you:
1) about the script file, which language - for which a parsing engine is
already available in python - do you suggest?
Don't use a home-made-language. Use python itself, together with a lib
of pre-defined functions and hooks.

Python can do the serial communication (google pyserial), and together
with e.g. the execfile-command you can execute the user-provided
commands after initializing your system.
2) about the graphical frontend, which graphical libraries do you
recommend?
Google this group for a PLETHORA of discussions about this very subject.
The answer vary depending on usecase, taste & relative moon humidity.

Diez
Mar 22 '08 #2

P: n/a
On 22 Mar, 14:48, llandre <r...@dave-tech.itwrote:
- it must run both on linux and windows PC
- it must interact with an electronic device connected to the PC through
serial cable
Python should be fine.
- initially the program must be written in the form of simple command
line tool that is invoked like this:
program <script_file.txt>
python script_file.py

- in the future, it must be possible to develop a graphical frontend on
top of it; the resulting look&feel should be similar on linux and windows.
Python has numerous cross-platform GUI libraries.

As I never used python, I ask you:
1) about the script file, which language - for which a parsing engine is
already available in python - do you suggest?
I'd suggest Python...
2) about the graphical frontend, which graphical libraries do you recommend?
wxPython, PyGTK, tkinter, PyQt, or PyGame are some options.

I have started to prefer wxPython together with wxFormBuilder for my
graphical frontends.

http://sturlamolden.blogspot.com/200...-wxpython.html





Mar 22 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.