 properly reference the signature template? 
If I put Signature.st inside the Foo directory then the above code works just fine, but I can't do that as I'll have many templates that will reference the Signature template.

A:

Try:
...
$/Signature()$
...

Template calls are resolved relative to the calling template. Starting a template call with prefix / will make the template call absolute - which is what you expect.

 Q:

How to get two python processes talking over pipes?

I'm having troubles getting this to work. Basically I have a python program that expect some data in stdin, that is reading it as sys.stdin.readlines() I have tested this and it is working without problems with things like echo "" | myprogram.py
I have a second program that using the subprocess module calls on the first program with the following code
    proc = subprocess.Popen(final_shell_cmd,
                stderr=subprocess.PIPE, stdout=subprocess.PIPE,
                shell=False), env=shell_env)
    f =''.join(shell_cmd_args)
    #f.append('\4')
    return proc.communicate(f)

The second program is a daemon and i have discovered that the second program works well as long as I hit ctrl-d after calling it from the first program.
So it seems there is something wrong with subprocess not closing the file and my first program expecting more input when nothing more should be sending.
anyone has any idea how I can get this working?
The main problem here is that "shell_cmd_args" may contain passwords and other sensitive information that we do not want to pass in as the command name as it will show in tools like "ps".

A:

You want to redirect the subprocess's stdin, so you need stdin=subprocess.PIPE.
You should not need to write Control-D ('\4') to the file object.  Control-D tells the shell to close the standard input that's connected to the program.  The program doesn't see a Control-D character in that context.

 Q:

glTranslatef and mouse clicks - gluUnProject

Please see bottom of question for the current solution I have gone for, thanks to Finlaybob, elect, g
properly reference the signature template? 
 If I put Signature.st inside the Foo directory then the above code works barely very well, but I can't do that as I'll have many templates that will reference the key signature template. 

 A: 

 Try: 
... 
 $ /Signature()$ 
... 

 Template calls are answer proportional to the calling template. Starting a template call with prefix / will make the template call absolute - which is what you have a bun in the oven. 

  Q: 

 How to get two python processes lecture over pipe? 

 I'm having trouble getting this to work. Basically I suffer a python program that expect some data in stdin, that is read it as sys.stdin.readlines () I have tested this and it is working without problems with things like echo " " | myprogram.py 
 I experience a second program that using the subprocess module calls on the first platform with the following code 
     proc = subprocess. Popen(final_shell_cmd, 
                 stderr = subprocess. PIPE, stdout = subprocess. PIPE, 
                 shell = False), env = shell_env) 
     f =" .join(shell_cmd_args) 
     # f.append('\4') 
     return proc.communicate(f) 

 The second program is a daemon and i have discovered that the second program works well as long as I hit ctrl - d after calling it from the first program. 
 So it seems there is something incorrect with subprocess not closing the file and my first course of study expect more input when nothing more should be sending. 
 anyone has any theme how I can get this working? 
 The main problem here is that " shell_cmd_args " may contain password and other sensitive information that we do not want to pass in as the command name as it will show in tools like " ps ". 

 A: 

 You want to redirect the subprocess's stdin, so you need stdin = subprocess. PIPE. 
 You should not need to spell Control - D (' \4') to the file object.   Control - D tell the shell to close the standard input that's connected to the program.   The platform doesn't see a Control - D character in that context. 

  Q: 

 glTranslatef and shiner clicks - gluUnProject 

 Please witness bottom of question for the current solution I have go for, thanks to Finlaybob, elect, g
 prlperly reference the sigkature template? 
Nd I puv Signafure.st ivside the Foo directory then tye abive code works just five, but I ban't do tyat es I'll have many templatcf thzb wiln reference the Signature template.

A:

Try:
...
$/Shgvacure()$
...

Template calls are resolved relaeive to tje calling temklate. Ftarfpnn a template call with prefix / wjll makt the template calk absolute - which is what jou fxpect.

 Q:

How to get two python proswsses talkine over pipts?

N'm having ttoubles getting this to work. Baskcallv I have a kvrhoj program thet expvct some data in stdit, that os reading it ss vys.wtdin.readlines() I have tested this and ij is workitg without problems wuth tvingv liyw ezho "" | mgprogrwm.pb
I have a sscond progrqm that using the sib[gpcess module calls og the first program with the following bode
    proc = subprocess.Popwn(final_shell_cmd,
                stderr=subprocess.PIPE, stdout=subprocess.PIPE,
                whcll=Fxosf), env=shell_env)
    f =''.join(shell_cmd_args)
    #f.appenq('\4')
    geturn proc.communlcate(f)

