473,558 Members | 2,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pygame and python 2.5

@Ben Sizer

Hi Ben,

in January I received your message re Pygame and Python 2.5:
>pygame and python 2.5
Ben Sizer kylotan at gmail.com
Fri Jan 12 11:01:00 CET 2007
--------------------------------------------------------------------------------

siggi wrote:
>when I rtry to install pygame (pygame-1.7.1release.wi n32-py2.4.exe, the
most
ciurrent version I found) it requires Python 2.4! Will I really have to
uninstall my Python 2.5 and install the old Python 2.4 in order to use
pygame?

For now, yes. This is a long-standing problem with Python really,
requiring extensions to always be recompiled for newer versions. I
usually have to wait about 6 months to a year after any new release
before I can actually install it, due to the extension lag.

--
Ben Sizer
As a Python (and programming ) newbie allow me a - certainly naive -
question:

What is this time consuming part of recompiling an extension, such as
Pygame, from source code to Windows? Is it a matter of spare time to do the
job? Or do you have to wait for some Windows modules that are necessary for
compiling?

I am just asking for sake of "scientific " interest; building, compiling
from source code is a mystery to me poor Windows user ;-)

Thank you,

siggi

Feb 9 '07 #1
32 2807
On Feb 9, 1:48 pm, "siggi" <smusnmrNOS...@ yahoo.comwrote:
@Ben Sizer
Lucky I spotted this...
As a Python (and programming ) newbie allow me a - certainly naive -
question:

What is this time consuming part of recompiling an extension, such as
Pygame, from source code to Windows? Is it a matter of spare time to do the
job? Or do you have to wait for some Windows modules that are necessary for
compiling?
The problem is something like this:
- Python extensions written in C require recompilation for each new
version of Python, due to Python limitations.
- Recompiling such an extension requires you to have a C compiler set
up on your local machine.
- Windows doesn't come with a C compiler, so you have to download
one.
- The compiler that Python expects you to use (Visual Studio 2003) is
no longer legally available.
- The other compiler that you can use (MinGW) is requires a slightly
convoluted set of steps in order to build an extension.

Hopefully in the future, some of those convoluted steps will be fixed,
but that requires someone putting in the effort to do so. As is often
the case with Python, and indeed many open source projects, the people
who are knowledgeable enough to do such things usually don't need to
do them, as their setup already works just fine.

--
Ben Sizer

Feb 9 '07 #2
BenPython extensions written in C require recompilation for each new
Benversion of Python, due to Python limitations.

Can you propose a means to eliminate this limitation?

Skip
Feb 9 '07 #3
Ben Sizer wrote:
The problem is something like this:
- Python extensions written in C require recompilation for each new
version of Python, due to Python limitations.
- Recompiling such an extension requires you to have a C compiler set
up on your local machine.
- Windows doesn't come with a C compiler, so you have to download
one.
- The compiler that Python expects you to use (Visual Studio 2003) is
no longer legally available.
- The other compiler that you can use (MinGW) is requires a slightly
convoluted set of steps in order to build an extension.

Hopefully in the future, some of those convoluted steps will be fixed,
but that requires someone putting in the effort to do so. As is often
the case with Python, and indeed many open source projects, the people
who are knowledgeable enough to do such things usually don't need to
do them, as their setup already works just fine.
True. There really should be no need to recompile a C extension unless
the linkage format of the C compiler changes, which is a very rare event.
Binary compatibility needs to be improved.

In the GCC world, any compiler since 3.2 should generate interchangeable
output.

http://gcc.gnu.org/onlinedocs/gcc/Compatibility.html

In the Windows world, I'm not sure about compatibility across the
VC6/.NET transition, but I think you only need one version for either
side of that one.

John Nagle
Feb 9 '07 #4
sk**@pobox.com wrote:
BenPython extensions written in C require recompilation for each new
Benversion of Python, due to Python limitations.

Can you propose a means to eliminate this limitation?
Sure, write your wrapper-style extensions in ctypes :) . For example,
pygame-ctypes[1] should work on Python 2.5. Of course, you need to get
the PyGame dependencies (SDL) installed via some external mechanism, but
the ctypes-based code should run in Python 2.5 today (with the caveat
that it's not finished software).

[1] http://www.pygame.org/ctypes/

Have fun,
Mike

--
_______________ _______________ _______________ ___
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com

Feb 9 '07 #5

BenPython extensions written in C require recompilation for each new
Benversion of Python, due to Python limitations.
>Can you propose a means to eliminate this limitation?
MikeSure, write your wrapper-style extensions in ctypes :).

I was think more along the lines of how could the Python extension module
API change so that for example, modules compiled for Python 2.6 would
continue to work without warning under Python 2.7. Maybe ctypes is the
answer, but suspect it addresses a different API than I was thinking of.

Skip
Feb 9 '07 #6
On Feb 9, 5:53 pm, s...@pobox.com wrote:
BenPython extensions written in C require recompilation for each new
Benversion of Python, due to Python limitations.

Can you propose a means to eliminate this limitation?
By putting an intermediate layer between the extensions and the
language. I suppose this is essentially what ctypes does, except from
the other direction.

