Re: Interface with C

2005-09-14 Thread Eric Lavigne
> When this button is hit, it will send a code of 0 to the C > program. > > ./mcp | python gui.py Your pipe is backwards. Try this: python gui.py | ./mcp When your gui.py notices that a button got hit, it can just print the number 0 (followed by a newline character) to standard output. This beco

Re: last line chopped from input file

2005-08-21 Thread Eric Lavigne
> > import os > > os.command("debug\\curve-fit output.txt") > > > > I imagine thats was a typo for: > > >>> os.system("debug\\curve-fit output.txt") > > Alan That fixes it. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: last line chopped from input file

2005-08-21 Thread Eric Lavigne
>A shorter python program would be: > > os.command("debug\\curve-fit output.txt") I tried this program: import os os.command("debug\\curve-fit output.txt") My error message is: AttributeError: 'module' object has no attribute 'command' I also could not find os.command in the help files.

last line chopped from input file

2005-08-20 Thread Eric Lavigne
Here is a shell command (MS-DOS): debug\curve-fit output.txt And here is a Python script that *should* do the same thing (and almost does): import os inputfilename = 'input.txt' outputfilename = 'output.txt' inputfile = open(inputfilename,'r') outputfile = open(outputfilename,'w')

Re: Python and games

2005-08-14 Thread Eric Lavigne
>Like XML, scripting was extremely useful as both a mod tool and an >internal development tool. If you don't have any need to expose code >and algorithms in a simple and safe way to others, you can argue that >providing a scripting language is not worth the effort. However, if you >do have that n