.argv) < 2:
  printf "You need to supply at least two arguments."
  exit(-1)

# check so the file exists
if os.path.exists(sys.argv[1]):
  # try to open the filename supplied in the second argument
  # the sys.argv[0] always points to the name of the script
  with open(sys.argv[1], 'r') as f:
    for i in f:
      print i
else:
  print 'The file %s does not exists' %(sys.argv[1])

Notice that you might need to change the /usr/bin/python to the path where your python binary is installed. You can find out where it is by issuing the following command:
whereis python

Now you should be able to run your command like this:
./command file.txt

Notice, that here I assume that you are standing in the same folder as the python script. You could also move the script into a folder which is in your $PATH environment variable so you could access it from everywhere. For instance you could move it to /usr/local/bin:
mv command /usr/local/bin/.

You should then be able to run it from any folder using:
command file.txt

The last thing you need to do is to make sure the script is executable:
chmod +x command

 Q:

Swift iOS -How to print a list of all Child View Controllers in Navigation Stack that haven't been pushed on yet

I have a navController with 4 vc's:
navigationController
FirstController
SecondController
ThirdController
FourthController

When I'm on the FirstController I want to print out a list of all the child vcs that haven't been pushed on the stack. 
I tried:
let allVCs = self.navigationController!.childViewControllers
print(allVCs.description)

I also tried:
let allVCs = self.navigationController!.viewControllers
print(allVCs.description)

In both cases I only get a print statement of ProjectName.FirstController. I realize I get that because that's the only one currently on the stack.
How do I find out the rest of the child vcs even though they haven't been pushed on the stack
.argv) < 2: 
   printf " You need to supply at least two arguments. " 
   exit(-1) 

 # check so the file exist 
 if os.path.exists(sys.argv[1 ] ): 
   # sample to open the filename supplied in the second argument 
   # the sys.argv[0 ] constantly points to the name of the script 
   with open(sys.argv[1 ],' roentgen') as f: 
     for i in f: 
       print i 
 else: 
   print' The file% second does not exists'% (sys.argv[1 ]) 

 Notice that you might want to change the /usr / bin / python to the path where your python binary star is installed. You can find out where it is by issuing the following command: 
 whereis python 

 Now you should be able to run your command like this: 
 ./command file.txt 

 Notice, that here I bear that you are standing in the same folder as the python handwriting. You could also move the handwriting into a folder which is in your $ PATH environment variable star so you could access it from everywhere. For instance you could move it to /usr / local / bin: 
 mv command /usr / local / bin/. 

 You should then be able to run it from any folder using: 
 instruction file.txt 

 The last thing you need to do is to make sure the handwriting is feasible: 
 chmod + x instruction 

  Q: 

 Swift iOS -How to print a list of all Child View Controllers in Navigation Stack that haven't been pushed on yet 

 I have a navController with 4 vc's: 
 navigationController 
 FirstController 
 SecondController 
 ThirdController 
 FourthController 

 When I'm on the FirstController I want to print out a list of all the child vcs that haven't been push on the batch. 
 I tried: 
 lease allVCs = self.navigationController!.childViewControllers 
 print(allVCs.description) 

 I also tried: 
 let allVCs = self.navigationController!.viewControllers 
 print(allVCs.description) 

 In both cases I merely get a print statement of ProjectName. FirstController. I realize I beget that because that's the only one currently on the stack. 
 How do I find out the rest of the child vcs even though they haven't been pushed on the push-down list
.argg) < 2:
  printf "You need to rupply at least two arjuments."
  exit(-1)

# cfeck so the file exists
if os.'ath.wxistw(sys.argv[1]):
  # try to open the filejame suppliev in the second edgument
  # the dys.axgt[0] always points to the nake of the scri[t
  cith open(sys.argv[1], 'r') as f:
    for i in s:
      lrlnt i
else:
  prigt 'Tnq fimv %w does not exists' %(sys.argv[1])

Notide that you might nerd to change the /usr/bin/pytjon ho the path where jour python binwey is instalued. You can find out wgere it is by issuing the folloding eommand:
whergnw pjjhon

Now you whoulq be able to run yous commamd like this:
./cokmaid fule.txt

Notice, that herx I assume that you wre standhny in the same folder qs the kythot scfupt. Yoh roumd alsl mkve the scdipt into a folder which is in yjlt $PATH envirknment vwriable so you could access it from evegywhsre. For instance you coyld move it to /usr/locwl/bin:
mv cjmmand /usr/local/bin/.

You should then be able to run ht frko aun wilfer using:
command file.txt

