Python Forum
Embedding Args in external program call
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Embedding Args in external program call
#1
Needing to make a this os call happen stuck on how to do it.
print fname+ " %d Plants Detected" % len(keypoints)
need to preform the following
exiftool -description="%d" fname

 # Detect.
    reversemask=255-mask
    keypoints = detector.detect(reversemask)
    if keypoints:
        print fname+ " %d Detected" % len(keypoints)
        call([exiftool -description="%d" fname])
    else:
        print "No Found"
Reply
#2
Your code has nothing to do with call to external program.  Please, post your actual code that you have problem with. You may want to check subprocess module
Reply
#3
He/she maybe is using it.

from subprocess import call
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#4
Yes, however he/she edited the post to add the line

call([exiftool -description="%d" fname])
that's why I strike trough part of my post
Reply
#5
subprocess.call(['exiftool', '-description='+str(len(keypoints)), fname]) is where im stuck at

Needing to make a this os call happen stuck on how to do it.
print fname+ " %d Plants Detected" % len(keypoints)
need to preform the following
exiftool -description="%d" fname

 # Detect.
    reversemask=255-mask
    keypoints = detector.detect(reversemask)
    if keypoints:
        print fname+ " %d Detected" % len(keypoints)
       call([exiftool -description="%d" fname])
    else:
        print "No Found"
Reply
#6
try this

# Detect.
   reversemask=255-mask
   keypoints = detector.detect(reversemask)
   if keypoints:
       args1 = '-description={}'.format(len(keypoints))
       print '{} {} Detected'.format(fname, len(keypoints))
       call(['exiftool', args1, fname])
   else:
       print "No Found"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Embedding python script into html via pyscript pyscript_dude 7 1,452 Apr-16-2023, 11:17 PM
Last Post: pyscript_dude
Question How to compare two parameters in a function that has *args? Milan 4 1,183 Mar-26-2023, 07:43 PM
Last Post: Milan
  C++ python embedding comarius 0 803 Aug-26-2022, 02:01 AM
Last Post: comarius
  *args implementation and clarification about tuple status amjass12 10 3,915 Jul-07-2021, 10:29 AM
Last Post: amjass12
Question Embedding a python file online Dreary35 0 1,477 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  [SOLVED] Good way to handle input args? Winfried 2 2,003 May-18-2021, 07:33 PM
Last Post: Winfried
  Two Questions, *args and //= beginner721 8 3,422 Feb-01-2021, 09:11 AM
Last Post: buran
  Need help merging/embedding duckredbeard 10 3,333 Aug-13-2020, 04:48 AM
Last Post: duckredbeard
  How to call a routine in another Python program kenwatts275 1 1,610 May-17-2020, 05:37 PM
Last Post: deanhystad
  does yield support variable args? Skaperen 0 1,641 Mar-03-2020, 02:44 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020