Python for Mac OS X
Python comes pre-installed on Mac OS X so it is easy to startusing. However, to take advantage of the latest versions ofPython, you will need to download and install newer versionsalongside the system ones. The easiest way to do that is toinstall one of the binary installers for OS X from thePython Download page. Installers areavailable for the latest Python 3 and Python 2 releases thatwill work on all Macs that run Mac OS X 10.5 and later.
Python releases include IDLE, Python's built-in interactivedevelopment environment. If you download and install Pythonfrom the release page, you may also need to download and installa newer version of Tcl/Tk for OS X. See theIDLE and Tkinter on OS X page formore information.
You can run a Python interpreter by double-clicking onApplications / Utilities / Terminal and typing python3 (if you'veinstalled a version of Python 3) or python (to use Python 2) inthe window that opens up. You can also launch IDLE for the Pythonversion you have installed by double-clicking its icon inthe appropriate Python version folder in the Applications folderor you can also just type idle3 or idle in a terminal window.
There are many thousands of additional Python software packagesavailable through PyPI, the PythonPackage Index. We recommend you use thepip tool to simplifyinstalling and managing additional packages. pip is includedwith Python 3.4 releases; for earlier releases, follow the pipinstall instructions.
Among the packages available through PyPI are some that arespecifically for OS X environments. Among these are:
- pyobjc which providesa bridge between Python and Objective-C, allowing you to writefull-featured native Cocoa applications in pure Python.
- py2app which allowsyou to make standalone OS X double-clickable application bundlesand plugins from Python scripts.
For more information about Python on OS X, see the mailing list and archivesfor thePython-Macintosh Special Interest Group.
Alternative Packages for Mac OS X.
- ActiveState ActivePython(commercial and community versions, including scientific computing modules).
- Enthought Python DistributionThe Enthought Python Distribution provides scientists with a comprehensive setof tools to perform rigorous data analysis and visualization.
Python and a comprehensive set of third-party packages and libraries are alsoavailable from several open source package manager projects for OS X,including:Latest version
aws-shell - The interactive productivity booster for the AWS CLI
The aws-shell requires python and pip to install.You can install the aws-shell using pip:
If you are not installing into a virtualenv you can run:
Mac OS X (10.11 El Capitan) users: There is a known issue with Apple andits included python package dependencies (more info athttps://github.com/pypa/pip/issues/3165).We are investigating ways to fix this issue but in the meantime,to install the aws-shell, you can run:sudo pip install aws-shell--upgrade--ignore-installed six
Once you’ve installed the aws-shell, you can now run:
To exit the shell, press Ctrl-D.
Upgrading the aws-shell
If you want to upgrade to the latest version of the aws-shell,you can run:
You can also use this upgrade command whenever a new version of the AWS CLI isreleased that includes new services and API updates. You will then beable to use these new services and API updates in the aws-shell.
Supported Python Versions
The aws-shell works on the same python versions supported by the AWS CLI:
- 2.6.5 and greater
- 2.7.x and greater
- 3.3.x and greater
- 3.4.x and greater
The aws-shell uses the same configuration settings as the AWS CLI.If you’ve never used the AWS CLI before, the easiest way to getstarted is to run the configure command:
For more information about configure settings, see theAWS CLI Getting Started Guide.
The aws-shell accepts the same commands as the AWS CLI, except you don’tneed to provide the aws prefix. For example, here are a few commandsyou can try:
The aws-shell supports AWS CLI profiles. You have two options to useprofiles. First, you can provide a profile when you start the aws-shell:
When you do this all the server side completion as well as CLI commandsyou run will automatically use the prod profile.
You can also change the current profile while you’re in the aws-shell:
You can also check what profile you’ve configured in the aws-shell using:
After changing your profile using the .profile dot command, allserver side completion as well as CLI commands will automatically usethe new profile you’ve configured.
Auto Completion of Commands and Options
The aws-shell provides auto completion of commands andoptions as you type.
Shorthand Auto Completion
The aws-shell can also fill in an example of theshorthand syntax used for various AWS CLI options:
Server Side Auto Completion
The aws-shell also leverages boto3, the AWS SDK for Python, to auto completeserver side resources such as Amazon EC2 instance Ids, Amazon Dynamodb tablenames, AWS IAM user names, Amazon S3 bucket names, etc.
This feature is under active development. The list of supported resourcescontinues to grow.
Every auto completion value supports fuzzy searching. This enables you tospecify the commands, options, and values you want to run with even lesstyping. You can try typing:
- The first letter of each sub word: ec2 describe-reserved-instances-offerings-> ec2 drio
- A little bit of each word: ec2 describe-instances -> ec2 descinst
- Any part of the command: dynamodb table -> Offers all commands thatcontain the subsequence table.
Python On Mac
The aws-shell will automatically pull up documentation as you type commands.It will show inline documentation for CLI options. There is also a separatedocumentation panel that will show documentation for the current command oroption you are typing. Pressing F9 will toggle focus to the documentation panelallowing you to navigate it using your selected keybindings.
Fish-Style Auto Suggestions
The aws-shell supports Fish-style auto-suggestions. Use the right arrow key tocomplete a suggestion.
The aws-shell records the commands you run and writes them to~/.aws/shell/history. You can use the up and down arrow keys to scrollthrough your history.
The aws-shell has a bottom toolbar that provides several options:
- F2 toggles between fuzzy and substring matching
- F3 toggles between VI and Emacs key bindings
- F4 toggles between single and multi column auto completions
- F5 shows and hides the help documentation pane
- F9 toggles focus between the cli and documentation pane
- F10 or Ctrl-D exits the aws-shell
As you toggle options in the toolbar, your preferences are persistedto the ~/.aws/shell/awsshellrc file so that the next time you runthe aws-shell, your preferences will be restored.
The aws-shell provides additional commands specific to the aws-shell.The commands are available by adding the . prefix before a command.
Exiting the Shell
You can run the .exit or .quit commands to exit the shell.
Creating Shell Scripts with .edit
There are times when you may want to take a sequence of commandsyou’ve run in the aws-shell and combine them into a shell script.In addition to the command history that’s persisted to thehistory file, the aws-shell also keeps track of all the commandsyou’ve run since you first started your aws-shell session.
You can run the .edit command to open all these commands inan editor. The aws-shell will use the EDITOR environmentvariable before defaulting to notepad on Windows andvi on other platforms.
Changing Profiles with .profile
You can change the current AWS CLI profile used by the aws-shellby using the .profile dot command. If you run the .profilecommand with no arguments, the currently configured shell profilewill be printed.
You can change the current working directory of the aws-shell by usingthe .cd command:
Executing Shell Commands
The aws-shell integrates with other commands in several ways.First, you can pipe AWS CLI commands to other processes as wellas redirect output to a file:
Second, if you want to run a shell command rather than an AWS CLIcommand, you can add the ! prefix to your command:
Developer Preview Status
The aws-shell is currently in developer preview.We welcome feedback, feature requests, and bug reports.There may be backwards incompatible changes made in orderto respond to customer feedback as we continue to iterateon the aws-shell.
Below are miscellaneous links for more information:
Release historyRelease notifications RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size aws_shell-0.2.2-py2.py3-none-any.whl (50.6 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes|
|Filename, size aws-shell-0.2.2.tar.gz (55.4 kB)||File type Source||Python version None||Upload date||Hashes|
Python Shell For Mac OsxClose
Hashes for aws_shell-0.2.2-py2.py3-none-any.whl
Hashes for aws-shell-0.2.2.tar.gz