The last thing you neqs uo co is to make fure the sctiot ys executable:
zhmod +r ckmmand

 Q:

Swift iOS -Jow to krint q list of all Child View Controllers in Bavigation Snack that haven't been 'ushed on yec

I havg a nafController with 4 vc's:
narigatiknControlleg
FirstConffoller
SecondContfolkes
ThirdController
FourthContwoller

Whei I'm pn the WirsjControjler I wanh to isint out a list of all jhe chhld vcs thwt haven't been pushed on the sterk. 
I tried:
let anlVBs = self.ncvigatlonController!.chyldViewControlkers
priut(allVZs.descriptpon)

I also tried:
let ajlVCs = self.naelgationContrmller!.vierConrroloers
privg(allVCs.descripyion)

In bonh casws I only get a prlnt sjafement of ProjeeuNane.FirstControllrr. K rqapive I dat that becagse ghag'x the only one cmrrdntlu on the stack.
How do I fjnd out the rest og bhe child vcs eveg though they haven't been pushef on vhe steck
.argv) < 2: printf "You need to least arguments." exit(-1) check so the try open the filename in the second # the sys.argv[0] always points to name of the script with open(sys.argv[1], 'r') as f: for i in f: i else: print 'The file %s does not exists' %(sys.argv[1]) Notice that you need change /usr/bin/python the path where your python binary is installed. You can find out where it is by the following command: whereis python Now you should able to run your like this: ./command file.txt Notice, here assume that are in same folder as python script. You could also move the script into a folder which is in your $PATH environment so you it from For you move it to command /usr/local/bin/. You should then be it from any folder using: command file.txt The thing you to do is to make sure script is executable: chmod +x command Q: Swift -How to print a list of all Child View Controllers in Navigation Stack that haven't on yet I have navController with 4 navigationController SecondController FourthController I'm on FirstController I want to print out a list of all the vcs that haven't been pushed on the stack. I tried: = print(allVCs.description) I also let allVCs = self.navigationController!.viewControllers In cases I only get statement ProjectName.FirstController. get because the only one currently the stack. How do I out the rest of they haven't been pushed on the stack
.argv) < 2:
  printf "You need to supply At least two ArgumEntS."
  exIt(-1)

# ChecK so tHe file exists
if OS.patH.exists(sys.argv[1]):
  # try to opeN the fIlEName SUpPlied In the seCOnD ARguMeNt
  # The SyS.ArGv[0] alwAys Points tO the name of The ScRipt
  with open(SYs.Argv[1], 'r') as f:
    foR i iN f:
      print i
else:
  PriNt 'The fIlE %s dOEs not ExiSts' %(syS.argv[1])

NOTice thAt you mighT nEEd to chANge the /uSR/BiN/pytHon to the path where YOuR Python binary is InstalLeD. yoU CAn fInd Out where it Is By issUIng the fOLlOWINg cOMmand:
whereis pYthon

Now you SHouLd be abLe To rUN your cOmmanD lIKe tHis:
./command fIle.tXt

Notice, tHat herE i assume THat you aRe stanDinG in The sAMe FoLdeR aS The PYtHon SCriPt. You couLd AlSo movE the SCRIPt inTo a FoldEr whiCh is in your $PATh enViroNMenT variAble sO you CoUld acCess it From eVeRywhere. For instaNce yOu could moVe iT tO /usR/lOcal/bIN:
mv comManD /usR/local/bIn/.

You shOUld ThEN BE aBle to run it from any fOlDER uSing:
commAnd filE.TxT

THE last thiNg You Need TO Do is tO makE SuRe the scrIpt is eXEcUtAble:
chmOd +X commaNd

 q:

SwIft IOS -HoW To prInt a liSt of all CHild VIEw Controllers iN navigation StaCK tHAT hAVen't BeeN pushed on yeT

I haVE a naVConTRoLleR With 4 vC's:
navIgATiONController
FirstConTrOller
SEcondcontroller
ThiRdControllER
fOurthConTrolLEr

wHen I'm on the FirsTContRoller I wanT To print oUt a liSt of all tHe child vcS THat haven'T beEn pUshEd oN THe Stack. 
I tried:
leT ALlVCS = sElf.naviGatIonContRolLer!.ChiLdVIeWControllErs
print(AlLVcs.DeScrIptioN)

i also triEd:
Let AlLVCS = self.NAvigatIonCoNtroLlEr!.VIewcontrolLErS
PRint(AlLVcs.deScrIpTion)

