python開發中級_針對中級Python開發人員的13個專案構想

2020-07-15 03:51:15

python開發中級

Learning the basics of Python is a wonderful experience. But the euphoria of just learning can be replaced by the hunger for hands-on projects. It’s normal to want to build projects, hence the need for project ideas.

學習Python的基礎知識是一次很棒的經歷。 但是,對於動手專案的渴望可以代替僅僅學習的欣快感。 想要構建專案是正常的,因此需要專案創意。

The problem though is that some projects are either too simple for an intermediate Python developer or too hard. This article will suggest projects you can work on as an intermediate Python developer. These project ideas will provide the appropriate level of challenge for you.

但問題是,對於中級Python開發人員而言,有些專案太簡單了,或者太難了。 本文將建議您作爲中級Python開發人員可以從事的專案。 這些專案構想將爲您提供適當級別的挑戰。

In this article, you’ll learn:

在本文中,您將學習:

  • The importance of building projects
  • The major platforms you can build projects for
  • Thirteen project ideas you can work on
  • Some tips for working on projects
  • 建設專案的重要性
  • 您可以爲其構建專案的主要平臺
  • 您可以處理的十三個專案構想
  • 有關專案的一些提示

Free Bonus: 5 Thoughts On Python Mastery, a free course for Python developers that shows you the roadmap and the mindset you’ll need to take your Python skills to the next level.

免費獎金: 關於Python精通的5個想法 ,這是針對Python開發人員的免費課程,向您展示了將Python技能提升到新水平所需的路線圖和心態。

建築專案的重要性 (The Importance of Building Projects)

Working on projects is vital to pushing your career as a Python developer forward. They make you apply the skills and knowledge you’re acquiring.

專案工作對於推動您作爲Python開發人員的職業發展至關重要。 它們使您可以應用所學的技能和知識。

Projects can help you:

專案可以幫助您:

  • Build confidence: You will believe more in your ability to create software regardless the level of complexity.

  • Explore other technologies: You will learn about other technologies needed in building a complete product such as databases, servers, and other languages.

  • Understand programming concepts better: You will learn to write code better and understand concepts such as design patterns and object-oriented programming.

  • Experience a complete software development life cycle: You will learn how to plan before writing code, manage the coding process and update software.

  • 建立信心 :無論複雜程度如何,您都會更加相信自己的軟件開發能力。

  • 探索其他技術 :您將學習構建完整產品所需的其他技術,例如數據庫,伺服器和其他語言。

  • 更好地理解程式設計概念 :您將學習更好地編寫程式碼,並理解諸如設計模式和麪向物件程式設計之類的概念。

  • 體驗完整的軟件開發生命週期 :您將學習如何在編寫程式碼之前進行計劃,管理編碼過程以及更新軟體。

There is a lot to gain from building projects as a Python developer.

作爲Python開發人員構建專案有很多收穫。

選擇專案平臺 (Choosing a Project Platform)

You need to build your software to run on a platform so that people who lack certain technical knowledge can use your software. The web, desktop, and command-line are the three major platforms you’ll want to build your projects for.

您需要構建在平臺上執行的軟體,以便缺乏某些技術知識的人可以使用您的軟體。 Web,桌面和命令列是您要爲其構建專案的三個主要平臺。

網頁 (Web)

Web applications are applications that run on the web, they can be accessed on any device without being downloaded, provided there is access to the internet. If you want your projects to be accessible by everyone with internet access, it needs to be a web application.

Web應用程式是在Web上執行的應用程式,只要可以存取Internet,就可以在任何裝置上存取它們而無需下載它們。 如果您希望所有人都能存取您的專案,則它必須是一個Web應用程式。

A web application has a back end and front end. The back end is the part where the business logic is: your back-end code will manipulate and store data. The front end is the interface of the application: your front-end code will determine the look of a web application.

Web應用程式具有後端和前端。 後端是業務邏輯所在的部分:您的後端程式碼將操縱和儲存數據。 前端是應用程式的介面:您的前端程式碼將確定Web應用程式的外觀。

As an intermediate Python developer, your major focus will be the back-end code. However, the front-end code is important too, so you will need some knowledge of HTML, CSS, and maybe JavaScript to create a simple-looking interface. Just the basics will be enough.

作爲Python的中級開發人員,您的主要重點將是後端程式碼。 但是,前端程式碼也很重要,因此您將需要一些HTML,CSS甚至JavaScript知識,才能 纔能建立一個簡單的介面。 僅僅基礎就足夠了。

Another option is to use Python for both the front end and back end. Thanks to the anvil library, which eliminates the need for HTML, CSS, and JavaScript, you can focus on Python code alone.

另一種選擇是將Python用於前端和後端。 由於有了anvil庫,它消除了對HTML,CSS和JavaScript的需求,因此您可以僅關注Python程式碼。

You can build web applications with Python through web frameworks such as django and flask. The list of frameworks for building web applications using Python is long. There are plenty to choose from, but django and flask remain the most popular web frameworks.

您可以通過djangoflask等Web框架使用Python構建Web應用程式。 使用Python構建Web應用程式的框架列表很長。 有很多選擇,但是djangoflask仍然是最受歡迎的Web框架。

桌面GUI (Desktop GUI)

Every time you perform a task on your PC, be it a desktop or laptop, it is through an application. As an intermediate Python developer, you can make your own desktop applications.

每當您在臺式機或筆記型電腦上的PC上執行任務時,都是通過應用程式進行的。 作爲中級Python開發人員,您可以製作自己的桌面應用程式。

You do not have to learn any front-end technology to create your own Graphical User Interface (GUI) applications, as you saw with web applications. You can build all the parts using Python.

您無需學習任何前端技術即可建立自己的圖形用戶介面(GUI)應用程式,就像在Web應用程式中看到的那樣。 您可以使用Python構建所有零件。

There are frameworks for building your desktop applications. PySimpleGUI is one of them, and it’s pretty user-friendly for an intermediate Python developer.

有用於構建桌面應用程式的框架。 PySimpleGUI是其中之一,對於中級Python開發人員而言,它非常使用者友好。

An advanced GUI framework like PyQt5 is quite powerful, but it may have a steep learning curve.

PyQt5這樣的高階GUI框架非常強大,但是學習曲線可能比較陡峭。

The software you create for the Desktop GUI is able to work on any of the Windows, Linux, or Mac operating systems. All you have to do after creating the project is compile it to an executable for your operating system of choice.

您爲Desktop GUI建立的軟體可以在任何Windows,Linux或Mac操作系統上執行。 建立專案後,您要做的所有事情就是將其編譯爲所選操作系統的可執行檔案。

命令列 (Command-Line)

Command-line applications are those applications that work in a console window. This is the command prompt on Windows and the Terminal on Linux and Mac.

命令列應用程式是在控制檯視窗中工作的那些應用程式。 這是Windows上的命令提示字元,Linux和Mac上的終端。

You’d click to use a web or GUI application, but you’d type in commands for command-line applications. Users of command-line applications need to have some technical knowledge since they’ll need to use commands.

您將單擊以使用Web或GUI應用程式,但要鍵入命令列應用程式的命令。 命令列應用程式的使用者需要掌握一些技術知識,因爲他們需要使用命令。

Command-line applications may not be as beautiful or easy to use as web or GUI applications, but that doesn’t make them less powerful than web or GUI applications.

命令列應用程式可能不如Web或GUI應用程式那麼漂亮或易於使用,但這並沒有使它們比Web或GUI應用程式更強大。

You can improve the look of your command-line applications by applying colors to the text. There are libraries you can use for coloring, such as colorama and colored. You can spice things up and use some color.

您可以通過將顏色應用於文字來改善命令列應用程式的外觀。 有一些可用於着色的庫,例如coloramacolored 您可以使事情變得有趣,並使用一些顏色。

You can use frameworks such as docopt, argparse, and click to build your applications.

您可以使用諸如docoptargparse框架,然後click來構建您的應用程式。

網路專案的想法 (Web Project Ideas)

In this section, you’ll see project ideas for the web. These project ideas can be classified as utility and education tools.

在本節中,您將看到網路上的專案創意。 這些專案構想可以歸類爲實用工具和教育工具。

Here are the project ideas:

以下是專案構想:

  • Content Aggregator
  • Regex Query Tool
  • URL Shortener
  • Post-It Note
  • Quiz Application
  • 內容彙總器
  • 正則表達式查詢工具
  • URL縮短器
  • 便利貼
  • 測驗申請

內容彙總器 (Content Aggregator)

Content is king. It exists everywhere on the web, from blogs to social media platforms. To keep up, you need to search for new information on the internet constantly. One way to stay updated is to check all the sites manually to see what the new posts are. But this is time consuming and quite tiring.

內容爲王。 從部落格到社交媒體平臺,它在網路上無處不在。 爲了跟上步伐,您需要不斷在網際網路上搜尋新資訊。 保持更新的一種方法是手動檢查所有站點以檢視新貼文。 但這很耗時,而且很累。

This is where the content aggregator comes in: A content aggregator fetches information from various places online and gathers all of that information in one place. Therefore, you don’t have to visit multiple sites to get the latest info: one website is enough.

這就是內容聚合器出現的地方:內容聚合器從各個地方線上獲取資訊,並將所有這些資訊收集在一個地方。 因此,您不必存取多個站點即可獲取最新資訊:一個網站就足夠了。

With the content aggregator, all of the latest information can be gotten from one site that aggregates all the content. People can see the posts that interest them and can decide to find out more about them without traipsing all over the internet.

使用內容聚合器,可以從聚合所有內容的一個站點獲取所有最新資訊。 人們可以看到他們感興趣的貼文,並且可以決定查詢更多關於它們的資訊,而無需遍歷整個Internet。

Examples of Content Aggregators

內容彙總器範例

Here are some implementations of the Content Aggregator idea:

以下是Content Aggregator創意的一些實現:

Technical Details

技術細節

The main objective of this project idea is to aggregate content. First, you need to know what sites you’ll want the Content Aggregator to get content from. Then, you can use libraries such as requests for sending HTTP requests and BeautifulSoup to parse and scrape the necessary content from the sites.

該專案構想的主要目標是彙總內容。 首先,您需要知道您希望Content Aggregator從哪些站點獲取內容。 然後,你可以使用庫,比如requests發送HTTP請求和BeautifulSoup解析和刮從網站的必要的內容。

Your application can implement its content aggregation as a background process. Libraries such as celery or apscheduler can help with that. You can try out apscheduler. It’s great for small background processes.

您的應用程式可以將其內容聚合實現爲後臺進程。 諸如celeryapscheduler圖書館可以幫助您解決此問題。 你可以嘗試apscheduler 這對於小型後臺進程非常有用。

After scraping content from various sites, you’ll need to save it somewhere. So, you’ll use a database to save the scraped content.

從各個站點抓取內容後,您需要將其儲存在某處。 因此,您將使用數據庫來儲存抓取的內容。

Extra Challenge

額外挑戰

For a tougher challenge, you can add more websites. This will help you learn how to study and extract information from websites.

如果遇到更嚴峻的挑戰,您可以新增更多網站。 這將幫助您學習如何研究網站中的資訊並從中提取資訊

You can also have users subscribe to certain sites that you aggregate. Then, at the end of the day, the content aggregator will send the articles for that day to the email address of the user.

您還可以讓使用者訂閱您聚合的某些站點。 然後,在一天結束時,內容聚合器會將當天的文章發送到使用者的電子郵件地址。

正則表達式查詢工具 (Regex Query Tool)

You and I deal with text daily. This article, which is also text, has a structure. This makes it easier for you to understand. Sometimes, you need to find certain information in text, and using the regular search tool in text editors can be ineffective.

您和我每天都處理文字。 本文也是文字,具有結構。 這使您更容易理解。 有時,您需要在文字中查詢某些資訊,而在文字編輯器中使用常規搜尋工具可能會無效。

This is where the Regex Query Tool comes in. A regex is a set of strings, so the regex query tool will check for the validity of the queries. When the regex matches patterns in the text, it tells the user and highlights the matched patterns. So, your Regex Query Tool will check the validity of the regex strings passed in by the user.

這是Regex查詢工具出現的地方。regex是一組字串,因此regex查詢工具將檢查查詢的有效性。 當正則表達式與文字中的模式匹配時,它會告訴使用者並突出顯示匹配的模式。 因此,您的Regex查詢工具將檢查使用者傳遞的regex字串的有效性。

With the Regex Query Tool, users can quickly check the validity of their regex strings on the web. This makes it easier for them, instead of having to check the strings with a text editor.

使用正則表達式查詢工具,使用者可以在Web上快速檢查其正則表達式字串的有效性。 這使他們更輕鬆,而不必使用文字編輯器檢查字串。

Examples of Regex Query Tools

正則表達式查詢工具範例

Here are some implementations of the Regex Query Tool idea:

以下是Regex查詢工具提示的一些實現:

Technical Details

技術細節

The main objective of this type of project is to tell the user the validity of the inputted query strings. You can make it give a positive or negative response such as Query String Is Valid and Query String Is Invalid, implementing the positive response in green and the negative in red.

這類專案的主要目的是告訴使用者輸入的查詢字串的有效性。 您可以使其給出肯定或否定的響應,例如「 Query String Is Valid和「 Query String Is Invalid ,以綠色實現正響應,以紅色實現負響應。

You don’t have to implement the query tool from scratch. You can use Python’s standard re library, which you can use to run the query strings on the inputted text. The re library will return None when the query string matches nothing, and it’ll return the matched strings when positive.

您不必從頭開始實施查詢工具。 您可以使用Python的標準re庫,該庫可用於對輸入的文字執行查詢字串。 當查詢字串不匹配時, re庫將返回None當查詢字串爲正時,它將返回匹配的字串。

Some users may not understand regex fully, so you can make a page to explain how regex works. You can make documentation that is interesting enough to keep the users excited about learning and understanding regex.

