如何通过管道将PHP输出到Linux命令?

时间:2019-01-01 07:21:35

标签: php linux pipe

我有一个def GetLinkData(self): LinkData = {} LinkData[id(self.RootPage)] = "](" + self.JSONSerializer.SerializeDataToJSONString(self.RootPage.GetFullIndexPath(), Indent=None) + ")" self.AddSubPageLinkData(self.RootPage, LinkData) return LinkData def AddSubPageLinkData(self, CurrentPage, LinkData): for SubPage in CurrentPage.SubPages: LinkData[id(SubPage)] = "](" + self.JSONSerializer.SerializeDataToJSONString(SubPage.GetFullIndexPath(), Indent=None) + ")" self.AddSubPageLinkData(SubPage, LinkData) def UpdateLinks(self, OldLinkData, NewLinkData): ReplaceQueue = [] for PageID in NewLinkData: if PageID in OldLinkData: if NewLinkData[PageID] != OldLinkData[PageID]: ReplaceStrings = (OldLinkData[PageID], "<<LINK UPDATE TOKEN" + str(PageID) + ">>", NewLinkData[PageID]) ReplaceQueue.append(ReplaceStrings) for ReplaceStrings in ReplaceQueue: self.SearchWidgetInst.ReplaceAllInNotebook(SearchText=ReplaceStrings[0], ReplaceText=ReplaceStrings[1], MatchCase=True, DelayTextUpdate=True) for ReplaceStrings in ReplaceQueue: self.SearchWidgetInst.ReplaceAllInNotebook(SearchText=ReplaceStrings[1], ReplaceText=ReplaceStrings[2], MatchCase=True, DelayTextUpdate=True) 脚本作为tel.php,它创建了一个cap = cv2.VideoCapture(0) # cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) # # cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720) while 1: ret, frame = cap.read() # cv2.imshow("frame",frame) cv2.imwrite('test.bmp',frame) if cv2.waitKey(20) & 0xFF == ord('q'): break width = cap.get(cv2.CAP_PROP_FRAME_WIDTH) height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT) print('size:', width, height) (作为$ url)。现在,我想使用此PHP作为myBashScript的URL脚本的输入,像这样:

  

php tel.php | myBashScript

如何将URL创建为URL的输出? 例如,类似Linux

0 个答案:

没有答案