Well, first of all I will speak much so that you
guys can target my problem better.
Hello, I am a poster from the C++ forum. Hence, I am a well established
C++ programmer.
Now I want to learn Python.
First of all, should I? I mean, keeping in mind my skills in C++, should
I devote my time learning Python. I am in a believe that Python will
increase my productivity regarding writing software as my
development/maintainability will increase with Python as
compared to C++. I presume that learning Python will not
shatter my C++ knowledge. I am also in an impression that
after learning a good amount of Python, I would be able to
use C++ Python Combo to write ' the finest' applications.

So, I, as am running GNU/Linux, already have Python installed, went to Python
website and had a look at the Tut. So well so, I started liking Python.

My first major question is - what would be the best books for me. Considering
that:
1. I am a C++ Programmer
2. Want to master Python as well.
3. Am not afraid of reading.
4. But the books should be standard and well-written
5. Should provide me with deep knowledge of python.

Another Point that was snagging in my mind was:
C++ apps readily compile and I can distribute my softwares to Public
either paid or free. I have guaranteed that my software cannot be
(or is VERY HARD) to reverse engineer as all of code is machine code.
My client gets a executable and they just double click it and wooh!!
my application starts.

But Python is interpreted Language. I, no doubt, will have my client to
install a python runtime(thats fine with me) but my question is if I would be
able to give them non-reversible executable, so that they just execute it
by double clicking on desktop and ..... start working?

My last question is for those C++ Developers who migrated to Python or
are using python as second language to give me comments about how
successful are you switching to python. Do you prefer the control that
C++ provides? Or are you comfortable by the Luxuries that python
provides.( I know its a boring question but still ). How do you guys manage
to get both language to work together.

I know thats perhaps a BIG thread. But well, what more can I say?
Thank You

I don't believe that there is a way to ensure Python is un-reverse engineer-able... Meaning that even Python byte code programs can be translated back to source code if someone were dedicated enough to do it.

That being said, I used to be a C++ programmer until I discovered Python. I have not touched C++ since I learned Python and have never looked back. I hope that I can continue to use Python for the rest of my professional career as it is by far the best language that I've ever used. It makes programming actually enjoyable and stress free.

The resource I used to learn Python was Dive Into Python, which is a book that is geared towards programmers and not beginners, as it assumes you already know much about control structure, data types, etc.

I hope that you enjoy learning Python and I think that you'll find that it is nothing short of a pleasure to use.

If you want to make python into an executable file, thats easy with py2exe!
http://www.py2exe.org/

I started learning C++ as my first language a couple of years ago but was almost killed by the amount of syntax i didnt understand, so i started python instead. Its easy, simple and great fun. I still use C++ today (as you would know, been posting on C++ forum) but not as much as python. I really only use C++ for things i cant do in python, because at the end of the day, python is easier and great fun!

Py2exe still stores your scripts (in pyc form I think).

That said, byte compiled code can be difficult to reverse engineer (but still possible). You *can* .pyd modules in C\C++ (these are actually renamed .dll files with some extra definitions for python interop) if you'd like, but then that sort of defeats the purpose of using Python, doesn't it?

Well, Then how do you guys write proprietor(non-free) software with python?

Please tell something about books too( like jlm699 did, thanks).
I am trying on
Core Python Programming by Wesley Chun
Learning Python by Mark Lutz&David Asche
and Dive Into Python
Which ones for me? like I specified.

Well, Then how do you guys write proprietor(non-free) software with python?

Open-Source software is the way to go.

>>Open-Source software is the way to go.
it is likely that I would be writing Open Source.
But Does that means that I shall loose my ability to write closed-source.
Don't you think its a heavy price to migrate to python?
I am sorry but I didn't like your answer. Actually this is no answer! :(

If I wanted to write proprietary software in Python, I would byte compile my python scripts to .pyc, and I would implement the "critical" modules in C\C++.

