473,327 Members | 1,952 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,327 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 2516
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.