Re: Checking if a script is compiled or not in Python?

2020-12-15 Thread AudioGames . net Forum — Developers room : tunmi13 via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

Ah, I see. All right, thanks for the help.

URL: https://forum.audiogames.net/post/598927/#p598927




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

The only time I ever use something like this (and I just use frozen) is when I have a runs counter, and I only want it written to when compiled. I really don't recommend using it for anything more than that.

URL: https://forum.audiogames.net/post/598727/#p598727




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

it's impossible to break, is my point.  You can't run it if it's not there, unless you steal it from the author somehow.

URL: https://forum.audiogames.net/post/598699/#p598699




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@camlorn, Yes I see, Your idea is much secure Because the code isn't included only with the source code not the compiled exe, So that is hard to break.

URL: https://forum.audiogames.net/post/598692/#p598692




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@camlorn, Yes I see, Your idea is much secure Because the code isn't include only with the source code not the compiled exe, So that is hard to break.

URL: https://forum.audiogames.net/post/598692/#p598692




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

This is trivially easy to undo.  It doesn't matter how you do this.  It doesn't matter what language.  If the code is in the game, someone can and will eventually figure out how to turn it on, and by the nature of such things it's pretty much always possible to patch the executable.Storing the password in a file is the kind of thing that someone will get through in about 10 seconds, when they open the game directory and go "huh, look at this password.txt, wonder what's in there".You have to make a devtools module, and manually remove it before compiling the game.  rite a little powershell script that copies all of the files to a temporary directory, remove the devtools module, then build the game.  To actually turn devtools on, set an env variable as described above, then:if os.environ.get("DEVTOOLS", 0):
import devtools
devtools.install()And you're done, problem solved.

URL: https://forum.audiogames.net/post/598689/#p598689




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

or maybe just add a file that contains a password or something, and add a function to check for that, For exampaldef is_dev():    f=open("developer_password.txt","r")    data="" />    f.close()    if data="" return True    else return Falsebut as others said, Someone may be able to get the way or/password, So put that in mine.

URL: https://forum.audiogames.net/post/598686/#p598686




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

If you need that, do:import sysif hasattr(sys, "meipass"): # codeOf course, this isn't elegant either, and I wouldn't recommend adding "dev-only" code in general when doing production releases.

URL: https://forum.audiogames.net/post/598667/#p598667




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

you're aware that if you're coding features that only devs can access then, even in the final version, someone is going to figure out how to access them?   This also holds true for e.g. C++.  In order to prevent players from having access, you must entirely remove the code before compiling, so that it's not in the final version at all, not merely do:if frozen:
# disable dev featuresBut: it is possible to tell, I seriously think it's sys.frozen, if it's not sys.frozen then go ask the people who wrote whichever packager you're suing.  As a temporary solution (or even a permanent one, to be honest) just set an environment variable DEVMODE=1 and then os.environ.get(DEVMODE, 0) will read it.

URL: https://forum.audiogames.net/post/598651/#p598651




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

Can't you just do likedev: bool = TrueAnd simply change it to False when compiling?

URL: https://forum.audiogames.net/post/598639/#p598639




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-14 Thread AudioGames . net Forum — Developers room : tunmi13 via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

Hi there,The reason I need this is for example, a feature that only devs can access. This can include changing cordinates, clearing NPC's, etc.

URL: https://forum.audiogames.net/post/598588/#p598588




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-09 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@14, you actually do not. Assuming you've passedpyinstaller --add-data sounds.dat;. myfile.pyw ...

URL: https://forum.audiogames.net/post/596806/#p596806




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-09 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@14, you actually do not. Assuming you've passedpyinstaller --add-data sounds.dat;. myfi.e.pyw ...

URL: https://forum.audiogames.net/post/596806/#p596806




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@13i am not talking about that.see, first in lucia, you do likepack=lucia.ResourceFile('encriptionkey')pack.load('path/to/pack/file.dat')see, here to load the pack, we need the path of it right? if it's loaded in a temp directory, how can we exactly find the path of where dat file is located.we need sys.meipasshope you got it.

URL: https://forum.audiogames.net/post/596702/#p596702




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-08 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@12 that's what lucia.set_global_Resource_file() does. 

