question on callback functions with ctypes

2020-06-20 Thread oyster
question on callback functions with ctypes I try to use GoVCL( https://github.com/ying32/govcl ) in python via ctypes. GoVCL supplies C header and simple C demo under https://github.com/ying32/govcl/tree/master/Tools/makeCHeader/test Now the simple python code can run on both win7 and win10

why same ctypes code runs on win7, but not on win10?

2020-06-19 Thread oyster
The attachment is a very simple code that uses the DLL from https://github.com/ying32/govcl to create a GUI application. The code runs on my python 3.6.10 64 bits with win7 64 bits, but failed on my python 3.6.10 64 bits and python 3.7.5 with win10 64 bits, by saying following message. What is the

release: a function to express the 4 steps of math calculation in markdown format

2018-12-21 Thread oyster
I wrote a post on https://stackoverflow.com/questions/53833884/failed-to-show-calculation-steps-with-sympy-and-markdown Now I wrote https://github.com/retsyo/expand_expression to answer the post partly I released it for it can help others. Thanks --

Re: is @ operator popular now?

2017-07-15 Thread oyster
sorry, I mean "PEP 465 - A dedicated infix operator for matrix multiplication" on https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-465 2017-07-15 20:05 GMT+08:00 Matt Wheeler <m...@funkyhat.org>: > On Sat, 15 Jul 2017, 12:35 oyster, <lepto.pyt...@gmail.com> wrote

is @ operator popular now?

2017-07-15 Thread oyster
as the title says. has @ been used in projects? -- https://mail.python.org/mailman/listinfo/python-list

what does type(subprocess.Popen)== mean?

2016-10-29 Thread oyster
why does not type(subprocess.Popen)==? Thanks [quote] Python 3.4.4 |Anaconda 2.3.0 (64-bit)| (default, Feb 16 2016, 09:54:04) [MSC v.1 600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> type(subprocess.Popen) >>> import

what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread oyster
for a simple code [code] vexList = [1, 2, 3] print('vexList', list(vexList)) vexList=map(lambda e: e+1, vexList) print('vexList', list(vexList)) vexList = list(vexList) print('vexList', list(vexList)) vexList=map(lambda e: e*2,vexList) print('vexList', list(vexList)) [/code] py27 says [quote]

real usable file/directory operation module?

2015-12-10 Thread oyster
there is shutil module, but I find it limits the user heavily. For example, I want to move 2 directories "a/scene" and "c/scene" to "d", but there is "scene" under d already. Then shutil.move will raise Error, "Destination path '%s' already exists" % real_dst So is there any module, which allow

Re: how to split this kind of text into sections

2014-04-26 Thread oyster
First of all, thank you all for your answers. I received python mail-list in a daily digest, so it is not easy for me to quote your mail separately. I will try to explain my situation to my best, but English is not my native language, I don't know whether I can make it clear at last. Every

how to split this kind of text into sections

2014-04-25 Thread oyster
I have a long text, which should be splitted into some sections, where all sections have a pattern like following with different KEY. And the /n/r can not be used to split I don't know whether this can be done easily, for example by using RE module [demo text starts] a line we do not need I am

how? Py extension does not depend on py version

2014-03-23 Thread oyster
I found an extension on this blog http://www.cnblogs.com/DxSoft/archive/2011/04/08/2009132.html or you can download the extension directly from http://files.cnblogs.com/DxSoft/PyFetion.rar I found that I can do from DxVcl import * in py 2.5/2.6/2.7. When I try this in py24, a msgbox says no

any lib to convert 3200+ pic to animated gif?

2013-11-30 Thread oyster
I want to make an animated GIF from 3200+ png I searched and found http://code.google.com/p/visvis/source/browse/#hg/vvmovie and I wrote: [code] allPic=glob.glob('*.png') allPic.sort() allPic=[Image.open(i) for i in allPic] writeGif('lala3.gif',allPic, duration=0.5, dither=0) [/code] However I

image lib supports arbitrary canvas coordinate

2012-06-24 Thread oyster
Can any image(not for line plot, but for pixel set) lib behaves like a person? that is to say: when we are doing image processing( for exapmle, http://www.freebasic.net/forum/viewtopic.php?f=17t=20057p=176300#p176300) , the new image maybe have a bigger canvas size than the original image's, and

how to let shell.SendKeys use unicode on windows in python

2010-08-09 Thread oyster
I want to use python to do some automatical operation on windows. the following is the code, which try to open a file with unicode characters in its filename in msword but I can't get it work correctly. Can anybody help me? if that is the shortcoming of WScript, is there any other way to do so in

how to copy and move file with its attribute?

2010-07-19 Thread oyster
I mean writeonly, hidden, system and so on attributes I use windows, but if possible, is there any method to do so in a crossplatfrom way? thanks -- http://mail.python.org/mailman/listinfo/python-list

lib to do advanced geometry calculation?

2009-06-19 Thread oyster
My problem is some complex, because some condition is not supplied as a given value please have a look at http://www.lusiya.com/bbs/attachment/thumb/Mon_0906/80_3201_d2fa7bd75d28675.jpg because I have to do futher calculation based on previous steps as

Re: ANN: WHIFF += Flash chart widget support (Aaron Watters)

2009-06-12 Thread oyster
nice the only pity is that amcharts is not a money-free product -- http://mail.python.org/mailman/listinfo/python-list

RE replace problem too

2009-06-12 Thread oyster
in my case, I want to replace all the function name with '', that is sin(1) - (1) sin(pi*(2+4)) - (pi*(2+4)) how can I use RE in this situation? thanx -- http://mail.python.org/mailman/listinfo/python-list

do replacement evenly

2009-06-02 Thread oyster
I have some strings, and I want to write them into a text files, one string one line but there is a requirement: every line has a max length of a certain number(for example, 10), so I have to replace extra SPACE*3 with SPACE*2, at the same time, I want to make the string looks good, so, for I

Re: do replacement evenly

2009-06-02 Thread oyster
even ' b= evenReplace(a, 27) print 'a=%s, len=%0i' %(a, len(a)) print 'b=%s, len=%0i' %(b, len(b)) print [/code] 2009/6/2 oyster lepto.pyt...@gmail.com: I have some strings, and I want to write them into a text files, one string one line but there is a requirement: every line has

re: Dabo 0.9.2 released

2009-06-01 Thread oyster
I have to say: please let dabo use english if it does not find any langauge resource! I have 'e:\prg\py\sap-24\python e:\prg\py\pure_pylib\_dabo\tools\remove_dLocalize.py .', but then the scripts says 'I don't know _ -- http://mail.python.org/mailman/listinfo/python-list

any lib to extract pages form pdf and then merge?

2009-05-25 Thread oyster
I want to extract some pages from vary pdf files, then write them with/witout rotation into one new pdf file. something likes this [py] import gfx doc = gfx.open(pdf, rTheory.pdf) pdf = gfx.PDF() for pagenr in [1,5,7]: page = doc.getPage(pagenr) if pagenr==1: page.rotate(90)

html ui + py background? any tut?

2009-05-23 Thread oyster
I have read for many times that the modern appliaction (not a web one, but desktop on) uses html + js for its UI, and python code is for the background work but I have never found event a simple (yet completed) article on how to develop such a thing from scrach in these advocacy thing. Can anyone

free chart lib for Python?

2009-05-07 Thread oyster
I mean chart, not plot. If you don't know the difference, you can check www.advsofteng.com, which is a commercial program is there such a thing with many kinds of chart, i.e. pie-chart, line-chart, ..? A long time ago, I programmed a rmchart interface, however rmchart is windows only, and

any complete and actual pysqlite example?

2009-04-18 Thread oyster
I mean not a code to do seperated functions, but a real project I have read the doc of pysqlite, but since I know little about database, I found it is still very hard for me to cook a real database app from the scratch with the help of codelet in pysqlite doc. here is the simplified details:

lib to auto-click mouse

2009-03-17 Thread oyster
is there any this kind of lib for python? thanx -- http://mail.python.org/mailman/listinfo/python-list

Re: can multi-core improve single funciton?

2009-02-10 Thread oyster
Hi, guys, my fib(xx) is just an example to show what is a single function and what is the effect I expect to see when enable multi-core. My real purpose is to know whether multi-core can help to improve the speed of a common function. But I know definitely that the answer is NO. --

can multi-core improve single funciton?

2009-02-09 Thread oyster
I mean this [code] def fib(n): if n=1: return 1 return fib(n-1)+fib(n-2) useCore(1) timeit(fib(500)) #this show 20 seconds useCore(2) timeit(fib(500)) #this show 10 seconds [/code] Is it possible? and more, can threads/multi-processors/clusters be used to improve fib? thanx --

check whether a JPG is completed?

2008-12-20 Thread oyster
there are some pics(most of them are JPGs) on my disk, but some are not completed, that is to say, if I view it in irfanview, the bottom is displayed as a gray block. so I want to check where they are completed. but how to do that in python? (No, I am not saying how to tell the fileszie when I

bind to HTMLayout or ubrowser

2008-11-06 Thread oyster
http://www.terrainformatica.com/htmlayout/ uses its own lightweight HTML rendering engine, helps you to create applications with the Web style user interface http://ubrowser.com/ is a library that makes it a little easier to embed the Mozilla Gecko rendering engine into your application is there

Re: Creating single .exe file without py2exe and pyinstaller

2008-10-21 Thread oyster
you can try jungle ( http://www.suda-chen.biz/?page_id=21 ) also -- 已转发邮件 -- From: MRAB [EMAIL PROTECTED] To: python-list@python.org Date: Mon, 20 Oct 2008 15:47:55 -0700 (PDT) Subject: Re: Creating single .exe file without py2exe and pyinstaller On Oct 20, 4:48 pm, Larry

search for a python compiler program whose name is jingle

2008-10-19 Thread oyster
I don't remember its name very clear, it may be 'jingle' or not this program runs on windows and can compile a python program into exe file without gcc it has no webspace but is announced on the author's blog when I find it some times ago. I can't find the link now. I there anybody else know it

Re: ANN: pyparsing 1.5.1 released

2008-10-19 Thread oyster
but the pyparsing.py in pyparsing-1.5.1.tar.gz is marked as 2008-10-02 I think it is good too touch all the files' time up-to-date. -- http://mail.python.org/mailman/listinfo/python-list

Re: a question about Chinese characters in a Python Program

2008-10-19 Thread oyster
I believe that is the problem with encode/code. you can find more @ http://groups.google.com/group/python-cn -- http://mail.python.org/mailman/listinfo/python-list

Re: how to set the time of a directory?

2008-10-13 Thread oyster
10, 2008 at 10:16 PM, oyster [EMAIL PROTECTED] wrote: os.utime works only against files. so what to do for a directory? thanx Not sure why you'd say that. I am. He's running Windows. drwxr-xr-x 2 tjg tjg 68 Oct 10 22:23 test ([EMAIL PROTECTED]) python

how to set the time of a directory?

2008-10-10 Thread oyster
os.utime works only against files. so what to do for a directory? thanx -- http://mail.python.org/mailman/listinfo/python-list

how to start thread by group?

2008-10-06 Thread oyster
my code is not right, can sb give me a hand? thanx for example, I have 1000 urls to be downloaded, but only 5 thread at one time def threadTask(ulr): download(url) threadsAll=[] for url in all_url: task=threading.Thread(target=threadTask, args=[url]) threadsAll.append(task) for

any tool can shrink DLL?

2008-09-22 Thread oyster
For many external lib, python( and www.freebasic.net) use only the DLL version, whcih is very big often if we want to release our program. So, is there such a tool that can scan a DLL then strip the unused function's code out, so yields a small working DLL? for example, in my program I use only

Re: embed python in ms-word?

2008-09-06 Thread oyster
in fact, during my work, I often write documnets in ms-word. But the doc has many numbers in it, which need to be calculated and to be modified frequently. Is there a method to write a ms-word add-in, so that 1.I can type in the calculation steps in some program language, please have a look at

embed python in ms-word?

2008-09-05 Thread oyster
In my ms-word documnet, there are some calculation whihc I have to change due to different argumnet. is there any way to embed python code in word, so that I can write the following as a macro or something else, then the result (i.e. 2) is shown in the word documnet? def f(n): if n2: return

Re: CAB files

2008-08-08 Thread oyster
there is 2 files: text2pdf.py and cab.py but I get a cab, in which there is a file text2pdf.py in it, but cab.py is created as a directory! [your cab.py starts] blahblah if __name__ == __main__: import os, glob hfci = HFCI(my-first.cab, verbose=1) files = glob.glob(r*.py) for fnm

a module.pth question

2008-07-14 Thread oyster
My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] import sys sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') import pyglet [/code] it is ok. but if I created h:\pure_pylib\pyglet.pth file, which containts

Re: a module.pth question

2008-07-14 Thread oyster
question On Jul 14, 6:26 am, oyster [EMAIL PROTECTED] wrote: My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] import sys sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') import pyglet [/code

how to judge urllib.Request is finished?

2008-07-01 Thread oyster
currently I am using [code] req=urllib2.Request(url) data='' if '/htm' not in data: fd=urllib2.urlopen(req) data=fd.read() time.sleep(10) time.sleep(10) blahblah [/code] Is there any other ready-to-use function? And what if the internet connection is chocked so that the

instructions on adding external Tcl/Tk widget into Tkinter?

2008-06-26 Thread oyster
It is so funny that the official GUI lib for python is Tkinter, but I cannot find an articles which explains indetail how can we use thounsands of Tcl/Tk widget in Tkinter. For example, I have download the dll at http://www.hwaci.com/sw/tkhtml/index.html, renamed it to tkhtml12.dll and put it in

ask for a RE pattern to match TABLE in html

2008-06-26 Thread oyster
that is, there is no TABLE tag between a TABLE, for example table something with out table tag/table what is the RE pattern? thanks the following is not right table.*?[^table]*?/table -- http://mail.python.org/mailman/listinfo/python-list

Any GUI lib wiget is capable of a WYSIWYG editor?

2008-06-24 Thread oyster
that is an html editor with text and picture, while the picture is linked to the local image file. for wxPython, the richtextcontrol save the image as en embedded object, so it is not my choice is there any other GUI lib and/or sample code to do so? thanks --

problem with 'global'

2008-01-20 Thread oyster
why the following 2 prg give different results? a.py is ok, but b.py is 'undefiend a' I am using Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 #a.py def run(): if 1==2:# note, it always False global a a=1 run() a

ANN: pyharu-2.0.8, the interface to libharu(PDF generate lib)

2008-01-18 Thread oyster
Pyharu is a pure python interface to haru(Haru Free PDF Library, http://libharu.sourceforge.net/) via ctypes. All of the C API is usable. All the example programs in haru C src has been ported. It (should) run on windows/linux without modification. Pyharu is only 1M, which is small and easy to

jpype with JFreeChart, anyone interested to help?

2008-01-14 Thread oyster
As you may know, there is no beautiful and free chart(not plot, you can find the examples at http://www.jfree.org/jfreechart, http://www.rmchart.com) module for python than runs on windows/linux/mac osx. On the other hand, there is a living package(http://www.jfree.org/jfreechart) for java, and

Re: jpype with JFreeChart, anyone interested to help?

2008-01-14 Thread oyster
am, oyster [EMAIL PROTECTED] wrote: As you may know, there is no beautiful and free chart(notplot, you can find the examples athttp://www.jfree.org/jfreechart,http://www.rmchart.com) module for python than runs on windows/linux/mac osx. Actually, may I humbly suggest two: Chaco: http

Re: hkimball's question on ctypes

2008-01-08 Thread oyster
2008/1/9, [EMAIL PROTECTED] [EMAIL PROTECTED]: Date: Tue, 8 Jan 2008 17:11:18 -0800 (PST) Subject: ctypes 1. please make your title more specific from ctypes import * cdecl = cdll.LoadLibrary(c:\projects\python\geinterface.dll) 2. are you sure '\' is ok?

Re: Why python says unexpected parameter 'mini.py' for my code?

2008-01-06 Thread Oyster
you need wx-c.so from wxnet.sourceforge.net on linux My source uses wx-c.dll, because I am in ms win2k On Jan 4, 10:30 pm, Nick Craig-Wood [EMAIL PROTECTED] wrote: oyster [EMAIL PROTECTED] wrote: The following is my pure-python wxwidgets test. It is hardly pure python since it depends

Why python says unexpected parameter 'mini.py' for my code?

2008-01-04 Thread oyster
The following is my pure-python wxwidgets test. It runs and give a frame, but soon python comes up to say unexpected parameter 'mini.py' and I have to close it. I cannot find the reason. Can somebody give me a hint to let it work well? Thanks http://pyguiviactypes.googlepages.com/mini.py --

Pure Python GUI lib?

2007-12-22 Thread oyster
For the word Pure, I mean it is not a C/C++/Z++.. extension, so that we can use it under pythons of different version. Is it possible? I don't like to update the module for different python and the module Currently, I am writing the interface to iup(http://www.tecgraf.puc-rio.br/iup) via ctypes,

ANN: pyRMChart 0.0.1 is released

2007-11-27 Thread oyster
1. What is it? pyRMChart is an interface to DLL-verison RMChart(http://rmchart.com), which is a free, lightweight and elegant chart creator 2. Dependency? Python + ctypes 3. How to install? a) you should install RMChart and make sure it works. On win2k/me/98, maybe you have to get a copy

how to get the native DC value in Tkinter/wxPython for drawing?

2007-11-23 Thread oyster
I am porting www.rmchart.com to python, now the code is almost finished, and I have supplied some examples.py which write to picturefiles directly, but the example to draw the chart on GUI stops me. that is the vb declaration nResult (LONG) = RMC_CreateChartOnDC( ByVal nParentDC (LONG), ByVal

why ctypes+dll gives a strange result

2007-11-11 Thread oyster
you can download the files at http://www.newsmth.net/att.php?s.284.38015.655.zip the dll and exe are created by freebasic import ctypes mydll=ctypes.windll.LoadLibrary(mydll.dll) _TwoTimes=getattr(mydll,'[EMAIL PROTECTED]') _TwoTimes.argtypes=[ctypes.c_double] def TwoTimes(i): return

Any free python module acts like Image Processing Toolbox in matlab?

2007-11-01 Thread oyster
as the title says, and thanx. for example, that is the help on cpselect(input, base) starts the Control Point Selection Tool ( www.mathworks.com/access/helpdesk/help/toolbox/images/cpselect.html) -- http://mail.python.org/mailman/listinfo/python-list

some OT: how to solve this kind of problem in our program?

2006-12-23 Thread oyster
1. first of all, what is the English jargon (Optimize? But I think this is not a very good keyword :( )for this problem? So I can use it to search on the internet 2. is there any free/open lib for this? 3. I know for some questions(case 1, case 2, and sudoku), we can use bundles of FOR...NEXT loop

Any easy-to-use email send module?

2006-12-20 Thread oyster
I find that the existing email moudle is some hard for me to understand, especially the part of how to set the CC, BCC and attach the files. Is there any more easy one like this p-code? import easyemail smtpserver=easyemail.server('something') smtpserver.login('[EMAIL PROTECTED]', pwd)

any advanced table module for wxpython?

2006-05-28 Thread oyster
Just like excel or vb does. A grid always looks like a normal grid, and can acts as a normal gird, where we can input some text. but when we click the right-most part, this grid becomes a choice widget, so we can choose some pre-defined gizmo; or it becomes a file-selector, and there is a button

how to make bibus with win32com into a exe file

2006-05-19 Thread oyster
Hi, everyone. http://bibus-biblio.sourceforge.net/ is a bibliographic and reference management software, which runs on windows/linux thru wxwidget. On windows, it uses win32com to insert reference into winword automatically. I have installed all the modules, and can launch and use bibus in my

any lib to generatre treemap?

2006-02-13 Thread oyster
I want to visualize my disk space like http://www.werkema.com/img/scrnshot/spacemonger.gif. ie. draw the directory as a big rectangleand its size is proportionable to the file size under this directory, then draw and fill small rectangles into it to behalf the size of every files. Is there a

trap the Newwindow2 event on wxPython with IE ActiveX

2006-01-16 Thread oyster
Hi, everyone. I work on windows os and want to write a IE based webbrowser. For I find that the only method which can handle most of the HTML standard is to embed IE object, I want to change demo\wxIEHtmlWin.py (from old wxPython) into a kind of multi-tab webbrowser( like greenbrowser, maxthon).