8/21/2021
91

儿子开始学Python,对于少儿编程来说,Python如何进行教学,各家是不同的,甚至有把Python外挂搞成类似Scratch那样,适合低龄的儿童。

  1. I have python3.7.2 and idle installed on my mac, both of them came from the official installation package, run without problem for months, until recently I changed my terminal shell to zsh and also installed another version of python when homebrew is trying to have it as a dependency.
  2. IDLE is known to hang or crash when used with the Apple 8.5.7 included in all versions of macOS 10.6.x. Because of this, we strongly recommend that you do not attempt to use Tkinter or IDLE with the Apple-supplied Python 2.6.1 in 10.6. Instead, install a newer version of Python that supports a newer version of Tk. This is an Aqua Cocoa Tk.
  3. Downloading and Installing Python, IDLE, Tkinter, NumPy, and Pygame. A version of Python 2 is bundled with Mac OS X. It's fine to use that version. IDLE, Tkinter, and NumPy are part of that version, but you must download and install Pygame yourself. Perform these steps to download and install Pygame: Open a Terminal window.

儿子的少儿培训机构,使用的是Python 3,后续用Pygame进行游戏教学。由于兼容性的问题,目前无法支持Python 3.8,所以就只能安装Python 3.7。

下面就是我记录一下整个过程,查了好多篇文章才搞定。大家可以省事一点,一篇文章解决4个问题。

  1. 安装Python 3.7 in mac
  2. 实现清屏的功能,定制快捷键:Command +L
  3. 调整字体,实现全屏
  4. 添加theme,改变白色背景

Python是支持windows和MacOS,对我来说,为了小孩免受各种广告骚扰的麻烦,我让小孩使用Mac。同样的搜狗拼音,在windows,不停广告,Mac下就非常安静,什么广告都没有。

IDLE code editor is popular among students, as it is supplied together with Python. It’s simple to work with, universal, and supports different devices. It’s no wonder they call it a disposable IDE, as it helps to learn the basics before moving on to more sophisticated tools. Compatibility: Windows, Linux, and Mac OS. Top plugins with features.

建议推荐大家给小孩编程,选择Mac Air。

Contents

对于mac来说,安装Python,至少是有3种方式,这只是其中一种,不同的安装方式,会导致配置文件的位置有所不同。大家需要注意。这是从官方网站进行安装

我还是第一次在Mac下体验windows的类似setup安装

下一步就搞定。

启动IDLE

IDLE is Python’s Integrated Development and Learning Environment.

可以通过终端,直接启动IDLE

这个必须加上的功能,才能正常使用。需要你增加一个模块才能搞定。进行这个目录

创建文件:CleanWindow.py 。注意大小写。或者你直接用curl下载,避免出错。

代码其实也是来自Python官方,

修改 config-extensions.def ,加入下面内容

如果不熟悉mac下的文件编辑。你可以直接复制下面内容,在终端执行就可以。确保idle是关闭的状态就可以。

查看

Clean Shell Window,就是我们添加,快捷键就是:Command+L

设置一下字体,就可以实现全屏,舒服很多。

第一个菜单

Farming simulator 19 xbox 360. 我用的是mac air,size改成 29,就全屏。

默认白色,我们可以增加自己定义的主题。

需要创建一个config-highlight.cfg 文件

大家可以看一下添加的3个主题

上面是默认自带的

添加的3个主题。

参考文章

Python Idle For Mac

相应的文件,都存放在github上

https://github.com/shake/config-file/tree/master/idle

Python idle download

最简单的清屏操作

Python Idle For Mac

上面3条命令,我是没严格测试。大家可以自己看看。运行3条命令搞定。

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.

Python Idle Mac Crash

  • 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.

Idle Ide Download

Python and a comprehensive set of third-party packages and libraries are alsoavailable from several open source package manager projects for OS X,including:

6817.info – 2018