URL: https://forum.audiogames.net/post/596638/#p596638




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-07 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@11im not talking about loading sounds.i mean, say you made sounds.dat with lucia. and, to load that, we need to know the path of the dat file. to get that, when compiled, it will extract ot temp directory. so, to get that directory, we need to use sys.meipass. to know that, we need to know if script is frozen or not

URL: https://forum.audiogames.net/post/596408/#p596408




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-07 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

For loading sounds? It sure does.

URL: https://forum.audiogames.net/post/596388/#p596388




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-07 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

no i don't think it does that for us @9

URL: https://forum.audiogames.net/post/596234/#p596234




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-07 Thread AudioGames . net Forum — Developers room : Turret via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

@8: Lucia handles this for you.

URL: https://forum.audiogames.net/post/596226/#p596226




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-07 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

meatbag, mey bee he is adding sounds.dat file in directly onefile script and when application runs, he wan't to directly load it from sys.miepass. as we knnow the data will extractto the sys.meipass directory. that is temperery directory of pyinstall extracts. it's use full to find out if it's using sys.meipass or root directory of the project with pyinstaller. and, many things like that i think

URL: https://forum.audiogames.net/post/596201/#p596201




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-07 Thread AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

tbh I dont know why you need such a thing in the firstplace, if you want something difrint in the uncompiled version, just add it in a seprit uncompiled version, and same for the compiled  version

URL: https://forum.audiogames.net/post/596187/#p596187




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-06 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

if your using pyinstaller, you indeed have a way to check this. but as other said, it mey have bugs some times. i havn't noticed, but well i can just tell you the way. but as camlorn said is right you can use that wayyou can make a variable. i can't remember it exactly, since i got to use it long time ago. so, as far  as i remember, it's sys.frozen. use the getattr to check it. for exampleimport sysiscompiled=getattr(sys, 'frozen', False)this return's true if your script is compiled using pyinstaller. it returns false if it's not.for more info, this mey help youhttps://pyinstaller.readthedocs.io/en/s … ation.htmlin this page, look at sys.executable heading and read that info. it mey help you.

URL: https://forum.audiogames.net/post/596134/#p596134




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

I'd strongly discourage this practice, as 2 and 3 have noted. Your bound to create bugs you won't notice if you do this, and its just generally not good practice anyway.

URL: https://forum.audiogames.net/post/596118/#p596118




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-06 Thread AudioGames . net Forum — Developers room : redfox via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

If you have something hinging on it, you can just have a flag for is_compiled that you switch when compiling. You still probably shouldn't have things be based on such things, but still.

URL: https://forum.audiogames.net/post/596095/#p596095




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-06 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

Camlorn is right here. Almost the only situation where I needed to know if my app is actually packaged into an executable or not (note, thats not the same as compiled or not) was when doing things like finding a config directory for either the plain script or the executable, finding the script's directory (the temp folder trick from pyInstaller usually prevents the usual way of detecting that), but other than that, there shouldn't be alot of situations where actually knowing that will benefit you.

URL: https://forum.audiogames.net/post/596070/#p596070




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking if a script is compiled or not in Python?

2020-12-06 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: Checking if a script is compiled or not in Python?

It's going to depend on which thing you use to compile it, but I believe that the compilers maybe set sys.frozen, which isn't normally on the sys module, so something like getattr(sys, 'frozen', False).  But, while you're figuring this out, you should also figure out if you can just not need to know, because changing code based on whether or not it's frozen is in general a good way to have bugs.

URL: https://forum.audiogames.net/post/596032/#p596032




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Checking if a script is compiled or not in Python?

2020-12-06 Thread AudioGames . net Forum — Developers room : tunmi13 via Audiogames-reflector


  


Checking if a script is compiled or not in Python?

Hi,I was wondering if there was a way if you could check the status of a Python script to see whether it is actually an executable or just the naked .py file. I remember BGT had a feature like this built in, but I'm not sure if Python does, after doing a thorough Google search.Any help would be appreciated.Thanks.

URL: https://forum.audiogames.net/post/596015/#p596015




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector