1

I would love to find out what the best way to go about writing Python scripts on a Mac would be. I've gone through two ways (mind you, I'm trying to avoid using vim because I want an IDE rather bland text editor). I went through using PyDev in Eclipse (the more I went through their recommendations and steps, the more of a hassle everything seemed to be.. although I do have everything set up and it can compile.. I want to know if there's a better way. I'm not too fond of Eclipse as is) and I tried to set up Xcode through the following steps: Xcode4 to run Python scripts. The problem with the Xcode version, is I would have to consistently setup the project like this every time. That, and every time I compiled something that needed to create a file it didn't (say using the command conn = sqlite3.connect('list.sqlite3'). Is there a simple way to do this? I've been trying to follow various iOS tutorials that want me to use python scripts (which I'm not familiar with at all) such as raywenderlich.com and Oreilly tutorials. Can anyone provide some guidelines on the best way to go about this?

Community
  • 1
  • 1
TheCodingArt
  • 3,281
  • 4
  • 25
  • 51
  • This might be helpful: http://stackoverflow.com/questions/81584/what-ide-to-use-for-python – shx2 Mar 23 '13 at 22:15

2 Answers2

1

Personally, I prefer the one that is found on the official Python website, IDLE, which can be downloaded here. It is very easy to deal with, and with the Shell it offers an area to test things out on, it has more than Eclipse can offer- in my opinion. I'm sure that people would feel the complete opposite that I do, but with my experience, IDLE is the way to go.

erdekhayser
  • 6,171
  • 2
  • 31
  • 65
  • I saw this before and see it's in the bin path. (a little annoying how you have to use ;\ for every new line). Can you create and save scripts using this? Or is it all real time? – TheCodingArt Mar 24 '13 at 00:52
  • I assume you are talking about the Shell; The Shell is where the program runs, like when you run your script, that is where `print()` functions and `input()` functions are presented. The Shell allows you to create functions, but is is much too hard to do it completely in the the shell. It allows you to test certain things out, and can manipulate external files within it. After the code is written, you are able to use the functions by manually typing what you want Python to do. For example, I made a function which found a number of Pythagorean triples. However, I did not put in the code – erdekhayser Mar 24 '13 at 02:51
  • anything which would return any values. In the shell, I typed the function's name, gave the parameters, and printed the result. This allows you to test certain variables or certain inputs to see if your code works and gives you more freedom than other IDEs. – erdekhayser Mar 24 '13 at 02:52
  • I'm not 100% sure how that provides more functionality in IDEs. I pretty much get the same functionality out of writing a Python Script within Easy Eclipse or Xcode (Xcode just doesn't create files... at least that I know of yet). – TheCodingArt Mar 24 '13 at 06:31
0

I think PyDev in Eclipse is pretty good. For scientific programming I wrote the following installation guide: http://hywelowen.org/installing-python-for-scientific-computing-on-osx/

Spyder appears to be a decent alternative, but I haven't used it myself.

Hywel
  • 1
  • Actually, turns out it may already have been set up properly in Eclipse for me which is lovely. I hate over complicated badly explained documentation. Seems this may be the way to go right now. I still am unsure if there's a way to set up the environment within Xcode (maybe someone has a template out there) to where it can create files as noted above. – TheCodingArt Mar 23 '13 at 22:44
  • I was wondering for the said script above, how would you go about making that a relative path in Python rather absolute? Seems this makes minor annoyances because of the director my Eclipse workspace is in – TheCodingArt Mar 23 '13 at 22:51