import subprocess
import nipype.interfaces.fsl as fsl
import os

my_home = os.path.expanduser('~')
data_dir = os.path.join(my_home, 'nipype_tutorial', 'data')
os.chdir(data_dir)

for id in range(1,11):
    subject = 'sub' + str(id).zfill(3)
    top_dir = os.getcwd()
    os.chdir(subject)
    mybet = fsl.BET(in_file='struct.nii.gz',
                    out_file='struct_bet.nii.gz')
    mybet.run()
    os.chdir(top_dir)

###  Note, you may prefer these other methods to the one above.
###  Examples from
#    http://miykael.github.io/nipype-beginner-s-guide/firstSteps.html

# Method 2: specify parameters after node creation
# mybet = fsl.BET()
# mybet.inputs.in_file = 'struct.nii.gz'
# mybet.inputs.out_file = 'struct_bet.nii.gz'
# mybet.run()

# Method 3: specify parameters when the node is executed
# mybet = fsl.BET()
# mybet.run(in_file='struct.nii.gz',
#          out_file='struct_bet.nii.gz')

@@ -176,35 +176,16 @@
 r)%0A%0A
-for id in range(1,11):%0A    
+id = 1%0A%0A
 subj
@@ -215,20 +215,16 @@
 fill(3)%0A
-    
 top_dir 
@@ -237,20 +237,16 @@
 etcwd()%0A
-    
 os.chdir
@@ -255,20 +255,16 @@
 ubject)%0A
-    
 mybet = 
@@ -308,28 +308,24 @@
             
-    
 out_file='st
@@ -342,20 +342,16 @@
 ii.gz')%0A
-    
 mybet.ru
@@ -354,20 +354,16 @@
 t.run()%0A
-    
 os.chdir
@@ -388,60 +388,111 @@
 te, 
-you may prefer these other methods to the one above.
+there are other ways to fill in the needed information,%0A###  some of which you might find more readable
 %0A###

Update bet_test_nipype.py