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

BartC bc at freeuk.com
Sat Apr 2 18:08:56 EDT 2016


On 02/04/2016 22:59, Loop.IO wrote:
> Hey
>
> So I built a keylogger using python as a test, got the code from the tutorial online, I want to improve on it to make it more automated, but the issue I'm having is it won't create the file until I press return, any clues where I'm going wrong?
>
> If I press return it makes the batch file, otherwise it just hangs.

>      name=raw_input ('C:\\Documents\\PythonCoding\\')+'launch2.bat'

You're asking for a file name to be entered. So that if ABC is pressed, 
followed by Enter, it will use:

       C:\Documents\PythonCoding\ABClaunch2.bat

Assuming that's the intention, then Enter is needed so that it knows 
when the user has completed typing the name. If not, then just use:

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

(If you want a single character name, without pressing Enter, that's 
harder to do. Someone else will have to help.)

-- 
Bartc



More information about the Python-list mailing list