# Wannabe Python Programmer - Please Help !



## MetalheadGautham (May 30, 2008)

Hello Everybody.

After studying C when I was 12 in a crash course, learning Visual Basic 6.0 for a tiny period at school(and hating it), studying C++ at school (Turbo C++), experimenting a lot with Glade interface designer by making simple GUIs, and finally trying QT4 for a very short time, I decided that my next destination should be Python, and like C++, I must learn this one completely.
*
My Current Programming Tools:
*
1. Ubuntu Hardy Heron with default kernel and Gnome/KDE/Xfce/IceWM/FluxBox
2. Wikibooks edition of how to program with Python
3. PyPE - Python Program Editor
4. Gedit and Kate

*Questions:*

1. What else should I install to start writing and running programs in Python ?

2. Upto what scale is python's GUI programmable ?

3. How do I run python scripts in the terminal ?

4. How do I compile python scripts and make binaries, instead of letting them remain as .py files and running them ?

5. What is the difference between the architecture, speed of running and advantages of binary python programs and python scripts ?

6. What are the other resources(sites, programs, books, ebooks, etc) available to help me learn python programming ?

7. Whats the actual scope of learning python ? How can it be benifitial to me ?

8. Is it possible to compile python programs under windows environment for windows without using MinGW ? I need something like a drag and drop GUI prog that just accepts a python script and attempts to compile it. If successful, a binary is created. Else error message. Its really great if the program allows me to specify an icon for the executable.

9. Any GUI designer using (and only using) python for linux ? I want something that acts like a visual IDE, where I can drag and drop widgets in a window, create buttons, assign tasks for buttons, make text boxes, input areas, etc.


10. How long will it take me to learn python scripting/programming completely ? I heard some say that it can be learnt to a good level in 6 months ? Is it true ?


----------



## Pathik (May 30, 2008)

The first step : Goto IRC and ask Qwerty or Sykora.


----------



## MetalheadGautham (May 30, 2008)

Pathik said:


> The first step : Goto IRC and ask Qwerty or Sykora.


Sykora ? I thought Qwerty was the only Python geek around ?


----------



## Pathik (May 30, 2008)

1. Its installed already
3. $ python script.py
7. Use IDLE
6. A byte of python, Dive into python


----------



## mehulved (May 30, 2008)

MetalheadGautham said:


> 1. Ubuntu Hardy Heron with default kernel and Gnome/KDE/Xfce/IceWM/FluxBox
> 2. Wikibooks edition of how to program with Python
> 3. PyPE - Python Program Editor
> 4. Gedit and Kate


Python Interpreter and a text editor are good to begin with, you don't need IDE's now.
For books, there's also Core Python Programming.


MetalheadGautham said:


> *Questions:*
> 
> 1. What else should I install to start writing and running programs in Python ?


Start with the interpreter



MetalheadGautham said:


> 2. Upto what scale is python's GUI programmable ?


Python has no GUI capabilities on it's own, it can use various GUI toolkits like GTK, Qt, tk, etc. You can also use Java's UI by using jython


MetalheadGautham said:


> 3. How do I run python scripts in the terminal ?


Just create a python script beginning with a she-bang and execute it.



MetalheadGautham said:


> 4. How do I compile python scripts and make binaries, instead of letting them remain as .py files and running them ?


Python can only be byte-compiled. Look for compilers like psyco



MetalheadGautham said:


> 5. What is the difference between the architecture, speed of running and advantages of binary python programs and python scripts ?


Depends on various factors.



MetalheadGautham said:


> 6. What are the other resources(sites, programs, books, ebooks, etc) available to help me learn python programming ?


wikipedia, byte of python, CPP, dive into python, docs.python.org are some to start with.



MetalheadGautham said:


> 7. Whats the actual scope of learning python ? How can it be benifitial to me ?


You should know, you decided to select python.



MetalheadGautham said:


> 8. Is it possible to compile python programs under windows environment for windows without using MinGW ? I need something like a drag and drop GUI prog that just accepts a python script and attempts to compile it. If successful, a binary is created. Else error message. Its really great if the program allows me to specify an icon for the executable.


Well python runs on windows too, it has native windows executable too.



Pathik said:


> The first step : Goto IRC and ask Qwerty or Sykora.



There's also #python and a lot of python users on linux channels. And devmodem doesn't visit #think-digit, else he's another python geek.


----------



## victor_rambo (May 30, 2008)

Guyz, I am completely alien to python. Can you give some preliminary info about it.

1. Is Python a client-side(like javascript), server side(like PHP/PERL) or is it desktop(like C/C++)

2. If I make a python program and give it away to someone, do I need its interpreter to be installed on that other person's computer?

Thank you!


----------



## FilledVoid (May 30, 2008)

> For books, there's also Core Python Programming.


On IRC I think Mehulved and me are at the same pace although hes starting to overtake me now . I'm kind of stuck with some assignments now but other than that we both are learning Python when we get free time and we both use Core Python programming as well.



> 1. Is Python a client-side(like javascript), server side(like PHP/PERL) or is it desktop(like C/C++)


if I understand correctly all of them together. 


> 2. If I make a python program and give it away to someone, do I need its interpreter to be installed on that other person's computer?


Yes.


----------



## praka123 (May 30, 2008)

MetalheadGautham said:
			
		

> 9. Any GUI designer using (and only using) python for linux ? I want something that acts like a visual IDE, where I can drag and drop widgets in a window, create buttons, assign tasks for buttons, make text boxes, input areas, etc.


@gowtham:you may be interested in gambas although it isnt related 
*gambas.sourceforge.net/


----------



## MetalheadGautham (May 30, 2008)

@mehulved:

