I need to debug cython code. Official documentation says, I need to install "gdb 7.2 or higher, built with Python support". Unfortunately I didn't find any step-by-step guide how to install it on Windows 7. Do I have to build it myself (how?) or there already exists an installer for Windows 7, 64 bit? Any help would be greatly appreciated.
I use Windows 7, Python 2.7 64bit and Visual Studio 2008.
Also suggestions about alternative ways to debug cython (especially concerning non-console visual debuggers) are welcome. Thanks in advance for your help!
As with all GNU projects, GDB is provided as source code. The good news is that this means it can be built to run on practically any platform. The bad news is that, unless someone has already figured the process out for you, you have to do it yourself. GDB will be provided built-in on virtually any Linux distribution, but with Windows you're on your own.
You basically have three options:
Move development (or at least debugging) over to Linux. This isn't as hard as it sounds. You can easily run Linux within a virtual machine inside Windows using VirtualBox, which is free software under GPL.
Do debugging using a Cygwin shell inside windows. Cygwin is free under the GPL and allows you to run a Linux-like environment in Windows. It includes most of the GNU software, including the latest release of GDB.
If you're feeling particularily adventurous, you could try to compile GDB yourself to work on your Windows system. This is by far the hardest route, and only for someone familiar with programming on Windows platforms.
In the end, I would strongly recommend using Linux for any serious Python development, especially when using Python extensions that do not have large developer communities.
Related
I would like to use my Raspberry Pi for some programming. (never done it before, I want to get into Python.) If I can transfer my programs yo my Windows 8.1 computer and run them there also, that would be perfect. Can I do that? Thanks!
Yes! Python code is mostly platform independent. Only some specific libs must be compiled in the Maschine. These should be installed using pip (if needed). More info in Google.
Short answer: Yes.
Long answer: That is the whole point actually. Just make sure you install proper python version on your Windows machine, and set up path properly in order to be able to start your python scripts globally. Here is a nice resource - https://docs.python.org/2.7/using/windows.html. Once you set it up, you just need to transfer your .py files from Raspberry Pi to Windows machine.
Short answer: mostly yes, but it depends.
Obviously, the Raspberry Pi specific libraries for controlling its peripherals won't work on ms-windows.
Your Pi is probably running a Linux distribution that has package management and comes with a functioning toolchain. That means that installing (python) packages and libraries will be a breeze. Tools like pip and setup.py scripts will mostly Just Work.
That is not necessarily the case on ms-windows.
Installing python libraries that contain extensions (compiled code) or require external shared libraries is a frustrating epxerience for technical reasons pertaining to the microsoft toolchain. On that OS it is generally easier to use a python distribution like Anaconda that has its own package manager, and comes with packages for most popular libraries.
Furthermore, if you look into the documentation for Python's standard library you will see that sometimes a function is only available on UNIX or only on ms-windows. And due to the nature of how ms-windows creates new processes, there are some gotchas when you are using the multiprocessing module.
It would be a good idea to use the same Python version on both platforms. Currently that would be preferably 3.6 or 3.5.
Is there any way to launch a Python3 / GTK3 based application on a Windows machine? It seems that this is not that simple as with GTK2/Python2.
Thanks a lot,
Thomas
I hope, i understand the question. You Need a actual runtime of gtk3 on Windows.
inofficial gtk3.14.13 64bit-Runtime, 32bit here not available,
see:
https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer
win32 and win64: experimental official runtime 3.6.4 in http://www.gtk.org/download/index.php
is very Alpha or beta.
I hope this helps enough for gtk3.
As far as I know, there are still no official GTK3 or GObject-Introspection libraries for Windows, and so there are no python bindings.
I'm assuming you want the development kit. Windows version has indeed been missing for a long time, but there's some available now.
Going to official site and finding https://wiki.gnome.org/Projects/PyGObject, you can find a link to "Windows installers" which should lead to a rather massive all-in-one installer for Gtk3 and many related libraries for Python 3. You can load a current cpython from https://www.python.org/downloads/ and install that first.
For windows, there's also a lot of unofficial pre-built packages in http://www.lfd.uci.edu/~gohlke/pythonlibs/. Cpython 3.4 at least seems to include a functional pip for installing wheels.
I've made some use of these for running some python and matplotlib code 64-bit windows and they work rather nicely with 64-bit python 3.4. You can test with e.g. http://gtk3-matplotlib-cookbook.readthedocs.org/en/latest/ to find backend settings and other tips.
I have a lovely Macbook now, and I'm enjoying coding on the move. I'm also enjoying coding in Python. However, I'd like to distribute the end result to friends using Windows, as an executable.
I know that Py2Exe does this, but I don't know how portable Python is across operating systems. Can anyone offer any advice? I'm using PyGame too.
Many thanks
The Python scripts are reasonably portable, as long as the interpreter and relevant libraries are installed. Generated .exe and .app files are not.
Py2exe generates Windows executables, so they will only work on the Windows Platform. The FAQ at http://www.py2exe.org/index.cgi/FAQ has more information on how it all works. Essentially it provides what is needed to run on Win9x as well as more current platforms. NOTE: the FAQ mentions some potential gotchas with character encodings and the work arounds.
With python, it is common enough on Unix based systems, as several Linux distributions have their custom maintenance scripts written in the language. So the Python scripts will be just as portable as Ruby scripts, etc. As long as the target machine has the interpreter and you are not using external programs that are only on one type of platform, others will be able to use your work.
Personally I experienced huge difficult with all the Exe builder, py2exe , cx_freeze etc. Bugs and errors all the time , keep displaying an issue with atexit module.
I find just by including the python distro way more convinient. There is one more advantage beside ease of use.
Each time you build an EXE for a python app, what you essential do is include the core of the python installation but only with the modules your app is using. But even in that case your app may increase from a mere few Kbs that the a python module is to more than 15 mbs because of the inclusion of python installation.
Of course installing the whole python will take more space but each time you send your python apps they will be only few kbs long. Plus you want have to go to the hussle of bundling the exe each time you change even a coma to your python app. Or I think you do , I dont know if just replacing the py module can help you avoid this.
In any case installing python and pygame is as easy as installing any other application in windows. In linux via synaptic is also extremly easy.
MACOS is abit tricky though. MACOS already come with python pre installed, Snow leopard has 2.6.1 python installed. However if you app is using a python later than that and include the install of python with your app, you will have to instruct the user to set via "GET INFO -> open with" the python launcher app which is responsible for launcing python apps to use your version of python and not the onboard default 2.6.1 version, Its not difficult and it only takes a few seconds, even a clueless user can do this.
Python is extremely portable, python pygame apps cannot only run unchanged to the three major platform , Windows , MACOS ,Linux . They can even run on mobile and portable devices as well. If you need to build app that runs across platform , python is dead easy and highly recomended.
If you are planning to include Linux in your portability criteria, it's worth remembering that many distributions still package 2.6 (or even 2.5), and will probably be a version behind in the 3.x series as well (I'm assuming your using 2.x given the PyGame requirement though).
Versions of PyGame seem to vary quite heavily between distros as well.
I need to make some Python applications for a work project. The target platform is AIX 5.3.
My question is: What version of Python should I be using?
My requirements are:
The Python version must be easy to install on the target machines. Others will do that according to instructions that I write, so no compiling from source or anything like that.
The Python version must have ncurses or curses support (I'm making a form handler).
I've found two different precompiled versions of Python for AIX, but one (2.1.something) didn't include the curses module, and the other (2.3.4, RPM format) had prerequisites that I failed to fulfill).
Any help would be greatly appreciated.
Use the AS Package of Python 2.6.3.7 from Activestate. They have a binary package for AIX on their download site.
If you don't have an AIX machine to test it on, the install works the same way on Solaris or Linux, so you could write your documentation based on that. Basically, you ungzip the tarball file, use tar to unpack the archive, change directory to the unpacked folder, run a shell script to install it, tell the shell script what directory to place it in, and wait.
Normally this would be used to install into a user directory, without superuser permissions, but you could install it anywhere that you like. You might also need to edit the system profile in order to make sure that all users can find the Python binary.
I suggest the latest Python 2.6, because it has a lot of bugfixes, and there is now a critical mass of 3rd party libraries ported to it. Also, the standard library includes a lot of useful stuff that you used to have to collect separately. Curses is in the standard library of Python 2.6.
Make sure to avoid Python 3.1 since it has not yet matured enough and provides few benefits for most business applications development.
I'd compile it from source myself and tell them where to download it from in the instructions
We've used ActiveState's Python as well as Pware's compiled version. Both have worked well. For AS, we've used 2.5 and 2.6. For Pware, just 2.6. Both 2.5 and 2.6 from AS support curses on our machine.
I've compiled from source but usually wind up having trouble with with ctypes or SSL. Currently I have the Frankenstein option going of AS Python2.6 installed but I pulled out a couple of *.so files from Pware's. I'm using GCC since we've never ponied up for a compiler but depending on what you need from Python, it's definitely doable if I can do it.
I will mention that AS Python claims to be 100% compatible with standard Python and it has been for everything we've done so far (mostly web applications).
How do I get python to work with aptana studio?
I've downloaded a bunch of stuff, but none of them seem to give me a straight text editor where I can interpret code into an executable type thing. I know there's interactive mode in IDLE, but I want to actually use an editor. So I downloaded the pydev extensions for Aptana studio, but it wants me to configure a python interpreter (so I guess it actually doesn't have one). Where can I find a straight python interpreter that will work with this? or another IDE?
It's easier than you think. First, there's a version of python on your machine by default. It's kind of out of date, though.
MacPorts is a nice method to get lots of good stuff.
ActiveState has a Python Mac package downloadable for free.
Python.org will lead you to some other options as well.
To add the current Python version on Mac:
Add new interpreter via Aptana Studio 3/Preferences/PyDev/Interpreter-Python.
Give it name (check version using the Terminal and then python or /usr/bin/python.
Then add the path (2.7 in my case): /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
If you install your own (2.6 in my case) use the following path instead:
/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
Don't forget to hit the "Apply" button...
Idle has a complete text editor -- open a "new window" and type away. Be sure to save it before you run it.
What didn't you like about the IDLE editor?
Also, look at Komodo Edit for Mac OS X. Very nice.
For windows, I'd recommend the aforementioned ActivePython. Mainly because it comes with Python win32, which you're going to end up installing anyway.
Secondly, if you're coming from the world of Java and C#, you might be expecting too much out of your IDE. I eventually found that more powerful IDEs just made things more difficult than they helped. So my advice is to try to go with something simple. In other words, go with something that will let you jump in and start coding rather than bugging you with a lot of features you probably won't need anyway. :-)
EDIT: One other thing, find and install pip. It makes installing python packages so much easier.
A lot of the sites in the Windows list mirror the Mac list.
Python.org has Win32 and Win64 installers.
ActiveState has a free Python Win32 package downloadable for free. There is no Win64 version (yet?).
PyWin32 is a Python package with extra modules for interfacing with Windows. This is not Python itself. These haven't been updated for Python 3.0, though. Despite the name, there is a Win64 version for Python 2.6 on this site.
On Mac OS X Leopard and Tiger, Python is already installed.
On Mac, I've tried a few editor. Textmate is my current choice. If you're looking for a free one, I really liked Xcode. But you'll have to run your script from the command line.
If you want a cross-platform environment, you could try Eclipse and the pydev extension. So you don't get lost between the two platform.
For Windows Operating system,
If you want to work with python using Aptana Studio. You have to do some simple basic settings with the interpreter.
For detailed step by step guide. You can follow this website link
http://www.infoknol.com/aptana-python-setup-guide/