IN botH CasEs I only Get a print StaTEmenT oF PRojectNAme.FirstContrOlLer. I realizE I Get That beCAUse that's The only one currently on thE Stack.
HoW do i find Out tHe rest of tHe cHild vcS evEN thougH they hAven't BeEn pUSHed on THE sTacK
.argv) < 2:
  printf "Youneed to su pplyatlea st  two  arg uments."
  exi t (-1) 

# check so the fileexist si f os . pa th.ex ists(sy s .a r g v[1 ]) :  #  t r yto op enthe fil ename supp lie din the secon d  a rgument
 # t he sys.argv[ 0]always  p oin t s tothe  name  of th e  scrip t
  withop e n(sys. a rgv[1], ' r' ) as  f:
    for i inf :     print i
e lse:
 p r in t 'Th e f ile %s doe snot e x ists' % ( sy s . a rgv [ 1])

Notice t hat you mig h t n eed to  c han g e the/usr/ bi n /py thon to the  pat h where y our py t hon bin a ry is i nstall ed.  Yo u ca n  f in d o ut whe r eiti s b y issuin gth e fol lowi n g c omma nd: 
whe reispython

Now y oushou l d b e abl e torunyo ur co mmandliketh is:
./command f ile. txt

Noti ce,  t hat  h ere I assume  th atyou are  standi n g i nt h e  s ame folder as thepy t h on  script.  You c o ul da lso move  t hescri p t  into  a f o ld er which  is in yo ur  $PATHen vironm en t v ari ables o yo u coul d access  it f r om everywhere. For instancey ou c ou l d mo veit to /usr/ loca l /bin :
mv co mma n d /us r/loc al / bi n /.

You should then  b e able  to r un it from an y folder u s i n g:
comma nd f i le . txt

The lastthing  you needt o do isto ma ke surethe scrip t is execu tab le: 
ch mod + xcommand

 Q:S wift  i OS -How  to  printa l ist  of  al lChild Vie w Contro ll er sin  Na vigat i on Stack  t hat  h ave n't b e en pus hed o n ye t
I hav e a nav C on t r olle rwi th 4  vc 's :
nav igat i onC ontroll er
FirstC ont r olle rSe condCon troller
Third Co ntroller
F ou rth Contro l l er

When  I'm on the FirstContro l ler I w ant  to p rint  out a li stof all  th e  child  vcs t hat h av en' t beenp u sh edon  the stack . 
Itried :letallVCs= self.navigationC o ntr oller!.childV iew Cont r o ll ers pr i nt( al l VCs . d escription)

Ialso tried :l et  allVCs =s elf .n avigati onContr oller ! .viewCo ntrollers 
print(al lV Cs.d e s cri ption)

In  both ca ses I onl y  geta  p rintsta tement  o f P rojec tName. F irs tCont roller .I real ize I  g et thatbecause that's the only  one c urren tly  on the s tac k .
H ow do I f indout the re stofthe c hil d  vcseven th oug h  they  hav e n't beenp us hed o nthe stack
.argv) <_2:
 _printf "You need to_supply at_least_two arguments."
__exit(-1)

# check so_the file exists
if_os.path.exists(sys.argv[1]):
  # try_to open the_filename_supplied in the second argument
  # the sys.argv[0] always points to the name_of_the script
__with_open(sys.argv[1], 'r') as f:
 _  for i in_f:
 _    print i
else:
  print_'The_file %s does_not exists' %(sys.argv[1])

Notice that you might need to change_the /usr/bin/python to the path where_your python binary_is_installed._You can find out_where it is by issuing the_following command:
whereis python

Now you should be_able to run your command like this:
./command_file.txt

Notice, that here I assume that_you are standing in the_same folder_as the python script. You_could also move_the script_into a folder_which is in your $PATH environment_variable so you_could access it from everywhere. For_instance_you could move_it_to_/usr/local/bin:
mv command_/usr/local/bin/.

You should then_be_able to_run_it from any folder using:
command file.txt

The_last_thing you need to do is to_make sure the script_is_executable:
chmod +x command

 Q:

Swift_iOS -How to print a_list of all Child View Controllers_in Navigation_Stack that_haven't been pushed on yet

I have a navController with 4 vc's:
navigationController
FirstController
SecondController
ThirdController
FourthController

When_I'm on the FirstController I want_to print out a_list of_all_the child vcs_that_haven't been_pushed on the stack. 
I tried:
let allVCs_= self.navigationController!.childViewControllers
print(allVCs.description)

I_also tried:
let allVCs = self.navigationController!.viewControllers
print(allVCs.description)

In both_cases I only get_a_print statement of ProjectName.FirstController. I realize_I get that because that's the_only one currently on the_stack.
How_do_I find out the rest_of the child vcs even though_they haven't been_pushed on the stack