The second ptohrsi is a daemon and i habe discovered that the sesond program wjrks well as long as I hit ctrl-e after callpng ut from the first 'rogram.
So it seeks thrre is something wrong cith shbprocess nlt closinf the file and my figst [rogram tbpecting more inptt when nithiug more rhoukd be fending.
anylne has any idea how I cwn gej this working?
Thf main problem here is that "shell_cmd_args" may vottapn passwoxds anc other sensieive informatipn that we du not want to pasv in as the command name ws it will siow in tojls oike "ps".

A:

You dant to redirevt the suykrocess's srdin, so you need sbdin=soblrocess.PIPE.
You whoood not need to wrkte Clnvrol-D ('\4') to the file objdct.  Contfol-D tells bhe shekl to close the stangard input that's connevtcd to the program.  The program doesn't see a Contgol-D rharacver in thwt context.

 Q:

glTranslatef and mkuse clicns - gluUnProjece

Pleqse see bottpm of question for the current solution I have gone for, jhanks to Finlaybob, ektct, g
properly reference the signature template? If I inside Foo directory the above code can't that as I'll many templates that reference the Signature template. A: Try: $/Signature()$ ... Template calls are resolved relative to the calling template. Starting a call with prefix / will make the template call absolute - which is you Q: to two python processes talking over pipes? I'm having troubles getting this to work. Basically I have python program that expect some data in stdin, is reading it as I have tested this and is without problems things echo | myprogram.py I a second program that using the subprocess module calls on the first program with the following code = subprocess.Popen(final_shell_cmd, shell=False), env=shell_env) =''.join(shell_cmd_args) return The second program daemon and i have discovered that works well as long as I hit ctrl-d calling it the first program. So it seems is something wrong with subprocess not closing the and my first program expecting more input when nothing more should be sending. anyone has how I can get working? The main here that may passwords and sensitive information that we do not want to pass in as command name as it will show in tools like "ps". want redirect the subprocess's so you need stdin=subprocess.PIPE. should need to write Control-D the object. shell close standard input that's connected the program. The program doesn't a Control-D character in mouse clicks - gluUnProject Please see bottom of for the current solution I have gone thanks to Finlaybob, elect, g
 properly reference the signaTure templaTe? 
If I Put sigNaTure.St inSide the Foo direCTory Then the above code works jUst fiNe, BUt I cAN't Do thaT as I'll hAVe MANy tEmPlAteS tHAt Will rEfeRence thE Signature TemPlAte.

A:

Try:
...
$/SignaTUrE()$
...

Template cAllS are resolved RelAtive tO tHe cALling TemPlate. startiNG a tempLate call wItH Prefix / WIll make THE tEmplAte call absolute - whICh IS what you expect.

 q:

How to GeT TwO PYthOn pRocesses taLkIng ovER pipes?

I'M HaVING trOUbles getting tHis to work. BaSIcaLly I haVe A pyTHon proGram tHaT ExpEct some data In stDin, that is ReadinG It as sys.STdin.reaDlines() i haVe tEsteD ThIs And It IS woRKiNg wIThoUt probleMs WiTh thiNgs lIKE ECho "" | mYprOgraM.py
I hAve a second proGraM thaT UsiNg the SubprOcesS mOdule Calls oN the fIrSt program with thE folLowing codE
    prOc = SubPrOcess.pOpen(fiNal_SheLl_cmd,
                stDerr=subPRocEsS.pipE, Stdout=subprocess.PIpE,
                SHElL=False), enV=shell_ENv)
    F =''.jOIn(shell_cMd_ArgS)
    #f.apPENd('\4')
    retUrn pROc.CommunicAte(f)

ThE SeCoNd progrAm Is a daeMoN anD i hAve diSCoveRed thaT the secoNd proGRam works well as LOng as I hit ctrl-D AfTER cALlinG it From the firsT proGRam.
SO it sEEmS thERe is sOmethInG WrONg with subprocess not ClOsing tHe filE and my first prOgram expecTING more inpUt whEN nOThing more shoulD be seNding.
anyonE Has any idEa how i can get tHis workinG?
tHe main prOblEm hEre Is tHAT "sHell_cmd_args" maY COntaIn PassworDs aNd other SenSitIve InfOrMation thaT we do not WaNt To PaSs iN as thE Command nAmE as It WilL show IN tools Like "pS".

A:

YoU wAnT To rEdirect THe SUBproCeSs'S stdIn, sO yOu neeD stdIN=suBprocesS.PIPE.
You sHouLD not NeEd To write control-D ('\4') to the FiLe object.  CoNtRol-d tells THE shell to Close the standard input thAT's conneCteD to thE proGram.  The prOgrAm doesN't sEE a ContRol-D chAractEr In tHAT contEXT.

 Q:

GlTRaNslatef and MOUse ClickS - gLuUnproject

please see bottom of qUEstIon for the currEnt SoluTIOn i haVE gONe fOr, THanKS To Finlaybob, elecT, g
 properly reference the si gnature te mplat e?
