On Thu, May 18, 2023 at 3:53 AM Barry wrote:
>
>
> > On 17 May 2023, at 20:35, Jason Qian via Python-list <
> python-list@python.org> wrote:
> >
> > Hi,
> >
> > I Need some of your help.
> >
> > I have the following C code to impor
Hi,
I Need some of your help.
I have the following C code to import *Import python.* It works 99% of
the time, but sometimes receives "*ImportError('Error: Reinit is
forbidden')*". error.
**We run multiple instances of the app parallelly.
*** Python version(3.7.0 (v3.7.0:1bf9cc5093, Ju
Awesome, thanks!
On Thu, May 11, 2023 at 1:47 PM Eryk Sun wrote:
> On 5/11/23, Jason Qian via Python-list wrote:
> >
> > in the Python, I have a array of string
> > var_array=["Opt1=DG","Opt1=DG2"]
> > I need to call c library and pass var_arra
Hi,
Need some help,
in the Python, I have a array of string
var_array=["Opt1=DG","Opt1=DG2"]
I need to call c library and pass var_array as parameter
In the argtypes, how do I set up ctypes.POINTER(???) for var_array?
func.argtypes=[ctypes.c_void_p,ctypes.c_int, ctypes.POINTER()]
I
Hey,
Someone has discussed this issue before. Other than redirect stderr, does
the new version python 3.7.0 has other way to retrieve the string
whichPyErr_Print( ) ?
if (PyErr_Occurred())
PyErr_Print(); //need to retrieve the error to string
Thanks
--
https://mail.python.org/mailman/listi
Thanks a lot.
On Thu, Sep 13, 2018 at 5:24 PM, MRAB wrote:
> On 2018-09-13 21:50, Jason Qian via Python-list wrote:
>
>> Hey,
>>
>> Need some help on PyList.
>>
>>
>> #get path
>> PyObject *path = PyObject_GetAttrString(sys, &q
Hey,
Need some help on PyList.
#get path
PyObject *path = PyObject_GetAttrString(sys, "path");
#new user path
PyObject* newPath = PyUnicode_DecodeUTF8(userPath, strlen( userPath ),
errors);
#append newPath to path
PyList_Append(path, newPath);
How to check if the newPath is already in the pa
, Thomas Jollans wrote:
> On 09/06/2018 09:46 PM, Jason Qian via Python-list wrote:
>
>> Hi
>>
>> Need some help.
>>
>> I have a C++ application that invokes Python.
>>
>> ...
>> Py_SetPythonHome("python_path");
>>
>
> This
Hi
Need some help.
I have a C++ application that invokes Python.
...
Py_SetPythonHome("python_path");
Py_Initialize();
This works fine on Python 3.6.4 version, but got errors on Python 3.7.0
when calling Py_Initialize(),
Fatal Python error: initfsencoding: unable to load the file system codec
Thanks Chris,
I think I figured it out that when build python on Linux, we need to
enable-shared.
Thanks again,
On Mon, Feb 19, 2018 at 5:04 PM, Chris Angelico wrote:
> On Tue, Feb 20, 2018 at 8:07 AM, Jason Qian via Python-list
> wrote:
> > Hi,
> >
> > I am
Hi,
I am calling python from a c application.
It compiles and works fine on the windows. How do I compile and link
it on the linux for Python 3.6.4 ?
Under python dir, it only have a static library,
/opt/Python-3.6.4*/lib*/*libpython3.6m.a*
* If I link to it, I g
Thanks a lot and I will take a look Cython,
On Mon, Feb 19, 2018 at 3:23 PM, Stefan Behnel wrote:
> Jason Qian via Python-list schrieb am 04.02.2018 um 17:52:
> >This is the case of calling python from c and the python function
> will
> > return a string.
>
> Hi J
Hi,
This only works when loading modules from the current directory.
Is there a way I can load from somewhere else ?
Thanks for help,
--
https://mail.python.org/mailman/listinfo/python-list
Hi Chris,
Thanks a lot ! Using PyUnicode_DecodeUTF8 fix the problem.
On Sun, Feb 4, 2018 at 12:02 PM, Chris Angelico wrote:
> On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list
> wrote:
> > Hi,
> >
> >This is the case of calling python from c and th
Hi,
This is the case of calling python from c and the python function will
return a string.
It seems python been called correctly, but got error when convert the
python string to c string.
-- c --
PyObject* pValue = PyObject_CallObject(pFunc, pArgs);
-- python --
import string, ran
The message type is bytes, this may make different ?
print(type(message))
On Sun, Jan 28, 2018 at 8:41 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote:
>
> > Thanks a lot :)
>
Thanks Peter,
replace print with os.write fixed the problem.
On Sun, Jan 28, 2018 at 3:57 AM, Peter Otten <__pete...@web.de> wrote:
> Jason Qian via Python-list wrote:
>
> > HI
> >
> >I have a string that contains \r\n\t
> >
> >[L
Thanks a lot :)
os.write(1, message) works !
On Sun, Jan 28, 2018 at 8:04 PM, Dan Stromberg wrote:
> How about:
> >>> os.write(1, message)
>
> On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list
> wrote:
> > print(repr(message)) out :
>
99 c
%d %c 111 o
%d %c 109 m
On Sun, Jan 28, 2018 at 9:50 AM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Sat, 27 Jan 2018 21:23:02 -0500, Jason Qian via Python-list wrote:
>
> > there are 0D 0A 09
>
> If your string actually contains CARRIAGE
there are 0D 0A 09
%c %d 116
*%c %d 13%c %d 10%c %d
9*
%c %d 97
On Sat, Jan 27, 2018 at 9:05 PM, Dennis Lee Bieber
wrote:
> On Sat, 27 Jan 2018 20:33:58 -0500, Jason Qian via Python-list
> declaimed the following:
>
> > Ljava.lang.Object; does not exis
Reedy wrote:
> On 1/27/2018 3:15 PM, Jason Qian via Python-list wrote:
>
>> HI
>>
>> I am a string that contains \r\n\t
>>
>> [Ljava.lang.Object; does not exist*\r\n\t*at
>> com.livecluster.core.tasklet
>>
>>
>> I would like it p
st*\r\n\t*at com
Thanks
On Sat, Jan 27, 2018 at 4:20 PM, Ned Batchelder
wrote:
> On 1/27/18 3:15 PM, Jason Qian via Python-list wrote:
>
>> HI
>>
>> I am a string that contains \r\n\t
>>
>> [Ljava.lang.Object; does not exist*\r\n\t*at
>>
HI
I have a string that contains \r\n\t
[Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet
I would like to print it as :
[Ljava.lang.Object; does not exist
tat com.livecluster.core.tasklet
How can I do this in python print ?
Thanks
On Sat, Jan 27, 20
HI
I am a string that contains \r\n\t
[Ljava.lang.Object; does not exist*\r\n\t*at com.livecluster.core.tasklet
I would like it print as :
[Ljava.lang.Object; does not exist
tat com.livecluster.core.tasklet
--
https://mail.python.org/mailman/listinfo/python-list
58 PM, Jason Qian wrote:
>
>> Thanks you very much, fixed the problem :)
>>
>> On Mon, Jan 22, 2018 at 4:28 PM, Random832
>> wrote:
>>
>>> On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote:
>>> > Hello!
>>> >
>&g
HI Dennis,
Thanks for the help, After changing WINFUNCTYPE to CFUNCTYPE, the call
back function works on the Linux :)
Thanks again,
Jason
On Wed, Jan 24, 2018 at 6:15 PM, Dennis Lee Bieber
wrote:
> On Wed, 24 Jan 2018 17:16:22 -0500, Jason Qian via Python-list
> declaim
Hi,
I have following code that works fine on windows.
InvocationCB=WINFUNCTYPE(None, c_char_p, c_int)
submit = lib.submit
submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB]
submit.restype = ctypes.c_int
def handleResponse(message, code):
print('--- handleResponse ---')
prin
s you very much, fixed the problem :)
>
> On Mon, Jan 22, 2018 at 4:28 PM, Random832 wrote:
>
>> On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote:
>> > Hello!
>> >
>> > I am using ctypes on Windows to interface with a dll and it works
&
Thanks for the help,
Jason
On Mon, Jan 22, 2018 at 5:41 PM, eryk sun wrote:
> On Mon, Jan 22, 2018 at 9:00 PM, Jason Qian via Python-list
> wrote:
> >
> > I am using ctypes on Windows to interface with a dll and it works fine
> > on Linux and windows 32-bit python.
Thanks you very much, fixed the problem :)
On Mon, Jan 22, 2018 at 4:28 PM, Random832 wrote:
> On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote:
> > Hello!
> >
> > I am using ctypes on Windows to interface with a dll and it works fine
> > on Linu
Hello!
I am using ctypes on Windows to interface with a dll and it works fine
on Linux and windows 32-bit python. But, when using 64-bit python, we got
error "exception: access violation writing 0x99222A60".
Checking our server, it seems work without any problem. but the python
gi
31 matches
Mail list logo