有些使用者可能不完全瞭解regex,因此您可以製作一個頁面來解釋regex的工作方式。 您可以製作足夠有趣的文件,以使使用者對學習和理解正則表達式感到興奮。

Extra Challenge

額外挑戰

Making a project that just returns the validity of the regex is fine. But you can also add a replacement feature. This means the application will check for the validity of the regex and also allow users to replace the matched strings with something else. So the tool is no longer a find tool but also a replace tool.

製作一個僅返回正則表達式有效性的專案就可以了。 但是您也可以新增替換功能。 這意味着應用程式將檢查正則表達式的有效性,並且還允許使用者用其他內容替換匹配的字串。 因此,該工具不再是查詢工具,而是替換工具。

URL縮短器 (URL Shortener)

URLs can be extremely long and not user-friendly. When people share links or even try to remember a URL, it’s difficult because most URLs are filled with more difficult characters and don’t form meaningful words.

URL可能非常長,而且不友好。 當人們共用鏈接或什至試圖記住URL時,這很困難,因爲大多數URL充滿了更困難的字元並且沒​​有形成有意義的詞。

This is where the URL Shortener comes in. A URL Shortener reduces the characters or letters in a URL, making them easier to read and remember. A URL like xyz.com/wwryb78&svnhkn%sghq?sfiyh can be shortened to xyz.com/piojwr.

這就是URL Shortener的用處。URLShortener減少了URL中的字元或字母,使它們更易於閱讀和記住。 喜歡的URL xyz.com/wwryb78&svnhkn%sghq?sfiyh可縮短至xyz.com/piojwr

With the URL Shortener, URLs become a joy to work with.

使用URL Shortener,URL成爲一種令人愉快的工作方式。

Examples of URL Shorteners

URL縮短器的範例

Here are some implementations of the URL Shortener idea:

以下是URL Shortener思想的一些實現:

Technical Details

技術細節

The main objective of this project idea is to shorten URLs. The main task the application will accomplish is to shorten URLs and then redirect users to the original URL when the shortened URL is visited.

該專案構想的主要目的是縮短URL。 應用程式將完成的主要任務是縮短URL,然後在存取縮短的URL時將使用者重定向到原始URL。

In the application, the users will input the original URL, and they will get the new, shortened URL as the result. To do this, you can use a combination of the random and string modules to generate the characters for the shortened URL.

在應用程式中,使用者將輸入原始URL,然後他們將獲得新的,縮短的URL。 爲此,您可以結合使用randomstring模組來爲縮短的URL生成字元。

Since users will visit the shortened URL days, months, or even years after, you’ll need to save the original and shortened URLs in a database. When a request comes in, the application checks if the URL exists and redirects to the original, or else it redirects to a 404 page.

由於使用者將在幾天,幾個月甚至幾年後存取縮短的URL,因此您需要將原始的和縮短的URL儲存在數據庫中。 收到請求時,應用程式將檢查URL是否存在並重定向到原始URL,否則將重定向到404頁面。

Extra Challenge

額外挑戰

Generating a shortened URL with random characters makes for a better URL than the long, random ones. But, you can make the result better for the users. You can add a feature to customize URLs, so the users can customize the generated URLs themselves.

與隨機的長URL相比,生成帶有隨機字元的縮短的URL可以提供更好的URL。 但是,您可以爲使用者帶來更好的結果。 您可以新增自定義URL的功能,以便使用者可以自定義生成的URL。

Without a doubt, a custom xyz.com/mysite URL is better than a randomly generated xyz.com/piojwr URL.

毫無疑問,自定義xyz.com/mysite URL比隨機生成的xyz.com/piojwr URL更好。

便利貼 (Post-It Note)

It’s human to have many thoughts and ideas in a day, but it’s also human to forget. One way to work around forgetting things is to jot them down before they disappear into thin air. While some of forgotten thoughts and ideas may be trivial, some can be quite powerful.

一天中有許多想法和想法是人類的工作,但忘記也是人類的工作。 解決遺忘問題的一種方法是在它們消失在稀薄的空氣中之前先將它們記下來。 儘管一些被遺忘的思想和觀念可能是微不足道的,但有些卻可能非常有力。

This is where a Post-It note comes in: A Post-It note is a small paper with low-tack adhesive at the back, making it attachable to surfaces such as documents, walls. Post-It notes make it easier to jot things down. The Post-It note project idea is something similar. It allows users to jot things down, making them accessible anywhere, since it’s a web application.

這就是便利貼的來源:便利貼是一種小紙,背面帶有低粘性粘合劑,可貼上到文件,牆壁等表面上。 便利貼可讓您輕鬆記筆記。 便利貼專案的構想與此類似。 它是一個Web應用程式,它使使用者可以記下所有內容,使其可以在任何地方存取。

With the Post-It note, people can now jot things down anywhere, without the fear of forgetting things or misplacing the notes—which is a possibility with physical notes.

有了便利貼,人們現在可以在任何地方記下東西,而不必擔心忘記東西或放錯地方—物理筆記是有可能的。

Examples of Post-It Notes

便箋範例

Here are some implementations of the Post-It Note idea:

這是便利貼想法的一些實現:

Technical Details

技術細節

The main objective of this project is to allow users to jot down thoughts. This means that each user will have their own notes, so the application will need to have an account creation feature. This ensures that the notes of each user remain private to them.

該專案的主要目的是允許使用者記下想法。 這意味着每個使用者都有自己的註釋,因此應用程式將需要具有帳戶建立功能。 這樣可以確保每個使用者的註釋對其保持私密。

django comes with a user authentication system, so it may be a good choice. You can use other frameworks like bottle or flask, but you’ll have to implement the user authentication system on your own.

django帶有使用者身份驗證系統,因此它可能是一個不錯的選擇。 您可以使用bottleflask類的其他框架,但必須自己實現使用者身份驗證系統。

Since users may need to separate their notes under different sections, implementing a feature to allow users to categorize their notes will make the application more useful.

由於使用者可能需要在不同的部分下分開他們的筆記,因此實現一項功能以允許使用者對其筆記進行分類將使該應用程式更加有用。

As an example, you may need to have notes on algorithms and data structures, so you’ll need to be able to separate the notes in those categories.

例如,您可能需要有關演算法和數據結構的註釋,因此您需要能夠將這些註釋分隔在這些類別中。

You’ll need to store the information and notes of each user, so a database becomes an essential part of this project. The MySQLdb module can be used if you want to use a MySQL database or the psycopg2 module for a PostgreSQL database. There are other modules you can use, but it all depends on the database you choose to use.

您需要儲存每個使用者的資訊和註釋,因此數據庫成爲該專案的重要組成部分。 如果要對PostgreSQL數據庫使用MySQL數據庫或psycopg2模組,則可以使用MySQLdb模組。 您可以使用其他模組,但這全部取決於您選擇使用的數據庫。

Extra Challenge

額外挑戰

