Cygwin and Python 2.6 - python

New to python (and programming). What exactly do I need from Cygwin? I'm running python 2.6 on winxp. Can I safely download the complete Cygwin? It just seems like a huge bundle of stuff.
Well, I keep running into modules and functionality (i.e. piping output) which suggest downloading various cygwin components. Will cygwin change or modify any other os functionality or have any other side effects?

There are builds of python which don't require cygwin. For instance (from python.org):
link text
Also, there is the .NET version called Iron Python:
link text

cygwin is effectively a Unix subkernel. Setup and installed in its default manner it won't interrupt or change any existing Windows XP functionality. However, you'll have to start the cygwin equivalent of the command prompt before you can use its functionality.
With that said, some of the functionality you're talking about is available in Windows. Piping definitely is. For instance:
netstat -ano | findstr :1433
is a command line I use to make sure my SQL Server is listening on the default port. The output of netstat is being piped to findstr so I only have to see any lines containing :1433.

I would say the simplest option is to try a Linux Distro. I know if your new Linux can be intimidating, but when I looked at Ubuntu and started developing there my life was changed. Ubuntu is bloated (for linux) however, it comes with the things that I would expect a Microsoft based OS to come pre-packaged with. The limitless amount of free software written by creative minds for creative minds is a wonder. The open-source community is great to get involved in for learning and experience. I can vouch that programming on Linux in any language (except myabe . . . .NET ?) will be a much pleasurable experience from the go. One is windows paths, sure you can still create portable Python applications that will port to windows, it just requires another couple lines of replacing characters and escaping them. If they are personal apps this can be bothersome if you do not plan to distribute them.
I found Ubuntu to be a nice balance suited towards both general usability, and development.
Stock Distro:
Python 2.7
Perl
XTerm
MP3 Player that kills WMP and Winamp =+ V.3.0
E-Mail w/ Thunderbird ( much like outlook express by the makers of Fire Fox browser with add-on and extensions)
Empathy (Internet Chat Client for AIM, ICQ, FACEBOOK, MySpace, etc . . it also keeps all your contacts on one list and operates just like AIM for all accounts)
Gwibber (social networking app that compiles the posts made on your twitter and your Facebook wall into a nice desktop widget that also allows you to reply and comment right from the app.)
Multiple Desktop Support: You can change your "desktop view" by pressing a hot key. Each desktop only has the windows you want on it. So you can create a work space, a chat space, a web browsing space and alternate between them quickly. You can also move windows around between work spaces quickly as needed.
Global Hot-Key Mapper: In your administration options you have an OS wide hot-key map. You can launch programs, and many other tasks simply by assigning a hot-key through the default interface.
Bash, Terminal, Shell, XTerm: These CLI (command line interfaces) offer much more functionality as you found than can be generally found in windows. Yes you can pipe output in windows but that's not what this is about. These CLIs allow you to create scripts that can take user input and perform complex tasks that usually would have to be done manually. The BASH is somewhat a programming language of itself; allowing for the assignment of functions, variables, if statements, etc.
I was very surprised that not only was Ubuntu well and ready to handle the developer but it was also plenty user friendly for your grand-parents. It comes with everything you need out of the box (for an average user not a developer) and the developer only requires a few installs. You're also working in open-source software remember. So you are going to be dealing with bugs and you may be stuck waiting on a ticket to be resolved in Windows for some time. If ever.
Also, Ubuntu is boot-able from CD and you can check out the main interface just by doing so. You can also dual-boot it with a screen asking you which partition/disk to boot after POST boot. There is also a tutorial on running it off a thumb drive.
Linux and the speed of your computer: Linux compared to say Windows 7 is EXTREMELY lightweight. What is considered to be a MID level computer such as an AMD Phenom 955 Black Edition x4 and it will run like a high level computer. 1 gib of memory goes quite a bit further in Linux than it does in windows.
The best way to try a Linux distro is as follows. You do not have to install it on the system. You can sandbox it with a virtual environment if you like it and want the speed and overhead improvements of running it stand-alone maybe consider the dual-boot at first followed by the "change".
Download the Linux Dist ISO of your choosing. For new users again Ubuntu, Mint, something simple. Something debian. Mostly due to the ease of using a good package manager. Download Oracle Virtual Box . Follow the instructions, create a new virtual disk, then start the virtual disk with install media placed in DVD drive or virtual DVD drive and install like a normal OS.
In my experience unless it is essential that you be using windows all the time, there is no reason not to try a Linux Distro. Just be careful because something like ArchLinux or SlackWare may scare you off right away; where as distros like Ubuntu, Mint, and others have built in GUI right off the bat. Linux comes in many varieties. It is more loosely coupled than windows you for example you can use any desktop environment you want. Linux is just a kernal. The distros are collections of tools the group maintaining the distro thinks will fit their over-all goal and purpose. Desktop Environments, programming tools, package managers, and other freely licensed pieces of software.

