I seem to be a fairly reasonable programmer once the configuration is set up, but am a noob at yak shaving, especially when there is a confusing choice of different yaks.
I am enjoying learning Python. It was the obvious choice with its abundance of libraries, native execution on both windows (for the moment) and linux (later, but not right now), and regular syntax. Up to now, everything I've wanted to add on has either just installed from a binary, or just been a simple file copy to the lib folder; pyaudio, numpy, videocapture, etc etc.
I am now tackling USB. I have bought a UM245R usb module and want to bit-bang it. I quickly learnt from PyUSB errors that I needed a backend. After a bit of reading, it appeared that as I have no legacy code, libusb1.0 was the appropriate choice. Is this correct?
Now my problems start. I am thoroughly confused about how to get it onto my PC. I have no tools or experience to build it from source, and cannot find anything that claims to be a self-installing .exe. I have seen a number of seperate installers mentioned, but cannot find any concensus on which uses what or is the correct way to go. I think I've been through all the replies here tagging libusb, without finding the specifics.
Would somebody who's done this for windows (XP SP3) take me by the hand and tell me what to use to install it please, for Python 2.6.
thanks in advance
From the pyUSB tutorial; "platform neutrality; ... PyUSB comes with builtin backends for libusb 0.1, libusb 1.0 and OpenUSB". So pyUSB doesn't really care what you use. But libusb 1 seems to be the safe choice.
Look at the windows backend section of the libusb wiki. You'll find prebuilt windows binaries (zadig.exe, under "Driver Installation") for libusb 1.0 there.
There are known restrictions to the underlying Microsoft driver that might impact its usability; e.g. you cannot reset USB devices nor change the device configuration.
Related
I read somewhere you could run python without an OS. How would I do this? Would I need to compile it? Can I run it raw? And if I did need to compile it, what tool would I use and what format would I compile it to?
As far as I know there's not really any way to do this easily but I could be wrong. There are "portable" versions of python but these are operating system dependent. I think what you're referencing is some guys at PyCon managed to run python from the GRUB Bootloader. Your best bet would be installing some minimalist Linux distribution, with essentially only Python and some core packages required to run. The problem is that there's a lot of types of hardware out there, all with their own drivers and assembly language. Python can work as a low level language when you need it to but it seems like configuration would be a nightmare. I haven't looked into it super thoroughly but it seems difficult and impractical. Having an OS above python gives you access to the package managers IDEs and compilier options that make python worth using.
yea that's one of the options, pretty much all the "light" distros will be similar, if you want more to try out try here. Not sure why you're worried about speed though, if you're having speed issues it's far more likely to be the IDE you're using or your code bogging down the computer, not any sort of compiler issues.
Have a few questions about libusb VS openusb
I'm the author of a project called Berry4all that allows tethering for Blackberries Via USB.
Cuurrently I'm using libusb-0.x but i'd like /need to migrate to either libusb1.x OR libopenusb ... but I'm not sure which to pick
Some of the things I need:
- Linux support
- Mac OSX support (need it to work and be able to package it)
- Python bindings
Opinions on either and why pick one over the other.
I would go for libusb-1 because it seems architecturally simpler, more actively maintained, more portable and more mainstream than OpenUSB. Their webpage lists successful projects based on it, and a small comparison to OpenUSB you might find useful.
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/
After playing around with NSIS (Nullsoft Scriptable Installation System) for a few days, I really feel the pain it's use brings me. No wonder, the authors claim it's scripting implementation is a "mixture of PHP and Assembly".
So, I hope there is something better to write installation procedures to get Windows programs installed, while creating the installation package on Linux.
But I did not find anything yet. Wix looks promising, but seems not really to run on Linux, Python can create .msi files - but only when running on Windows.
Izpack is out of the game because it requires Java for the installer to run on the target system.
Our app to be installed is a python app (and I'm even thinking about scripting the whole install myself in Python).
Any other ideas?
Forgot to say: Free/OpenSource apps preferred.
Not only because of cost, because of the power to control and adjust everything.
We might be willing to pay professional support if it helps us getting to our goals fast, but we also want to have full control over the build system.
You may be interested by BitRock
You might try looking at InstallAnywhere, but it may require Java.
Try running InnoSetup under Wine. It should work unless you have some very specific needs. InnoSetup is open source, BTW.
It seems that pyinstaller might do the trick. I'm also looking for something like what you need. I have not tried it yet ...
I have started on a personal python application that runs on the desktop. I am using wxPython as a GUI toolkit. Should there be a demand for this type of application, I would possibly like to commercialize it.
I have no knowledge of deploying "real-life" Python applications, though I have used py2exe in the past with varied success. How would I obfuscate the code? Can I somehow deploy only the bytecode?
An ideal solution would not jeopardize my intellectual property (source code), would not require a direct installation of Python (though I'm sure it will need to have some embedded interpreter), and would be cross-platform (Windows, Mac, and Linux). Does anyone know of any tools or resources in this area?
Thanks.
You can distribute the compiled Python bytecode (.pyc files) instead of the source. You can't prevent decompilation in Python (or any other language, really). You could use an obfuscator like pyobfuscate to make it more annoying for competitors to decipher your decompiled source.
As Alex Martelli says in this thread, if you want to keep your code a secret, you shouldn't run it on other people's machines.
IIRC, the last time I used cx_Freeze it created a DLL for Windows that removed the necessity for a native Python installation. This is at least worth checking out.
Wow, there are a lot of questions in there:
It is possible to run the bytecode (.pyc) file directly from the Python interpreter, but I haven't seen any bytecode obfuscation tools available.
I'm not aware of any "all in one" deployment solution, but:
For Windows you could use NSIS(http://nsis.sourceforge.net/Main_Page). The problem here is that while OSX/*nix comes with python, Windows doesn't. If you're not willing to build a binary with py2exe, I'm not sure what the licensing issues would be surrounding distribution of the Python runtime environment (not to mention the technical ones).
You could package up the OS X distribution using the "bundle" format, and *NIX has it's own conventions for installing software-- typically a "make install" script.
Hope that was helpful.
Maybe IronPython can provide something for you? I bet those .exe/.dll-files can be pretty locked down. Not sure how such features work on mono, thus no idea how this works on Linux/OS X...
I have been using py2exe with good success on Windows. The code needs to be modified a bit so that the code analysis picks up all modules needed, but apart from that, it works.
As for Linux, there are several important distribution formats:
DEB (Debian, Ubuntu and other derivatives)
RPM (RedHat, Fedora, openSuSE)
DEBs aren't particularly difficult to make, especially when you're already using distutils/setuptools. Some hints are given in the policy document, examples for packaging Python applications can be found in the repository.
I don't have any experience with RPM, but I'm sure there are enough examples to be found.
Try to use scraZ obfuscator (http://scraZ.me).
This is obfuscator for bytecode, not for source code.
Free version have good, but not perfect obfuscation methods.
PRO version have very very strong protection for bytecode.
(after bytecode obfuscation a decompilation is impossible)