You are not logged in.
Hi, i want to learn programming in python, i think its an interesting programming language.
I have a little knowlage from youngerdays with basic, i find python a bit simular as basic.
Iam writing test codes in geany but i dont know what more i need to run things.
i made a number guess game and named it game.py .
But what do i need to download to try the "game".
What are you recommending to download to start programming in python on #!?
Last edited by Tim (2012-07-18 22:52:11)
Crunchy feeling #!
Offline
Hi, Tim 
Type this in a terminal:
pythonIf that takes you to an interactive python console, you're good to go. Run the program like so:
python yourscript.pyi wonder if i missed the warning
Skinny Puppy, Love in Vein
Offline
I didn't understand what you're going to download and why you need to download anything, just chmod +x game.py and python game.py to try it from your terminal. Nothing more you need. If you need deeply libraries on python gaming just apt-get install python-pygame.
I hope this helps.
Offline
thanks for the feedback, i will try both tips, just to see whats fits me the best 
if i go to the python console, and trying to run a .py file, doesent i need to locate it somehow first?
Sorry if i ask dumb questions, but i have to start sometime from the begining!
Crunchy feeling #!
Offline
when i try to cd somewhere ive got some troble sometime.
if i write in terminal
cd /home/tim/there is no problem, but if i want to cd to a folder in /home/tim/python (python is the folder in /tim)
it just tells me it does not exist, dont know english terms from terminal caus its in swedish for me.
Think iam going to change that, caus iam trying to use only english on this notebook.
Crunchy feeling #!
Offline
I think you can't run a .py file from python console. Just python ....py to run it.
Thanks, thats what i thought too, i think i just missunderstod it a bit.
Crunchy feeling #!
Offline
Are you really sure that it's a folder? Because it has to enter if it's a folder. Have you got any screenshot to show us, with your terminal of course.
And a tip for you, if you write cd /home/tim and double tap tab button, it'll show a list of folders you got to enter.
Last edited by Eren (2012-07-18 22:39:05)
Offline
Are you really sure that it's a folder? Because it has to enter if it's a folder. Have you got any screenshot to show us, with your terminal of course.
And a tip for you, if you write cd /home/tim and double tap tab button, it'll show a list of folders you got to enter.
The tab-button is just wonderful, use it all the time. Thanks anyway for a really good tips.
here you go with my screenshots;
terminal:
Crunchy feeling #!
Offline
The folder is called "Python" and you're trying to cd into "python" -- linux is case sensitive. Try to cd into "Python"
(edit) eren types faster
Last edited by pidsley (2012-07-18 22:48:46)
Offline
Try to "cd Python". And you don't need your user folder to write again.
It's p and P problem.
Hey, the double tap on the tab-button was new, i just know single tap before. Awesome, just love the terminal more and more. And for the python game, it has some problem with the code 
think iam going to try to solve it tomorrow.
anyway, i made it to get in to the folder!
Thanks for the help 
and how to start python stuff from terminal is now solved to! THanks again #!-buddies
Crunchy feeling #!
Offline
The folder is called "Python" and you're trying to cd into "python" -- linux is case sensitive. Try to cd into "Python"
(edit) eren types faster
The strange thing is that i tested with a big P also, with same results.
But i think i got it sorted out now 
Thanks for the help!
Crunchy feeling #!
Offline
Eren wrote:I think you can't run a .py file from python console. Just python ....py to run it.
Thanks, thats what i thought too, i think i just missunderstod it a bit.
My bad, I wasn't clear there. I meant for you to exit the python console (with quit() or CTRL+D) first, then try the python yourscript.py command.
i wonder if i missed the warning
Skinny Puppy, Love in Vein
Offline
Thanks for the help
and how to start python stuff from terminal is now solved to! THanks again #!-buddies
Tim, if you haven't seen Learn Python the Hard Way you might want to check it out (you can read it online for free), or just search this forum for "python" and you'll get some other good tips for books and other resources.
Last edited by pidsley (2012-07-18 22:59:24)
Offline
^ Yep, great source. Another one is http://inventwithpython.com
Offline
Thanks for the tips, iam reading a book called "Oreilly - Head First Programming (12-2009)"
He writes in quite a fun way, i really like that book soo far. He explains in a easy way, pretty good.
ive got it in a pdf 
I will check out your links tomorrow.
Crunchy feeling #!
Offline
The Head First books are great 
i wonder if i missed the warning
Skinny Puppy, Love in Vein
Offline
"Learn Python the Hard Way" is a good book. I taught Python to kids using a book called "Snake Wrangling for Kids" -- I don't have a link for it, but if you search for it you can find a link for the PDF file. It's good -- you don't have to be a kid to get something from it, and I used it when I first learned Python a few of years ago, around the time I turned 50 (Old Kid -- "How's it goin'?").
Res publica non dominetur | Larry the CrunchBang Guy speaks of the pompetous of CrunchBang
Online
Also you can use the OCW of the MIT. There is a brilliant course "Introduction to Computer Sciences". You have 24 video courseparts and all the course stuff online, including the books - and learn Python while following the course.
http://ocw.mit.edu/courses/audio-video- … er-science shows all the computer courses, you can take either 6.00SC, from Professor Guttag only, or the older course 6.00 from Professor Grimson and Professor Guttag.
After you took one of those courses, 6.01SC would be a follow up course
Last edited by skbierm (2012-07-19 08:05:45)
Offline
Ah, thanks again, now i have some more good pdf:s, the kid pyhonbook looks fun too 
Video tutorial , i will check that up!! Paper and pen is very very handy!
Is idle3 (python shell) any good, and what is it exactly?
Crunchy feeling #!
Offline
^ Idle is an IDE bundled with Python. More info here.
I would stick to a regular text editor (with syntax highlighting) to keep things simple at the start - you can move to an IDE or something else as you discover more features you need.
Last edited by safetycopy (2012-07-19 19:16:39)
i wonder if i missed the warning
Skinny Puppy, Love in Vein
Offline
^ Idle is an IDE bundled with Python. More info here.
I would stick to a regular text editor (with syntax highlighting) to keep things simple at the start - you can move to an IDE or something else as you discover more features you need.
I found idle to be much easier to use than a simple text editor, because of the syntax highlighting and code testing. It's certainly simpler than full-blown IDEs I agree, but wasn't a problem for a python noob like me 
A more important concern may be whether to learn python3 or not, since a lot of python2x code is now deprecated. (There is idle3 as well)
Artwork at deviantArt; Iceweasel Personas; GDM #! Themes;
SLiM #! Themes
Online
^ That's largely a matter of circumstance: http://wiki.python.org/moin/Python2orPython3
i wonder if i missed the warning
Skinny Puppy, Love in Vein
Offline
I can recommend three things:
1. this book.
2. Do not use an IDE unless you are a capable programmer. Instead of helping you aquire a good style, complex IDEs teach you more about laziness and hide essential parts of the learning curve from your novice eyes. Stick with a good text editor like gedit, geany, vim or emacs and use the minimal IDE capabilities embedded in those editors for your convenience.
3. Turn off the auto intendation of your text editor. Python is intendation sensitive, the more you are aware of that from the beginning, the better you will be able to write and read code in the future.
EDIT:
With no "IDE", I meant complex environments with hand holding and automated everything. Geany is an IDE as well, but it doesn't attempt to cook you dinner in the middle of the night.
Last edited by Awebb (2012-07-20 06:12:33)
I'm so meta, even this acronym
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.