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.
har* serviceName)
{
//case 1 :
//This works fine
createService(methodname);
//case 2
//This will not working,
InvocationCallback serviceCallback;
createService(methodname, &serviceCallback);
}
On Mon, Jan 22, 2018 at 5:58 PM, Jason Qian wrote:
> Thank
ponse ---')
print(message)
print(code)
class GSPythonDriver(object):
def submif(self,methodname)
invm_fn = InvocationCB(handleResponse)
lib.submit(self.obj,methodname,invm_fn)
How can I do this on the Linux ?
Thanks for the help
Jason
--
https://mail.python.org/mailman/listinfo/python-list
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
Figured it out,
Thanks
On Wed, Jan 24, 2018 at 4:25 PM, Jason Qian wrote:
> Again, thanks for the help. Everything is working fine after the changes.
>
> Here is one more new issue needs some help.
>
> On c side,
>
>The createService function can pass a callb
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
, 2018 at 3:15 PM, Jason Qian 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 print as :
>
> [Ljava.lang.Object; does not exist
> tat com.live
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
>>
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
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
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
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 :
>
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
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 :)
>
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
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 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
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,
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 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
_int, ctypes.POINTER()]
In the c code:
int func (void* obj, int index, char** opt)
Thanks
Jason
--
https://mail.python.org/mailman/listinfo/python-list
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
Import_Import*(pName);
Py_DECREF(pName);
if (pModule == NULL) {
if (*PyErr_Occurred*()) {
handleError("PyImport_Import()");
}
}
}
void handleError(const char* msg)
{
...
"PyImport_Import() - ImportError('Error: Reinit is forbidden')"
}
String(str_value, "utf-8",
"Error ~");
const char **strErrValue* = PyBytes_AS_STRING(pyExcValueStr);
//where *strErrValue* = "ImportError('Error: Reinit is forbidden')"
...
}
What we imported is a Python file which import some pyd libraries.
Thanks
Jason
This gives the expected results:
with open(data_file, newline="") as reader:
csvreader = csv.DictReader(reader)
for row in csvreader:
#print(row)
match row[RULE_TYPE]:
case "RANGE":
print("range")
case "MANDATORY":
print("mandatory")
case _:
print("nothing to do")
This:
RANGE = "RANGE"
MANDATORY
3 at 6:01 PM Greg Ewing via Python-list <
python-list@python.org> wrote:
> On 8/06/23 10:18 am, Jason Friedman wrote:
> > SyntaxError: name capture 'RANGE' makes remaining patterns unreachable
>
> The bytecode compiler doesn't know that you intend RANGE
> to be
I'm writing a database connectivity module to be used by other modules and
leveraging the jaydebeapi module.
>From what I can tell jaydebeapi contains no built-in timeout capability, so
then I turned to https://pypi.org/project/timeout-decorator/.
My goal is to have a default timeout of, say, 10 se
import inspect
def my_example(arg1, arg2):
print(inspect.stack()[0][3])
my_frame = inspect.currentframe()
args,_,_,values = inspect.getargvalues(my_frame)
args_rendered = [f"{x}: {values[x]}" for x in args]
print(args_rendered)
my_example("a", 1)
The above "works" in the sense it prints what I
> My question is: let's say I wanted to add a type hint for my_frame.
> >
> > my_frame: some_class_name = inspect.currentframe()
> >
> > What would I put for some_class_name?
> > "frame" (without quotations) is not recognized,
> > Nor is inspect.frame.
>
> We know Python code is executed in an exec
>
> Jason Friedman wrote at 2023-8-3 21:34 -0600:
> > ...
> >my_frame = inspect.currentframe()
> > ...
> >My question is: let's say I wanted to add a type hint for my_frame.
>
> `my_frame` will be an instance of `Types.FrameType`.
>
Confirmed. Th
I want to be able to write code like this:
with Database() as mydb:
conn = mydb.get_connection()
cursor = conn.get_cursor()
cursor.execute("update table1 set x = 1 where y = 2")
cursor.close()
cursor = conn.get_cursor()
cursor.execute("update table2 set a = 1 where b = 2")
cursor.close()
I'd like
I have two questions, please (this is after reading
https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#automatically-label-sections
).
This is my project structure:
my_project
api
stuff1.py
stuff2.py
lib
stuff3.py
stuff4.py
main_application.py
>
> def construct_response(exit_code: int, message: str) -> Response:
> """
> Construct a Flask-suitable response
>
> :param exit_code: 0 or something else
> :param message: something useful
> :return: a Flask-suitable response
> """
>
>
> @app.route(f"/{version}/", methods=
And I can answer my own Question 2:
:func:`my_project.main_application.construct_response`
On Mon, Aug 28, 2023 at 1:39 PM Jason Friedman wrote:
> def construct_response(exit_code: int, message: str) -> Response:
>> """
>> Construct a Flask-suitable re
def construct_response(exit_code: int, message: str) -> Response:
>> """
>> Construct a Flask-suitable response
>>
>> :param exit_code: 0 or something else
>> :param message: something useful
>> :return: a Flask-suitable response
>> """
>>
>>
>> @app.route(f"/{version}/", me
On Sun, Nov 5, 2023 at 1:23 PM office officce via Python-list <
python-list@python.org> wrote:
> which python version is better to be used and how to make sure it works on
> my window 10 because i downloaded it and it never worked so I uninstall to
> do that again please can you give me the steps
stem codec
ModuleNotFoundError: No module named 'encodings'
Thanks for the help
Jason
--
https://mail.python.org/mailman/listinfo/python-list
, 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
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
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,
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
On Wed, Aug 21, 2024 at 4:04 PM Daniel via Python-list <
python-list@python.org> wrote:
>
> An example of use, here's a weather service tied to a finger. Put your
> city name as the user. This isn't mine, but it is inspiring. Example:
>
> finger mi...@graph.no
>
> For all options, go to the help f
This question concerns my process of creating Swift Linux from the
base distro (antiX Linux in the past, Linux Mint Debian Edition now).
(NOTE: The process I'm describing here is an oversimplification.)
All of my development work takes place in the ~/develop directory.
This is the directory where
>
> (a) An error-prone "feature" is returning -1 if a substring is not found
> by "find", since -1 currently refers to the last item. An example:
>
> >>> s = 'qwertyuiop'
> >>> s[s.find('r')]
> 'r'
> >>> s[s.find('p')]
> 'p'
> >>> s[s.find('a')]
> 'p'
> >>>
>
> If "find" is unsuccessful, an er
🙏
On Tue, Dec 3, 2024 at 5:06 PM Thomas Wouters via Python-list <
python-list@python.org> wrote:
> Another big release day! Python 3.13.1 and 3.12.8 were regularly scheduled
> releases, but they do contain a few security fixes. That makes it a nice
> time to release the security-fix-only versions
>
> Trying to compile Python-3.12.9 on Ubuntu-24.04
>
> The compilation is complete without errors but I have this message:
>
>
> The necessary bits to build these optional modules were not foun
On 22/05/2025 20:59, Michael F. Stemper wrote:
I recently wrote a program to do some record-keeping for me. I found
myself hard-coding a bunch of different values into it. This didn't
seem right, so I made my first use of configparser.ConfigParser().
Created the configuration file and everything
1001 - 1047 of 1047 matches
Mail list logo