If someone could explain the limitation in detail, I expect ways could
be found around it. After all, I don't know of any other systems that
require you to recompile all the extensions when you upgrade the
application.

Winamp is one application that comes to mind which has kept plugins
working across many upgrades. I doubt they're still compiling with
Visual Studio 6. Perhaps it works because they have a more restrictive
API that isn't passing non-primitive types across the DLL boundary.

--
Ben Sizer

Feb 9 '07 #7

BenIf someone could explain the limitation in detail, I expect ways
Bencould be found around it. After all, I don't know of any other
Bensystems that require you to recompile all the extensions when you
Benupgrade the application.

Python used to work that way. You'd then silently get errors if the API
changed between version A and version B and you neglected to recompile the
extensions you compiled against version A. Maybe the Python extension API
is mature enough now that it can be frozen, but I sort of doubt it.

Skip
Feb 9 '07 #8
Skip:
Python used to work that way. You'd then silently get errors if the API
changed between version A and version B and you neglected to recompile the
extensions you compiled against version A.
Can't the compiled module have one or more test functions that can be
used during linking to see if the compiled module respects the
expected standard?

Bye,
bearophile

Feb 9 '07 #9
On Feb 9, 9:01 pm, s...@pobox.com wrote:
BenIf someone could explain the limitation in detail, I expect ways
Bencould be found around it. After all, I don't know of any other
Bensystems that require you to recompile all the extensions when you
Benupgrade the application.

Python used to work that way. You'd then silently get errors if the API
changed between version A and version B and you neglected to recompile the
extensions you compiled against version A. Maybe the Python extension API
is mature enough now that it can be frozen, but I sort of doubt it.
The only reason this is an issue is because the system is tightly
bound on a binary level. Decouple that and the problem goes away.
These 'silent' errors will all stem from a small number of specific
things, each of which can be addressed. eg. PyFile_AsFile returns a
FILE*, which is all well and good if both the extension's compiler and
the language's compiler agree on what you get when you dereference
that type, and probably not so good when they don't. The answer there
is not to make assumptions about the structure of complex types across
the boundary. The same may well go for the multitude of macros that
make assumptions about the structure of a PyObject.

It's not really much to do with the maturity, since functions don't
seem to be getting regularly removed from the API. It's more the
choices made about how to implement it.

--
Ben Sizer

Feb 9 '07 #10

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

Similar topics

5
3077
by: Andrea Griffini | last post by:
Just a quick shoot... can I produce a "closed source" program using "core" python, pygame (and eventually psyco), packaging it by using py2exe and a custom installer ? A clear yes/no answer is something I'll be asked about when proposing python as an interesting alternative. If the answer is "no" (as I fear) what's the minimum of...
8
2526
by: Askari | last post by:
(Help for Pygame module) Hi, How I can make a "fadeout text"(alpha at 255,254,253...0) on a surface and my surface's background must be transparatly? Note : I can do a fadeout but with a background on the surface's text but I wan't a tranparently background. Example (don't work) :
3
3703
by: Tim Knauf | last post by:
Hi everyone, I'm glad to have found this list. I've written a small script for my own use which, amongst other things, captures mouse click information from a window containing an image. I used Pygame to manage the image window, as it was the easiest way to implement the functionality I needed. The surrounding interface windows (there are...
3
2592
by: devendra_k | last post by:
I want to intigrate the PyGame module with my Python exe, means i DONT want to generate .PYD files separtely rather than that want to put PyGame "c" src with Python workspace of VC project workspace. I am unable to import the sub modules( display, rect etc) of pygame, its raising errors, am giving the steps i followed, plz help me in this...
1
3218
by: kjm | last post by:
Hi everyone, I have recently acquired a Logitech Rumble pad to use as an input device. I have been having trouble getting the event que to respond that a button or hat arrow has been pressed. This is on a system running OS 10.3.9. I have modified/written a small piece of code that initializes the joystick, and pygame does recognize it....
1
6785
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image file during specific events in the script execution? image format doesnt matter. thanks! christine
0
1750
by: Julian Snitow | last post by:
Here is a more visual example of the technique presented in Logan Koester's article, "Live Coding in Python" (http://www.logankoester.com/mt/2006/07/live_coding_with_python_1.html). It's very quick-and-dirty in style, partly because half of the program was written in a moment of inspiration, and the other half was written and rewritten in...
4
5861
kaarthikeyapreyan
by: kaarthikeyapreyan | last post by:
I have installed pygame v 1.8.0 The installation was sucessful, but the optional packages were not included like the font,movie etc When i was trying to run the sample script that was given it showed me this error $python fonty.py fonty.py:33: RuntimeWarning: use font: No module named font font = pygame.font.Font(None, 80) Traceback...
0
1050
by: L. Lindstrom | last post by:
I build the Pygame releases for Windows. Pygame wraps the Simple Directmedia Layer (SDL) C library. I am doing preliminary research into porting Pygame to Python 2.6. For Pythons 2.4 and 2.5 the Pygame extension modules are built with MinGW. They link cleanly against msvcr71.dll. A custom SDL, also linked to msvcr71.dll, is used. It is built...
0
7549
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7835
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8061
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7914
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1164
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.