Pythonmac-sig Newbie Question: Building Gui For Mac
Just wanted to share a few questions. I'm coming across an abundance of free time right now and figured i'd try to pick up programming as a hobby, or at least something to fill the void and keep my mind going a little. At any rate I fired up Xcode 2.1 and started looking around at it. I also dug out a c book a friend of mine gave me about three years ago.
Not seeing anything on Mac OS? Try issuing a command like turtle.forward(0) and looking if a new window opened behind your command line.
Not sure if this may be the right forum for half of these questions, but I'll give them a shot. 1) I don't want to open a can of chuck norris, but what would you suggest as a language to start on? Would cocoa be a valid learning tool to start with, or should I stick with C or C? (Since my recent love affair with macs since entering the apple world, I'd be more inclined to learn something 'apple oriented' so to speak.) 2) I started working through the 1st chapter of this text book (dated 2001) and it was geared initally for PC (Borland C I believe) and already some things aren't working. I'l copy programs exactly, yet I'll recieve odd little errors.
(I'm only writing basic hello world or 'what is your rate of pay' programs right now:p) Things like void main(void) are causing errors. I'm starting new projects in the command line utility - c. What's happening? 3) I am to understand Xcode has all the compilers for most major programming languages (at least java, cocoa, c etc) at any point in my learning experience, would it be advised that I get anything else or will Xcode serve me well for it all?
Thanks alot for your time. If anyone has any good newbie friendly books to recommend or sites as well, feel free to point'em my way. You can work on simple C projects in Xcode with a template project that it provides; choose Project-New project from the menu and select 'C Tool' in the new project assistant. It will create a main.cpp file that you can use to test your code examples, and include all the necessary libraries that your code needs to link to.
If you do this, you will notice that the main( ) function within that file has a signature that returns an int value. It is standard behavior for C or C code to return int from main( ), and has been for many years. (void) main ( ) is not permitted by your compiler. The error message that you should have gotten on the command line main.cpp:3: error: `main' must return `int' baldly states this. By default, the executable will be in a build products folder (labeled 'build', strangely enough) at the top level of your project file tree. Look at the minimal code provided by the template to see what you absolutely must have inside main to get the code to work. Then, if you want to go back to the command line, invoke the compiler with something like g hello.cpp but I guess invoking the compiler as c will work too.
This will create an executable (assuming it compiles without syntax errors) named a.out in the same directory, and you can invoke that executable with./a.out That should get you started, at least enough to lead you to your next questions, which is as it should be. I don't know that I'd recommend C as a starting point for someone learning to program. I learned C, Java, then looked at C and then quickly looked away.
Cocoa is not a language. It's an application framework. That probably doesn't mean a whole lot to you at the moment.
What it means, essentially, is that Cocoa is a collection of things that you can use to build an application. For example, using the Cocoa, framework, it's possible to build a simple text editor with only a few lines of code. You provide a few instructions, and really great things come out. I'd recommend you start by learning C.
Objective-C, the 'native language' of the Cocoa frameworks, is only a small step from C. C is also the basis for C, if you really want to go that direction. The first book that really got me making progress with Objective-C and Apple's developer tools is 'Learning Cocoa With Objective-C' by John Duncan Davidson.
It's a couple years old, though, so not everything about the developer tools looks or works exactly the way it did when the book was written. Once you've got a basic grasp of working with Objective-C and XCode, 'Cocoa Programming for Mac OS X' by Aaron Hillegass is often recommended. I have that one on my shelf as well. 1) I don't want to open a can of chuck norris, but what would you suggest as a language to start on?
Would cocoa be a valid learning tool to start with, or should I stick with C or C? Personally I would suggest learning Python as a first programming language (plus it should already be installed on your Mac). For more info or for a quick tutorial Things like void main(void) are causing errors. Bad Programming Book.
Try 'int main' or 'int main(int argc, char.argv)' to be more accurate. I am under 15 years old, and I learned Python in about 6 months. I just made a program to convert all my MSWord documents to text and place them in my iPod's notes folder. Very easy to understand and debug, yet soooooooo powerful. There are so many extension modules you can find for whatever your specific program requires. I am a current Windows user but am looking to purchase a Mac mini. How integrated in Xcode is python?
Can you just install Xcode and start programming, or is there anything else I should be aware of? In normal language please, i am young but i am a power user. Unfortunately, OSX's Automator will probably replace my Python programs. Python is really handy for doing stuff that Automator can do for macs.
You don't have to install anything extra to use Python in Xcode, but you have to do two things to write Python programs in Xcode. Create an external build system project.


It's one of the available choices when you create a new Xcode project. Xcode has built-in support for AppleScript, C, C, Java, Objective C, and Objective C. External build system projects let you use other languages, such as Python. Tell Xcode to use the Python interpreter to build the project. If you do those two things, you can write and build Python programs with Xcode. Mark Szymczyk Author, Xcode Tools Sensei.
To answer your Python questions: 1. The Python interpreter is installed when you install Xcode. You don't have to do anything else.
Creating an external build system project is easy. Telling Xcode to use the Python interpreter involves changing a setting. With Xcode the hard part is finding the setting. Interface Builder doesn't work with Python out of the box.
There is something called pyObjC, which lets you write Cocoa programs in Python. I haven't used it, but it would be something for you to look into if you wanted to write GUI apps in Python. Mark Szymczyk Author, Xcode Tools Sensei.
I have heard of PyObjC, and I happen to have the Python Cookbook from O'Reilly. I seem to recall it having a recipe for using PyObjC to make Python GUIs. If I implement PyObjC, will I be able to use Interface Builder as if I have written a program in Objective C? I know I have alot of questions, but this post is titled 'A Variety of Random Newbie Questions' and there seemed to be an interest in Python. This might influence my decision to purchase a Mac mini.
It seems easy enough to integrate Python, so the Mac mini is looking really attractive to me- the computer I currently do homework on is a 6-year-old HP with 128MB RAM and a 233 (that's right, 233) megahertz Pentium I. I know that the Mac mini is bottom-of-the-line, but I'm absolutely in love with Mac OSX. If that's the case then you'd abolutely love a mini.
Your current system sounds fairly old. I recall older mice and keyboards having the other kind of plugin, so you may need to grab a keyboard and a cheap mouse somewhere. However, even as 'bottom line', the mini is still a quick little bugger.
Also, apple computers seem to have more longevity to them. There's alot of posters with 5,6,700mhz computers that are doing alot with them. You don't have to have a four thousand dollar powermac to program. Hey there, I noticed no one said this out of all the suggestions on where to start; so I will quickly just offer my humble little opinionas I just started learning to program not to long ago; and am very grateful to have taken the route I have. A bunch of my friends work for Yahoo. And they all know C in and out; but I started with c, and whenever I had a question about something, It was way too foreign for them to understand. They knew everything about C, nothing about C.
Pythonmac-sig Newbie Question: Building Gui For Mac Download
However, because it is very hard to learn c and not learn c as well, I understand both well enough to understand the basics, and don't have the problems some people have warned me about who started w/ interpreted languages like Python; but- since whitespace is important in Python, someone once said it might be a good place to start off (I guess assuming that the whitespace rules in C might contribute to laziness, or something)- however that same person and everyone else I've asked about Python have always said the same thing- 'I don't know of anyone who uses Python.' So you might ask yourself, am I doing this for fun, or to get paid for it.
If you decide the on the later- you will find very few good-paying jobs requiring you to program in anything other than c or c.not that they aren't out there, but they are less available. Apple Footer.
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple may provide or recommend responses as a possible solution based on the information provided; every potential issue may involve several factors not detailed in the conversations captured in an electronic forum and Apple can therefore provide no guarantee as to the efficacy of any proposed solutions on the community forums.
Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the.