473,804 Members | 3,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GDI in python>?

hi,

is it possible to address the 'screen pixels' using python , like
analogous to older dos( functions that graphics.h provides') or win api
calls for gdi.

what i want is to display clusters (in differetn colours) on screen
using python.

thanks.

Feb 18 '06 #1
5 4907
al pacino wrote:
hi,

is it possible to address the 'screen pixels' using python , like
analogous to older dos( functions that graphics.h provides') or win api
calls for gdi.

what i want is to display clusters (in differetn colours) on screen
using python.

thanks.

Sure. The problem will be to choose the right tool from the myriads of
available ones.

I have some experience with PyGame
http://www.pygame.org/news.html
which is built on top of SDL
http://www.libsdl.org/index.php
and find it easy to understand and use.

Don't be fooled by the 'Game' part - PyGame is as useful as SDL (a very
good library).

Claudio
Feb 18 '06 #2
al pacino schrieb:
hi,

is it possible to address the 'screen pixels' using python , like
analogous to older dos( functions that graphics.h provides') or win api
calls for gdi.

Use one of the available GUI-Toolkits - Tkinter is included already. Or
pygame.

Diez
Feb 18 '06 #3
Le 17 Feb 2006 22:02:23 -0800, al pacino a écrit :
hi,

is it possible to address the 'screen pixels' using python , like
analogous to older dos( functions that graphics.h provides') or win api
calls for gdi. Some possibilities (all on Win32 only):
ctypes by Thomas Heller
venster (uses ctypes) on sourceforge
win32all by Marc Hammond
what i want is to display clusters (in differetn colours) on screen
using python.

thanks.

Feb 18 '06 #4
al pacino wrote:
is it possible to address the 'screen pixels' using python , like
analogous to older dos( functions that graphics.h provides') or win api
calls for gdi.

what i want is to display clusters (in differetn colours) on screen
using python.


Almost any (or just "any") GUI toolkit can do that. Check out wxPython,
Tkinter, PyQT, Pygame, etc.

For example, in the wxPython demo (two easy downloads to install and run
on a Windows box), the Miscellaneous->DrawXXXList demo page shows how to
draw sets of points, lines, rectangles, etc, directly to the display via
a DeviceContext object.

-Peter

Feb 18 '06 #5
Thanks claudio, that should work out fine.

Feb 18 '06 #6

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

Similar topics

1
2585
by: TheDustbustr | last post by:
I'm writing a game in C++ which calls out to python for scripting. I'd like to expose the instance of my Game class (a singleton) to python (so that the instances of Clock, Camera, etc are available to the scripts). I ran into trouble trying to expose a specific instance (or even a function returning the instance). Here is a simplification of my problem in code (c++): <code> class A{ public:
2
3605
by: Rene Pijlman | last post by:
I can't seem to find any way to specify the character encoding with the DB API implementation of PyPgSQL. There is no mention of encoding and Unicode in the DB API v2.0 spec and the PyPgSQL README. When I have Unicode strings in Python and store it in a PostgreSQL Unicode database, will the data automatically be correctly encoded? Or do I need to specify the UTF-8 client encoding on the database connection somehow? I'm using the...
42
3722
by: Bicho Verde | last post by:
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And also I don't know exactly why would I learn Python rather than C#, C++ or Perl. Basicaly I don't know where to start, if there is much to do or if it is has it seems and there is software to everything nowadays and so doesn't make sense to spend...
2
1906
by: aum | last post by:
Hi, I'm looking for an object-relational layer, which can wrap a MySQL database into highly pythonic objects. There seem to be dozens of packages which provide some of this functionality, but all the ones I've looked at so far have major drawbacks. What I'm looking for in an object-relational wrapper layer is:
1
2215
by: Michael R Seefelt | last post by:
I have written a simple C-program that loads a Python Function that connects to a PostgreSQL database> When I only load and execute the Python function all works OK. If I call the Python function a second time I get the following: Called PyObject_CallObject Traceback (most recent call last): File "/home/mike/src/arthur/query_server/query_analyzer/Query_Analyzer.py", line 25, in processQuery from pyPgSQL import PgSQL File...
5
1822
by: john | last post by:
Hi I am devlopeing a data centric intranetsite with data in mysql database I would like your opinion on this architecture Data will be fetched from database by python & converted into xml The XSLT will be stored on the client cache.So only the xml is transferred to client & the xslt transforms it into xhtml & displays it. Will this improve performance or have i gone nuts??
4
3435
by: news | last post by:
I've just started to test/learn python. I've got Linux > mandrake9 > python & documentation. What I'll initially want to be doing needs file I/O, so I wanted to confirm file I/O early in my tests. Following the examples : >>> f=open('/tmp/workfile', 'w') >>> print f <open file '/tmp/workfile', mode 'w' at 80a0960> <-- OK
5
2992
bartonc
by: bartonc | last post by:
Two new sub forums have been added to the Python Forum. These are NOT Q&A forums, but threads will be open to discussion. In Python > Python Code you will find snippets submitted by experts and contributors. Python > Python Articles will include tutorials, classes, documentation links, etc. Please feel free to use these temporary links to check out this new feature or post your submissions. All submissions will be subject to review by the...
15
2241
by: rh0dium | last post by:
Hi Folks, OK I love the logging module. I use it everywhere. I was happily putting at the top of each of my scripts ------<snip>------ #!/usr/bin/env python2.4 import logging
4
22059
by: pdlemper | last post by:
Have carefully installed Python 2.5.1 under XP in dir E:\python25 . ran set path = %path% ; E:\python25 Python interactive mode works fine for simple arithmetic . Then tried >> import math Get error Name error : name 'sqrt' is not defined Same thing with sin(x) . I'm unable to find "math" , "sqrt" , or "sin" anywhere in lib , Libs or include directories . The Tutorial does not clear this up . Please help. Thanks Dave ...
0
9705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10567
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3809
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.