User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 391,997 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,192 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:

Projects for the Beginner

Join Date: Jun 2005
Posts: 142
Reputation: G-Do is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 11
G-Do's Avatar
G-Do G-Do is offline Offline
Junior Poster

Re: Projects for the Beginner

  #25  
Oct 1st, 2005
Write a simple Python shell with a GUI. The shell should use Python functions whenever possible to make it as portable as it can be. This is another project that can be divided into phases:

i) Write the shell GUI. It should have a spot to enter commands and a scrollable output screen.

ii) Write the command parser. Have the shell recognize a limited subset of commands. If it sees those commands, it does the appropriate thing in Python - otherwise, it hands the command to the OS and reproduces the output on its screen. The list of commands the program should recognize are: cd, ls, clear, echo, exit, pwd, touch, rm, mkdir, rmdir, mv, cp, chmod, and ps. Most of these can be written in Python, but some may have to be redirected to the OS.

iii) Add a command history feature, so that pressing the up and down arrow keys lets you cycle through previously entered commands.

iv) Add the ability to run a command in the background by adding an & to it.

v) Add the ability to redirect output using > and >>.

vi) If you're feeling particularly ambitious, try to add tab-completion.

vii) If you're feeling very, very ambitious, try to add pipes!

I tried to do this before, and got stuck on (iii). I figured out that (using Tkinter) I needed threads to monitor up/down arrow keypresses, and I didn't have the energy to deal with threading at the time.
Vi veri veniversum vivus vici
Reply With Quote  
All times are GMT -4. The time now is 10:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC