Re: install older Python version parallel

2009-06-11 Thread A. Cavallo
Hi, I'm working on a project of mine that does creates python installation under /opt so they can be installed side by side with a system installed one. There's a web page: http://pyvm.sourceforge.net/ With links to the newest build plus all teh accompaining unitests. But you can use the sour

Re: easiest way to check python version?

2009-06-10 Thread A. Cavallo
A common way to do it is (it is widely accepted): python -c 'import sys; print sys.version[:3]' Regards, Antonio On Wednesday 10 June 2009 12:25:22 John Machin wrote: > On Jun 10, 9:01 pm, dmitrey wrote: > > hi all, > > what is easiest way to check python version (to obtain values like > > 2.4

Re: Using logging module to log into flash drive

2009-06-09 Thread A. Cavallo
Hi, the problem screams for a separate thread. Anyway there's a TimedRotatingFileHandler handler in the logging package: you can derive from it and change the emit/doRollover pair to hold the records until a device is not ready. Regards, Antonio On Tuesday 09 June 2009 16:57:00 kretel wrote:

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread A. Cavallo
On Wednesday 03 June 2009 14:05:35 Roy Smith wrote: > #include > int main(int argc, char * argv[]) > { > std::cout << "SyntaxError: can't assign to function call"; > std::cout << endl; > } Ops, I've forgotten a.cpp: In function ‘int main(int, char**)’: a.cpp:5: error: ‘endl’ was not

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread A. Cavallo
On Wednesday 03 June 2009 14:05:35 Roy Smith wrote: > In article , > > "A. Cavallo" wrote: > > The following is the STL equivalent of: > > > > print [ x*2 for range(10) in data if (x%2 == 0) ] > > Are you sure about that? I haven't tested the f

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread A. Cavallo
> >> > No wonder, you have never actually used C++ with C types. An extern > >> > "C" clause tells the compiler to generate C functions (more precisely, > >> > functions that conform to the C ABI conventions), so effectively > >> > you're calling into C, not into C++. > >> > >> Seems like the only

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-02 Thread A. Cavallo
Mmmm, not really a conspiracy but it is not that trivial In wrapping c++ you might find useful the commands nm with c++filt although they work under linux there is the same pair for every platform (under windows I remember there is objdump): they should only you need to wrap a c++ library.

Re: Searching for pyvm

2009-05-25 Thread A. Cavallo
http://students.ceid.upatras.gr/~sxanth/pyvm/ Does this help? Regards, Antonio On Monday 25 May 2009 00:19:57 Vladimir G. Ivanovic wrote: > Hello, > > I'm looking for the sources to pyvm, a python virtual machine > implementation which can run Python 2.4 bytecode. > > If someone could point me in

Re: help! Troubled when embed python into C++

2009-05-25 Thread A. Cavallo
You need the: int main(int argc, char * argv[]) { Py_Initialize(); PySys_SetArgv(argc, argv); PyRun_SimpleString("execfile(r'1.py')"); Py_Finalize(); return 0; } Regards, Antonio On Sunday 24 May 2009 11:42:13 孟炜 wrote: > I have the following codes in C++: > #include > void

Re: Replacing module with a stub for unit testing

2009-05-24 Thread A. Cavallo
how about the old and simple: import ExpensiveModuleStub as ExpensiveModule On a different league you could make use of decorator and creating caching objects but that depends entirely on the requirements (how strict your test must be, test data sizes involved and more, much more details). Rega

Re: package with executable

2009-05-19 Thread A. Cavallo
Hi, > Matplotlib and Numpy, and a command line program. My goal is to create a > distributable package, that should ideally contain both the "gnucal" > package and the command line program. > * where should the executable module be wrt setup.py and/or the > package directory in the s

Re: Package problem

2009-05-19 Thread A. Cavallo
> > It is solved in other languages.. for example perl.. and delphi > I don't know much about perl, and even less about delphi, but I am > pretty sure it does not solve the problem of overwriting files from a > package with an installation outside the control of the package > manager. On a sytem a

Re: Package problem

2009-05-18 Thread A. Cavallo
On Monday 18 May 2009 20:52:52 Sverre wrote: > I'm using Ubuntu and some of the packages in the repository are too > old. So I got the thought to remove nearly all packages downloaded > from the repository and install them with easy_install. Is this a way > to go without greater problems? If you'

Numpy on python 2.7a

2009-05-05 Thread A. Cavallo
Hi, I'm trying to compile numpy using my own pet project based on the python svn code (that's the reason for the 2.7a tag). It is essentially a /opt python installation and it tailored for linux: its main goal is to be installed in parallel so it won't collide with a system installed python (t