Using PyParallel in Windows XP - python

I have successfully implemented the PyParallel module in both Linux and Mac OSX as part of a large application to interface with a sensor I am developing.... I am now attempting to use this application on an instance of Windows XP. I have found several references (including right from the PySerial/PyParallel group) that:
The windows version needs a compiled extension and the giveio.sys driver for Windows NT/2k/XP. It uses ctypes to access functions in a prebuilt DLL.
However, I don't know what "a compiled extension" requirement is. And, I can't seem to get givio.sys to work. I obtained giveio.sys here and followed the recommendations, but LoadDrv.exe fails to "start" the service (it does "install", however).
I cannot find specific examples online of getting PyParallel working on Windows XP. Since PyParallel is "thoroughly" integrated into the application and is working on both Linux and Mac OSX, I'd prefer not to use a different module -- especially since PyParallel is great to not require root/administrator privileges to utilize.

I was having trouble with giveio.sys and LoadDrv.exe as well.
There is a handy installer that does it all automatically:
http://sourceforge.net/projects/pyserial/files/pyparallel/giveio/

Related

Python and Active Directory (modules pyad, flask_ldap, active_directory, python_ldap, etc.)

Trying to investigate using Python instead of a compiled language to support users with "web applications", etc. So at this point, I'm getting the various aspects of "what we do" and trying basic things out to find out if they work.
I'm sure this will probably result in a "not specific enough", or something similar, BUT there are so many problems/issues with all the packages I've tried to install for Python and Active Directory, it makes me wonder if these are being heavily used, and if not - what should be?
We operate in an mixed Windows/Linux environment, Windows servers are 2012/2012R2/2016, Linux boxes are generally RHEL 7 level (couple of older RHEL5 boxes that will be updated). PCs are all 64bit, Windows 10
Need the following capabilities
Host the flask content on either Windows or Linux server
Get the current AD account login from the client (are they logged into AD, and what account?)
From that current account - get the groups that the account is a member of
something still supported, and not "umpteen" years old...
I've "looked" into using/installing (on Windows ONLY at this time...):
active_directory (fails because of print syntax errors in the installation of pypiwin32 apparently)
pyad (fails due to above issue in pypiwin32)
python_ldap (fails because VStudio 14.0 is required?! I don't know of a VS version 14 - and this is "Windows unique")
flask_ldap (requires python_ldap which fails)
couple of others with same problems, etc.
Why do several of these REQUIRE a Win32 component (pypiwin32), especially if you operate in a "64bit only" environment? I'm also assuming the pypiwin32 "print" issue is a change between python 2 and 3 (i.e. "print 'something'" vs. "print('something')"???
Being as nothing I can find for python and active directory will install, I'm not sure where to turn. As I said, I'm investigating at this point.
win32 appears to be the only officially supported version, but there are alternative 64bit builds available.
e.g. https://www.lfd.uci.edu/~gohlke/pythonlibs/

Getting gpu vendor name on windows and linux

I'm currently writing some integration tests which should run on different physical machines and VMs with different OS.
For one type of test I have to find out if an nvidia-graphic card is installed on the running machine. I don't need any other information - only the vendor name (and it would be OK if I only knew if it is an NVIDIA graphic card or not - not interested in other vendors).
I can only use the python standard lib so I think the best way is to use subprocesses and using the shell.
Are there some commands for Windows(Win10x64) and Linux(Fedora, CentOS, SUSE) (without installing any tools or external libs) to find out the gpu vendor?
Following solution:
On Linux I'm using lsmod (or /sbin/lsmod; thanks to n00dl3) to see any occurence of "nvidia" and on Windows I'm using wmic path win32_VideoController get name to get some gpu information.

Python: could a script compiled with py2exe freeze the operating system?

I am using py2exe to compiling python scripts in executable files on Windows Xp/7/2000.
I am wondering if such executable scripts could freeze the operating system, and I have to reboot Windows.
I suppose such problems could occur if I try to manage driver library.
What do you think about?
Theoretically, yes. Windows is not the most stable OS out there, and programs sometime "freeze" it even without mucking with drivers and kernel-mode code. Python programs aren't any different in this respect, whether packed with py2exe or not, since Python programs on Windows easily have access to the same Windows APIs any other program can access.
However, I have a feeling you're not "just asking" if you have a specific application freezing the system, it's something that should be addressed for the specific case in hand. Unless the application does something really crazy, it's probably a bug in it that can be solved.
A Python program - regardless of whether iterpreted by the Python executable or in py2exe form - can do the same as any other program. That means that it should not be able to freeze a modern operating system unless it is run with superuser rights. However, programs (especially malicious and badly written ones) can significantly degrade user experience, for example by going fullscreen and refusing to show the desktop or starting lots of threads and processes.

desktop development language compiled binary or scripting language (windows)?

Does anyone use a scripting language only solution to produce a binary (.exe) to produce a commercial desktop application for windows or mac? e.g. Java, python etc. If so how do you distribute your app and does using a scripting language cause any problems with the installation?
I'm asking about users that can download an application and install it, they don't know about setting path variables, or changing there JAVA_HOME. The assumption for the PC are users with a consumer PC with windows (XP/Vista/7), not power users. (Or alternatively a mac type solution would be interesting to hear about to)
I have done this in a couple ways. One was to use Python and py2exe, and the other was to use Idle, a Lua-based "compilable" language, using InnoSetup to create installers.
I have had no problems with either, though I haven't used Idle for anything of any significant complexity --- its main advantage is the small size of the executable produced. With py2exe, you have to be careful to get all the dependencies included in the package, and I recommend testing it thoroughly on a clean installation of Windows before releasing. For example, when I used PyGTK with py2exe, I had to be very careful to get the theming files included in the package. It was not evident at first that I had missed them, since PyGTK found them in the installed version on the development machine.
I also had to be careful about installation paths, permissions, and startup directories, as well as licensing of the libraries I used, but that's nothing you wouldn't have to be concerned with in a more traditional compiled language. Other than the relatively large size of the installer, I've been very happy with py2exe and InnoSetup, and I'd recommend it.
Does anyone use anything else for shrink wrap apps on windows? e.g. Java, python etc.
Yes. I assume you're not really asking about Java, since that is so wide-spread. I can count quite a few Java applications that I use, and I don't operate in the "Enterprise" environment.
There are tools that allow you to ship Python code without shipping actual .py files and without needing the to actually have Python installed, so there are solutions for that as well. Since such tools exist I assume people do ship Python applications.
If so how do you distribute your app and does using a scripting language cause any problems with the installation?
What scripting language?

Building PyGTK- and poppler-based binaries under Windows

For quite some time now, I've been fighting in vain to get a software I'm working on to work under Windows. It's written in Python (the 2.x series), and although all Linux users can benefit from its GUI when they use the source package, it seems that many people who download it go for the Windows package, for which I've only been able to provide command-line binaries.
The GUI was built using Glade/GTK, and uses poppler to embed a PDF viewer. I've found various howto's in the past (I don't have them at hand right now, sorry), which I've tried to follow religiously, but I never got things to work at all.
So, is there a reliable tutorial explaining exactly how to install the needed libraries (GTK and Poppler), so that I can build the corresponding binaries for my users?
There is a window installer here: http://download.gnome.org/binaries/win32/pygtk/2.22/

Categories