课程: Level Up: Python
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Build a zip archive
(playful music) - When you need to package up a bunch of related data, ZIP files are great. Your goal for this challenge is to write a Python function to build a ZIP archive. It should accept a path to the top-level directory you want to include, a list of file extensions, and an output file path for the resulting archive. The function should search the input directory and all of its subdirectories for files with the specified extension and then package them together into a ZIP file. But we don't just want to throw files together all willy-nilly, so that ZIP archive should maintain the folder structure relative to the top-level path. For example, this call to my zip_all function would search the my_stuff folder for all files ending in .jpg or .txt and wrap them together in my_stuff.zip. Pause the video now to create your own solution, then I'll show you how I solved this challenge. (playful music) - For my…
内容
-
-
-
Find prime factors3 分钟 11 秒
-
(已锁定)
Identify a palindrome2 分钟 48 秒
-
(已锁定)
Sort a string3 分钟 2 秒
-
(已锁定)
Find all list items3 分钟 12 秒
-
(已锁定)
Play the waiting game2 分钟 22 秒
-
(已锁定)
Save a dictionary3 分钟 13 秒
-
(已锁定)
Schedule a function3 分钟 16 秒
-
(已锁定)
Send an email3 分钟 12 秒
-
(已锁定)
Simulate dice3 分钟 16 秒
-
(已锁定)
Count unique words3 分钟 12 秒
-
(已锁定)
Generate a password3 分钟 59 秒
-
(已锁定)
Merge CSV files3 分钟 35 秒
-
(已锁定)
Solve a sudoku4 分钟 8 秒
-
(已锁定)
Build a zip archive3 分钟 42 秒
-
(已锁定)
Download sequential files4 分钟 2 秒
-