Noob question: Python dev on Mac


#1

I installed Atom for simple development of Python on the Mac. I am unable to figure out how to even run a Python script that asks for terminal input while inside Atom. I have installed the “script” package which lets me run “hello world” but can’t accept input. I tried some ways to accept command line type input but without success. If someone could share a recipe of packages and their basic settings to accomplish this it would be great.


#2

I am not aware that any of the script-running packages have incorporated the ability to accept input. The place to investigate would be in the repos of individual packages, which may have open issues (or may need someone to open an issue and get the ball rolling). As most of its functionality is contained in the decentralized, open-source package ecosystem, the things that get done are the the things that people find valuable enough to write code for. In the mean time, I suggest using an embedded terminal package like termination.


#3

Thanks for the suggestion to use “termination” package. I had already installed the “script” package to run my code in Atom. Do you know if “terminal” can be setup to work with “script”? It is totally not obvious to me how to do this from looking at their documentation.


#4

Those packages operate along completely different paths. termination embeds a terminal in Atom that you can use in the same way you’d use a free-standing Terminal window, but you don’t have to switch windows. script sends a command-line instruction in the background to the compiler, then it receives the output and generates a display for it. Packages that operate like script have to incorporate a separate function to generate HTML to receive user input and send it back, whereas an embedded terminal will just work like your system terminal.


#5

Well that explains why I can’t find a way to link the two.


#6

As a rule, most packages don’t assume the presence of other packages. Many of them have config variables or commands that can be accessed from outside, but other packages aren’t going to be written to manipulate them except in specific cases where you have a suite of packages that are meant to work together. In the case that you want to make packages interact (this isn’t one of those cases, since it would be unnecessary), an init.coffee script can achieve some measure of that.


#7

Here is a clear instruction how to run python in atom https://maketips.net/tip/144/run-python3-in-atom , this wil work on mac because it explains how to setup python path. Hope it helps