In the end though, there is no real foolproof way to prevent reverse engineering (even C++ code can be reverse engineered), and I'm not a big fan of protection schemes so I tend to just open source my stuff (after all, I've gained quite a bit from open source myself).

If you want to write non reversible python code, you could encrypt the python code and decrypt it at run time with a non reversible C++ encryption routine.

>>In the end though, there is no real foolproof way to prevent reverse engineering (even C++ code can be reverse engineered).

Do you know, how hard it is to reverse engineer it? I never found a decompiling tool that guarantees me to decompile the executable in th original source as this tool for python does http://www.depython.net/
(I have not tried this tool though)

I anyhow agree to your open source point. I am too a big OS/FSF fan.
Free softwares(free as in freedom of speech not as in free beer) have always fantasized me.
But, I am very keen about python. I am not just gonna learn it for fun. Or just to add one more name to the language-I-know list.
Thus, before submitting myself to the python world, I need to make sure I am not loosing anything out of it.

>>A list of python books online
I have a bigger list with me. What I need your help was to help me decide, which book will be right for me. I am trying for I am trying on
Core Python Programming, Learning Python, and Dive Into Python.
Which one of these do you guys recommend? another? why?
Thank You

Personally i would definitely go for Dive Into Python, it is a long and very comprehensive book. I went back to one of its chapters just the other day to read up on unit testing and found it to be a great help.

Seeing you already know C++ the migration to python will be most likely quick and easy.

>>Personally i would definitely go for Dive Into Python, it is a long and very comprehensive book. I went back to one of its chapters just the other day to read up on unit testing and found it to be a great help.

Thats the type of answers I wanted: Thanks!

Finally, I found pyobfuscate http://www.lysator.liu.se/~astrand/projects/pyobfuscate/ that can give me a level of obfuscation. I would also be using something like bbfreeze if I ever write a closed-source software.
So, I am learning Python from Learning Python(starting chapters only) then will switch to Dive Into Python. And then perhaps Core Python Programming.

After reading these, I would switch to some advance books.
Is this right?

I would say after reading Dive into Python is probably all you need in the way of a book, because in the end after you know all that book has to offer you will know practically all that you need to just muck around with python.

If you are looking for GUI's and books/tutorials for that then i would reccomend zetcode.com, it has a great wxPython tutorial.
Personally wxPython is my favourite GUI in python, if you have used Qt then there is pyQt if you are familliar with that.

There is a thread on this forum about learning wxPython as well if you need some extra tips. I would reccomend getting a full understanding of python before starting GUI's but it is a lot lot lot lot simpler then C++ guis! :)

Great
Python.org says that there is something like Tk which is native GUI toolkit for python. I use GTK+ on C/C++. So tell me which one should I use:
wxPython
pyGTK
TK
would I have any advantage using pyGTK (since I already know GTK+)?
Or should I use wxPython or TK. My prime objective is PORTABILITY and complete GUI

Well i could be a bit biased, i am very much a wxPython guy, i love it, its a smart, easy to use GUI. Oh and also, wxPython is cross platform

People tend to not use Tkinter, as it is not that powerful and does not have that many things going for it.

If you know GTK then there really would be no hard in using pyGTK, but i have found with switching between wxWidgets and wxPython that there isnt that much that is actually the same apart from what is looks like. The general things will stay the same, such as widgets and such, but the code style will be different.

commented: Thank You +3

I agree with paulthom, I started out using pyGTK but then settled on wxPython as it is very powerful and very easy to create great GUIs. Also you can use PyInstaller to create a standalone .exe file of your python program, it works perfectly with applications that have a GUI made in wxPython.

There is also a book on wxPython called "wxPython in action" by Noel Rappin and Robin Dunn

wxPython is much simpler to distribute than PyGTK/GTK (which is a bear for Windows customers).

The other important thing is that the users of PyGTK/GTK are much smaller in number than the users of Tkinter or wxPython. So, if you need PyGTK help, good luck!?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.