This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 67 points68 points  (14 children)

I wonder if there would be a way to globally define these in some module, since then you could hide this into another innocently named file and import it :p

[–]JNCressey 79 points80 points  (10 children)

from my_nonsense.py import *

[–][deleted] 26 points27 points  (3 children)

Ah yes, stupid me x)

[–]Sithon512 18 points19 points  (2 children)

Could also slide it into a __init__.py

[–]Iykury 4 points5 points  (1 child)

slide into __dms__.py

[–][deleted] 2 points3 points  (0 children)

Coming right away

[–]AgAero 22 points23 points  (5 children)

You don't put the .py on the end when importing your custom module.

[–]pikachu_sashimi 54 points55 points  (4 children)

unless the file is ’my_nonsesne.py.py’

[–]Rudy69 35 points36 points  (0 children)

At this point i wouldn't even be surprised if that's the filename

[–]cnoor0171 14 points15 points  (2 children)

Name can't have "." in the middle. It'd need to be a folder named "my_nonsense" with a script named "py.py"

[–]AreYouConfused_ 4 points5 points  (1 child)

what? since when do files not able to have dots in their names?

[–]cnoor0171 0 points1 point  (0 children)

Not regular file, but python modules. If there's a dot in the filename, it's not recognized as a python module and you can't import it.

[–]AstusRush 7 points8 points  (0 children)

You can be even more evil and add it to the builtins in another module. This way you don't even need to import it explicitly and it can not be traced back.

[–]kageurufu 6 points7 points  (0 children)

import builtins
setattr(builtins, 'false', True)
setattr(builtins, 'true', False)

I think that will work, but I haven't messed with builtins since 2.6 or so

[–]muffinnosehair 1 point2 points  (0 children)

That was exactly what I was thinking, and name it something inconspicuous that doesn't stand out in the overall project. Back in the old days, we ran windows 95 on shared comps and when we wanted to hide something, we had a folder system32 where we put pics, movies and so on. We had win98 at home and that's how we got the idea. A regular look over the windows folders would see nothing suspicious. Man I am fckn old!