Since it’s human for users to forget their ideas, it’s also human for them to forget that they even made a note somewhere. You can add a feature to remind users of their notes. This feature will allow users to set a time for the reminder, so the application will send the reminder to the users when it’s time, by email.

由於使用者忘記他們的想法是很人性化的,因此忘記他們甚至在某個地方做筆記也是人性化的。 您可以新增一項功能來提醒使用者他們的筆記。 此功能允許使用者設定提醒時間,因此應用程式將在時間到時通過電子郵件將提醒發送給使用者。

測驗申請 (Quiz Application)

Knowledge is power. There are so many things in the world to learn, and quizzes help in testing the understanding of those concepts. You, as an intermediate Python developer, do not have to understand everything about the language. Taking tests is one way to find out things you don’t fully understand.

知識就是力量。 世界上有很多東西要學習,測驗有助於測試對這些概唸的理解。 作爲Python的中級開發人員,您不必瞭解有關該語言的所有知識。 進行測試是找出您不完全瞭解的事情的一種方法。

This is where the Quiz Application comes in. The Quiz Application will present questions to the users and expect the right answers to those questions. Think of the Quiz Application as a kind of questionnaire.

這是測驗應用程式出現的地方。測驗應用程式將向使用者提出問題,並期望對這些問題有正確的答案。 將測驗應用程式視爲一種問卷。

With the Quiz Application, special users you can call administrators will be allowed to create tests, so regular users can answer the questions and test their understanding of the topics in the quiz.

使用測驗應用程式,您可以呼叫管理員的特殊使用者可以建立測試,因此普通使用者可以回答問題並測試他們對測驗主題的理解。

Examples of Quiz Applications

測驗應用範例

Here are some implementations of the Quiz Application idea:

以下是測驗應用程式構思的一些實現:

Technical Details

技術細節

The main objective of this project is to set quizzes and have people answer them. Therefore, users should be able to set questions, and other users should be able to answer those questions. The application will then display the final score and the right answers.

該專案的主要目的是設定測驗並讓人們回答。 因此,使用者應該能夠設定問題,其他使用者應該能夠回答那些問題。 然後,應用程式將顯示最終分數和正確答案。

If you want users to be able to have a record of their scores, you may have to implement an account creation feature.

如果您希望使用者能夠記錄其分數,則可能必須實現帳戶建立功能。

Users creating the tests should be able to create tests with the questions and answers by simply uploading a text file. The text file will have a format that you can decide, so the application can convert from a file to a quiz.

建立測試的使用者應該能夠通過簡單地上載文字檔案來建立帶有問題和答案的測試。 文字檔案將具有您可以確定的格式,因此應用程式可以從檔案轉換爲測驗。

You’ll need to implement a database for this project. The database will store the questions, possible answers, correct answers, and the scores for each user.

您需要爲此專案實現一個數據庫。 數據庫將儲存每個使用者的問題,可能的答案,正確的答案以及分數。

Extra Challenge

額外挑戰

For more of a challenge, you can allow users to add timers to the quizzes. This way, the creators of a quiz can determine how many seconds or minutes a user should spend on each question in the quiz.

對於更多挑戰,您可以允許使用者將計時器新增到測驗中。 這樣,測驗的建立者可以確定使用者應在測驗中的每個問題上花費多少秒或幾分鐘。

It would be great to also have a quiz-sharing feature, so users can share interesting quizzes with their friends on other platforms.

擁有測驗共用功能也很好,因此使用者可以與其他平臺上的朋友共用有趣的測驗。

GUI專案的想法 (GUI Project Ideas)

In this section, you’ll see project ideas for Graphical User Interfaces. These project ideas can be classified as entertainment, finance, and utility tools.

在本節中,您將看到圖形用戶介面的專案構想。 這些專案構想可以歸類爲娛樂,金融和實用工具。

Here’s are the project ideas:

這裏是專案的想法:

  • MP3 Player
  • Alarm Tool
  • File Manager
  • Expense Tracker
  • MP3播放器
  • 報警工具
  • 檔案管理器
  • 費用追蹤器

MP3播放器 (MP3 Player)

Audio is as important as text today if not more important. Since audio files are digital files, you’ll need a tool that can play them. Without a player, you’ll never be able to listen to the contents of an audio file.

如今,音訊與文字同樣重要,甚至更爲重要。 由於音訊檔是數位檔案,因此您需要一個可以播放它們的工具。 沒有播放器,您將永遠無法收聽音訊檔的內容。

This is where the MP3 Player comes in. The MP3 Player is a device for playing MP3s and other digital audio files. This MP3 Player GUI project idea attempts to emulate the physical MP3 Player. You can build software that allows you play an MP3 files on your desktop or laptop computer.

這是MP3播放器的來源。MP3播放器是用於播放MP3和其他數位音訊檔的裝置。 這個MP3 Player GUI專案創意試圖模仿物理MP3 Player。 您可以構建允許您在臺式機或便攜式計算機上播放MP3檔案的軟體。

When you are done building the MP3 Player project, users can play their MP3 files and other digital audio files without having to purchase a physical MP3 Player. They’ll be able to play the MP3 files using their computers.

完成MP3 Player專案的構建後,使用者可以播放其MP3檔案和其他數位音訊檔,而不必購買實際的MP3 Player。 他們將能夠使用自己的計算機播放MP3檔案。

Examples of MP3 Players

MP3播放器的範例

Here are some implementations of the MP3 Player idea:

以下是MP3播放器提示的一些實現:

Technical Details

技術細節

The main objective of this project is to allow users to play MP3 and digital audio files. To be engaging for users, the application has to have a simple but beautiful user interface.

該專案的主要目的是允許使用者播放MP3和數位音訊檔。 爲了吸參照戶,該應用程式必須具有簡單但美觀的用戶介面。

You can have an interface for listing the available MP3 files. You can also give users the option to list other digital audio files that are not MP3.

您可以使用一個介面來列出可用的MP3檔案。 您還可以爲使用者提供列出非MP3的其他數位音訊檔的選項。

The users will also expect the MP3 Player to have an interface that shows information on the file that is playing. Some of the information you can include are the name of the file, its length, the amount played, and the amount not played, in minutes and seconds.

使用者還將期望MP3 Player具有一個介面,該介面顯示有關正在播放的檔案的資訊。 您可以包括的一些資訊是檔案的名稱,檔案的長度,播放的數量和未播放的數量(以分鐘和秒爲單位)。

Python has libraries that can play audio files, such as pygame, which allows you to work with multimedia files in few lines of code. You can also check out pymedia and simpleaudio.

Python具有可以播放音訊檔的庫,例如pygame ,它使您可以用幾行程式碼來處理多媒體檔案。 您還可以檢查出pymediasimpleaudio

These libraries can handle a lot of digital audio files. They can handle other file types, not just the MP3 files.

這些庫可以處理許多數位音訊檔。 他們可以處理其他檔案型別,而不僅僅是MP3檔案。

You can also implement a feature that allows users to create a playlist. To do this, you’ll need a database to store information on the created playlists. Python’s sqlite3 module allows you to use the SQLite database.

