Skip to content

Instantly share code, notes, and snippets.

@BastinRobin
Last active September 23, 2016 15:32
Show Gist options
  • Select an option

  • Save BastinRobin/3a55473f02b7e3e27b9e9347f4e20f13 to your computer and use it in GitHub Desktop.

Select an option

Save BastinRobin/3a55473f02b7e3e27b9e9347f4e20f13 to your computer and use it in GitHub Desktop.
Build Script Challenge

Build Script Challenge

Write a python or shell script when its executed inside a directory it should convert all python .py files inside the current directory and all its subdirectories into .pyc and remove all .py files

For eg:

base(dir)
   - init.py
   - lib(dir)
     - base.py
     - lib.py
   - doc
     - doc.py
     - __init__.py

Output:

  base(dir)
   - init.pyc
   - lib(dir)
     - base.pyc
     - lib.pyc
   - doc
     - doc.pyc
     - __init__.pyc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment