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 9 years ago.
Improve this question
Can I know this information across python?, for example, the name of the card graphic, processor, audio, mother board ....
There isn't anything in Python itself. You can detect what OS you're on via the platform module. Otherwise
See also:
How can I return system information in Python?
If you're on Windows, you can probably use PyWin32 to get some of this information. See the following recipe to get an idea of some of the stuff you can get:
http://code.activestate.com/recipes/511491-getting-system-information-under-windows/
I also wrote a little about this regarding getting Windows system information here:
http://www.blog.pythonlibrary.org/2010/01/27/getting-windows-system-information-with-python/
You might be able to use HAL:
http://www.daniweb.com/software-development/python/threads/300786/how-to-get-graphics-card-details-in-python
I have also found the psutil project very helpful. I also came across PyCPU, although I'm unsure what its status is.
For Linux (and probably Mac), you'll probably have to use system commands called via Python's subprocess module and parse the result(s).
Related
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 am developing a paid program in Python with Tkinter. How can I make the program user-specific. I don't want people sharing their license. If there is no better option than serial keys. What is the best way of doing this? Doesn't have to be top of the line security. Just don't want people to share their license..
You could embed the machine ID and user ID in your code to check at startup.
import getpass
userID = getpass.getuser()
import socket
machineID = socket.gethostname()
Also see (not verified but here it goes): Getting computer hardware information
Also at the Windows command prompt, you can use systeminfo which will give you the whole computer information. From Python you can run os.system('systeminfo > lolo.txt') which will display and pipe to the text file.
I was looking a the same problem you have. Hope it helps
If you want to use python to write code, but keep embedded secrets, your best bet will be to compile to binary and ship only binary to users. PyInstaller is a good place to start your research. There are several alternatives to PyInstaller.
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 don't want to use any library. And learn popular image processing algorithms and implement it. Purely using Python.
It's my project in college. Not anything fancy, just want to implement simple image processing algorithms on Bitmap.
Here, I'll give you a start without libraries.
filer=open('turkey.png','rb')
print(filer.read())
filer.close()
Then you have to figure out a way to decode it.
You can't. Simple answer. Python on its own does not have any libraries pre-installed or pre-imported for manipulating pictures. Why wouldn't you use libraries? If you are building a big project or even a smaller one, I think you will need to import a library. Python is very dependent on libraries! Maybe in the future if python has a pre-installed & pre-imported library for picture editing! :)
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 am attending a coding bootcamp and python is the primary language. For the final project, we were told to study and learn how to create console apps. I have searched online for tutorials and books but none seems to have beginner content. Where can I get the best tutorial on creating Python console apps? I have only done python for a month.
Argparse for parsing command line arguments :
https://docs.python.org/3/library/argparse.html
Then for input you can use input(), or maybe curses.
https://docs.python.org/3/library/curses.html
Curses is a really powerful tool.
As an example here's htop that uses ncurses :
http://hisham.hm/htop/
Using sys.stdin.readlines() you can get the data that has been passed to your application, exemple :
cat myfile.txt | myapp.py
Then you can render your script executable using chmod +x, and adding a header in your script to the python binaries to use :
#!/usr/bin/python
Then you could create an alias, or add your program to the PATH, so you could use it from anywhere on the system, like ls, cat or whatever you may think of...
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
Is there a way to define what window is being used in python? Such as, if I have three separate Firefox windows open, how would i get a python program to know which one I am looking at/scrolling through/clicking on/typing in? I am having a really hard time trying to find a good way of describing this so if you don't understand please tell me so i can elaborate. I cant really decide what to type into Google to solve this so anything would help. i am using Windows 7.
Here is a simple example:
import win32gui
win = win32gui
while True:
print(win.GetWindowText(win.GetActiveWindow()))
If the module is documented well enough try help(win32gui) after it is imported.
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 9 years ago.
Improve this question
I searched a lot, but couldn't find any precise answer to my question. I would like to programmatically be able to simulate user interactions with the computer. I would like to target OSX since that's what I am working on. For example, I would launch Dashboard or Mission Control, move the mouse and click on things, open a keyboard, etc.
I wonder if I should use Linux with Xlib or something like that... Would I be more free to execute these kinds of operations? And do you know any libraries that allow them easily, in Python preferably?
This kind of software is called a "robot", or "ui automation", which makes googling a little difficult. Here is one in python: http://code.google.com/p/robotframework/
I like to use Sikuli for this sort of thing. Last time I needed to automate a GUI app on OS X, I wrote a standalone Jython script which used Sikuli as a library.
You can also use the Sikuli IDE if you want to get something working quickly, which can be nice for experimentation.