Re:

2019-05-29 Thread Bo YU
On Wed, May 29, 2019 at 1:19 PM Sri Tharun wrote: > Why I am unable to install packages > If you really want to get help from the list,please give us more info. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.7 for all users on SLES 11

2016-08-05 Thread Bo Stone
On Thursday, August 4, 2016 at 8:54:35 PM UTC-7, Bo Stone wrote: > I installed Python 2.7 on SLES 11 box that previously was running Python 2.6. > To do so I used a script described in this post > (http://stackoverflow.com/a/11371726/135946) and run it as a root user. > Everything w

Installing Python 2.7 for all users on SLES 11

2016-08-04 Thread Bo Stone
I installed Python 2.7 on SLES 11 box that previously was running Python 2.6. To do so I used a script described in this post (http://stackoverflow.com/a/11371726/135946) and run it as a root user. Everything went well but when it was done I discovered few issues: 1. No symbolic links were crea

How can I add space in to several numbers?

2009-03-02 Thread Bo Zhang
I want to parse a file and do this : A 74.335 -86.474-129.317 1.00 54.12 then add space between -86.474 and -129.317. I can get the file with A 74.335 -86.474 -129.317 1.00 54.12 How can I do this? Thanks. -- Best regards, Zhang Bo (Cindy) SMA-CSB -- http://mail.python.org

help

2008-05-30 Thread ha bo
hi i wanna paginate my table (x lines per pages),the size of my table is changing according to the user. i wanna know if paginator.py can help me ,if yes how? some one can help me ps:i use django thank you _ Découvrez Windows Live

RE: unpack

2008-04-11 Thread ha bo
-> 3.0 3.6 -> 4.0 3.5 -> 4.0 2.5 -> 2.0 -0.5 -> 0.0 -1.5 -> -2.0 -1.3 -> -1.0 -1.8 -> -2.0 -2.5 -> -2.0 --Pièce jointe du message transmise-- From: [EMAIL PROTECTED] To: python-list@python.org Date: Fri, 11 Apr 2008 09:07:42 -0400 Subject: Re: (unknown) ha bo wrote: >

[no subject]

2008-04-11 Thread ha bo
hi i use this programme in my application django: import structMASK_CCITT = 0x1021 # CRC-CCITT mask (ISO 3309, used in X25, HDLC)MASK_CRC16 = 0xA001 # CRC16 mask (used in ARC files)def updcrc(crc, data, mask=MASK_CRC16): data_length = len(data) unpackFormat = '%db' % data_lengt

How to port Python code into C++ code automatically?

2008-03-12 Thread Bo
I want to port a Python project (about 10,000 line python code) to C+ +. Is there any automatically tool to do this kind of things? e.g., SWIG(http://www.swig.org/)? Any comment is welcome! Thanks! -- http://mail.python.org/mailman/listinfo/python-list

step through .py file in a .NET application written in C# in Visual Studio

2007-08-06 Thread Bo
rough it to debug it. Any suggestions on how to do it? Thanks a bunch. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Watch folder for new file and execute extern program

2007-02-07 Thread Michael Bo
> BTW-It helps us out here if you let us know what platform you > are running on (e.g. Windows, Linux, Mac, etc.). > > -Larry Sorry... I'm running on windows XP. - Michael -- http://mail.python.org/mailman/listinfo/python-list

Watch folder for new file and execute extern program

2007-02-05 Thread Michael Bo
Hi. Can anyone guide me on how to minitor a folder for new files? And when they appear I need to run and externe program with the file just created (buy a 3rd program). - Michael Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to distribute an additional DLL to site-packages?

2006-12-22 Thread Bo Peng
ever necesary, usually all distutils commands > operate on relative paths (relative to location of setup.py for source > files, relative to some meaningful directory for targets). I read that page but I am not using package so things are installed to site-packages directly. What should I put

Re: How to distribute an additional DLL to site-packages?

2006-12-22 Thread Bo Peng
> directory. After all, this directory is configurable. So nobody has ever done this??? Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Building python C++ extension modules using MS VC++ 2005?

2006-12-22 Thread Bo Peng
t how exactly should I do it? I installed VC8 and get the all-familiar error message: Python was built with Visual Stuidio 2003 Actually, I get a copy of VC6/2003 but this compiler can not compile boost 1.33.1/serialization so it can not be used to compile my extension module. Bo -- http://mail.python.org/mailman/listinfo/python-list

Building python C++ extension modules using MS VC++ 2005?

2006-12-21 Thread Bo Peng
... (http://msdn2.microsoft.com/en-us/visualc/aa336490.aspx) Can I use the 2005 version to build python extension? What is the official or recommended way to build python extension module under windows? Many thank in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

How to distribute an additional DLL to site-packages?

2006-12-21 Thread Bo Peng
directory. After all, this directory is configurable. I guess I need to determine /path/to/site-package for setup( ... ext_modules = [...] data_files = [ ('/path/to/site-package', ['mydll.dll]) ] ) using something like distutil.config.get_dest_dir(). Many thanks

Re: How to download a web page just like a web browser do ?

2006-08-24 Thread Bo Yang
Thank you , Max ! I think HarvestMan is just what I need ! Thanks again ! -- http://mail.python.org/mailman/listinfo/python-list

How to download a web page just like a web browser do ?

2006-08-23 Thread Bo Yang
such as text findings and substitutions . Thanks in advance ! Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: pickling or xml or other?

2006-08-20 Thread Bo
You could use a python file and use the builtin import facility to read in configurations. from http://dirtsimple.org/2004/12/python-is-not-java.html ... in Python, more often than not, code is easier to write than XML. And Python can process code much, much faster than your code can proc

How do you use this list ?

2006-06-27 Thread Bo Yang
Hi everyone , I have join this list for about 4 months , and everyday I receive hundreds of mails . There is no means to read all of them , so I just read something interesting for me . But if so , there are too much mails pile up in my inbox , I want to ask how do you use this list , reading every

Re: Python or Ajax?

2006-06-12 Thread Bo Yang
I think if you know java language very well but feel suffering with the error prone javascript , GWT is good choose for AJAX development . With the well-known IDE Eclipse your development time efficiency will promote fast ! -- http://mail.python.org/mailman/listinfo/python-list

Re: An error ?

2006-06-12 Thread Bo Yang
It works , thank you everyone ! I think there is much more I need to learn before I can grasp a full understand of the C/S modle ! Thanks again ! -- http://mail.python.org/mailman/listinfo/python-list

An error ?

2006-06-11 Thread Bo Yang
Hi , I am confronted with an odd question in the python cgi module ! Below is my code : import cgitb ; cgitb.enable() import cgi print "Hello World !" How easy the script is , and the url is 202.113.239.51/vote/cgi/a.py but apache give me a 'Server internal error !' and the error log is : [Fr

Re: An algorithm problem

2006-05-31 Thread Bo Yang
ke it as a ring , and fetch any continuous 2 numbers from it , finally get four combinations : 11 , 10 , 00 , 01 and they are 3 , 2 , 0 , 1 . I hope this time it is clear for all to understand what problem confront me . And again I am sorry for the trouble , thanks for you again ! Best Rega

Re: An algorithm problem

2006-05-31 Thread Bo Yang
as a ring , and fetch any continuous 2 numbers from it , finally get four combinations : 11 , 10 , 00 , 01 and they are 3 , 2 , 0 , 1 . I hope this time it is clear for all to understand what problem confront me . And again I am sorry for the trouble , thanks for you again ! Best Regard Bo

An algorithm problem

2006-05-30 Thread Bo Yang
Hi , I have writen a python program to slove a problem described as below: (Forgive my poor English !) Put the 2^n 0 or 1 to form a ring , and we can select any continuous n ones from the ring to constitute a binary number . And obviously we can get 2^n selections , so the question is : Given a n

Re: reusing parts of a string in RE matches?

2006-05-10 Thread Bo Yang
John Salerno 写道: > I probably should find an RE group to post to, but my news server at > work doesn't seem to have one, so I apologize. But this is in Python > anyway :) > > So my question is, how can find all occurrences of a pattern in a > string, including overlapping matches? I figure it ha

Re: Python distutil: build libraries before modules

2006-05-01 Thread Bo Peng
Bo Peng wrote: > How can I let setup.py build these boost libraries separately so that I > can link them to my modules? This will also save some link time because > all my python modules link to the same boost libraries. Although this is nowhere documented, I find that I can

Python distutil: build libraries before modules

2006-05-01 Thread Bo Peng
thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a Dynamic Library (libpython.so) for Python 2.4.3 Final

2006-04-26 Thread Bo Gus
In article <[EMAIL PROTECTED]>, Andrew MacIntyre <[EMAIL PROTECTED]> wrote: > Dean wrote: > > I've been trying to make python a dynamic library. I downloaded Python > > 2.4.3 Final from the Python web site and I cannot get it to create the > > library. > > > > I've tried using the directive: >

Re: Kross - Start of a Unified Scripting Approach

2006-04-15 Thread Bo Yang
RM 写道: > This is from the new KOffice Announcement. > > http://www.koffice.org/announcements/announce-1.5.php > > '''This version of KOffice features a start of a unified scripting > solution called Kross. Kross provides cross-language support for > scripting (thus its name) and at present supports

Re: A question about the urllib2 ?

2006-04-14 Thread Bo Yang
Serge Orlov 写道: > Bo Yang wrote: > >> Hi , >> Recently I use python's urllib2 write a small script to login our >> university gateway . >> Usually , I must login into the gateway in order to surf the web . So , >> every time I >> start my co

Re: A question about the urllib2 ?

2006-04-12 Thread Bo Yang
Fuzzyman 写道: > Bo Yang wrote: > >> Hi , >> Recently I use python's urllib2 write a small script to login our >> university gateway . >> Usually , I must login into the gateway in order to surf the web . So , >> every time I >> start my computer ,

A question about the urllib2 ?

2006-04-11 Thread Bo Yang
Hi , Recently I use python's urllib2 write a small script to login our university gateway . Usually , I must login into the gateway in order to surf the web . So , every time I start my computer , it is my first thing to do that open a browser to login the gateway ! So , I decide to write such a s

How can I get the text under the cusor ?

2006-04-06 Thread Bo Yang
Hello , I want to develop an application to record some of the best words and ideas in the web when I surfing with the Firefox or IE . I would like the application have such a GUI : 1.it appear in the system tray area in the Windows ; 2.whenever I select some words (ether in an IE or MS word),I hop

Re: Learning different languages

2006-03-08 Thread Bo Yang
Rich said : > Hi, > > (this is a probably a bit OT here, but comp.lang seems rather > desolated, so I'm not sure I would get an answer there. And right now > I'm in the middle of learning Python anyway so...) > > Anyway, my question is: what experience you people have with working > with different

Re: Suggestions for documentation generation?

2006-03-04 Thread Bo Peng
cstring 4. insert the docstring into SWIG interface file I can send you the parser but I do not know if pyrex support python docstring. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: do design patterns still apply with Python?

2006-03-04 Thread Bo Yang
Paul Novak : > A lot of the complexity of design patterns in Java falls away in > Python, mainly because of the flexibility you get with dynamic typing. > I agree with this very much ! In java or C++ or all such static typing and compiled languages , the type is fixed on in the compile phrase ,

Re: do design patterns still apply with Python?

2006-03-04 Thread Bo Yang
Paul Novak 写道: > A lot of the complexity of design patterns in Java falls away in > Python, mainly because of the flexibility you get with dynamic typing. > I agree with this very much ! In java or C++ or all such static typing and compiled languages , the type is fixed on in the compile phrase ,

Re: Module written in C does not repond to Ctrl-C interruption.

2006-02-24 Thread Bo Peng
table way to do it (max, win32). Does anybody know a quick way under windows? Bo -- http://mail.python.org/mailman/listinfo/python-list

Module written in C does not repond to Ctrl-C interruption.

2006-02-24 Thread Bo Peng
interruption. I have to kill python explicitly. If this is a known behavior or just a special case of mine? Any fix to it? I am using python 2.3.4 under Redhat EL4 with gcc 3.3.4. Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

make a class instance from a string ?

2006-02-23 Thread Bo Yang
Hi, I know in java , we can use class.ForName("classname") to get an instance of the class 'classname' from a string , in python , how do I do that ? Thanks in advance ! -- http://mail.python.org/mailman/listinfo/python-list

Re: How many web framework for python ?

2006-02-18 Thread Bo Yang
Thank you very much ! -- http://mail.python.org/mailman/listinfo/python-list

How many web framework for python ?

2006-02-17 Thread Bo Yang
Hello everybody , I am a student major in software engeering . I need to do something for my course . There are very good web framework for java and ruby , Is there one for python ? I want to write a web framework for python based on mod_python as my course homework , could you give some advise ?

Start a python interactive shell from python.

2006-01-26 Thread Bo Peng
e use raw_input and eval but I will lose the convenience of a real shell. Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Start a python interactive shell from python.

2006-01-26 Thread Bo Peng
I think I find what I need: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355319 Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to profile underlying C++ code?

2006-01-25 Thread Bo Peng
am out of idea how to fix it since the nature of my algorithm is working randomly on large arrays. Cheers, Bo -- http://mail.python.org/mailman/listinfo/python-list

Is there a way to profile underlying C++ code?

2006-01-24 Thread Bo Peng
advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does Rpy/R-plot work under PythonWin, but not under commandline/IDLE?

2006-01-08 Thread Bo Peng
Bo Peng wrote: > Does anyone know why commandline/IDLE cause this > problem, while PythonWin does not? I am interested to know what I can do > in commandline (or in rpy) to fix this problem. Just note that R/plot works fine both from command window and a R-GUI. Bo -- http://mail.p

Why does Rpy/R-plot work under PythonWin, but not under commandline/IDLE?

2006-01-08 Thread Bo Peng
w why commandline/IDLE cause this problem, while PythonWin does not? I am interested to know what I can do in commandline (or in rpy) to fix this problem. Regards, Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird memory consumption problem.

2005-12-20 Thread Bo Peng
Bo Peng wrote: >> Sorry, are you saying that the code you posted does NOT have a memory >> leak, but you want us to find the memory leak in your real code sight >> unseen? Problem found. It is hidden in a utility function that converts the return value to a double. The re

Re: Weird memory consumption problem.

2005-12-20 Thread Bo Peng
out why val[0], readonly access to a tuple element, can cause this kind of problem. Anyway, is there a way to list all or newly added python objects? I guess I can trace the ref_cnt of the tuple element manually. Bo -- http://mail.python.org/mailman/listinfo/python-list

Weird memory consumption problem.

2005-12-19 Thread Bo Peng
Dear list, I spent the last 12 hours in catching this bug (?) and what I found out is very difficult to explain: Basically, I need to call a user-provided function many times, with a tuple as parameter. C/C++ side: (class A, constructed using a python function m_func) // create in the con

Re: Testing the availability of a module

2005-12-19 Thread Bo Peng
e('Tkinter'): tkGUI() else: cml() After a user loads this module (without wx loaded automatically as before), he can call cml() or GUI(). Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing the availability of a module

2005-12-19 Thread Bo Peng
Peter Hansen wrote: > Bo Peng wrote: > >> Is there a better way than doing >> >> try: >>import aModule >> except: >>has_aModule = False >> else: >>has_aModule = True >> >> The main concern here is that loading aModule i

Testing the availability of a module

2005-12-19 Thread Bo Peng
Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest.assertRaise and keyword arguments?

2005-12-02 Thread Bo Peng
; > Or you can always do something like: > > self.assertRaises(ValueError, lambda: myfunc(arg1,arg2, arg3, arg4, abc=0, > foo=1, bar="hello")) This is also useful. I now have nothing to complain against assertTaises. :-) Bo -- http://mail.python.org/mailman/listinfo/python-list

unittest.assertRaise and keyword arguments?

2005-12-02 Thread Bo Peng
ept? Thanks. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
Fredrik Lundh wrote: > replacing sys.stdin with something that isn't a TTY will fix this. This works like magic! Thank you! Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
; you > want. This method works fine with only one minor problem. It would stop (waiting for user input) at help(str) command. I will have to find a way to feed the program with'q' etc. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
e + "\n" > co = code.compile_command(script, "", "exec") > if co: > # got a complete statement. execute it! > exec co > script = "" > prompt = ">>>" > else: >

How to obtain a 'interactive session' of a script?

2005-09-18 Thread Bo Peng
script. Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-19 Thread Bo Peng
es not look so bad in this case. Thanks. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Bo Peng
many of these things do you have? I have around 10 of them. Using these if/else, it will take 50 lines for a function call. It also bothers me to have 10 variables left in the namespace, in addition to finding 10 meaningful names. The FAQ provides two solutions, neither of them are el

Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Bo Peng
Python? BTW, I do not want to use the following since all of a,b,c,d etc will be evaluated. def condValue(cond, val1,val2): if cond: return val1 else: return val2 func(condValue(cond1,a,b), condValue(cond2,c,d),...) Thanks. Bo -- http://mail.python.org/mailman/listinfo/python

Re: control precision for str(obj) output?

2005-05-04 Thread Bo Peng
;, but they don't > explain why str([x]) != '[%s]' % x . > I am new to Python but has experience with other languages. I am quite aware of 'why-are-floating-point-calculations-so-inaccurate'. I would not be surprised if >>> str[0.0002) 0.00020

Re: control precision for str(obj) output?

2005-05-03 Thread Bo Peng
As a matter of fact, this python list is the most friendly mailinglist I have ever joined. Thanks! Bo -- http://mail.python.org/mailman/listinfo/python-list

control precision for str(obj) output?

2005-05-03 Thread Bo Peng
r([0.0002]) '[0.00020001]' >>> str(0.0002) '0.0002' Is there any way to fix this, other than checking the type of everything and output with %.4f? Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass parameter when importing a module?

2005-03-20 Thread Bo Peng
r myModule. Since wxPython uses this method, I suppose this is the standard approach for this problem. Thanks. Bo -- http://mail.python.org/mailman/listinfo/python-list

How to pass parameter when importing a module?

2005-03-20 Thread Bo Peng
>>> import param >>> param.setParam('lib','standard') >>> from myModule import * in myModule.py -- from param import para try: lib = para['lib'] except: lib = 'standard' ... Is there an establish

Re: parameter name conflict. How to solve?

2005-03-08 Thread Bo Peng
Kent Johnson wrote: Bo Peng wrote: def func(output=''): output(output=output) Naturally, I get 'str' object is not callable. Is there a way to tell func that the first output is actually a function? (like in C++, ::output(output) ) You could use a default argum

Re: parameter name conflict. How to solve?

2005-03-08 Thread Bo Peng
function may cause confusion. Bo -- http://mail.python.org/mailman/listinfo/python-list

parameter name conflict. How to solve?

2005-03-07 Thread Bo Peng
n keyword parameter output def func(output=''): output(output=output) Naturally, I get 'str' object is not callable. Is there a way to tell func that the first output is actually a function? (like in C++, ::output(output) ) Thanks. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: default value for list access?

2005-02-27 Thread Bo Peng
performance is acceptable. Thanks. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: default value for list access?

2005-02-27 Thread Bo Peng
= df( a, [80, 1], 0) + df( a, [80,2], 0) + df( a, [80, 3], 0) would work if df is defined as def df(a, idx, default): try: for i in range(0, idx): a = a[ idx[i] ] return a except: return 0 but I am afraid that a for loop would bring serious performance problem. Thanks. Bo

default value for list access?

2005-02-27 Thread Bo Peng
acceses? (automatic wrapping a[...] as try: a[...] except: 0 ) Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Big latex subscript using python.sty and manual.cls

2005-02-15 Thread Bo Peng
python.sty is causing the problem but can not fix it. (I get errors when commenting out this block of code.) Does anyone know what is happening here? Note that the subscripts are OK if I use other classes like report.cls. Many thanks in advance. Bo % in python.sty

Re: changing local namespace of a function

2005-02-05 Thread Bo Peng
Kent Johnson wrote: Bo Peng wrote: Exec is slow since compiling the string and calls to globals() use a lot of time. The last one is most elegant but __getattr__ and __setattr__ are costly. The 'evil hack' solution is good since accessing x and y takes no additional time. Previous

Re: changing local namespace of a function

2005-02-05 Thread Bo Peng
10.0000.0000.1000.100 profile:0(fun4(a)) 00.000 0.000 profile:0(profiler) 10.0000.0000.0000.000 python-10176e-N.py:6(__init__) 10.1000.1000.1000.100 python-10176rIU.py:1(fun4) Since d['x'] is fast but cumbersome exec "z=x+y' is still slow. exec "locals().update(d)" is evil d.x is elegant and only a little slower than d['x'] I am announcing the winner of the contest: dictwrap! (applause) Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-05 Thread Bo Peng
y more items than just x and y. So, if there is are other items in the dictionary >>> a = {'x':1, 'y':2, 'else':4} >>> f(a,**a) Traceback (most recent call last): File "", line 1, in ? File "/usr/tmp/python-10176RtT.py", line 1, in ? f(a,**a) TypeError: f() got an unexpected keyword argument 'else' Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-05 Thread Bo Peng
any value in the dictionary, original or calculated, in a uniform and easier way! This makes my program instantly easier to use. I can not say enough thank you for this. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread Bo Peng
anguages, be a good addition to python? For example, with d do: z = x + y would be equivalent to d['z']=d['x']+d['y'] or d.z = d.x + d.y in some other cases. This would absolutely be the *best* solution to my problem. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread Bo Peng
error prone. If I have to use this code, I would write _z = func(_x + _y + _whatever['as'] + _a[0]) and use a perl script to generate the real code. (See, I am not lazy :-) Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread Bo Peng
e. The last one is most elegant but __getattr__ and __setattr__ are costly. The 'evil hack' solution is good since accessing x and y takes no additional time. I guess I will go with solution 3. It is evil but it is most close to my original intention. It leads to most readable code (except for the first line to do the magic and the last line to return result) and fastest performance. Thank again for everyone's help. I have learned a lot from the posts, especially the wrapdict class. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread Bo Peng
sible since involved number of items are huge. It is basically like exec 'statements' in d but a function with local dictionary d would be best. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread Bo Peng
you could use exec: Yes. I thought of using exec or eval. If there are a dozen statements, def fun(d): exec 'z = x + y' in globals(), d seems to be more readable than def fun(d): d['z'] = d['x'] + d['y'] But how severe will the performance penalty be? Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: changing local namespace of a function

2005-02-04 Thread Bo Peng
M.E.Farmer wrote: def fun(d): ... __dict__ = d ... return __dict__ hth, Does not work? >>> a = { 'x':1, 'y':2} >>> b = { 'x':2, 'y':9} >>> def fun(d): ... __dict__ = d ... print locals() ... z = x + y >>> fun(a) {'__dict__': {'y': 2, 'x': 1}, 'd': {'y': 2, 'x': 1}} Traceback (most re

changing local namespace of a function

2005-02-04 Thread Bo Peng
ict as local namespace # locals() = dict? z = x + y Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

mixing SWIG generated and Python-level usertype?

2005-02-01 Thread Bo Peng
current approach. Could anyone tell me some better (more standard) way? Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list

Can't load bytecode with execfile ?

2005-01-25 Thread Bo Jacobsen
I have a number of files compiled to bytecode using py_compile.compile(). The .pyc files can be invoked by python directly ($python file.pyc), but "loading" them by execfile just throws an exception ? Any suggestions Bo. -- http://mail.python.org/mailman/listinfo/python-list

compiler version mismatch when building ext_modules with MSVC

2005-01-09 Thread Bo Peng
Dear list, I was using autoconf/automake etc to build my python extension. Since distutil seems to be easier, I have switched to this method. However, when I build the module under windows, I am told that compiler version mismatch... I am using msvc 7 and python was build by msvc 6.0. I am not

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Bo Peng
hanged) according to this flag and the new module works well. Thank everyone for the help. especially in thie new year's day. Bo -- http://mail.python.org/mailman/listinfo/python-list

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Bo Peng
Craig Ringer wrote: On Sat, 2005-01-01 at 08:18, Bo Peng wrote: Python's array module is built-in, easy to use, but *without* a FromLenAndData function! Even the buffer interface provides only 'get buffer' but no 'set buffer' functions. Could anyone tell me how I ca

exposing C array to python namespace: NumPy and array module.

2004-12-31 Thread Bo Peng
enAndData. Many thanks in advance. Bo -- http://mail.python.org/mailman/listinfo/python-list