hi all, assuming a path of for example "C:\Python24\development\radar\nra.py" where 'nra.py' is the executable file, could someone please show me the exact syntax for a call to os.execv() in order to run the file 'nra.py'. (nra.py requires no arguments when called. )
Thanks in advance!
If you want help for syntax. There is an easy way to do it. you go something like this for your example:
# just type each line in the interpreter
>>> import os
in your case it shows this:
Help on built-in function execv in module nt:
Execute an executable path with arguments, replacing current process.
path: path of executable file
args: tuple or list of strings
Thanks paulthom12345, I think perhaps my initial post was badly worded! Sorry for that. I realise that the call to os.execv requires two arguments, and I'm fairly sure the 'path' argument I pass is ok. Its what is required in the 'args' list/tuple that I cannot get right. Any thoughts?
Ok, have done that. I, wrongly, assumed that getting a 'Exec format error' meant there was a problem with one or other of the passed arguments. Having done a little more searching I now think it means that the program was not able to be executed. I've a feeling that the 'args' argument has to contain some string(s) which are not necessarily arguments for the program to be executed. If anyone out there knows.....
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...