473,383 Members | 1,795 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,383 software developers and data experts.

Re: python custom command interpreter?

On Wed, Aug 20, 2008 at 03:19:19PM -0400, joey boggs wrote:
In the end I'd like to be able to run a custom interpreter and just feed it
one command and a directory. The end result in the kickstart something like
this:

%post --interpreter #!/usr/bin/myinterpreter
DROP /tmp/directory
DROP /tmp/directory2
What is the problem you are trying to solve? Are you asking how to
write a shell in Python?

<pet peeve>
How would I setup the interpreter to take the DROP command?
You wouldn't... "setup" is a noun. You might "set up" an interpreter
though.
</pet peeve>
I've been reading and searching all day but I haven't found anything
close to what I'm doing. I realize that using custom commands in
this case is overkill but in the end is used to make the users life
easier.
How so? What could be easier than "rm -rf directory"?
If anyone can point me to some documentation I would be more than
grateful.
I'd be happy to, but I can't imagine what sort of documentation would
help you. It sounds like what you want to do, basically, is write a
program to read commands from stdin, parse them to make sure the
syntax is right, and then execute the equivalent code in Python.

--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFIrJ7SdjdlQoHP510RAuqYAKCknb97T0qTuWINmY2iRq IMdHSASgCdG0rW
f+N+2yzxsQI+K6N1hBCO4QQ=
=wLvp
-----END PGP SIGNATURE-----

Aug 20 '08 #1
3 2525
On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote:
How so? What could be easier than "rm -rf directory"?
C:\>rm -rf directory
Illegal command: rm.

Hm. ;-)

Ciao,
Marc 'BlackJack' Rintsch
Aug 21 '08 #2
Marc 'BlackJack' Rintsch wrote:
>How so? What could be easier than "rm -rf directory"?

C:\>rm -rf directory
Illegal command: rm.

Hm. ;-)
does CentOS/Fedora run Windows these days?

</F>

Aug 21 '08 #3
On Thu, Aug 21, 2008 at 05:17:41AM +0000, Marc 'BlackJack' Rintsch wrote:
On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote:
How so? What could be easier than "rm -rf directory"?

C:\>rm -rf directory
Yeah, except the application specified by the OP is to remove
directories during a kickstart install of Linux... so your comment is
worthless.

--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFIrWTadjdlQoHP510RAqaZAJ9DajWj9EhzcOTK4OH5dl inbmCxtQCeL3va
peWQjMl384pI3SbAE8KvROA=
=Ko56
-----END PGP SIGNATURE-----

Aug 21 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
29
by: Steven Bethard | last post by:
Fuzzyman wrote: > Cameron Laird wrote: > > >>This is a serious issue. >> >>It's also one that brings Tcl, mentioned several >>times in this thread, back into focus. Tcl presents >>the...
12
by: Rex Eastbourne | last post by:
Hi, I'm interested in running a Python interpreter in Emacs. I have Python extensions for Emacs, and my python menu lists "C-c !" as the command to run the interpreter. Yet when I run it I get...
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
0
by: rjain7 | last post by:
Hello, I am a newbie; looking for an easy equivalent of TCL 'unknown' command in python. My basic aim is to be able to pass any command which python interpreter does not understand to my own C++...
267
by: Xah Lee | last post by:
Python, Lambda, and Guido van Rossum Xah Lee, 2006-05-05 In this post, i'd like to deconstruct one of Guido's recent blog about lambda in Python. In Guido's blog written in 2006-02-10 at...
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
29
by: Gerald | last post by:
Hi ,Im a BSc4 Maths/Computer Science student.Unfortunately my curriculum did not include Python programming yet I see many vacancies for Python developers.I studied programming Pascal,C++ and...
0
by: Fredrik Lundh | last post by:
joey boggs wrote: I'm not sure I understand what you're doing, but maybe you'll find the following somewhat useful: .... def raw_input(self, prompt=None): .... # override input...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.