Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

Timed 4 python optimising


ghost's Avatar
0 0

Ok, so far the challenges have been pretty lax on time allowed to return the answer. Im now on timed 4, and have written a python script which (i believe) returns the correct answer. Im getting errors when I submit it though, telling me its either wrong or too late. So I checked my answers and they seem ok, the only thing it can be is the time.

I imported python's time module and took 2 readings, one just before my http request and one just after. Got about 4.5 seconds back. I do have an ugly for..if..elif statement in the middle, but even with this commented out i'm still at 3.5.

Does anyone know any good techniques for optimizing python code? Dont really want to do it in C, im getting on well with python.

Cheers


ghost's Avatar
0 0

Might be traffic, always best to do the timed challenges when the fewest people are on. Then again I did mine in curl (haven't done 4 though :\ ) But try again when fewer people are on.


ghost's Avatar
0 0

Yeah, im on wireless as well, im gonna try plugging straight into my router with my laptop. Mind you that has a much slower proc, will this influence things much?


ghost's Avatar
0 0

Anything that will slow your connection down will effect the time you take. You could try it on a free PHP host (donno if they CURL installed though).


ghost's Avatar
0 0

I don't mind taking a look at your script and seeing if I can help.


ghost's Avatar
0 0

PM sent swartmumba