How to verify it's the same computer [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I was wondering if there's any Python code I can run that, assuming the Python code has not been tampered with, will return an ID specific to that computer that cannot be spoofed. My initial thought was to use MAC addresses, but I know those can be easily spoofed. How about CPU serial number? How would I go about doing that?
Thanks.

This is an impossible problem, as it's equivalent to effective DRM. Every identifier can be spoofed. Remember, the user can tamper with your Python code (any compiling/obfuscating/encrypting you do can be reversed, so don't bother) to return whatever identifier they want. (And even if your code were absolutely read-only, they could change the Python runtime or the OS to do whatever they want.)

Related

When to use while true [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 months ago.
Improve this question
What are some acceptable use cases for using while true. I’ve heard that it’s not good practice to use while true and break. For simple use cases like let’s say a rps game, would it be worth using. If not, I’m considering to use boiler plate code.
You can use while(True) in such conditions when you need to make the code running until interrupted by the person running the code.
A use case can be fee submitting system. The program needs to be running for the entire day. There are a lot of other use cases too.

Running a function with the different functionalities at different times in Python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I'm looking for a way to create a function that takes two args, time and operation and it does the operation at the given time as an argument. The script should be running on a server and it reads the data from a Redis-like database. I'm trying to find a way to do that avoid using any other frameworks or non-standard packages. Have any idea about that?
See the library https://github.com/dbader/schedule and this example https://github.com/dbader/schedule/blob/master/docs/examples.rst#run-a-job-once

how can I translate efficiently a Java code to python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would be greatfull if you could tell me how one can translate a code from Java to python.
Should one do it manually ? is there any tool to convert it automatically?
If you want to translate java code to python you have to translate it manually. Automatic conversion generally does not have the appropriate quality. It looks like there are some tools out e.g. java2python but the author states
The generated Python code is not guaranteed to run, nor is guaranteed to be syntactically valid Python.
Converting a library to another programming language is never an easy task.
If you simply want to use a java library in a application that you want to write in python you could give jython a try.

hook file creation in python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm working on a program, where in some part of it, it needs to listen to the OP for when files are created/saved, so I can work on said file.
I know the basic concept of hooking, but I don't know exactly how to implement it in this specific use(I know how to attach a hook to a specific PID, but here I need to listen to all processes and see if one of them is creating a file).
I'm using pydbg for my hooking needs, but if your answer uses something different, feel free to still answer.
Thanks :)
It seems you need something like watchdog, pyinotify or python-inotify. You can also see this SO question for other options.

How do you save what you've done in a module without keeping the computer on? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Am going to design a game about raising dragons but don't know a way of saving my session/exp/stats so it would be pointless! Can't work out how to use pickle so can somebody give me an answer?
P.S.Simplify your answers as I am stupid
Here is a link for info on basic I/O in the standard library: http://docs.python.org/tutorial/inputoutput.html You will want to store the data from the game in some format (that is up to you) to a file, and then, later, you will read the file, and parse the data, and put it back into memory when the user comes back from a previous session.

Categories

Resources