ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have learned the basics of C++, but that language is taking up too much time that I do not have to put into learning all of it yet. So, I figured I will just learn python and pygame to make games.
I have no expierence with python and very very little with C++ (only learned basics like variables, if statements, operators, cout, for, etc...just the small stuff)
I looked for tutorials on python, but I have not found too many good ones yet. Anyone have a recommended tutorial for python and pygame for programming games? Preferably printable.
I really want to start making simple games soon, so the plan is to learn python, then pygame, and start making games.
I'm learning Python too...start with this if you aren't familiar with the language at all it will get you ready to understand the tutorials on python's homepage, or any gaming tutorials.
Thanks, now as far as environment for developing games with python. Could I just use anjuta or a simple text editor and python shell? Or is there better stuff out there.
"Python Programming for the Absolute Beginner" by Michael Dawson
Michael Dawson is a games programmer. Each chapter is a project of writing a game in order to learn Python. Loopy strings, lists, functions... he has a new game to write in each chapter in order to learn these things. It a fun book!
I this respect, python is like perl: It's basically a scripting language, so you just run your program with "python your_prog.py" and it will be compiled (as far as compiling is actually involved) and the resulting byte-code is cached for the next run. All automatically.
Or put this as the first line of your python script:
#!/usr/bin/env python
..and make it executable with: "chmod +x your_prog.py"
num = input("enter first number :")
num2 = input("enter second number :")
#is this supposed to be str or just function?
str funtion = raw_input("enter the function you want: *, /, -, +: ")
if str function = *:
print num "*" num2 "=",num*num2
And why won't it say:
enter first number : user inputs num
enter second number: user inputs num2
enter function you want: user inputs function
Then it gives me a syntax error on my if statement...I know this is simple, but I am not sure why I can't do this.
Then for a second question:
There is a program for the palm called pippy 0.7 which has python 1.5.2, my home computer has 2.3. Will I be able to use them and they will still be compatible? (ie: type code on home, port to palm and still work?)
Originally posted by tigerflag "Python Programming for the Absolute Beginner" by Michael Dawson
Michael Dawson is a games programmer. Each chapter is a project of writing a game in order to learn Python. Loopy strings, lists, functions... he has a new game to write in each chapter in order to learn these things. It a fun book!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.