您還可以實現允許使用者建立播放列表的功能。 爲此,您需要一個數據庫來儲存有關建立的播放列表的資訊。 Python的sqlite3模組允許您使用SQLite數據庫。

The SQLite database is a better option in this case, because it is file based and easier to set up than other SQL databases. While SQLite is file based, it is better for saving data than a regular file.

在這種情況下,SQLite數據庫是一個更好的選擇,因爲它是基於檔案的,並且比其他SQL數據庫更易於設定。 雖然SQLite是基於檔案的, 但與常規檔案相比,儲存數據更好

Extra Challenge

額外挑戰

For a more exciting challenge, you can add a feature to allow the MP3 player to repeat currently playing files or even shuffle the list of files to be played.

對於更具挑戰性的挑戰,您可以新增一項功能,以允許MP3播放器重複當前正在播放的檔案,甚至重新整理要播放的檔案列表。

It’s also possible to implement a feature that allows users to increase and decrease the playing speed of the audio file. Users will find this interesting, as they’ll be able to play files at a slower or faster pace than usual.

也可以實現允許使用者增加和減少音訊檔的播放速度的功能。 使用者會發現這很有趣,因爲他們將能夠以比平時更快或更慢的速度播放檔案。

報警工具 (Alarm Tool)

As they say, 「Time and tide wait for no man.」 But with a lot of things going on in our lives, it’s difficult to not lose track of time. To be able to keep track of time, a reminder is needed.

正如他們所說:「時光流逝,沒有人在等待。」 但是,隨着我們生活中發生的很多事情,很難不失時間。 爲了能夠跟蹤時間,需要提醒。

This is where the Alarm Tool comes in. An alarm is a device that gives an audio or visual signal about a certain condition. This Alarm Tool project idea is an attempt to build an alarm as software. The Alarm Tool gives an audio signal when a certain condition is met. The set time is the certain condition in this case.

這是警報工具的用處。警報是一種提供有關特定狀況的音訊或視覺信號的裝置。 此警報工具專案的想法是嘗試將警報構建爲軟體。 滿足特定條件時,警報工具會發出音訊信號。 在這種情況下,設定時間是一定條件。

With the Alarm Tool, users can set alarms to remind them of things at certain times of the day. The Alarm Tool project will work from the user’s laptop or desktop device, so they do not have to purchase a physical timer.

使用警報工具,使用者可以設定警報以提醒他們一天中的某些時間。 「警報工具」專案將在使用者的便攜式計算機或臺式機裝置上執行,因此他們不必購買物理計時器。

Examples of Alarm Tools

報警工具範例

Here are some implementations of the Alarm Tool idea:

以下是「警報工具」概唸的一些實現:

Technical Details

技術細節

The main objective of this project is to activate audio signals at certain times of the day. So, timing and the audio signal to be played are the most important parts of the Alarm Tool.

該專案的主要目的是在一天中的特定時間啓用音訊信號。 因此,定時和要播放的音訊信號是警報工具最重要的部分。

The Alarm Tool should allow users to create, edit, and delete alarms. It should also have an interface that lists all the alarms, provided they have not being deleted by the user. So, it should list the active and inactive alarms.

警報工具應允許使用者建立,編輯和刪除警報。 如果沒有被使用者刪除,它還​​應該具有列出所有警報的介面。 因此,它應該列出活動和不活動的警報。

Since it is an alarm, the application has to play tones at the set time. There are libraries for playing audio, like the pygame library.

由於是警報,因此應用程式必須在設定的時間播放提示音。 有一些用於播放音訊的庫,例如pygame庫。

In your code logic, the application has to keep checking for set alarm times. When the time is reached, it triggers a function to play the alarm tone.

在您的程式碼邏輯中,應用程式必須繼續檢查設定的警報時間。 到達時間後,它將觸發播放警報音的功能。

Since the application will check for set alarm times, it means the application has to save the alarms in a database. The database should store things like the alarm date, time, and tone location.

由於應用程式將檢查設定的警報時間,因此這意味着應用程式必須將警報儲存在數據庫中。 數據庫應儲存警報日期,時間和提示音位置等資訊。

Extra Challenge

額外挑戰

As an extra feature, you can allow users to set recurring alarms. They’ll be able to set alarms that will ring at a certain time on certain days of the week, every week. As an example, an alarm can be set at 2:00 PM every Monday.

作爲一項附加功能,您可以允許使用者設定重複警報。 他們將能夠設定警報,該警報將在每週的某些天的某個特定時間響起。 例如,可以在每個星期一的下午2:00設定警報。

You can also add a snooze feature, so your users can snooze alarms instead of only dismissing them.

您還可以新增暫停功能,以便您的使用者可以暫停鬧鐘,而不是僅將其關閉。

檔案管理器 (File Manager)

The number of files on the personal computer of an average PC user is pretty high. If all of those files were placed in a single directory, it would be difficult to navigate and find files or directories. So, there is a need to arrange the files and manage them properly.

普通PC使用者在個人計算機上的檔案數量非常高。 如果所有這些檔案都放在一個目錄中,將很難導航和查詢檔案或目錄。 因此,需要整理檔案並適當地管理它們。

This is where a file manager comes in. A file manager allows users to manage files and directories through a user interface. While files can be managed through the command-line, not all users know how to do that.

這是檔案管理器的用武之地。檔案管理器允許使用者通過用戶介面管理檔案和目錄。 儘管可以通過命令列管理檔案,但並非所有使用者都知道如何執行此操作。

With a file manager, users can arrange, access, and administer their files and directories properly without knowing how to use the command line. Some of the tasks a file manager allows users to perform includes copying, moving, and renaming files or directories.

使用檔案管理器,使用者可以正確地排列,存取和管理其檔案和目錄,而無需知道如何使用命令列。 檔案管理器允許使用者執行的某些任務包括複製,移動和重新命名檔案或目錄。

Examples of File Manager Tools

檔案管理器工具範例

Here are some implementations of the File Manager idea:

以下是檔案管理器概唸的一些實現:

Technical Details

技術細節

The main objective of the file manager project is to give users an interface to manage their files. Users want a file manager that has a file management tool that looks good and is easy to use.

檔案管理器專案的主要目的是爲使用者提供一個介面來管理他們的檔案。 使用者需要一個檔案管理器,該檔案管理器具有看起來不錯且易於使用的檔案管理工具。

You can use the PySimpleGUI library to create unique user interfaces with a powerful widget, without having to deal with a lot of complexity.

您可以使用PySimpleGUI庫通過功能強大的視窗小部件建立唯一的用戶介面,而不必處理很多複雜性。

Your users should be able to perform simple tasks like creating new directories or empty text files. They should also be able to copy and move files or directories.

您的使用者應該能夠執行簡單的任務,例如建立新目錄或空文字檔案。 他們還應該能夠複製和移動檔案或目錄。

The sys, os, and shutil libraries will be quite useful for this project, as they can be used to execute actions on the files in the background, while the user clicks away.

