- Secret Recipes of the Python Ninja
- Cody Jackson
- 116字
- 2021-06-25 22:14:47
How to do it...
- A number of options are available for the Python command-line call. To enter interactive mode, call Python with no additional options:
$ python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for
more information.
>>>
- To execute a regular Python program with no special options, add the program name:
$ python <script>.py
- To execute a series of Python commands without entering interactive mode or calling a file, use -c:
$ python -c "print('Hello World')"
- To call a Python module as a standalone program, use -m:
$ python -m random
- Discussion of the other possible options is provided in the following section.
推薦閱讀
- TypeScript Blueprints
- Effective C#:改善C#代碼的50個有效方法(原書第3版)
- ASP.NET Core Essentials
- iOS開發實戰:從零基礎到App Store上架
- HTML5 Mobile Development Cookbook
- 編寫高質量代碼:改善Python程序的91個建議
- 編寫高質量代碼:改善C程序代碼的125個建議
- JS全書:JavaScript Web前端開發指南
- 用Python實現深度學習框架
- Windows內核編程
- Multithreading in C# 5.0 Cookbook
- Building Android UIs with Custom Views
- C和C++游戲趣味編程
- HTML5開發精要與實例詳解
- C++從入門到精通(第6版)