User Name
Password
AppleNova Forums » Programmer's Nook »

Python in Xcode


Register Members List Calendar Search FAQ Posting Guidelines
Python in Xcode
Thread Tools
Oskar
Member
 
Join Date: Jan 2006
 
2006-02-03, 09:37

I understand that OSX comes with Python preinstalled. However, does Xcode play nice with it? When I start a blank file, can I just start typing python and it will recognize it and color the code accordingly? I figure it is more complicated than that, so chime in if you can.

PS. I'm aware of PyObjC. I don't know if I need that in order to use python - please let me know if I do.

Thanks!
  quote
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2006-02-03, 10:06

Is this any good..

http://ulaluma.com/pyx/archives/2004...ng_python.html

'Google is your friend' TM

EDIT : This is kind of interesting too..

http://www.codecomments.com/archive2...-3-153273.html

'Remember, measure life by the moments that take your breath away, not by how many breaths you take'
Extreme Sports Cafe | ESC's blog | scratt's blog | @thescratt
  quote
Barto
Student extraordinaire
 
Join Date: May 2004
Location: Canberra, Australia
 
2006-02-03, 10:20

If you're writing python applications, I'd recommend a text editor like SubEthaEdit, TextMate or BBEdit over the (pretty bloated) IDE that is Xcode.

That said, when you save a file as "blahblahblah.py" then Xcode should automatically recognise it as such and use python highlighting and indenting. A new, unsaved document won't have highlighting/indenting because Xcode won't know what the hell it is.

PyObjC isn't necessary to make console python applications but it is required to make Mac OS X happy-fun-GUI applications.

The sky was deep black; Jesus still loved me. I started down the alley, wailing in a ragged bass.
  quote
Oskar
Member
 
Join Date: Jan 2006
 
2006-02-03, 11:20

Quote:
Originally Posted by scratt
I did what they said and chose "Run executable" but it brings me to a command line. What's up with that?

Quote:
'Google is your friend' TM
In my defense, I already tried google but didn't find much

Quote:
EDIT : This is kind of interesting too..

http://www.codecomments.com/archive2...-3-153273.html
One guy says: I don't think you'll get debugging support no matter what you do.

Aww, I guess I'll try another editor like Barto suggests. It doesn't look like I can get the level of integration I want with Xcode

Edit: If anyone has a mac python editor to suggest, please tell me. I'll look at the ones Barto suggested too. I don't care if it is free or open source - in fact, I might prefer a pay-for editor as it probably is higher quality.
  quote
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2006-02-03, 11:25

SubEthEdit is great, as Barto says. Although I have to say that when you just load a source file into Xcode it seems to load a lot quicker than Xcode proper, so I don't have a problem using Xcode most of the time as a lot of my files default to that now..

I tend to use Xcode for all C++ source etc, and SubEthaEdit to work on data files, XML, HTML, CSS etc..

I used to use BBedit, but to be honest SubEthEdit is free and better, so I don't know how BBEdit gets away with it...

(P.S. Thanx to Brad originally for pointing me the way of SEE).

'Remember, measure life by the moments that take your breath away, not by how many breaths you take'
Extreme Sports Cafe | ESC's blog | scratt's blog | @thescratt
  quote
Barto
Student extraordinaire
 
Join Date: May 2004
Location: Canberra, Australia
 
2006-02-03, 11:29

SubEthaEdit and BBEdit are apples and oranges. It's like comparing iPhoto with Photoshop. Of course, most people only need iPhoto and likewise most people only need SubEthaEdit.

I've heard good things about TextMate but I haven't used it and it costs money.

The sky was deep black; Jesus still loved me. I started down the alley, wailing in a ragged bass.
  quote
autodata
hustlin
 
Join Date: May 2004
 
2006-02-03, 11:37

I'm not sure that there is a good cocoa IDE for python. Some time ago (early last year) when I was using python a bit I looked around for one and only found PyOXIDE, which was buggy and clumsy, but it was certainly on the right track. I certainly didn't find anything along the lines of PythonWin. There's also macpython, but last I checked it was carbon and kind of sucked (IMO, of course. YMMV). I just went back to using command line tools. Supposedly you should be able to use eclipse, but for some reason that I don't remember I didn't like it.

If anyone has any more info it would be much appreciated.

Anyway, pythonmac.org has some resources.
  quote
Oskar
Member
 
Join Date: Jan 2006
 
2006-02-04, 16:23

Thanks for the recommendations - I think I'll try SubEthaEdit first. The UI and collaborative coding both are looking great.

Anyone else interested in python IDEs for mac might consult the following...
http://ask.slashdot.org/article.pl?sid=05/12/29/0137252
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 06:36.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova