Hi there,

Tl;Dr: How do you guys develop Python stuff on the Mac? Is it possible?

I've done some light Python development in the past, mostly thanks to SoundRTS. I used Visual Studio and its Python tools and it was a pretty good experience. I then tried the same thing for TheQube and for some reason it was just not happening for me. So I stopped for a while.

Queue getting a new job (wooo) that needs a bit of Python, I thought I'd pick this back up. I recently got my grubby mitts on a Mac, and in the spirit of cross-platform development, thought I'd try learning to do Python some more and thought I'd try it on the Mac.

Oh the horror!

Or at least, frustration. I started out by going and grabbing Python for the Mac (3.5 I think), which I saw comes with IDLE (a Python IDE). I love a good IDE, well, Visual Studio made me love IDEs. It then said I had to go grab some new TK and TCL bits (that means Transaction Control Language to an SQL guy like me but apparently this is different). Okay, I didn't know what it really was, but grab it I did and install. Happy days, right?

So I use Spotlight to jump into IDLE and try to use it with VoiceOver. Aw hell, it's not accessible.

So now what? How would I go about doing Python development on a Mac? Is it possible with VoiceOver? Is it worth the extra hoops, or am I better off retreating to Windows?

I've had various VO problems getting used to the Mac, even on things like Safari, but I'm blaming some of that on it being El Kapitan. Maybe this is to blame here?

Any advice appreciated.

Thumbs up

2 (edited by Victorious 2016-04-21 14:35:23)

@truecraig: sorry to go off topic..., but you implied that you have a good experience with visual studio. What screen reader do you use with it? Despite me filing many bugs last summer, virtually no progress has been made in fixing them, so I'm getting the impression that accessibility is a non priority, so I'd describe visual studio as being only usable. This is a shame as some of the upcoming technologies like the universal windows runtime requires VS to work.

Thumbs up

@Victorious, I use NVDA with it myself, and have yet to find anything better. And some of your bugs have been fixed. Not every single one of them, but some have. I don't remember all your bugs, but if you had a particular one in mind, I can tell you if its still a problem or not. One annoying one you did raise, about the line numbers being read out even when you turn them off, that's been fixed now. Of course it could be better, most applications written by sighted people could be. But it's good enough for me and it's loads faster than trying to write all this stuff by hand using notepad and MSBuild on the command line or something like that.

Thumbs up

Hm, i think one of the more annoying ones is this one.

1. Just tried switching tabs with NVDA; i am not sure if this is new behaviour or whether this behaviour existed before, but i've remapped my ctrl+tab
and ctrl+shift+tab to the window.nextDocumentWindow and Window.PreviousDocumentWindow commands, the default was nextDocumentWindowNav and window.PreviousDocumentNav
which does something different. On NVDA, if i switch from a.c to b.c, the tab switch is not detected, and pressing the arrow keys causes NVDA to continue
reading from a.c even though the current document is now b.c. I have to switch to another app and back to visual studio to get it to reacquire focus.

Thumbs up

I don't understand what you mean by the difference between NextDocumentNav and NextDocumentWindow. But in its default behaviour, it still works and reads stuff out from the right window. If you hold ctrl and keep hitting tab, it'll tell you what window you're about to move onto. You can also hold control after hitting tab and arrow around that weird window thing that comes up, I don't know what it's called but I remember trying to script NVDA to understand it once but failed miserably. Most seem to have made that window accessible now.

Is that the sort of thing you mean?

Still interested if anyone has any ways of doing Python on a Mac btw. Though I'm happy to discuss VS as well.

Thumbs up

Oops, didn't mean to turn this into the VS thread. Yeah, I changed the default behaviour so that ctrl+tab and ctrl+shift+tab would take me to the previous/next window without dealing with that popup thinggy (last i used that, the popup was inaccessible). Maybe I should give that dialog a try.

Thumbs up

Hi,
Concerning python on the mac, I've had a bit of experience. Certainly not as much as some on this forum, but I hope this will help you.
If you previously coded python3, then downloading it was a good idea. Otherwise, python 2.7 is built-in to mac OS. To run the interpreter in interactive mode, open the terminal and at the prompt, type
python
this will run 2.7. If you want to run any other version, just type python followed by that version.
Also, you may want to install pip, you can do that by using this command
sudo easy_install pip
If you want to run a python script, open the terminal and cd to the directory where the file is located and, for example, python test.py. Maybe not what you were looking for, but I know some extreme beginners may find it helpful. Also, you can read the book python the hard way. In this book, they cover things from getting started to some advanced stuff on windows, mac, and linux. Also, I would recommend reading think python for more coding advice. Again, sorry if this goes a bit off-topic, but yes, python is indeed pretty accessible on the mac.

Thumbs up

@Victorious, yeah, they made that dialog more accessible, it's a bit weird with the first press, but subsequent presses or arrowing around like I said is better.

@cartertem: Thanks! For some reason I never thought of just using the inbuilt Python interpreter. Though I am kinda after an IDE to go with it, I guess I can work without one. I'm used to working with one but I think for an interpreted language like this it's probably cool to work without one.

