My first real request for help

Tim Chase python.list at tim.thechases.com
Tue Nov 19 13:57:42 EST 2013


On 2013-11-19 13:43, Gene Heskett wrote:
> Interesting, a print cmd immediately in front of that is quite
> noisy: ['./camview-emc-f1oat.py', '-v', '1280x720', '-C',
> 'camview.cfg', '-g', 'cam.ui', '-H', 'campins.hal', '-w',
> '150995278']

This suggests that the value of "cmd" is indeed a list of
[program_name, arguments...] which is what it should be.  So the
Popen(cmd) should be right.

The next thing to verify that the working directory contains the
program that is being called, and that it's executable. So I'd add
some debugging dump, something like

  print(repr(cmd))
  ####### added stuff below #######
  import os
  print("Current directory: %s" % os.getcwd())
  cmd_name = cmd[0]
  if os.path.isfile(cmd_name):
    print("%s exists and has a mode of %o" % (
      cmd_name,
      os.stat(cmd_name).st_mode,
      ))
  else:
    print("%s isn't a file (missing or a directory?)" % cmd_name)
  ####### added stuff above #######
  child = Popen(cmd)

This should give you information on where the current working
directory is, whether the "./camview-emc-float.py" is in that
directory, and whether it is executable or not.

Just an observation here, it looks like you might have a "one"
instead of an "ell" in "float" in the file-name.  Intentional?

-tkc










More information about the Python-list mailing list