hello all ...
im trying to add a variable inside a String ...
this is my code :
how i can solve this issue ?
i think the problem is here :
the powershell add a new empty line !! when i try to use len() it gives me 5 while they are just 4 !!
how i can remove the empty line ?
im trying to add a variable inside a String ...
this is my code :
import os import sys cmd2 = """powershell -command "Get-Process | where {$_.Description -like 'VMware Tools Core Service'} | select -expand id""" # the commnad run the powerashell and search for a proccess with Description then get her pid number tmp = os.popen(cmd2).read() cmd3 = "wmic process where processId="+tmp+"get name | findstr /v Name" # this commnad show the name of the pid number thet getting from first command tmp2 = os.popen(cmd3).read() #print("hey " + tmp ) print tmp2the problem here : wmic process where processId="+tmp+"get name | findstr /v Name" ,,,, my script ignore this section of command ( get name | findstr /v Name ) it's add new line and just run the commnad until here : wmic process where processId="+tmp
how i can solve this issue ?
i think the problem is here :
the powershell add a new empty line !! when i try to use len() it gives me 5 while they are just 4 !!
how i can remove the empty line ?