Related

Cross Platform Python Executable - Mac & Windows?

I used pyinstaller to create an executable file (Desktop GUI). I am on Windows, and the person I am sending it to is on Mac.
I was under the impression that pyinstaller was cross platform, but the Mac user gets an error when trying to run the app. What are my options for distributing my GUI for both Windows and Mac?
I have not been able to find a straightforward answer and do not have a Mac to test with. I saw Inno Setup, but haven't found anything saying whether or not it's cross platform.
I need to create a script that can run both Windows and Mac. I am also looking for an easy way to send it electronically.
I have no knowledge of Python but after a quick serach on the internet came up with this which might help you.
A few months ago I went through this process (rather painstakingly I might add) to deploy a simple Xamarin Cross Platform App. In my own experience I have learned that the macOS has very strict rules about how software is to be packaged for deployment on a computer.
If you are using Visual Studio for Mac it will automatically build a packaged installer for you. But, you do have to purchase (at an yearly cost) a Developer ID.
Then, you create specific provision profiles for your application and these are used along with your developer ID to sign your packaged installer. I found it somewhat complicated!
Finally, you follow a procedure via the console on the mac to submit your package for an automatic scan. This is referred to as getting your package notarized (link to a SO question about that process).They provide you a result that then gets stapled to the package.
It is like a double signing. Once this is done then the package can be installed by users using the macOS.
An alternative is that the user run a instance of Windows by using a software package called Parallels. I have to say it is very good and I did enjoy my trial of the software, You can fire up Windows from inside the macOS (no need to reboot) and since it is Windows you can simply run your stahdard installers.
In summary, for the macOS, if you do not correctly sign your package with a developer and application ID, and don't get it notarized and stapled the operating system will throw it back out at you and not run it.

Small Mac-based post house looking to run a Windows box, but we rely on some Python scripts

You can tell where this is going from the title..
I work at a small post house, and to replace one of our older Mac Pros, we were looking at building a mid-range PC (doesn't need to do much heavy lifting - not worth the price of a new Mac Pro)..
The problem is, we have a number of scripts that we use for footage transcoding and media management, and they were coded for our Mac-exclusive environment..
The basic procedure for setting up a new workstation is:
Install pip using easy_install
Use pip to install:
youtube_dl
pexpect
parsedatetime
XlsxWriter
Install MacPorts.. Use MacPorts to install ffmpeg, lftp, and ImageMagick. From there, install a couple custom in-house scripts (that rely mostly on the preceding dependencies and python 2.7 (via xcode).
I'm NOT going to ask how to adapt this to PC, since that would be way outside the scope of a single question. My question is, without a strong python developer on-site (the custom scripts were written years ago by someone who's no longer with the company), is it even feasible to adapt the install scripts to a PC environment? We have a freelance Python developer that we consult for minor script changes and he wasn't sure (his response was "I would first double check to make sure some of the utilities can even run on windows. I’m not 100% sure they can or not"). Do any of the utilities jump out as something that would not be adaptable to a Windows environment?
Thanks very much in advance - I know it's a rather broad question.
If you "don't need heavy lifting", why upset your workflow this way?
If you are determined to buy a PC, why not run Linux on it rather than Windows? The setup process you described will be almost exactly the same on a Linux machine except for involving a different package manager instead of MacPorts.
Craig
PS the Python modules you listed are all available via MacPorts. It would simplify the software management process to install everything that way.

Equivalent of pywinauto library for debian

I'm looking for an equivalent Python library that will work when I run my script on Raspberry Pi. I'm under the impression that pywinauto only works on windows machine.
I want to control some inputs to a GUI launched by my script, using my script. Apart from pywinauto I have no idea how to do this. I thought about using command line to control the software directly, but if there is a simpler way I would really appreciate knowing about it.
Thanks for your time.
ATSPI is an Linux accessibility technology to obtain GUI text/rectangle properties programmatically. See how to find and run ATSPI registry daemon and how to enable ATSPI for the most popular types of GUI apps. Usually it's
$ /usr/libexec/at-spi-registryd &
There is a Python bindings for ATSPI. See this answer for details:
How to install pyatspi?
The pyatspi package has too many dependencies like pygobject etc. It also requires some compilation during installation steps. We think this is not user friendly so we decided to use libatspi.so directly (without any dependencies). This work status can be tracked here: https://github.com/pywinauto/pywinauto/pull/449
There is no exact deadline for pywinauto 0.7.0 with this feature (it's a hobby project), but I would say this summer sounds realistic.

Should I take a Python CS class using Windows or Mac?

I'll be taking a Python-based computer science class next semester using my MacBook Pro. It will be centered around a custom-designed package for this class. The problem is that this package is being sponsored by Microsoft Research, so it was obviously designed with Windows in mind. Supposedly, it runs on Mac OS and Linux too, but they say they don't officially support Snow Leopard whatsoever.
My concern is that there will be some sort of miniscule differences between the Python code on a Mac and on a PC. The homework is submitted online, and is graded for results. Apparently, they don't actually look at the code itself.
Is this a concern? Should I install Windows in a VM/partition and be done with it? Or should I stay where I feel most comfortable? After all, switching back and forth constantly would be a huge hassle. Thanks for your help!
If the class expects the code to run on Windows then I would install a VM with Windows on it since it is possible that some things may not work quite the same way (especially if you are doing system-specific things like file-system access or executing OS commands).
Classwork/homework always goes smoother when you have the exact same environment as the professor and the rest of the class.
Definitely start with Mac. If it turns out that it really does need Windows, you can switch once you're sure. But Python development is definitely more natural on a Unix-based machine.
Most online graders will let you submit multiple times, and the first assignment is usually easy, so you should know pretty quickly if using a Mac is causing you problems. In the meantime though, you'll have a much smoother ride doing Python on a Mac than on Windows.
If they will be testing your code on windows then you really need to be targeting that platform. However if you feel more comfortable on the Mac, do your dev there but also run a virtual win machine so you can test on the target platform. I would suggest the excellent VirtualBox. You can share local folders with the VM, which reduces the pain of switching back and forth, once the VM has python setup you can just hop in and and run the code direct from the directory on the Mac you developed in.
From their site it looks like Mac is fully supported (up to 10.5 -- it's true that 10.6 is different enough to give occasional problems... I haven't upgraded yet even though I did buy a family pack of 10.5 to 10.6 upgrades, as I'm not looking for trouble right now). If you can use a Macbook with 10.5, I'd say to go for it -- the familiarity and extra productivity are worth the miniscule risk that despite all their claims of support something goes wrong (and you can in fact download and start testing right now!). If your Mac options are limited to 10.6, then I'd go for a VMWare or Parallels VM with a Windows (not sure if Windows 7 is fully supported yet, maybe XP is a more prudent option) installation instead.
Develop and test on a Mac. If it works on the Mac, then test it on Windows before submitting. Done this tons of times with my own programming courses, albeit with a different set of languages and technologies.
Go Mac and never go back.
More seriously, a Mac offers UNIX environment, and Windows offers blue screens.

Miminal Linux For a Pylons Web App?

I am going to be building a Pylons-based web application. For this purpose, I'd like to build a minimal Linux platform, upon which I would then install the necessary packages such as Python and Pylons, and other necessary dependencies. The other reason to keep it minimal is because this machine will be virtual, probably over KVM, and will eventually be replicated in some cloud environment.
What would you use to do this? I am thinking of using Fedora 10's AOS iso, but would love to understand all my options.
I really like JeOS "Just enough OS" which is a minimal distribution of the Ubuntu Server Edition.
If you want to be able to remove all the cruft but still be using a ‘mainstream’ distro rather than one cut down to aim at tiny devices, look at Slackware. You can happily remove stuff as low-level as sysvinit, cron and so on, without collapsing into dependency hell. And nothing in it relies on Perl or Python, so you can easily remove them (and install whichever version of Python your app prefers to use).
For this purpose, I'd like to build a minimal Linux platform...
So Why not try to use ArchLinux www.archlinux.org?
Also you can use virtualenv with Pylons in it.
debootstrap is your friend.
Damn Small Linux? Slax?
If you want to go serious about the virtual appliance idea, take a look at the newly released VMware Studio. It was built exactly for trimming down a system (only Linux for now afaik) so it provides only enough base to run your application.
VMware is going (a bit more) open by pushing an open virtual appliance format (OVF) so, at some point in the future, you might be able to run the result on other virtualization platforms too.
Debootstrap, or use kickstart to strap your FC domains. However, other methods of strapping an RPM based distro exist, such as Steve Kemp's rinse utility that replaces rpmstrap.
Or, you could just grab something at jailtime to use as a base.
If that fails, download everything you need from source, build / install it with a /mydist prefix (including libc, etc) and test it via chroot.
I've been building templates for Xen for years .. its actually turned into a very fun hobby :)

Categories

Resources