1

I am currently working on some Python exercises and I downloaded two text editors: Brackets and Atom. I use them because I like to be able to run the program I'm writing with a simple shortcut instead of saving it and then opening it on terminal (I'm on OS X Yosemite):

python ex3.py

Most programs run just fine, but whenever I include a raw_input() function inside my program and I try to run it with a shortcut from Atom or Brackets, the console output just freezes. It doesn't show any error, and I actually can run the program on Terminal just fine.

I would like to enable this feature as it is much more convenient to run my code with a shortcut without having to save and switch programs everytime.

Thanks for your help!

9
  • 3
    Maybe it freezes because it's waiting for your input? Commented Jun 17, 2015 at 1:02
  • It does not print the message asking for the input. And I can't type anything. Commented Jun 17, 2015 at 1:08
  • Looks like it doesn't accept anything or doesn't have any stdin. Commented Jun 17, 2015 at 1:08
  • 1
    Could you please show your code? And besides, is the Python interpreter used by Atom or Brackets the same as the one you use in the terminal? You can check the one from terminal with which python., but I don't really know the way for those ide's. Commented Jun 17, 2015 at 1:30
  • 1
    @MaximilianoSantiago See the answers, but btw, I would advice to use the terminal for running your scripts, rather than the ide's interpreter. That way you have much more control on what you are using, and won't have problems like stdin not being recognized. Commented Jun 17, 2015 at 1:38

2 Answers 2

2

With Atom, I know this is not just a python problem, I first encountered it with Ruby, it is due to the fact that Atom does not currently support STDIN.
The only current workaround (will only work for not very interactive scripts) is data file containing intended stdin input and a testing shell script eg:

#!/bin/bash
python3 test_script.py < data_file_with_input

With Brackets, its issue page shows a number of freezing issues both closed issues and open ones. So I'd start there and see if you can find a solution or open an issue yourself if you fail to.

Sign up to request clarification or add additional context in comments.

Comments

0

From what I can gather, Atom Script doesn't support raw_input. I can't find anything regarding Adobe Brackets, but I haven't had much success with third-party programs, so I would guess that there is a similar problem there. Is there any reason you're not using IDLE? If you're looking for a more IDE environment, I can also suggest using PyDev package in Eclipse.

2 Comments

I think I will do that. I just realized it is explicitly not supported as of now. (At least for Atom)
If atom script doesn't support raw_input, it likely doesn't support any input. Looks like there is no sys.stdin...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.