0

Something is wrong with my code but I'm not sure why it's wrong!

import os

os.system('cp $HOME/Documents/MATLAB/processFates.m $HOME/Documents/Outputs/test2')

write = open('matlabEx.submit','w+')

write.write("""
#$ -N matlab_example
#$ -o job.out
#$ -e job.error
#$ -cwd
#$ -S /bin/bash
#$ -pe orte 2
#$ -V

matlab -nodesktop -nosplash -r \"fwhm = processFates('FWHM',200)\"
"""

write.close()

os.system('qsub matlabEx.submit')

It's not writing the file. What is wrong?

1
  • What actually happens? Commented Aug 13, 2013 at 23:59

1 Answer 1

4

You forgot a closing parenthesis on the write.write call.

2
  • @alvarezcl: In the future, if Python gives you a SyntaxError, do a quick check for mistakes like that. It's usually something simple. Commented Aug 14, 2013 at 0:04
  • Actually, I forgot to set the python environment: #!/usr/bin/env python
    – alvarezcl
    Commented Aug 14, 2013 at 1:44

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.