473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Experienced programmer evaluating Python

Hello. I'm an experienced programmer who is evaluating learning Python if
it is applicable to a few projects. The programs I am going to list are
production software - they are not throwaway toy projects, but will
actually have real world application. I've spent years writing C++ and
Perl code, but I would like to try "this Python language" out in their
implementation, as I have the luxury of slack deadlines for the next
little while.

That said, I was hoping Python gurus could quickly tell me if these
projects would be a good fit, or if there are any pitfalls I should look
for.

1] Embedding Python into a realtime game. I'm willing to take a
performance hit over strict c++ in the range of 10%, if the implementation
can be elegant. I've embedded Perl into a cross platform application
(win32 & Linux) and I found it to be a nasty undertaking. Perl.h had
namespace conflicts with libraries, and I had crashes within the
statically linked Perl library that essentially made traces impossible. I
could go on, but it was basically an inelegant solution.

I understand I haven't given enough details to let people know if 10% is
in order, but a general opinion about scalability and bytecode execution
working in a non-threaded realtime environment in parallel with c++ code
would be appreciated.

2] IRC bot. I understand there are third party libraries available, but
they all claim to be alpha. Can anyone recommend a solid one?

I think I miss CPAN. Is this normal?

3] Redistributable end-user product development tools. I know and love
using wxWindows in C++. Basically, I need the ability to distribute
everything necessary for developers on the Internet (read: not average
users) to run wxWindows based Python apps on Win32 development
workstations. Licenses and convenience come into play. I don't mind a
large download for this crowd, but asking them to compile anything is
above and beyond.

Finally, is there any issues with me not distributing Python source if I
include a compiled DLL with commercial software? If I embed Python for
Win32, I have read that I need to dynamically link it. If I do so with no
modifications, am I free to not offer source code for download? (Yes, I
am addressing all you IANALs out there...)

Thanks for the advice. I will check back as I continue to research this
intriguing language.
Jul 18 '05 #1
6 1798
>1] Embedding Python into a realtime game. I'm willing to take a
performance hit over strict c++ in the range of 10%, if the implementation
can be elegant. I've embedded Perl into a cross platform application
(win32 & Linux) and I found it to be a nasty undertaking. Perl.h had
namespace conflicts with libraries, and I had crashes within the
statically linked Perl library that essentially made traces impossible. I
could go on, but it was basically an inelegant solution.
Most people believe that extending Python (Python calling C code) is much
easier and much better than embedding Python (C code calling Python code). It's
possible to embed, but it's a real pain in the butt (I know, I tried it.)
Anything too slow to run in Python can be done in C, and there's a library
called Psyco (psyco.sourceforge.net) that you'll definitely want to look at
(it's sort of a JIT compiler). Psyco's not a panacea, but it sure as heck can
help. This is the approach I'm using for my own game design, which is an RPG.
(By the way, I find XML DocBook to be a great format to write design documents
in, if you're also a designer.) Because most of the execution is in such a
small portion of the code, it shouldn't be a big deal.
3] Redistributable end-user product development tools. I know and love
using wxWindows in C++. Basically, I need the ability to distribute
everything necessary for developers on the Internet (read: not average
users) to run wxWindows based Python apps on Win32 development
workstations. Licenses and convenience come into play. I don't mind a
large download for this crowd, but asking them to compile anything is
above and beyond.
wxPython is what you want. http://wxpython.org/
Finally, is there any issues with me not distributing Python source if I
include a compiled DLL with commercial software?


I'm not sure how you'll manage to use Python code without giving the Python
source in some for. You could distribute .pyc files, but I think they could be
reasonably decompiled (not sure).

- Kef

Jul 18 '05 #2
Michael L. Labbe wrote:
1] Embedding Python into a realtime game. I'm willing to take a
performance hit over strict c++ in the range of 10%, if the
implementation can be elegant. I've embedded Perl into a cross
platform application (win32 & Linux) and I found it to be a nasty
undertaking. Perl.h had namespace conflicts with libraries, and I
had crashes within the statically linked Perl library that
essentially made traces impossible. I could go on, but it was
basically an inelegant solution.


See boost::python.
--
Rainer Deyke - ra*****@eldwood.com - http://eldwood.com
Jul 18 '05 #3
> Hello. I'm an experienced programmer who is evaluating learning Python if
it is applicable to a few projects. The programs I am going to list are
production software - they are not throwaway toy projects, but will
actually have real world application. I've spent years writing C++ and
Perl code, but I would like to try "this Python language" out in their
implementation, as I have the luxury of slack deadlines for the next
little while.
Awesome - hope you find the info below helpful.
1] Embedding Python into a realtime game. I'm willing to take a
performance hit over strict c++ in the range of 10%, if the implementation
A few commercial games out there have done this (Google Groups should turn
up a few links if someone doesn't post the specific games) so it's
definitely doable although I'm not sure of how much of a performance
overhead you'll incur - hopefully someone more knowledgeable will chime in.
At least one commercial game used the Stackless variant of Python so that
you can have literally thousands of "microthreads", each running a separate
game entity. You might also check out Pygame, although that's probably
farther down the path than you're thinking of going.
3] Redistributable end-user product development tools. I know and love
using wxWindows in C++. Basically, I need the ability to distribute
everything necessary for developers on the Internet (read: not average
users) to run wxWindows based Python apps on Win32 development
workstations. Licenses and convenience come into play. I don't mind a
large download for this crowd, but asking them to compile anything is
above and beyond.
Not a problem, especially for Win32. www.wxPython.org plus stuff like py2exe
or McMillian's Installer can give you whatever combination of half-baked or
fully-baked applications you need. On Windows you can install Python,
wxPython, and most other add-on libraries without requiring the user to have
a compiler, and licensing isn't an issue with Python or wxPython. Another
interesting twist is to use ctypes, which lets you call just about any API
in any Windows DLL, again without a compiler, and again easily
distributable.
Finally, is there any issues with me not distributing Python source if I
include a compiled DLL with commercial software? If I embed Python for
Win32, I have read that I need to dynamically link it.


No - see http://www.python.org/doc/Copyright.html which includes

"The gist of it is that Python is absolutely free, even for commercial use
(including resale). There is no GNU-like "copyleft" restriction."

Hope you have fun trying out Python,
Dave
Jul 18 '05 #4

"Michael L. Labbe" <us****@frogtoss.com> wrote in message
news:pa****************************@frogtoss.com.. .
Hello. I'm an experienced programmer who is evaluating learning Python if it is applicable to a few projects.
Welcome to a community of generally friendly, helpful, enthusiasts --
some with a sense of humor, even if subtle.
I think I miss CPAN. Is this normal?
Yes, for people with prior Perl experience.
3] Redistributable end-user product development tools.... .... Finally, is there any issues with me not distributing Python source if I include a compiled DLL with commercial software?
People routinely distribute executables produced by py2exe that
combines interpreter, needed libraries, and custom source in one file.
Period.

The Python license is 'GPL compatible' but is intentionally different
from the GP and much more permissive. As I remember, there are
basically two provisos: give appropriate credit and take full
responsibility for the use you make of it. For instance, if you want
to sell software with a guarantee, then test until you are willing to
service said guarantee. Is this what you were asking about?
If I embed Python for
Win32, I have read that I need to dynamically link it.
AFAIK, this is a technical rather than legal issue.
If I do so with no modifications, am I free to not offer
source code for download?


Which source? CPython's or yours? ;-)

Terry J. Reedy
Jul 18 '05 #5
On Sun, 02 Nov 2003 22:32:13 -0500, Terry Reedy wrote:
Welcome to a community of generally friendly, helpful, enthusiasts --
some with a sense of humor, even if subtle.
Thanks - all of the responses have been very helpful so far.
People routinely distribute executables produced by py2exe that combines
interpreter, needed libraries, and custom source in one file. Period.

The Python license is 'GPL compatible' but is intentionally different
from the GP and much more permissive. As I remember, there are
basically two provisos: give appropriate credit and take full
responsibility for the use you make of it. For instance, if you want to
sell software with a guarantee, then test until you are willing to
service said guarantee. Is this what you were asking about?
If I embed Python for
Win32, I have read that I need to dynamically link it.


AFAIK, this is a technical rather than legal issue.
If I do so with no modifications, am I free to not offer
source code for download?


Which source? CPython's or yours? ;-)


I'm fine with accountability for my company's software. However, I cannot
rule out the possibility of closing the source code of the software I
produce, and not distributing any of the Python core code.

My situation is that a third party, perhaps a publisher, will be
interested in building a distribution of the software for end users. It
would seriously weaken my ability to reach a reasonable agreement if I
insisted upon any source code whatsoever being included. Publishers can
be like that.

So, to answer your question, can I amicably not distribute my source code or
Python's alongside the binary distribution? :)
Jul 18 '05 #6
"Michael L. Labbe" wrote:

So, to answer your question, can I amicably not distribute my source code or
Python's alongside the binary distribution? :)


Have you actually tried to read the license? If so, and you haven't
got an answer to the above question, perhaps you would be so good as
to post the relevant sections and try to explain what it is you don't
understand about them. That way at least someone could consider
improving the license (or maybe making some notes to go with it) for
a later time.

The last time I read the license, it was quite clear on the areas
touching on your question, so I'm surprised it wasn't equally clear
for you.

-Peter
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: NotGiven | last post by:
I'm an programmer experienced in other languages but have been using PHP for about a year now. I want to take it to the next level - be the expert. What book do you recommend help take me there?...
29
by: jeffc | last post by:
How would you answer a question like this in an interview? I'm not interested in gathering the average of folks on this forum. I'm interested in a strategy for a) evaluating yourself objectively...
3
by: Guy Middleton | last post by:
A friend want to learn C, and is already an experienced programmer -- she knows VB and Java, and some application-specific HLLs (e.g. ToolBook). Could somebody recommend an intro C text I could...
65
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.