ctypes does not load .dll and generate windowsError 127

2014-05-13 Thread Ji Xia
Hi all, Could anybody help me out? I am trying to use python ctypes and load a .dll file. It works on my colleagues' machine, just does not work on mine Python on my machine is : python 2.7.6 OS: windows 7 Result is always: File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__

Re: Python development tools

2013-06-24 Thread Reed Xia
在 2013年6月24日星期一UTC+8上午4时40分07秒,cutems93写道: > Hello, > > > > I am new to python development and I want to know what kinds of tools people > use for python development. I went to Python website and found several tools. > > > > 1. Automated Refactoring Tools > > 2. Bug Tracking > > 3. Confi

Re: why i can't read sda1 with python?

2012-06-04 Thread Xia
#ls -l /dev/sda1 will print brw-r- 1 root disk ... so only root or accounts in group disk can access /dev/sda1, you could add the account into group disk with usermod, then re-login. On Sat, 2 Jun 2012 10:14:36 +0800 "水静流深" <1248283...@qq.com> wrote: > tiger@debian:~$ sudo fdisk -l > > Dis

Re: can not import hashlib

2010-09-14 Thread Xia, Zhen
Your python is compiled without md5. Maybe your system misses some libraries and you have to re-compile the python. On Wed, 15 Sep 2010 11:03:40 +0800 ch huang wrote: > i have a big problem,here is > and any can help me? > > Python 2.6.5 (r265:79063, Apr 1 2010, 05:22:20) > [GCC 4.4.3 201003

Re: favicon.ico problem

2010-08-09 Thread Xia, Zhen
where that name '/favicon.ico' comes from. Any insight into > this weird behavior would be greatly appreciated. > > Regards, > Nav > -- > http://mail.python.org/mailman/listinfo/python-list Your server just need to return an HTTP 404 response for this 'fav

copy construtor question

2009-08-28 Thread xiaosong xia
Hi all,   I am trying to define a class with copy constructor as following:   class test: def __init__(self, s=None):   self=s   x=[1,2]   y=test(x)   print y.__dict__   it gives {}   The above code doesn't work.   Questions are:   1. Can 'self ' be a class attribute? 2. How to make

Re: Convert PyIDispatch object to struct IDispatch*

2008-04-11 Thread Huayang Xia
On Apr 11, 9:47 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Huayang Xia wrote: > > On Apr 11, 12:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <[EMAIL PROTECTED]> > >> escr

Re: Convert PyIDispatch object to struct IDispatch*

2008-04-11 Thread Huayang Xia
On Apr 11, 12:15 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <[EMAIL PROTECTED]> > escribió: > > > I am trying to use ctypes to call dll functions. One of the functions > > requires argument &q

Convert PyIDispatch object to struct IDispatch*

2008-04-10 Thread Huayang Xia
I am trying to use ctypes to call dll functions. One of the functions requires argument "struct IDispatch* ". I do have a PyIDispatch object in python. How can I convert this "PyIDispatch object" to "struct IDispatch* "? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Huayang Xia
n 6 feb, 21:17, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Feb 6, 9:59 pm, "Luis M. Gonz�lez" <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 6, 6:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > > > > > > > >

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Huayang Xia
What's the difference between .NET DLL and normal C DLL? Do you mean after clr.AddReference('ClassLibrary1'), there is no need to import ClassLibrary1? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to use .NET DLL from Python

2008-02-06 Thread Huayang Xia
Or maybe we can do it in IronPython? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to use .NET DLL from Python

2008-02-06 Thread Huayang Xia
On Feb 6, 4:59 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Feb 6, 6:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > > > Hello All, > > > I have several .NET DLL (I have no source code for them), is there > > anyway to use them from pyt

Is there a way to use .NET DLL from Python

2008-02-06 Thread Huayang Xia
Hello All, I have several .NET DLL (I have no source code for them), is there anyway to use them from python instead of from C#. Thanks, Huayang -- http://mail.python.org/mailman/listinfo/python-list

PyPerforce: How to open file for editing

2008-01-24 Thread Huayang Xia
I'm completely new to pyperforce. I want to open a file (check out a file) for editing. How can I do it from PyPerforce? Another thing is how can I add files to my created label? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Memory Management in Embedded Python

2007-01-18 Thread Huayang Xia
Hi there, I have a piece of code like this: void funct(PyObject* pyobj) { char str[128]; strncpy(str, "just a test string", sizeof(str)); PyObject* pydata = PyObject_CallMethod(pyobj, "method_x", "s", str); Py_DECREF(pydata); } After the fu

Re: How to modify object attribute by python C API

2007-01-12 Thread Huayang Xia
re is no exception thrown (in C++) so that we can integrate the error handling. What is the best way(less code) to handle the error checking in normal practice? On Jan 11, 4:37 pm, "Huayang Xia" <[EMAIL PROTECTED]> wrote: > I get a python object by running a class' constructor

How to modify object attribute by python C API

2007-01-11 Thread Huayang Xia
I get a python object by running a class' constructor. Then I need to modify the instance's attribute just like obj.attr1.attr2 = 'a' if in python's term. PyObject* py_obj_attr1 = PyObject_GetAttrString(obj, "attr1"); PyObject_SetAttrString(py_obj_attr1, "attr2", PyString_FromString("a"));

Re: where to find the spec of format in PyObject_CallMethod

2007-01-10 Thread Huayang Xia
Thanks. I have mixed arguments. I found the format spec @ http://docs.python.org/api/arg-parsing.html On Jan 10, 5:31 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote: > > I am trying to use PyObject_CallMethod. It needs a f

where to find the spec of format in PyObject_CallMethod

2007-01-10 Thread Huayang Xia
I am trying to use PyObject_CallMethod. It needs a format string to specify what are the followed arguments. Is it possible to use a PyObject* as an argument? Where can I find the spec for the format? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: subclassing a module: misleading(?) error message

2007-01-04 Thread Huayang Xia
So you know you are subclassing a module. There is an answer @ http://www.velocityreviews.com/forums/showpost.php?p=1819038&postcount=2 On Jan 4, 3:49 pm, "Erik Johnson" wrote: > I ran into a problem I didn't understand at first. I got part of it figured > out. Let me first demonstrate the origi

Re: what is this?

2007-01-04 Thread Huayang Xia
Sequence slicing [starting-at-index : but-less-than-index [ : step]]. Start defaults to 0, end to len(sequence), step to 1. So l[i::rows] means: slicing start from i, ending with len(l) and step with rows. So function colsplit(l, cols) returns a list of sequence with conversion of: Assume cols =

Re: When Closure get external variable's value?

2006-12-19 Thread Huayang Xia
te. That was the reason I skipped it. On Dec 19, 4:14 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Huayang Xia a écrit : > > > I'm confused. What is the definition of closure. > > > I'm not sure if it's correct, I get the definition from wikipedia: &

Re: When Closure get external variable's value?

2006-12-19 Thread Huayang Xia
I'm confused. What is the definition of closure. I'm not sure if it's correct, I get the definition from wikipedia: "A closure typically comes about when one function is declared entirely within the body of another, and the inner function refers to local variables of the outer function. At runtim

Re: When Closure get external variable's value?

2006-12-19 Thread Huayang Xia
That is a really concise and precise answer. Thanks. So the object binding can only happen explicitly at the closure declaration argument list(non-free variable). On Dec 19, 10:37 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Huayang Xia wrote: > > When does the closure get t

Re: When Closure get external variable's value?

2006-12-19 Thread Huayang Xia
Thanks for the clarification. But my question is: When does the closure get the value of the maxIndex in the following code snippet? def testClosure(maxIndex) : def closureTest(): return maxIndex maxIndex += 5 return closureTest

Re: When Closure get external variable's value?

2006-12-18 Thread Huayang Xia
It will print 15. The closure gets the value at run time. Could we treat closure as part of the external function and it shares the local variable with its holder function? -- http://mail.python.org/mailman/listinfo/python-list

When Closure get external variable's value?

2006-12-18 Thread Huayang Xia
What will the following piece of code print? (10 or 15) def testClosure(maxIndex) : def closureTest(): return maxIndex maxIndex += 5 return closureTest() print testClosure(10) My question is when the closure function gets val

Security Descriptor and CoInitializeSecurity

2006-12-01 Thread Huayang Xia
I'd like to call pythoncom.CoInitializeSecurity with a PySecurityDescriptor object to set the process-wide security values. But I'm not able to find a way to let the code go through. I have read MSDN and searched web, I've not been able to find answer. I cooked a security descriptor like this (ass