Skip to content
Snippets Groups Projects
Commit a2ba6b06 authored by Julia  KENDE's avatar Julia KENDE
Browse files

Solution for file manip exercice

parent 7110443f
No related branches found
No related tags found
1 merge request!1Adding file manip exercice data
Pipeline #158075 passed
...@@ -188,3 +188,23 @@ For instance which is a very convenient way to use it:: ...@@ -188,3 +188,23 @@ For instance which is a very convenient way to use it::
for seq in fasta_iter('my_fast_file.fasta'): for seq in fasta_iter('my_fast_file.fasta'):
print seq print seq
Exercise
--------
Before performing any modification on files or folders, it is good practice to print and check the names of the affected items.
:download:`file_manip.zip <_static/data/file_manip.zip>`
#. Unzip the folder
#. Create a script to:
* Append today’s date to all files whose names contain "sample".
* Create a folder named "log".
* Move all files ending with ".log.txt" into the "log" folder.
* Delete all empty folders in the directory.
.. literalinclude:: _static/code/file_manip.py
:linenos:
:language: python
:download:`fasta_reader.py <_static/code/file_manip.py>` .
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment