From praveen.patil@silver-software.com Wed Sep 4 13:23:48 2002 From: praveen.patil@silver-software.com (Praveen Patil) Date: Wed, 4 Sep 2002 13:23:48 +0100 Subject: [EuroPython] Please help in calling python fucntion from 'c' Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_000B_01C25416.4D279A90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, I have written 'C' dll(MY_DLL.DLL) . I am importing 'C' dll in python file(example.py). I want to call python function from 'c' function. For your reference I have attached 'c' and python files to this mail. In my pc: python code is under the directory D:\test\example.py dll is under the directory C:\Program Files\Python\DLLs\MY_DLL.pyd Here are the steps I am following. step(1): I am calling 'C' function(RECEIVE_FROM_IL_S) from python. This 'C' function is existing imported dll(MY_DLL). step(2): I want to call python function(TestFunction) from 'C' function(RECEIVE_FROM_IL_S). Python code is(example.py) :- ---------------------------- import MY_DLL G_Logfile = None def TestFunction(): G_Logfile = open('Pytestfile.txt', 'w') G_Logfile.write("%s \n"%'I am writing python created text file') G_Logfile.close G_Logfile = None #end def TestFunction if __name__ == "__main__": MY_DLL.RECEIVE_FROM_IL_S(10,50) 'C' code is (MY_DLL.c) :- --------------------- #include #include #include PyObject* _wrap_RECEIVE_FROM_IL_S(PyObject *self, PyObject *args) { FILE* fp; PyObject* _resultobj; int i,j; if( !(PyArg_ParseTuple(args, "ii",&i,&j))) { return NULL; } fp= fopen("RECEIVE_IL_S.txt", "w"); fprintf(fp, "i=%d j=%d" , i,j); fclose(fp); /* Here I want to call python function(TestFunction). Please suggest me some solution*/ _resultobj = Py_None; return _resultobj; } static PyMethodDef MY_DLL_methods[] = { { "RECEIVE_FROM_IL_S", _wrap_RECEIVE_FROM_IL_S, METH_VARARGS }, { NULL , NULL} }; __declspec(dllexport) void __cdecl initMY_DLL(void) { Py_InitModule("MY_DLL",MY_DLL_methods); } Please anybody help me solving the problem. Cheers, Praveen. ------=_NextPart_000_000B_01C25416.4D279A90 Content-Type: text/plain; name="exampl.py" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="exampl.py" import MY_DLL G_Logfile = None def TestFunction(): G_Logfile = open('Pytestfile.txt', 'w') G_Logfile.write("%s \n"%'I am writing python created text file') G_Logfile.close G_Logfile = None #end def TestFunction if __name__ == "__main__": MY_DLL.RECEIVE_FROM_IL_S(10,50) ------=_NextPart_000_000B_01C25416.4D279A90 Content-Type: application/octet-stream; name="MY_DLL.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="MY_DLL.c" #include #include #include PyObject* _wrap_RECEIVE_FROM_IL_S(PyObject *self, PyObject *args) { FILE* fp; =20 PyObject* _resultobj; int i,j; =20 if( !(PyArg_ParseTuple(args, "ii",&i,&j))) { return NULL; } fp=3D fopen("RECEIVE_IL_S.txt", "w"); fprintf(fp, "i=3D%d j=3D%d" , i,j); fclose(fp); /* Here I want to call python function(TestFunction). Please suggest = me some solution*/ _resultobj =3D Py_None; return _resultobj; } static PyMethodDef MY_DLL_methods[] =3D { { "RECEIVE_FROM_IL_S", _wrap_RECEIVE_FROM_IL_S, METH_VARARGS }, { NULL , NULL} }; __declspec(dllexport) void __cdecl initMY_DLL(void) { Py_InitModule("MY_DLL",MY_DLL_methods); } ------=_NextPart_000_000B_01C25416.4D279A90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline [ The information contained in this e-mail is confidential and is intended for the named recipient only. If you are not the named recipient, please notify us by telephone on +44 (0)1249 442 430 immediately, destroy the message and delete it from your computer. Silver Software has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses. However, we cannot accept liability for any damage sustained as a result of any such software viruses and advise you to carry out your own virus check before opening any attachment. Furthermore, we do not accept responsibility for any change made to this message after it was sent by the sender.] ------=_NextPart_000_000B_01C25416.4D279A90-- From mal@egenix.com Wed Sep 4 13:27:34 2002 From: mal@egenix.com (M.-A. Lemburg) Date: Wed, 04 Sep 2002 14:27:34 +0200 Subject: [EuroPython] Please help in calling python fucntion from 'c' References: Message-ID: <3D75FC36.7020803@lemburg.com> Please post this to comp.lang.python. This is not the right list to discuss technical aspect around Python. Thanks. Praveen Patil wrote: > Hi, > > I have written 'C' dll(MY_DLL.DLL) . I am importing 'C' dll in python > file(example.py). > I want to call python function from 'c' function. > For your reference I have attached 'c' and python files to this mail. > In my pc: > python code is under the directory D:\test\example.py > dll is under the directory C:\Program Files\Python\DLLs\MY_DLL.pyd > > Here are the steps I am following. > > step(1): I am calling 'C' function(RECEIVE_FROM_IL_S) from python. > This 'C' function is existing imported dll(MY_DLL). > step(2): I want to call python function(TestFunction) from 'C' > function(RECEIVE_FROM_IL_S). > > > Python code is(example.py) :- > ---------------------------- > import MY_DLL > > G_Logfile = None > > def TestFunction(): > G_Logfile = open('Pytestfile.txt', 'w') > G_Logfile.write("%s \n"%'I am writing python created text file') > G_Logfile.close > G_Logfile = None > #end def TestFunction > > if __name__ == "__main__": > > MY_DLL.RECEIVE_FROM_IL_S(10,50) > > > 'C' code is (MY_DLL.c) :- > --------------------- > #include > #include > #include > > PyObject* _wrap_RECEIVE_FROM_IL_S(PyObject *self, PyObject *args) > { > FILE* fp; > PyObject* _resultobj; > int i,j; > > if( !(PyArg_ParseTuple(args, "ii",&i,&j))) > { > return NULL; > } > fp= fopen("RECEIVE_IL_S.txt", "w"); > fprintf(fp, "i=%d j=%d" , i,j); > fclose(fp); > > /* Here I want to call python function(TestFunction). Please suggest me > some solution*/ > > _resultobj = Py_None; > return _resultobj; > } > > > static PyMethodDef MY_DLL_methods[] = { > { "RECEIVE_FROM_IL_S", _wrap_RECEIVE_FROM_IL_S, METH_VARARGS }, > { NULL , NULL} > }; > > __declspec(dllexport) void __cdecl initMY_DLL(void) > { > Py_InitModule("MY_DLL",MY_DLL_methods); > } > > > Please anybody help me solving the problem. > > > Cheers, > > Praveen. > > > ------------------------------------------------------------------------ > > import MY_DLL > > G_Logfile = None > > def TestFunction(): > G_Logfile = open('Pytestfile.txt', 'w') > G_Logfile.write("%s \n"%'I am writing python created text file') > G_Logfile.close > G_Logfile = None > #end def TestFunction > > if __name__ == "__main__": > > MY_DLL.RECEIVE_FROM_IL_S(10,50) > > > ------------------------------------------------------------------------ > > [ The information contained in this e-mail is confidential and is intended for the named recipient only. If you are not the named recipient, please notify us by telephone on +44 (0)1249 442 430 immediately, destroy the message and delete it from your computer. Silver Software has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses. However, we cannot accept liability for any damage sustained as a result of any such software viruses and advise you to carry out your own virus check before opening any attachment. Furthermore, we do not accept responsibility for any change made to this message after it was sent by the sender.] -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From mailing@espace-video.fr Mon Sep 16 14:42:15 2002 From: mailing@espace-video.fr (mailing@espace-video.fr) Date: Mon, 16 Sep 2002 15:42:15 +0200 Subject: [EuroPython] ESPACE VIDEO FRANCE Message-ID: <200209161342.g8GDgFQ19413@localhost.localdomain>
ESPACE VIDEO=20 FRANCE
 
