473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
2 1476
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Manlio Perillo | last post by:
Regards. In the standard library there are two modules for command line parsing: optparse and getopt. In the Python Cookbook there is another simple method for parsing, using a docstring. ...
0
by: John J Lee | last post by:
Just noticed your c.l.py post quoted below. Nobody but me knows or cares about this obscure stuff ;-) so I'm not surprised you got no answer... C. Titus Brown Dec 27 2004, 12:41 pm wrote: >...
4
by: Boogie El Aceitoso | last post by:
Hi, I need a command line parser that understands filename swith spaces. Since I'm absolutelly sure I'm not the first developer to need a command line parser, I was wondering is there's a...
3
by: Spam Survivor | last post by:
Hi folks: I'm assuming someone's been down this path before: we want to provide our users with a tool integrated into our content-management website that will allow them to validate their html &...
0
by: dtsearch | last post by:
Press Contact: Belinda Banks S&S Public Relations (212) 946-2823 Belinda@sspr.com Announcing New dtSearch® Product Line Version Release Enhances Indexing, Searching and Display of MS Word,...
7
by: Dave | last post by:
Does anyone know of a Windows compatible command line tool that capable of parsing Microsoft's VC++ workspace/project (e.g., .dsw, .dsp, .sln, ..vcproj, etc.) files and generating an...
1
by: ProJee | last post by:
Hi, I've got the following problems while trying to finish my NewsReader class: #1 There's a NEWNEWS command in the RFC specs, which should retrieve the list of articles posted after the...
40
by: raphfrk | last post by:
I have a program which reads in 3 filenames from the command line prog filename1 filename2 filename3 However, it doesn't work when one of the filenames has spaces in it (due to a directory...
2
by: =?Utf-8?B?UmFtb24gR2VuZQ==?= | last post by:
Hello: I am building a console application and I am having an issue with the command line arguments. A couple of my arguments are paths and they are usually enclosed in double quotes. If one of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.