desperately in need of a tool
Hi. I recently started working for a company that has just implemented its first set of software standards. So far, so good. Here's the problem: one of those standards is that the comments for each routine must indicate every other routine that it calls. As I try to keep my routines small, and factor out methods alot, this can lead to an enormous ammount of extra typing. I really, really, really don't want to do this by hand. Does anyone know of a tool that could do this for me, or at least a tool that can tell what other routines a given routine calls that I could program against? (Preferably something that works under pydev, but I'm not going to be choosy.) I'm sure some will wonder about the reasoning of this standard. The company primarily has experience writing scientific alogorythms which can get rather long. It makes a bit more sense to document all routines called for a very long routine, but for short routines that primarily call other routines, as most mine do, well Thanks. -- http://mail.python.org/mailman/listinfo/python-list
introspection and functions
Hi. I would like to be able to tell, at run time, how many parameters a function requires. Ideally I would like to be able to tell which are optional as well. I've tried looking at the functions attributes, but haven't found one that helps in this. How can I do this? Thanks -- http://mail.python.org/mailman/listinfo/python-list
pipes
Hi. I'm rtying to use pipes to communicate between a python GUI and a spawned C++ program. I prefer not to use forking because the app may be run on windows, where forking isn't supported. Roughly what I'm doing is: (r,w) = os.pipe() spawnl(P_WAIT, 'tool.exe', ' ', message, str(w)) close(w) print os.read(r, 1000) In c++ , ... int main(int argc, char** argv) { } -- http://mail.python.org/mailman/listinfo/python-list
pipes
Hi. I'm trying to communicate with a c++ executable via pipes. I prefer not to use forks because I want it to work on windows. In python the code looks roughly like: (r,w) = pipes() spawnl(P_WAIT, 'tool.exe', 'dummy', message, str(w)) close(w) print os.read(r, 1000) close r and in c++ int main (int argc, char**argv) { .. filedescriptor = atoi(argv[2]); message = argv[1]; FILE * stream = fdopen(filedescriptor, "a"); cout << fputs(stream, message) << endl; . return 0; } Sorry for any obvious errors, but I have neither the code nor my c++ reference handy, and I'm quite tired. When I run the program the line " cout << fputs(stream, message) << endl", prints '0', indicating that I am writing to the file. I try closing the file to be sure it is being flushed. I think I've tried flushing it while leaving it open to be sure it isn't destroyed. But no matter what I do, 'message' just sin't getting written back to the pipe, or at least the python code isnt getting it. If I don't close w after calling the c++ code the program hangs without responding to input. Do I need to be doing this across two processes (ie forking) ? Any ideas? Thanks -- http://mail.python.org/mailman/listinfo/python-list