[Beginner] - Hanging in the code, can't figure out what's wrong

Mark Lawrence breamoreboy at yahoo.co.uk
Sat Apr 2 20:38:21 EDT 2016


On 03/04/2016 01:12, BartC wrote:
> On 02/04/2016 23:31, Loop.IO wrote:
>
>> Oh i see, so the code prompts for a name.. so i'm more lost than i
>> thought, what do I need to change to make it just create the file with
>> the chosen name Launch2.bat without the prompt?
>
> If you don't want the user to enter anything, then I explained how
> before, just use:
>
>       name='C:\\Documents\\PythonCoding\\launch2.bat'
>
> if that's the file name you need.
>

name = r'C:\Documents\PythonCoding\launch2.bat'

Alternatively you could just use a forward slash.

I'm not sure which is the most efficient, I'll leave that to others to test.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list