Actualit=E9s Vid=E9os Vivez en direct toute= =20 l'actualit=E9 de la vid=E9o =E0 la location...
Les sorties=20 cin=E9ma...

Acc=E8s direct= au Site=20
 
Faites vos achatsCoquins =E0=20 prix Malins...
Acc=E8s direct au Site
(+18 ans uniquement)
Bou= tique lingerie=20
VHS =E0 partir de
1,99=80
     &nbs= p;DVD
=E0 partir de 4,99=80

 


Pour vous d=E9sinscrire, merci de vous rendre ici:
http://espace-video.fr/cgi-bin/pg-mlpro.cgi?A=3Deuropython= @python.org&L=3D4 From praveen.patil@silver-software.com Mon Sep 16 16:09:09 2002 From: praveen.patil@silver-software.com (Praveen Patil) Date: Mon, 16 Sep 2002 16:09:09 +0100 Subject: [EuroPython] Please help solving the problem In-Reply-To: Message-ID: Hi , Please help me in solving the problem below. step 1: I have written three dlls : a.dll , b.dll , c.dll. a.dll contains funct_A(); b.dll contains funct_B(); c.dll contains funct_C(); step 2: I am copying a.dll to directory C:\Program Files\Python\DLLs and renaming as a.pyd similarly I am copying b.dll to directory C:\Program Files\Python\DLLs. I am not renaming as b.pyd I am copying c.dll to directory C:\Program Files\Python\DLLs and renaming as c.pyd So my C:\Program Files\Python\DLLs directory contain a.pyd , b.dll , c.pyd step 3: a)Python function func_pyA() calls funct_A() b)funct_A() call funct_B() c)funct_B() call funct_C() d)funct_C() call python fuction func_pyC() step 4: I am importing a.pyd and c.pyd in python program. import a import c step 5: I am having problem in importing 'a' because 'a' need to load b.dll and c.dll. But I copied c.dll as c.pyd. Please suggest me some solution. here is my code : 1)a.c (a.dll) ---------- void func_A(); 2)b.c (b.dll) ----------- void func_B(); 3)c.c( c.dll) ----------- void func_C(); 4) example.py --------- import a import c G_Logfile = None def TestFunction(): G_Logfile = open('Pytestfile.txt', 'w') G_Logfile.write("%s \n"%'I am writing python created text file') G_Logfile.close G_Logfile = None if __name__ == "__main__": a.func_A(); ..... ..... Please help me in solving the problem. Cheers, Praveen. [ The information contained in this e-mail is confidential and is intended for the named recipient only. If you are not the named recipient, please notify us by telephone on +44 (0)1249 442 430 immediately, destroy the message and delete it from your computer. Silver Software has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses. However, we cannot accept liability for any damage sustained as a result of any such software viruses and advise you to carry out your own virus check before opening any attachment. Furthermore, we do not accept responsibility for any change made to this message after it was sent by the sender.] From magnus@thinkware.se Mon Sep 16 16:44:26 2002 From: magnus@thinkware.se (Magnus Lycka) Date: Mon, 16 Sep 2002 17:44:26 +0200 Subject: [EuroPython] Please help solving the problem In-Reply-To: References: Message-ID: <5.1.0.14.0.20020916173902.02af4ee0@www.thinkware.se> Wrong mailing list. This list is for Python conferences in Europe etc. (Perhaps the scope at the mailing list server isn't clear enough?) Please send such questions to tutor, win32 or the general python list: http://mail.python.org/mailman/listinfo/tutor http://mail.python.org/mailman/listinfo/python-win32 http://mail.python.org/mailman/listinfo/python-list At 16:09 2002-09-16 +0100, Praveen Patil wrote: >Hi , > > >Please help me in solving the problem below. ... --=20 Magnus Lyck=E5, Thinkware AB =C4lvans v=E4g 99, SE-907 50 UME=C5 tel: 070-582 80 65, fax: 070-612 80 65 http://www.thinkware.se/ mailto:magnus@thinkware.se From duncan@rcp.co.uk Tue Sep 24 14:00:28 2002 From: duncan@rcp.co.uk (Duncan Booth) Date: Tue, 24 Sep 2002 14:00:28 +0100 Subject: [EuroPython] CFP: UK Python Conference 2003 Message-ID: <3D906FFC.27243.14C529B3@localhost> This is a repost (except I missed out the EuroPython mailing list last time!): if you missed it the first time it isn't too late to put yourself forward as a speaker at the UK Python Conference. No previous experience necessary, just tell me what you want to talk about or suggest a range of topics if you aren't sure. The provisional list of speakers for this conference includes Guido van Rossum, David Abrahams (Boost Python), Andrew Koenig, Marc Andr=E9 Lemburg, and many more. See http://www.accuconference.co.uk/ for more about the conference. *** Call for Participation *** UK Python Conference 2003 April 2-3 2003 Holiday Inn, Oxford The UK Python Conference 2003 is being held in conjunction with the larger ACCU conference. The conference will include two days of papers arranged in 90 minute speaking slots with either one or two tracks. The audience is highly technical and will include experts in many fields of computing, some of whom may know little or nothing about Python. Talks will be welcomed on any aspect of Python, but we are especially interested in the following: - Commercial applications for Python - Cross-language talks Speakers are welcome from the UK or the rest of the world, however our budget for overseas speakers may be limited. Speakers get reasonable travel and accomodation costs paid as well as free attendance at the Python conference and the associated ACCU conference. To submit a proposal, send an email message to duncan@rcp.co.uk by 2nd October 2002. In your message, please include the following: - Speaker name and affiliation - Contact address - Presentation title - A one paragraph abstract -- Duncan Booth duncan@dales.rmplc.co.uk int month(char *p){return(124864/((p[0]+p[1]- p[2]&0x1f)+1)%12)["\5\x8\3" "\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure? http://dales.rmplc.co.uk/Duncan