13 Jun Python XML Dir
To Do
You will write a script (or, scripts) that will take an optional argument, the directory to process. If not argument is supplied, use the current directory.
In each subdirectory (including the top-level directory on which the script was called) you will place a file called dir.xml . If it already exists, simply overwrite it. Do not include it as one of the files listed.
The root element will be direntry. It may contain up to 3 child nodes: index, required, and other. index will only contain a file. The remaining two might contain text elements:
<file>Regular file (or, symlink)<dir>Directory<fifo>A named pipe<sock>A socket
Index and required data will be harvested from README. Other files will be found by taking a listing of the directory, looking for files or directories that weren’t listed in README.
For example, the following file would be placed in CS265/Labs/2 :
dir.xml
Thoughts
It is preferrable to hand in a working program that addresses part of the problem than a mess that attempts the entire problem.
- Use small functions
- Implement 1 task at a time
- Test it, separately. Should be easy to do with functions
- When working, gather your small functions together to complete the larger task
- No function should be very long
- Keep your code neat, legible, logical
- Overall appeal of your source code will be part of the grade. Style matters
- Appropriate comments, including the file header(s)
You might want to consider os.walk, for flipping through directories. See os_walk.py . Some other useful functions, maybe: os.path.join os.path.abspath os.stat . See stat.py
Folks, please don’t spend a lot of time writing me 18 different classes. My solution contains no user-defined classes, though there is 1 fairly obvious candidate, if you have that itch.
Submission
Do not submit temporary files, nor your test data. Just the required scripts, and any helper files.
What to hand in
- dropXml.py — your Python3 script
- Any other files needed
- README (optional) — anything you want to tell us before we grade.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.