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
  C++ program embedding Python crashes when calling PyUnicode_AsUTF8 Alexandros 4 2,383 Sep-19-2025, 11:11 AM
Last Post: Alexandros
  Embedding python script into html via pyscript pyscript_dude 7 6,243 Apr-16-2023, 11:17 PM
Last Post: pyscript_dude
Question How to compare two parameters in a function that has *args? Milan 4 3,794 Mar-26-2023, 07:43 PM
Last Post: Milan
  C++ python embedding comarius 0 1,632 Aug-26-2022, 02:01 AM
Last Post: comarius
  *args implementation and clarification about tuple status amjass12 10 7,945 Jul-07-2021, 10:29 AM
Last Post: amjass12
Question Embedding a python file online Dreary35 0 2,355 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  [SOLVED] Good way to handle input args? Winfried 2 3,298 May-18-2021, 07:33 PM
Last Post: Winfried
  Two Questions, *args and //= beginner721 8 6,199 Feb-01-2021, 09:11 AM
Last Post: buran
  Need help merging/embedding duckredbeard 10 6,284 Aug-13-2020, 04:48 AM
Last Post: duckredbeard
  How to call a routine in another Python program kenwatts275 1 2,499 May-17-2020, 05:37 PM
Last Post: deanhystad

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.