- 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.
推薦閱讀
- Getting Started with Citrix XenApp? 7.6
- 數(shù)據(jù)庫(kù)程序員面試筆試真題與解析
- C語言程序設(shè)計(jì)實(shí)訓(xùn)教程
- Getting Started with PowerShell
- C語言程序設(shè)計(jì)
- 深入理解Java7:核心技術(shù)與最佳實(shí)踐
- 從0到1:Python數(shù)據(jù)分析
- Learning AngularJS for .NET Developers
- PHP編程基礎(chǔ)與實(shí)踐教程
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- ActionScript 3.0從入門到精通(視頻實(shí)戰(zhàn)版)
- 零基礎(chǔ)學(xué)HTML+CSS
- Arduino電子設(shè)計(jì)實(shí)戰(zhàn)指南:零基礎(chǔ)篇
- 嵌入式C編程實(shí)戰(zhàn)
- Python滲透測(cè)試編程技術(shù):方法與實(shí)踐(第2版)