473,473 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2538
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: 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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.