sysosshutil庫對於該專案將非常有用,因爲當使用者單擊時,它們可用於對後臺檔案執行操作。

The grid and list views are popular views today, so you can implement both in the application. This gives the user the option to choose which view option is suitable for them.

網格檢視和列表檢視是當今流行的檢視,因此您可以在應用程式中實現它們。 這使使用者可以選擇適合他們的檢視選項。

Extra Challenge

額外挑戰

To make the file manager a bit more advanced, you can implement a search feature. So users can search for files and directories without having to find them manually.

爲了使檔案管理器更高階,可以實現搜尋功能。 因此,使用者無需手動查詢即可搜尋檔案和目錄。

You can also implement a sort feature. This will allow users to sort files according to different orders, such as time, alphabetical order, or size.

您還可以實現排序功能。 這將允許使用者根據不同的順序(例如時間,字母順序或大小)對檔案進行排序。

費用追蹤器 (Expense Tracker)

We have daily expenses, from groceries to clothing to bills. There are so many expenses that it’s normal to lose track of them and keep spending till we’re almost out of cash. A tracker can help people watch their expenses.

我們的日常開支從雜貨到衣服再到賬單。 有太多的支出,通常會迷失方向並繼續支出,直到我們幾乎沒有現金爲止。 跟蹤器可以幫助人們觀看他們的費用。

This is where the expense tracker comes in. An expense tracker is a software tool that allows users to keep track of their expenses. It can also analyze the expenses, depending on how advanced it is, but let’s keep it simple for now.

這就是費用跟蹤器的用處。費用跟蹤器是一種軟體工具,它使使用者可以跟蹤其費用。 它還可以根據費用的高低來分析費用,但是現在讓我們保持簡單。

With the expense tracker, users can set a budget and track their spending so as to make better financial decisions.

使用費用跟蹤器,使用者可以設定預算並跟蹤他們的支出,以便做出更好的財務決策。

Examples of Expense Trackers

費用追蹤器範例

Here are some implementations of the Expense Tracker idea:

以下是Expense Tracker想法的一些實現:

Technical Details

技術細節

The main objective of this project is to keep track of the user’s expenses. Some statistical analysis has to be done to be able to give users correct information on their expenses and help them spend better.

該專案的主要目的是跟蹤使用者的支出。 必須進行一些統計分析才能 纔能爲使用者提供有關其支出的正確資訊,並幫助他們更好地支出。

While tracking the expenses is the key thing, a good interface is also important. With PySimpleGUI, you can create a unique interface to improve the experience of the users.

儘管跟蹤費用是關鍵,但良好的介面也很重要。 使用PySimpleGUI ,您可以建立一個獨特的介面來改善使用者體驗。

PyData libraries such as pandas and matplotlib can be helpful for building the expense tracker.