1. Whats she-bang ?

2. I only know that python is usable for websites, linux programming, scripting and making simple GUIs. I wanted to know if I missed something,

3. If I remember the wikibooks page right, python does have simple GUI capabilities. You can create buttons, windows, etc.


----------



## victor_rambo (May 30, 2008)

Thanks FilledVoid


----------



## mehulved (May 30, 2008)

rohan_shenoy said:


> Guyz, I am completely alien to python. Can you give some preliminary info about it.
> 
> 1. Is Python a client-side(like javascript), server side(like PHP/PERL) or is it desktop(like C/C++)


For desktop scripting, you have python interpreter and for apache there's mod_python, mod_cgi, etc. Not sure of other web servers. Then I believe frameworks like Django, Turbogears, etc have their inbuilt web servers.


rohan_shenoy said:


> 2. If I make a python program and give it away to someone, do I need its interpreter to be installed on that other person's computer?


I believe, yes.


----------



## FilledVoid (May 30, 2008)

> 1. Whats she-bang ?



#!/usr/bin/env python



> 2. I only know that python is usable for websites, linux programming, scripting and making simple GUIs. I wanted to know if I mixed something,
> 
> 3. If I remember the wikibooks page right, python does have simple GUI capabilities. You can create buttons, windows, etc.


*wiki.python.org/moin/GuiProgramming . Further you might want to clarify what you meant by " I wanted to know if I mixed something,"



> Thanks FilledVoid


No problem.


----------



## MetalheadGautham (May 30, 2008)

FilledVoid said:


> #!/usr/bin/env python


I use that on all python programs I wrote. Miracle I don't know what its for. 


FilledVoid said:


> *wiki.python.org/moin/GuiProgramming . Further you might want to clarify what you meant by " I wanted to know if I mixed something,"


typo. Its *missed* something. double oops


----------



## mehulved (May 30, 2008)

MetalheadGautham said:


> @mehulved:
> 
> 1. Whats she-bang ?


Here's what it actually is *en.wikipedia.org/wiki/Shebang_(Unix)


----------



## MetalheadGautham (May 30, 2008)

praka123 said:


> @gowtham:you may be interested in gambas although it isnt related
> *gambas.sourceforge.net/


thanks, will try.
(sry 4 late reply, me not a link checker)


----------



## Sykora (May 30, 2008)

@Metalhead :



> 4. How do I compile python scripts and make binaries, instead of letting them remain as .py files and running them ?



You can't. There is no such thing as a "python binary". There are some ways a making a pseudo-binary, but what that amounts to is bundling the interpreter along with the script.

As far as GUI is concerned, python is shipped with TK, which can do most of the basic GUI stuff. If you want anything which is more production-grade, You can try the other toolkits. As you said that you've done QT before, you should go for pyqt first.

@mehulved : psyco is a jit compiler, not a general-purpose one.


----------



## karmanya (May 30, 2008)

^true, as far as i know, python is self executing, the .py files execute.
I have an ebook that answered all my python questions. *www.ibiblio.org/swaroopch/byteofpython/read/


----------



## QwertyManiac (Jun 6, 2008)

rohan_shenoy said:


> 1. Is Python a client-side(like javascript), server side(like PHP/PERL) or is it desktop(like C/C++)


 Its server side and you can use it for web-dev just like you use PHP. Except that you might need a framework or build your own ways.



rohan_shenoy said:


> 2. If I make a python program and give it away to someone, do I need its interpreter to be installed on that other person's computer?



Not quite the "yes". Programs like py2exe for Windows package the required DLLs and files all together so that the computer its distributed to doesn't even need Python or the imported modules installed locally. Its all bundled. Not sure if this is also the case with other platforms.



			
				karmanya said:
			
		

> ^true, as far as i know, python is self executing, the .py files execute.


Nope they are not executed and are interpreted instead. Setting them to executable does not help unless there are environment variables or hash-bangs and such set to direct the file to the python interpreter for being interpreted.

Python is PERL with readability and is Java without the syntax nightmare. In a way of course. Just stop eval()ing and get exec()ing already.


----------



## sourav123 (Jun 7, 2008)

QwertyManiac said:


> Python is PERL with readability and is Java without the syntax nightmare. In a way of course. Just stop eval()ing and get exec()ing already.



That's not fair. Perl is highly readable if coded properly. But Perl programmers are lazy like me.


----------



## QwertyManiac (Jun 7, 2008)

Even if you are lazy you write readable code in Python. The language itself is built on readable grounds, I know its not fair to say it, but many do when asked for a comparision, I did say "in a way".

Also what it implied was PERL could do the same what Python can and perhaps even more but the readability factor makes it better in areas where you need to maintain it over long time. Its not only from me, but also from various books and online exchanges.

Do read the Zen of Python for more information. ("import this") in Python.


----------



## MetalheadGautham (Aug 13, 2008)

Hey I need hard copy of Core Python Programming. Is it available ? Where in bangalore ?
And I need dennis ritchie's C programming book too.


----------



## Faun (Aug 13, 2008)

MetalheadGautham said:


> 4. Gedit and Kate


me so loves kate but damn gnome !


----------



## mehulved (Aug 13, 2008)

MetalheadGautham said:


> Hey I need hard copy of Core Python Programming. Is it available ? Where in bangalore ?
> And I need dennis ritchie's C programming book too.


Both should be available at the book stores. KnR is available quite easily at any decent book store in Mumbai, atleast.

The C Programming Language - *www.sapnaonline.com/MoreInfoBK.aspx?lcID=EBK0011990
Core Python Programming - *www.sapnaonline.com/MoreInfoBK.aspx?lcID=EBK0067672


----------