I have been looking for a good Python ebook, previous attempts to find one were fruitless, but I might well check those ones out. Are there ebook versions of them?

Thumbs up

Hi,
The only ones I've been able to find are in pdf or html formats. I imagine you could find a torrent or crack for different formats somewhere on the web, but I won't go into detail about that for obvious reasons.

Thumbs up

10 (edited by magurp244 2016-04-23 23:25:27)

Keep in mind that built in versions of python on Linux and Mac may be short a few components, you may have to install HomeBrew to avoid complications, or if using pygame you can follow these instructions. You can also read Learn Python the Hard Way online over here.

Thumbs up

@cartertemm: HTML or PDF would do fine. I just didn't want to have to try and find a scanner to go scanning hard copy books in or anything extra like that. Are they freeware books or are they things you can get on Amazon et al? Maybe iBooks would be more appropriate under the Mac circumstances.

@magurp: Thanks for those suggestions, I might keep HomeBru in mind, I'm thinking it's like apt-get or Chocolatey, right? And I don't know if I'm ready for PyGame itself yet, maybe I am. I know the basics and that, I just need a refresher. Maybe that Python the Hard Way thing is exactly what I need, I've seen a lot of it when Googling. Is it really free? I remember hearing a Podcast with the main guy of the series before but I can't remember if he said it was free or not.

And another question for anyone really. Text editors on the Mac: Any good accessible programmer ones? I've heard people mention TextRangler but I haven't had chance to try it out for accessibility yet. I suppose TextWriter (or whatever the default is called) would be perfectly good for starters.

Thumbs up

You can buy the book for 29.95$ and get 1.7GB of video and a PDF of the book, this is also to help support the author. The link I provided is to the free HTML version that you can read online. As for IDE's, I generally stick to the built in IDLE editor that comes with python, preferences may vary, heh.

Thumbs up

I just bought it. It seemed like a fair enough exchange, especially as I can access it in HTML which is much easier. I'm not sure if that means I bought it and am just using the free product, especially as each exercise seems to have videos on it anyway. But considering the work that's obviously gone into all this it only seemed fair.

Really? You can use IDLE? I'm trying to use it but it's not working out too accessible for me.

Oh and in case anyone was wondering, TextWrangler doesn't seem to be accessible either. Shame, as there's things online suggesting it might be. Maybe it's something with the latest version of OSX. I don't know.

Thumbs up

14 (edited by magurp244 2016-04-25 00:21:16)

Hm, actually recommending IDLE may not be the greatest idea as it doesn't generally play nice with screen readers. PythonWin seems to work alright with NVDA, but is windows exclusive. You could try skimming through the list of Mac compatible python IDE's here and see which ones work, or worst case just use a text editor and save the file as discussed here with a *.py extension and run it from a command prompt with "python script.py".

Thumbs up

I haven't been able to find a version that works with iBooks on the mac, just usually read in HTML. They offer donations, but no charge to actually read think python. The situation is however different with learn python the hard way. You can read the book free of charge, and its a great resource, but that's where the pros end. It includes videos, which you can obtain access to by paying something like $20.00.

Thumbs up

Someone has uploaded the vidio's on youTube.

Thumbs up

@jawharh, Can you provide a link? Thanks

Thumbs up

no problem
http://www.youtube.com/playlist?list=PL … CeYpPeezUz

Thumbs up

Thanks for that. :-)
I'm sure the original creator of that isn't so happy, but what can we expect with all the torrents and cracks out there?

Thumbs up

I already paid so I could probably watch them on YouTube for convenience if I wanted smile

I've been ploughing on with that series, though on Windows, and it is helping. Yeah it's a bit slow if you already know coding from elsewhere, but I'd rather have a thorough grounding than race through. Python's such an easy language though. It's the framework around it sometimes that's a bit tricky, though I suspect that's the same with every language when you're starting out.

Still never really found a satisfactory way to work with this on Mac. I've tried:

* IDLE: Not accessible, at least on El Kapitan.
* TextWrangler + Python from the terminal: TextWrangler doesn't play at all with VoiceOver.
* TextEdit + Python from the terminal: This looked promising, except TextEdit kept saving the files as non-ansi files and it meant that every file I wrote had to have one of those coding tags at the top to tell Python how to play with it. Annoying especially when you can't remember where the # key is on a Mac. I even tried saving the files as specifically UTF-8, but no joy.

C'est la vie, I guess. Though if anyone has any ideas, feel free to shout.

Thumbs up

So, does this mean you guys have found it easier to code on windows with Python?
I seriously keep switching between both when it comes to this.

Thumbs up

I don't know.
I don't have access to a mac

Thumbs up

Okay...

Yeah, I stick to Windows for my Python development. I know lots of sighted people prefer coding Python on their Macs and such like, but I don't think that's a realistic prospect sadly.

Unless there's any tools I'm unaware of

Thumbs up

TextMate has Python support.
Also seems pretty accessible with VoiceOver.

Thumbs up