PyData庫(例如pandasmatplotlib可有助於構建費用跟蹤器。

The pandas library can be used for the data analysis, and the matplotlib library can be used for plotting graphs. Graphs will give the users a visual representation of their expenses, and a visual representation is usually easier to understand.

pandas庫可用於數據分析,而matplotlib庫可用於繪製圖形。 圖形將爲使用者提供其費用的直觀表示,並且直觀表示通常更易於理解。

The application will receive data from the users. The data here is the inputted expenses. So, you’ll have to store the expenses in a database. The SQLite database is a good database choice for this project since it can be set up quickly. You can use sqlite3 module for the SQLite database.

該應用程式將從使用者那裏接收數據。 這裏的數據是輸入的費用。 因此,您必須將費用儲存在數據庫中。 SQLite數據庫是此專案的理想數據庫選擇,因爲它可以快速設定。 您可以將sqlite3模組用於SQLite數據庫。

Extra Challenge

額外挑戰

For your users to benefit from this project, they’ll have to input their expenses regularly, which might slip their mind. It could be useful for you to implement a reminder feature. So the application will send a notification at certain times of the day or the week, reminding them to make use of the expense tracker.

爲了使您的使用者受益於此專案,他們必須定期輸入費用,這可能會引起他們的注意。 實施提醒功能可能對您很有用。 因此,應用程式將在一天或一週中的某些時間發送通知,提醒他們使用費用跟蹤器。

命令列專案構想 (Command-Line Project Ideas)

In this section, you’ll see project ideas for the command-line. The project ideas discussed can be classified as utility tools.

在本節中,您將看到命令列的專案構想。 討論的專案構想可以歸類爲實用工具。

Here’s are the project ideas:

這裏是專案的想法:

  • Contact Book
  • File Connectivity Checker
  • Bulk File Rename Tool
  • Directory Tree Generator
  • 聯絡書
  • 檔案連線檢查器
  • 批次檔案重新命名工具
  • 目錄樹生成器

聯絡書 (Contact Book)

We come across lots of people daily. We make acquaintances and friends. We get their contacts to keep in touch later on. Sadly, keeping the received contact details can be hard. One way to do this is to write the contact details down. But this is not secure as the physical book can easily be lost.

我們每天都會遇到很多人。 我們結識朋友。 我們會在以後與他們保持聯繫。 可悲的是,很難保持接收到的聯繫方式。 一種方法是寫下聯繫方式。 但這並不安全,因爲實物書很容易丟失。

This is where the Contact Book project comes in. A contact book is a tool for saving a contact’s details, such as name, address, phone number, and email address. With this contact book project, you can build a software tool that people can use to save and find contact details.

這是聯繫人簿專案的來源。聯繫人簿是用於儲存聯繫人詳細資訊(例如姓名,地址,電話號碼和電子郵件地址)的工具。 通過此通訊錄專案,您可以構建一個人們可以用來儲存和查詢聯繫人詳細資訊的軟體工具。

With the contact book project idea, users can save their contacts with less risk of losing the saved contact details. It’ll always be accessible from their computer, through the command-line.

使用聯繫人簿專案的想法,使用者可以儲存聯繫人,而丟失丟失已儲存的聯繫人詳細資訊的風險較小。 始終可以通過命令列從他們的計算機上存取它。

Examples of Contact Book Tools

通訊錄工具範例

There are Contact Book applications, but it’s rare to find command-line Contact Book products, as most are web, mobile, or GUI applications.

有「通訊錄」應用程式,但是很少找到命令列「通訊錄」產品,因爲大多數是Web,移動或GUI應用程式。

Here are some implementations of the Contact Book idea:

這是「聯繫書」構想的一些實現:

Technical Details

技術細節

The main objective of this project is to save contact details. It’s important that you set up the commands users can use to enter the contact details. You can use the argparse or click command-line frameworks. They abstract a lot of complex stuff, so you only have to focus on the logic to be run when executing commands.

該專案的主要目的是儲存聯繫方式。 設定使用者可用來輸入聯繫方式的命令很重要。 您可以使用argparseclick命令列框架。 它們抽象了很多複雜的東西,因此您只需要關注執行命令時要執行的邏輯即可。

Some features you should implement include the commands to delete contacts, update contact information, and list saved contacts. You can also allow users to list contacts using different parameters, such as alphabetical order or contact creation date.

您應該實現的某些功能包括刪除聯繫人,更新聯繫人資訊以及列出已儲存的聯繫人的命令。 您還可以允許使用者使用不同的參數列出聯繫人,例如字母順序或聯繫人建立日期。

Since it’s a command-line project, the SQLite database will be fine for saving contacts. SQLite is user-friendly to set up. You may save the contact details in a file, but a file will not offer the benefits you can gain from using SQLite, such as performance and security.

由於這是一個命令列專案,因此SQLite數據庫可用於儲存聯繫人。 SQLite易於使用者設定。 您可以將聯繫人詳細資訊儲存在檔案中,但是檔案不會提供使用SQLite所能獲得的好處,例如效能和安全性。

To use the SQLite database in this project, the Python sqlite3 module will be very useful.

要在此專案中使用SQLite數據庫,Python sqlite3模組將非常有用。

Extra Challenge

額外挑戰

Remember how the database is stored on the user’s computer? What if something happens, like the user losing their files? It means they’ll also lose the contact details.

還記得數據庫是如何儲存在使用者計算機上的嗎? 如果發生某些事情,例如使用者丟失檔案怎麼辦? 這意味着他們還將失去聯繫方式。

You can challenge yourself further and backup the database to an online storage platform. To do this, you can upload the database files to the cloud at certain intervals.

您可以進一步挑戰自己,並將數據庫備份到線上儲存平臺。 爲此,您可以按一定的時間間隔將數據庫檔案上傳到雲中。

You can also add a command that allows users to backup the database themselves. This way, the user can still have access to the contacts if the database file is lost.

您還可以新增一個命令,該命令允許使用者自己備份數據庫。 這樣,如果數據庫檔案丟失,則使用者仍然可以存取聯繫人。

You should note that you may need some form of identification, so the contact book can tell which database file belongs to which user. Implementing a user authentication feature is one way to go about it.

您應該注意,您可能需要某種形式的標識,因此通訊錄可以告訴哪個數據庫檔案屬於哪個使用者。 實現使用者身份驗證功能是實現此功能的一種方法。

站點連線檢查器 (Site Connectivity Checker)

When you visit a URL, you expect to get the requested pages on your browser. But this is not always the case. Sometimes, sites can be down, so you won’t get the desired results. Instead, you’ll be presented with error messages. You can keep trying a site that is down, till it comes up and you get the information you need.

當您存取URL時,您希望在瀏覽器上獲得請求的頁面。 但這並非總是如此。 有時,站點可能會關閉,因此您將無法獲得理想的結果。 相反,您將看到錯誤訊息。 您可以繼續嘗試關閉的站點,直到它出現並獲得所需的資訊。

This is where the Site Connectivity Checker project comes in. The Site Connectivity Checker visits a URL and returns the status of the URL: it is either live or not. The Site Connectivity Checker will visit the URL at intervals, returning the results of each visit.

這是Site Connectivity Checker專案的來源。SiteConnectivity Checker存取URL並返回URL的狀態:它是否有效。 Site Connectivity Checker會定期存取URL,並返回每次存取的結果。

Instead of manually visiting a URL, a Site Connectivity Checker can do all of that manual work for you. This way, you’ll only get the results of the check without having to spend time on the browser, waiting for the site to go live.

Site Connectivity Checker可以代替您手動存取URL,而是可以爲您完成所有這些手動工作。 這樣,您將只獲得檢查結果,而不必花時間在瀏覽器上,等待網站上線。

Examples of Site Connectivity Checkers

站點連線檢查器的範例

Here are some implementations of the Site Connectivity Checker idea:

這是站點連線檢查器想法的一些實施:

Technical Details

技術細節

The main objective of this project is to check the status of sites. So, you need to write code for checking the status of a website.

該專案的主要目的是檢查站點的狀態。 因此,您需要編寫程式碼來檢查網站的狀態。

You can choose to use either TCP or ICMP for your connections. The socket module is one to check out. You can also read Socket Programming in Python (Guide).

您可以選擇使用TCPICMP進行連線。 socket模組是一個可以檢出的模組。 您還可以閱讀Python通訊端程式設計(指南)

Through your chosen framework, be it the docopt, click, or argparse framework, you can add commands to allow users to add and remove sites from the list of sites to be checked.

通過您選擇的框架(是docoptclickargparse框架),您可以新增命令,以允許使用者從要檢查的站點列表中新增和刪除站點。

The users should also be able to start the tool, stop it, and determine the intervals.

使用者還應該能夠啓動,停止工具並確定時間間隔。

Since you’ll have to save the list of files to be checked, you can either save it in a file (just a list of sites) or use a SQLite database through the sqlite3 module.

由於必須儲存要檢查的檔案列表,因此可以將其儲存在檔案中(只是站點列表),也可以通過sqlite3模組使用SQLite數據庫。

Extra Challenge

額外挑戰

The application can check for the connectivity status of sites and display the results to the command-line. But this will require the user to keep checking the command-line.

該應用程式可以檢查站點的連線狀態,並在命令列中顯示結果。 但這將要求使用者繼續檢查命令列。

You can increase the challenge and implement a notification feature. The notification feature can be a sound played in the background to alert the user when a site’s status changes. You’ll need a database to store the previous status of a site. That’s the only way the tool can tell when the status changes.

您可以增加挑戰並實施通知功能。 通知功能可以是在後台播放的聲音,以在站點狀態更改時提醒使用者。 您將需要一個數據庫來儲存站點的先前狀態。 這是該工具可以告知狀態何時更改的唯一方法。

批次檔案重新命名工具 (Bulk File Rename Tool)

Sometimes, you need to name all the files in a directory according to certain conventions. For example, you can name all the files in a directory with File0001.jpg, where the numbers increase based on the number of files in the directory. Doing this manually can be stressful and repetitive.

有時,您需要根據某些約定爲目錄中的所有檔案命名。 例如,您可以使用File0001.jpg命名目錄中的所有檔案,其中檔案的數量根據目錄中File0001.jpg的數量而增加。 手動執行此操作可能會造成壓力和重複性。

The Bulk File Rename Tool allows users to rename a large number of files, without having to manually rename files.

批次檔案重新命名工具允許使用者重新命名大量檔案,而無需手動重新命名檔案。

This saves users a lot of time. It spares them the trouble of having to do boring repetitive work and make mistakes. With the Bulk File Rename Tool, users can rename files in a couple of seconds without any mistakes.

這樣可以爲使用者節省大量時間。 這使他們免於必須進行無聊的重複工作和犯錯誤的麻煩。 使用批次檔案重新命名工具,使用者可以在幾秒鐘內重新命名檔案而不會出現任何錯誤。

Examples of Bulk File Rename Tools

批次檔案重新命名工具的範例

Here are some implementations of the Bulk File Rename idea:

以下是批次檔案重新命名概唸的一些實現:

Technical Details

技術細節

The main objective of this project idea is to rename files. So, the application needs to find a way to manipulate the target files. The os, sys, and shutil libraries will be useful for a large part of this project.

該專案構想的主要目的是重新命名檔案。 因此,應用程式需要找到一種操作目標檔案的方法。 ossysshutil庫對於該專案的很大一部分很有用。

Your users will be able to rename all the files in the directory, using naming conventions. Therefore, they should be able to pass in the naming convention of choice. The regex module will help match the required naming patterns, if you understand how regex works.

您的使用者將能夠使用命名約定來重新命名目錄中的所有檔案。 因此,它們應該能夠傳遞所選的命名約定。 如果您瞭解正則表達式的工作原理, regex模組將有助於匹配所需的命名模式。

A user may want to pass in a naming convention such as myfiles as part of the commands and expect that the tool renames all the files like myfilesXYZ, where XYZ is a number. They should also be able to choose the directory where the files to be renamed are.

使用者可能希望將諸如myfiles類的命名約定作爲命令的一部分傳遞,並希望該工具重新命名所有檔案,如myfilesXYZ ,其中XYZ是數位。 他們還應該能夠選擇要重新命名的檔案所在的目錄。

Extra Challenge

額外挑戰

The major challenge in this project is to rename all the files in a directory. But users may only need to name a certain number of files. To test your skills, you can implement a feature to allow users to choose the number of files to be renamed, instead of all the files.

該專案的主要挑戰是重新命名目錄中的所有檔案。 但是使用者可能只需要命名一定數量的檔案。 要測試您的技能,您可以實施一項功能,允許使用者選擇要重新命名的檔案數,而不是所有檔案。

Note that renaming only a certain number of files will require the tool to sort the files based on alphabetical order, time of file creation, or file size, depending on the user’s requirements.

請注意,僅重新命名一定數量的檔案將需要該工具根據使用者要求根據字母順序,檔案建立時間或檔案大小對檔案進行排序。

目錄樹生成器 (Directory Tree Generator)

Directories are like family trees: each directory has a particular relationship with other directories. No directories ever stays on its own, except an empty root directory.

目錄就像家族樹:每個目錄與其他目錄都有特定的關係。 除了空的根目錄外,沒有任何目錄可以保留。

When you’re working with files and directories, it is difficult to see the relationship between directories, as you can only see what exists in the current directory. You’re either using a file manager or working from the command-line.

使用檔案和目錄時,很難看到目錄之間的關係,因爲您只能看到當前目錄中存在的內容。 您正在使用檔案管理器,或者從命令列工作。

With a Directory Tree Generator, you can see the relationship between files and directories like a tree or a map.

使用目錄樹生成器,您可以檢視檔案和目錄之間的關係,例如樹或地圖。

This makes it easier to understand the positioning of files and directories. A directory tree map is important when you’re explaining certain concepts, and a Directory Tree Generator makes it easier to get a visual representation of the file and directory relationships.

這使得更容易理解檔案和目錄的位置。 在解釋某些概念時,目錄樹對映很重要,而目錄樹生成器使您更容易獲得檔案和目錄關係的直觀表示。

Examples of Directory Tree Generators

目錄樹生成器的範例

Here are some implementations of the Directory Tree Generator idea:

這是目錄樹生成器思想的一些實現:

Technical Details

技術細節

The main objective of the Directory Tree Generator is to visualize the relationships between files and directories. The os library can be very useful in listing the files and directories in a chosen directory.

目錄樹生成器的主要目的是視覺化檔案和目錄之間的關係。 os庫在列出所選目錄中的檔案和目錄時非常有用。

Using a framework such as docopt or argparse helps abstract a lot of stuff, allowing you to focus on writing code for the application’s logic.

使用諸如docoptargparse類的框架有助於抽象很多內容,使您可以專注於爲應用程式邏輯編寫程式碼。

In the application’s logic, you can decide how you want to represent files or directories. Using different colors is a brilliant way to go about it. You can use the colored library to print the files and directories in different colors.

在應用程式的邏輯中,您可以決定如何表示檔案或目錄。 使用不同的顏色是解決該問題的絕妙方法。 您可以使用colored庫以不同的顏色列印檔案和目錄。

You can also decide how deep you’d like the Directory Tree Generator to go. For example, if a directory has children directories twelve levels deep, you may decide to go only as deep as the fifth level.

您還可以決定目錄樹生成器的深度。 例如,如果目錄的子目錄深度爲十二級,則您可以決定只進入第五級。

If you wish, you can also let the user decide how deep they want the Directory Tree Generator to go.

如果您願意,還可以讓使用者決定他們希望目錄樹生成器執行的深度。

Extra Challenge

額外挑戰

Since the results of the generated directory tree will be on the command-line, you can go one step further. You can have the generator create images of the directory tree, so it’ll basically turn the text into an image.

由於生成的目錄樹的結果將在命令列上顯示,因此您可以再走一步。 您可以讓生成器建立目錄樹的影象,因此基本上可以將文字轉換爲影象。

You’ll find the pillow library useful for doing this.

您會發現pillow庫對此有用。

專案工作技巧 (Tips for Working on Projects)

Working on projects can be difficult. That’s one reason why motivation and interest in a project will make it a less daunting task.

在專案上工作可能很困難。 這就是爲什麼對專案的動力和興趣會使它成爲一項艱鉅的任務的原因。

If you’re interested in a project, you’ll be able to put in the time to research as well as find libraries and tools that will help you with the project.

如果您對某個專案感興趣,則可以花時間進行研究,並找到對專案有幫助的庫和工具。

Here are some tips:

這裏有一些提示:

  • Find a source of motivation
  • Break the project into subtasks
  • Do research on the subtasks
  • Build each subtasks, one step at a time
  • Reach out for help if you’re stuck
  • Put the subtasks together
  • 尋找動力來源
  • 將專案分解爲子任務
  • 研究子任務
  • 一次建立每個子任務
  • 如果遇到困難,請尋求幫助
  • 將子任務放在一起

結論 (Conclusion)

In this article, you’ve seen a couple of Python project ideas you may find interesting.

在本文中,您已經看到了一些您可能會發現有趣的Python專案構想。

The project ideas cover a range of platforms. You saw project ideas for the Web, GUI, and Command-line platforms.

該專案的想法涵蓋了一系列平臺。 您看到了針對Web,GUI和命令列平臺的專案構想。

You can choose to build a project for different platforms. Using the URL Shortener as an example, you may choose to build one for the Web, GUI, or the Command-line.

您可以選擇爲不同的平臺構建專案。 以URL Shortener爲例,您可以選擇爲Web,GUI或命令列構建一個。

Since you’re an intermediate Python developer, these projects can be quite challenging but interesting.

由於您是Python的中級開發人員,因此這些專案可能非常具有挑戰性,但很有趣。

The best way to make a project happen is to just get started. In no time, you’ll be finished and discover how much you’ve benefited from working on a project!

使專案成爲現實的最好方法就是開始。 您將很快完成工作,並發現從專案中受益匪淺!

翻譯自: https://www.pybloggers.com/2019/03/13-project-ideas-for-intermediate-python-developers/

python開發中級