Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Here is a summary of what I did with numpy and the dll I have verified that the values entering the last dll call (dl.cfunction) are identical across platforms. The c function has a signature as follows: int cfunction(int len_data, float* data, int* ac, int num_ac, int flag1, int

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
The c function has a signature as follows: int cfun(int len_data, float* data, int* a, int num_a, int flag1, int flag2, int flag3, float* param, float* out1, float* out2, float* out3) and in python: import numpy as np import ctypes as ct data = np.atleast_2d(np.float32(data

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Hello ChrisA, I don't quite understand, the binary shared library contains no python interfaces, it should be independent of python. As a matter of fact, I have successfully used it in Conda python 2.7, 3.5, Julialang as well as c++ executables. I think the fact that only stock python 2.7 faile

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Thanks for all the replies. It turned out that the Apple OS X stock python 2.7 gives the wrong results, but other distributions like 2.7 from miniconda gives the correct results. Facepalm. -- https://mail.python.org/mailman/listinfo/python-list

Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-22 Thread Siyi Deng
I have a dynamic library doing some numerical computations. I used ctypes to interact it by passing numpy arrays back and forth. Python 3.5 gives me the correct results. Python 2.7 gives me different, erroneous results, but it never crashes. How is this possible? There is no string operatio

How can I solve a equation like solve a function containint expressions like sqrt(log(x) - 1) = 2 and exp((log(x) - 1.5)**2 - 3) = 5

2011-08-27 Thread Xiong Deng
HI, Hi, I am trying to solve an equation containing both exp, log, erfc, and they may be embedded into each otherBut sympy cannot handle this, as shown below: >>> from sympy import solve, exp, log, pi >>>from sympy.mpmath import * >>>from sympy import Symbol >>>x=Symbol('x') >>>sigma = 4 >>>m

pickle.load() all dict

2010-05-15 Thread Yutao Deng
Hi all: I'm trying to learn to use Python wrote a applet to record every day doing. and i use the pickle pickle.dump something to file no problem i think. but pickle.load whith a problem. can not load all dict do my way that what i pickle.dump(). My code: import cPickle as pickle pickle_file

Hello everyone!

2009-04-20 Thread Yilong Deng
I'm a newby here, I love python very much. Is there any Chinese here?-- http://mail.python.org/mailman/listinfo/python-list

Re: Burrows-Wheeler (BWT) Algorithm in Python

2005-11-03 Thread DENG
thanks very much Michael i'll try your implementation, i hope i can improve it after i understand all the theory:) cheers -- http://mail.python.org/mailman/listinfo/python-list

Burrows-Wheeler (BWT) Algorithm in Python

2005-11-02 Thread DENG
Hi, all I've used Python Bz2 module for times and want to kown something about Burrows-Wheeler (BWT) algorithm, the Bz2 module is wrriten in C, is there a version in Python too? BWT http://gatekeeper.dec.com/pub/DEC/SRC/research-reports/abstracts/src-rr-124.html Python Bz2 module http://labix.org

socket.error: (32, 'Broken pipe'): need help

2005-10-27 Thread Junhua Deng (AL/EAB)
Hi, I have a simple server-client application with threading. It works fine when both server and client on the same machine, but I get the following error message if the server is on another machine: ... ... self.socket.send(outgoingMsg) socket.error: (32, 'Broken pipe') I do not know where

Re: HTML tags optimization [ interesting problem]

2005-09-02 Thread DENG
hi, Sybren, thanks for your reply, if use CSS: texttexttext optimise to: texttexttext what i need is the METHOD to do optimization, in fact, i have ready write a program to analyse the syntax of CSS, to make it works with all situation -- http://mail.python.org/mailman/listinfo/python-list

HTML tags optimization

2005-09-02 Thread DENG
hi all, i want to do some optimizations for HTML tags, something like this: TEXT1TEXT2 optimise to TEXT1TEXT2 at the very beginning, i was thinking of analysing each text-block, to know their color, size, if is bold or italic, but i found it was too complicated. e.g TEXT1 optimise to TEXT

Re: HTML tags optimization [ interesting problem]

2005-09-01 Thread DENG
I know very well Tidy, sir Tidy do a nice job but it is writen in Java, and have Python ported my aim is to learn Python, learn how to program I know many people write "hello the world" in 2005, why I can not write this program in 2005? you are french, right? peut etre we can talk about it in e

Re: HTML tags optimization [better learn CSS]

2005-09-01 Thread DENG
I know very well Tidy, sir Tidy do a nice job but it is writen in Java, and have Python ported my aim is to learn Python, learn how to program I know many people write "hello the world" in 2005, why I can not write this program in 2005? you are french, right? peut etre we can talk about it in e

HTML tags optimization [ interesting problem]

2005-08-31 Thread DENG
hi all, i use SGMLParser to process HTML files, in order to do some optimizations, something like this: TEXT1TEXT2 optimise to TEXT1TEXT2 at the very beginning, i was thinking of analysing each text-block, to know their color, size, if is bold or italic, but i found it was too complicated.

Re: how to join two Dictionary together?

2005-08-30 Thread DENG
thanks all!! update is very useful! -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join two Dictionary together?

2005-08-30 Thread DENG
yes, that's really what i want! the 2nd replace the 1st one' value! thanks so much King -- http://mail.python.org/mailman/listinfo/python-list

how to join two Dictionary together?

2005-08-30 Thread DENG
dict1={...something...} dict2={...somethind else ..} dict1 + dict2 that's does works ..:(, it's not like List... anyone can tell me how to get it? thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: python html

2005-08-20 Thread DENG
try this http://miex.tigris.org i wrote this for checking bad html, correct them and optimize them -- http://mail.python.org/mailman/listinfo/python-list

Re: how to execute Python in VIM

2005-03-07 Thread DENG
thanks Aaron i've changed that, but this time, even worse... when i press F5, the pop-up windows appears, and then, it disppears very quickly...(less than 1 second) i cant see anything~ :( -- http://mail.python.org/mailman/listinfo/python-list

Re: how to execute Python in VIM

2005-03-05 Thread DENG
ok i find it map :!d:\python24\python.exe % but it comes with a new pop-up windowsdame~ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to execute Python in VIM

2005-03-05 Thread DENG
i change the path autocmd FileType python setlocal makeprg=\"d:\\Python24\\python.exe\"\ autocmd BufNewFile,BufRead test*.py setlocal makeprg=\"d:\\Python24\\python.exe\"\ % -- http://mail.python.org/mailman/listinfo/python-list

how to execute Python in VIM

2005-03-05 Thread DENG
hi, im a newbie to VIM(gVIM under WINXP), i want to execute python in vim like press F5 in SciTE. i try to search in google and config as follows in my _vimrc: --- map :D:\python24\python.exe % if has("autocmd") autocmd FileType python

Share your SciTEGlobal.properties pls~~~~

2005-02-28 Thread DENG
hi, im new to Python, i chose SciTE as my Python editor. but the problem is SciTE needs to be config carefully, are there anyone use SciTE too? can you share your SciTEGlobal.properties file? black background solution is prefered:) thanks in advance best regards -- http://mail.python.org/mailma

Share your SciTEGlobal.properties pls~~~~

2005-02-28 Thread DENG
hi, im new to Python, i chose SciTE as my Python editor. but the problem is SciTE needs to be config carefully, are there anyone use SciTE too? can you share your SciTEGlobal.properties file? black background solution is prefered:) thanks in advance best regards -- http://mail.python.org/mailma