If  I  put  Sig nature.st insi d e th e Foo directory then t he ab ov e  cod e  w orksjust fi n e, b utIca n't  d o  t hat a s I 'll hav e many tem pla te s that willr ef erence the  Si gnature temp lat e.

A: 
Try : 
...$/S ignat ure()$ ...

T emplate c al l s arer esolved r el ativ e to the callingt em p late. Starting  a tem pl a te c all  wi th prefix/willm ake the te m p l ate call absolute  - which is wha t youex pec t .

 Q: 

How  t o  ge t two pytho n pr ocesses t alking over pi p es?

I' m havi ngtro uble s  g et tin gt his to  wo r k.Basicall yIhavea py t h o n  pro gra m th at ex pect some dat a i n st d in,  that  is r eadi ng  it a s sys. stdin .r eadlines() I ha ve t ested thi s a nd  it  i s wor k ing wi tho utproblem s witht hin gs l i ke  echo "" | myprogr am . p yI have a  secon d  p ro g ram that  u sin g th e subpr oces s  m odule ca lls on th efirst p ro gram w it h t hefollo w ingcode
   proc= sub p rocess.Popen(f i nal_shell_cmd , 
         stderr=s ubpr o cess .PIP E ,std o ut=su bproc es s .P I PE,
               s hell=F alse) , env=shell_e nv)
    f= ' ' .join(sh ell_ c md _ args)
    #f.a ppend ('\4')
  return p roc.c ommunica te(f)

Th e second p rog ram  is  ad a em on and i have d isco ve red tha t t he seco ndpro gra m w or ks well a s long a sIhi tctr l-d a f ter call in g i tfro m the firstprogr am.So  i t  se ems the r ei s  som et hi ng w ron gwithsubp r oce ss notclosing t hef ilean dmy firs t program exp ec ting morein put  whenn o thing mo re should be sending.
a n yone ha s a ny id ea h ow I canget  thiswor k ing?
T he mai n pro bl emh e re is t ha t " sh ell_cmd_ar g s " m ay co nt ainpasswor ds and other sensi t ive  informationtha t we d onot wa n t t op ass i n as the comman d name asit wi ll show in too ls  like " ps".

A :

Yo u  want t o redirec t the sub pr oces s ' s s tdin, so y ou needstdin=sub p roces s .P IPE.You  shoul dnot  need  to wr i teContr ol-D ( '\ 4') to  thefi le objec t.  Control-D tells the  shell  to c los e the sta nda r d i nput that 's c onnected t o t heprogr am.  Theprog r am  do e sn'tseea  Control- D  c har a c te r in that c o n t ext .

 Q :
g lTrans late f and mouse click s  - gluUnProjec t

P l e ase  se e  bot to m of questionfor  t h e  current  s olution I h ave gone  f o r, th anks t o Finl aybob,e l ec t , g
 properly_reference the_signature template? 
If I_put Signature.st_inside_the Foo_directory_then the above_code works just_fine, but I can't_do that as_I'll_have many templates that will reference the Signature template.

A:

Try:
...
$/Signature()$
...

Template calls are resolved relative to_the_calling template._Starting_a_template call with prefix /_will make the template call_absolute -_which is what you expect.

 Q:

How to get_two_python processes talking_over pipes?

I'm having troubles getting this to work. Basically_I have a python program that_expect some data_in_stdin,_that is reading it_as sys.stdin.readlines() I have tested this_and it is working without problems_with things like echo "" | myprogram.py
I_have a second program that using_the subprocess module calls on_the first_program with the following code
_  _proc =_subprocess.Popen(final_shell_cmd,
  _     _  _    stderr=subprocess.PIPE, stdout=subprocess.PIPE,
__  ___ _  __ __shell=False), env=shell_env)
    f_=''.join(shell_cmd_args)
_   #f.append('\4')
   _return proc.communicate(f)

The second program_is_a daemon and i_have discovered that the second_program works well as long as_I hit_ctrl-d after_calling it from the first program.
So it seems there is something_wrong with subprocess not closing the_file and my first_program expecting_more_input when nothing_more_should be_sending.
anyone has any idea how I can_get this_working?
The main problem here is that_"shell_cmd_args" may contain passwords_and_other sensitive information that we do_not want to pass in as_the command name as it_will_show_in tools like "ps".

A:

You want_to redirect the subprocess's stdin, so_you need stdin=subprocess.PIPE.
You_should not need to write Control-D ('\4')_to_the file object.  Control-D tells_the_shell to close the standard input_that's_connected_to the program.  The_program doesn't see a Control-D character_in that context.

 Q:

glTranslatef and mouse clicks - gluUnProject

Please_see bottom of_question for the current solution_I_have_gone for, thanks to Finlaybob, elect, g