Re: Why do I get SyntaxError: invalid syntax

2015-05-04 Thread Cecil Westerhof
Op Monday 4 May 2015 14:07 CEST schreef Chris Angelico: > On Mon, May 4, 2015 at 9:31 PM, Cecil Westerhof wrote: >> While copying pasting code to test, the following works: [chomp] >> But first I used: with NamedTemporaryFile(mode = 'w', prefix = file >> + '_', dir = filepath, delete = False) as

Re: Why do I get SyntaxError: invalid syntax

2015-05-04 Thread Chris Angelico
On Mon, May 4, 2015 at 9:31 PM, Cecil Westerhof wrote: > While copying pasting code to test, the following works: > [chomp] > But first I used: > with NamedTemporaryFile(mode = 'w', prefix = file + '_', dir = filepath, > delete = False) as tf: > tempfile = tf.name > with open(

Why do I get SyntaxError: invalid syntax

2015-05-04 Thread Cecil Westerhof
While copying pasting code to test, the following works: from itertools import islice from os import rename from os.pathimport expanduser, split from tempfile import NamedTemporaryFile real_file = (expanduser('~/Twitter/testing.txt')) (filepath, file)