Re: Why Python forbids multiple instances of one module?

2010-07-07 Thread CHEN Guang
>> Why Python forbids multiple instances of one module? >> If only Python allows multiple instances of one module, module will >> be enough to replace class in most cases. >> After all, it is much easier to write a module than a class, at least we do >> not have to write self everywhere. > If you

Why Python forbids multiple instances of one module?

2010-07-04 Thread CHEN Guang
Why Python forbids multiple instances of one module? If only Python allows multiple instances of one module, module will be enough to replace class in most cases. After all, it is much easier to write a module than a class, at least we do not have to write self everywhere. -- http://mail.pytho

copy some files from IE temporary internet files

2010-04-19 Thread CHEN Guang
Hi friends, I want to program Python to copy some video files (.flv) from the IE folder "temporary internet files", but os.listdir('C:\\Documents and Settings\\Administrator\\Local Settings\\Temporary Internet Files') seemed unable to find any video file (although they really exist and can

Re: help req debugging python and c together

2010-04-19 Thread CHEN Guang
>Hi, >I am working in gnuradio compiler. I need some help in debugging python and c >together. >By this i mean that i have written some blocks in c that are connected >together using python. So i need to debug >( breakpoints ect ) python such that when a specific c block is called at the >back e

Re: getting a string as the return value from a system command

2010-04-16 Thread CHEN Guang
> Catherine Moroney wrote: >> Hello, >> >> I want to call a system command (such as uname) that returns a string, >> and then store that output in a string variable in my python program. >> >> What is the recommended/most-concise way of doing this? >> >> I could always create a temporary file, c

Re: finding objects in a piece of functional code ?

2010-04-11 Thread CHEN Guang
PythoidC (http://pythoidc.googlecode.com or http://pythoidc.sf.net ) took the similar technique "finding objects in a piece of functional C code with Python" In the thread "Re: braceless and semicolonless", I discussed some details. May be of some help. - Original Message - From: Ste

Re: braceless and semicolonless

2010-04-10 Thread CHEN Guang
t e.g. ($object new Class)->method(). Unfortunately PHP is not a very good language and there are only a few things I can change about it. Peter. 2010/4/9 CHEN Guang Dear Peter, I am the developer of PythoidC (braceless and semicolonless C language). I am so glad to see your message, ju

Re: SIP

2010-04-09 Thread CHEN Guang
PythoidC ( http://pythoidc.sf.net ) provides some examples and templates for writing and importing C modules (.c or .exe) into Python environment, may be of some help. - Original Message - From: "omnia neo" To: Sent: Friday, April 09, 2010 1:51 PM Subject: Re: SIP On Apr 9, 10:42 am

Re: Loading an imported module (C API)

2010-04-08 Thread CHEN Guang
tackel the boring braces {} and line-end semicolons ; PythoidC automatically parses C header files, make corresponding Python objects, thus Python programmer can essily introspect into C ... ... CHEN Guang - Original Message - From: "booncw" To: Sent: Tuesday, April 06, 20

Re:Re: C++ code generation

2010-03-19 Thread CHEN Guang
Plug? Any evidence to say that? As long as this thread concerned, is there any answer more closed to the topic "C++ code generation" than mine? I think Stefan was telling you, in a nice way, to stop spamming every thread about code generation with a plug for your project. 2010

Re: C++ code generation

2010-03-18 Thread CHEN Guang
>> - Original Message - >> From: "Dan Goodman" >> >>> I'm doing some C++ code generation using Python, and would be interested >>> in any comments on the approach I'm taking. >> >> PythoidC ( http://pythoidc.googlecode.com ) is a C code generator (not C++) > > It would be nice if you could

Re: C++ code generation

2010-03-16 Thread CHEN Guang
PythoidC ( http://pythoidc.googlecode.com ) is a C code generator (not C++) - Original Message - From: "Dan Goodman" To: Sent: Wednesday, March 17, 2010 9:00 AM Subject: C++ code generation > Hi all, > > I'm doing some C++ code generation using Python, and would be interested > in

Re: Python bindings tutorial

2010-03-16 Thread CHEN Guang
> Is there any tutorial how to write a bindings for a exe ( dos) > program? > I would like to run it from a Python directly > ( using import command and a particular function from the binding) > not using os.system command. An example: PythoidC ( http://pythoidc.googlecode.com ), look at import

RE: python to exe

2010-03-13 Thread CHEN Guang
>Does anyone know of a good python to stand alone exe compiler? >Thanks, >-Robin I tried several such tools and found the easiest one: Pyinstaller ( http://www.pyinstaller.org/ ) but it does not make your script faster, if you want it as fast as C language, please try PythoidC ( http://pythoidc

Re: file seek is slow

2010-03-12 Thread CHEN Guang
ers adds more detailed annotation. PythoidC is a familar and convenient C language tool for Python programmers and mixed programming. plus, PythoidC is realizable only with Python, it's too far beyond C's preprocessor, believe it, or show us. CHEN Guang Convenient C Python mixed programming --- PythoidC ( http://pythoidc.googlecode.com ) -- http://mail.python.org/mailman/listinfo/python-list

Re: file seek is slow

2010-03-11 Thread CHEN Guang
. > PythoidC ( http://pythoidc.googlecode.com ) generates the shortest 'C' file. PythoidC is the C language like the Python, by the Python and for the Python. CHEN Guang-- http://mail.python.org/mailman/listinfo/python-list

Re: Six Minutes and fourty two seconds

2010-03-09 Thread CHEN Guang
>Tobiah wrote: >> Now that I use python, this is the amount of time >> per day that I spend adding forgotten semicolons while >> debugging other languages. >> >What compels you to write Python code without semicolons? >Frederic Try the C language without semicolons and braces http://pythoidc.

RE: How to detect C Function block using python

2010-03-09 Thread CHEN Guang
In the source code of PythoidC ( http://pythoidc.googlecode.com ), I wrote a Parser for C header files with Python regular expression, not only functions but also structs macros. May be of some help. Hey All, I'm new in this community. I am writing a static analyzer for validating C Code

Re: The C language like the Python, by the Python and for the Python--- PythoidC

2010-03-08 Thread CHEN Guang
( ChenGuang ) ? CHEN Guang, 08.03.2010 06:08: > Hi, if you are interested in C-Python mixed programming, please take a look > at: > http://pythoidc.googlecode.com > PythoidC is the C language like the Python, by the Python and for the Python It looks a bit dangerous to me to parse C header fil

The C language like the Python, by the Python and for the Python --- PythoidC

2010-03-07 Thread CHEN Guang
Hi, if you are interested in C-Python mixed programming, please take a look at: http://pythoidc.googlecode.com PythoidC is the C language like the Python, by the Python and for the Python import c c.include(c.h.stdio) c.include(c.h.stdlib) '''Annotation is free!''' int fib(int n): if(n<=2