Re: Get pixel colors from images in Python 3

2009-03-13 Thread Cro
I've noticed that Pygame has some similar implementation. It's a little harder to use, but efficient. And i think it depends on PIL too. And Pygame is Python 2.x too... So, not good. -- http://mail.python.org/mailman/listinfo/python-list

Get pixel colors from images in Python 3

2009-03-13 Thread Cro
Good day. As the title sais, i am trying to extract pixel colors from images, in Python 3. I know that for python 2.x, PIL (Python image library) can do that, via Image > getpixel((x,y)). It returns the colors as a list with 3 parameters, Red, Green and Blue. This is exactly what i want. Now, the

Re: HGE and Python (again)

2008-12-12 Thread Cro
Good day. Thank you so much for your answer Diez! I managed to call HGE dll the way you told: >>> HGE = windll.LoadLibrary("C:/hge181/hge") >>> HGE.hgeCreate(0x180) But it's not helpful. It would mean that i have to re-create all the header files from "include" directory in python, and all helper

Re: Why optimization mode is slower than normal mode?

2008-12-11 Thread Cro
Not-optimised: Pystone(1.1) time for 100 passes = 12.8366 This machine benchmarks at 77902 pystones/second Optimised: Pystone(1.1) time for 100 passes = 13.0574 This machine benchmarks at 76584.8 pystones/second It is probably the way it should be. :) -- http://mail.python.org/mailman/li

HGE and Python (again)

2008-12-11 Thread Cro
Good day. I've been trying to port HGE (http://hge.relishgames.com) to Python for more than 4 months now... HGE is a hardware accelerated 2D game engine. It comes with the source and examples. In the folder "include", you can find "hge.h", the file that i am talking about in all the post. # I tri

Re: Python 3 read() function

2008-12-04 Thread Cro
> Do you really mean io.StringIO? I guess you want io.BytesIO() .. > > Christian Mmm... i don't know. I also tried : [code] IDLE 3.0 >>> import io >>> vContent = io.BytesIO() >>> huge = io.open("C:\HUGE_FILE.pcl",'r+b',0) >>> vContent = huge.read() [/code] It still waits a lot... i don't have th

Python 3 read() function

2008-12-04 Thread Cro
Good day. I have installed Python 3 and i have a problem with the builtin read() function. [code] huge = open ( 'C:/HUGE_FILE.pcl', 'rb', 0 ) import io vContent = io.StringIO() vContent = huge.read() # This line takes hours to process !!! vSplitContent = vContent.split ( 'BIN;SP1;PW0.3,1;PA100,700

External code and functions integration

2008-09-22 Thread Cro
Good day. I am using python for quite some time now and i decided to advance a little. I want to write a little extension, or add some C modules for my python. I use Active version. What i want to do is write some wrappers for a game library, called HGE. See "hge.relishgames.com". I wrote some ap

NNTPLIB STRANGE ERROR

2006-08-13 Thread 2Good4You-Veki(Cro)
HI, when I want use python nntplib: >>> import nntplib >>> s=nntplib.NNTP('news.t-com.hr') >>> s.group('hr.mag.bug') THEN ERROR IS: Traceback (most recent call last): File "", line 1, in -toplevel- s.group('hr.mag.bug') File "C:\Python24\lib\nntplib.py", line 346, in group resp = sel

Python script setup

2006-08-11 Thread 2Good4You-Veki(Cro)
Hi all, When I want setup my script: I write: from distutils.core import setup setup(name="myscript", version='1.0', scripts=["myscripts.py"]) or some else example,error is Traceback (most recent call last): File "", line 1, in -toplevel- setup(name="myscript",