|
Goonicus posted:My question right now is for the first language beginners, what was your first project in Python? Did you have a goal in mind for something you wanted to accomplish? I had just joined a new team at the same time there was a managerial dictate to switch to python for analytical work.
|
# ? Oct 10, 2013 02:40 |
|
|
# ? May 9, 2024 17:09 |
|
Moddington posted:Might not be useful for you in the general case, but I'll just point out that for the example values you've given, j == i // 4, and k == i % 4. since it's a square, well >>> [divmod(i,4) for i in range(16)] [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3), (3, 0), (3, 1), (3, 2), (3, 3)]
|
# ? Oct 10, 2013 14:29 |
|
Update on the DNA sequencing script: it doesn't work, because the sequence doesn't necessarily start at a specific frame. You can only start splitting into codons once you hit ATG. I fixed the script and now it works rather well. Next up is translating the results to proteins.
|
# ? Oct 10, 2013 16:32 |
|
A few really broad questions - as I left a job and got to setting up a new machine, I've found all the ways I used to do thing are old and busted and there's a bunch of new hot ways. For example: - pythonbrew is dead. pythonenv looks like the successor, but I'm not sure it has all the functionality. I'd like to use jython as well. Is pythonz still active? What do people use for sandboxing and running different pythons? - Then we have the explosion in standalone, kitchen-sink environments: Anaconda, Pyzo, Canopy et al. Why would I (a fairly programming-savvy computational biologist) use one of those? What are the recommendations? Hell, is everyone still plotting with matplotlib?
|
# ? Oct 10, 2013 17:47 |
|
outlier posted:A few really broad questions - as I left a job and got to setting up a new machine, I've found all the ways I used to do thing are old and busted and there's a bunch of new hot ways. For example: I would advocate for Anaconda, but I am also certainly biased in that regard (I work for Continuum). The Anaconda community is growing very fast, we are now up to about 16k download per month. The mailing lists are active and folks are starting to contribute their own recipes for additional packages and making them available to others on Binstar. The development of conda is also going strong, with new improvements and features in the roadmap. Matplotlib is fantastic, it is still definitely the go-to plotting solution for python, especially for rich-client or static plots. That said, we are having a release (0.2) of Bokeh, and bokehjs tomorrow. If you need to do rich interactive plotting inspired by the Grammar of Graphics and ggplot, that targets the browser from python (static html output, embedding in ipython notebooks, or a server mode) then you should definitely check it out. We'd love to get as much feedback as possible (and hopefully even some additional contributors). http://continuumio.github.com/bokehjs/ has a nice interactive gallery from the js library https://github.com/ContinuumIO/Bokeh project page, will have a gallery from the python library shortly
|
# ? Oct 10, 2013 18:55 |
|
outlier posted:What do people use for sandboxing and running different pythons? virtualenv is the most common I think. Piss easy to use too.
|
# ? Oct 10, 2013 23:06 |
|
BigRedDot posted:I would advocate for Anaconda, but I am also certainly biased in that regard (I work for Continuum). The Anaconda community is growing very fast, we are now up to about 16k download per month. The mailing lists are active and folks are starting to contribute their own recipes for additional packages and making them available to others on Binstar. The development of conda is also going strong, with new improvements and features in the roadmap. I hate matplotlib, and will try bokeh soon.
|
# ? Oct 10, 2013 23:15 |
|
I'm about to start a new job where developers are all given Macbook Pros as workstations. Up till now, I've done almost all my Python development work in Windows and Ubuntu. What do I need to know about Python development in OS X? Are there any major gotchas? Note that I work in test automation, so I don't really need to worry about writing GUIs or writing software that'll run outside a controlled environment. I did a little googling on the topic but I didn't find anything major to worry about.
BeefofAges fucked around with this message at 00:24 on Oct 11, 2013 |
# ? Oct 11, 2013 00:14 |
|
BeefofAges posted:I'm about to start a new job where developers are all given Macbook Pros as workstations. Up till now, I've done almost all my Python development work in Windows and Ubuntu. What do I need to know about Python development in OS X? Are there any major gotchas? Note that I work in test automation, so I don't really need to worry about writing GUIs or writing software that'll run outside a controlled environment. I did a little googling on the topic but I didn't find anything major to worry about. Get Homebrew instead of Macports and use that to install pip and whatever else you need. Otherwise, not much. If you ever install XCode you'll have to deal with that mess, but if you use virtualenv you don't have to worry about it.
|
# ? Oct 11, 2013 00:57 |
|
The March Hare posted:Get Homebrew instead of Macports and use that to install pip and whatever else you need. Otherwise, not much. If you ever install XCode you'll have to deal with that mess, but if you use virtualenv you don't have to worry about it.
|
# ? Oct 11, 2013 01:40 |
|
One thing that might not be as well know about Anaconda, btw, is that it also supports creating isolated, independent, reproducible environments, each with different versions of python or python libraries (or even non-python things like LLVM). It uses a different technique than virtualenv, though.
|
# ? Oct 11, 2013 01:46 |
|
deimos posted:Don't you kinda need to install XCode to do almost anything useful with homebrew? You can download the Command Line Tools seperately from the Apple Developer website and it gives you everything you need for Homebrew without any Xcode installation.
|
# ? Oct 11, 2013 02:07 |
|
deimos posted:Don't you kinda need to install XCode to do almost anything useful with homebrew?
|
# ? Oct 11, 2013 02:09 |
|
Plorkyeran posted:You can just install the command line tools separately. It's also not really a mess with Xcode 4+ since it no longer shits files into a bunch of weird places. Yeah but it does change your default git installation to be really old and poo poo, it kinda can be a mess if you aren't being really good about using virtualenv. e; Though I haven't used it in a while, so maybe I'm wrong here. The March Hare fucked around with this message at 04:32 on Oct 11, 2013 |
# ? Oct 11, 2013 04:28 |
|
The March Hare posted:Yeah but it does change your default git installation to be really old and poo poo, it kinda can be a mess if you aren't being really good about using virtualenv. You're pretty wrong, which is good! I haven't run into any issues on 10.8 with Python, other than somehow my "blah ?" syntax doesn't work in IPython, just "? blah". XCode hasn't broken anything for me (and is required to be installed to get MacVim to compile).
|
# ? Oct 11, 2013 06:35 |
|
Does anyone have any recommendations on python libraries that handle multitouch events from the trackpad or touchscreen? I'm looking to write a program like bettertouchtool(mac) or touchegg(linux) but for windows to customize multitouch events. It seems like pyqt is an option. Another option is kiva or pymt. I haven't programmed for about 10 years and looking to learn python as a hobby that also fixes annoyances with windows 8.
|
# ? Oct 11, 2013 08:00 |
|
fritz posted:I hate matplotlib, and will try bokeh soon. While I recognise that Matplotlib is a Good Thing, it's never quite gelled with me. Partly to do with the way it mimics Matlab and it feeling very unpythonic. I'll have a look at Bokeh too.
|
# ? Oct 11, 2013 10:23 |
|
Is re.match significantly faster than re.search? Looking for information on it basically just results in "use match for anchoring at the start of the string", rather than why you'd use match at all instead of search.
|
# ? Oct 11, 2013 15:35 |
|
Murodese posted:Is re.match significantly faster than re.search? Looking for information on it basically just results in "use match for anchoring at the start of the string", rather than why you'd use match at all instead of search. They differ in semantics. Use match to check if entire string conforms to a pattern, use search to check if the pattern occurs anywhere in the string.
|
# ? Oct 11, 2013 15:45 |
|
Got a Skybot question for Scaevolus or anyone else familiar with it: I've knocked up a .ts3 command plugin to query active users on a teamspeak server, but I'm wanting to restrict it to certain nicks or hostmasks that can use it. I understand there's a Sieve hook that fits this purpose, but I've no idea how to use it - Skybot's inner workings and the way hooks work are mostly a mystery to me. Has anyone played around with this and is able to share briefly how to use it?
|
# ? Oct 11, 2013 16:22 |
|
lostleaf posted:Does anyone have any recommendations on python libraries that handle multitouch events from the trackpad or touchscreen? I'm looking to write a program like bettertouchtool(mac) or touchegg(linux) but for windows to customize multitouch events. Was "kiva" supposed to be Kivy?
|
# ? Oct 11, 2013 16:30 |
|
lostleaf posted:Does anyone have any recommendations on python libraries that handle multitouch events from the trackpad or touchscreen? I'm looking to write a program like bettertouchtool(mac) or touchegg(linux) but for windows to customize multitouch events. If you follow through with this, throw up a github repository. It would be cool to check out. Bettertouchtool is probably my most utilized application in OS X and touchegg sucks. Kivy looks like it would suit your needs, but the documentation is lacking. Report back if you find out how to hijack key/gesture bindings and or listen for them globally.
|
# ? Oct 11, 2013 17:44 |
|
Munkeymon posted:Was "kiva" supposed to be Kivy? Oops, I did mean kivy. I was looking into more yesterday and it sounds like both pymt and kivy are both python2 based. I tried importing them into a simple test program and received a ton of syntax errors. The main goal was to learn python3 so the only solution is pyqt unless someone knows of a different library with multitouch event handlers and python3 support.
|
# ? Oct 11, 2013 18:00 |
|
BeefofAges posted:I'm about to start a new job where developers are all given Macbook Pros as workstations. Up till now, I've done almost all my Python development work in Windows and Ubuntu. What do I need to know about Python development in OS X? Are there any major gotchas? Note that I work in test automation, so I don't really need to worry about writing GUIs or writing software that'll run outside a controlled environment. I did a little googling on the topic but I didn't find anything major to worry about. I was given a Macbook Pro at my work, and after about a month of trying to develop on it I gave up and installed an RHEL6 virtual machine. I've never looked back. OSX is just not a very good code development environment, especially if you're coming over from Linux. It's probably pretty good if you're coming over from Windows.
|
# ? Oct 11, 2013 21:37 |
|
QuarkJets posted:I was given a Macbook Pro at my work, and after about a month of trying to develop on it I gave up and installed an RHEL6 virtual machine. I've never looked back. OSX is just not a very good code development environment, especially if you're coming over from Linux. It's probably pretty good if you're coming over from Windows. Disagree with this, I do just fine on OS X (and I worked on linux machines for years). Just install python via homebrew and then make virtualenvs using the homebrew-installed python rather than the system python, and you're good to go. But all the same unix-y tools you're used to in linux are available either by default in OS X or via homebrew.
|
# ? Oct 11, 2013 21:53 |
|
Lamacq posted:Disagree with this, I do just fine on OS X (and I worked on linux machines for years). Just install python via homebrew and then make virtualenvs using the homebrew-installed python rather than the system python, and you're good to go. But all the same unix-y tools you're used to in linux are available either by default in OS X or via homebrew. Yes, follow this four-page guide in order to jury-rig together a working modern version of Python instead of just typing one line into a linux terminal, and then fix OS X's dozens of other weird default settings (such as page-up scrolling the terminal buffer instead of being emitted to an open application, terminals not actually closing when you type 'exit', etc). Linux feels like it was designed for coders. You can get to the same spot with OS X, but it takes a lot more work. Doing 'just fine' doesn't cut it when your job requires a lot of code development
|
# ? Oct 11, 2013 22:09 |
QuarkJets posted:I was given a Macbook Pro at my work, and after about a month of trying to develop on it I gave up and installed an RHEL6 virtual machine. I've never looked back. OSX is just not a very good code development environment, especially if you're coming over from Linux. It's probably pretty good if you're coming over from Windows. I wouldn't wanna do dev work on my host OS anyways. There are just sooo many benefits to using virtual machines for everything, even if my host OS was my preferred OS to do dev work in, I'd still use virtual machines.
|
|
# ? Oct 11, 2013 22:30 |
|
QuarkJets posted:Yes, follow this four-page guide in order to jury-rig together a working modern version of Python instead of just typing one line into a linux terminal, and then fix OS X's dozens of other weird default settings (such as page-up scrolling the terminal buffer instead of being emitted to an open application, terminals not actually closing when you type 'exit', etc). Why did you link to a extensive guide to installation of Python on Windows while complaining about OSX?
|
# ? Oct 11, 2013 22:33 |
|
fletcher posted:I wouldn't wanna do dev work on my host OS anyways. There are just sooo many benefits to using virtual machines for everything, even if my host OS was my preferred OS to do dev work in, I'd still use virtual machines. I'm coming around to this as well. I moved over to Ubuntu from Windows a year or two ago because dev work was so much easier, but recently I switched back to Win7 (because I plan on playing lots of BF4) and installed Ubuntu in VirtualBox to continue doing dev work on it. This works really well, and I plan on moving over to using Vagrant to make it even easier to spin up new dev environments. Having multiple monitors makes this even sweeter.
|
# ? Oct 11, 2013 22:34 |
|
QuarkJets posted:I was given a Macbook Pro at my work, and after about a month of trying to develop on it I gave up and installed an RHEL6 virtual machine. I've never looked back. OSX is just not a very good code development environment, especially if you're coming over from Linux. It's probably pretty good if you're coming over from Windows. I develop just fine on OSX, after spending the previous decade developing on Linux. Python, C++, Obj-C, coffeescript... SublimeText, Anaconda, Xcode, not sure what the issue would be.
|
# ? Oct 11, 2013 22:36 |
|
I'm doing fine with just Windows 7, but I guess I don't know what I'm missing since I haven't done any serious coding on linux. Does running a virtualised instance of a physical installation work fine?
|
# ? Oct 11, 2013 23:01 |
What's an easy way to strip exif data from an image?
|
|
# ? Oct 11, 2013 23:13 |
|
OnceIWasAnOstrich posted:Why did you link to a extensive guide to installation of Python on Windows while complaining about OSX? Because I just clicked the first link that I found for "OSX install Python" and didn't actually read it, my bad fletcher posted:I wouldn't wanna do dev work on my host OS anyways. There are just sooo many benefits to using virtual machines for everything, even if my host OS was my preferred OS to do dev work in, I'd still use virtual machines. This is generally how I operate as well, even on my home Ubuntu laptop I still run a few VMs (Windows and Linux) sharktamer posted:I'm doing fine with just Windows 7, but I guess I don't know what I'm missing since I haven't done any serious coding on linux. Does running a virtualised instance of a physical installation work fine? Absolutely; there's no risk in trying another OS in a virtual machine, and if you end up liking it then that's great. VMs have come a long way and work pretty flawlessly these days QuarkJets fucked around with this message at 23:18 on Oct 11, 2013 |
# ? Oct 11, 2013 23:14 |
|
fletcher posted:What's an easy way to strip exif data from an image? What kind of image? jpeg? exiftool is a widely available perl program/library that can do it very easily. code:
If you're doing photo processing with any of the adobe tools (lightroom, photoshop) they have options to strip metadata (exif) when you export files as jpeg.
|
# ? Oct 12, 2013 02:26 |
Dren posted:What kind of image? jpeg? I hadn't really thought about other image formats, I thought it was only jpg that supported exif data. I came across exiftool in my searching but I was hoping for something that was pure python. I suppose I'll use it anyways though. The purpose is just to strip exif data from user uploaded images, don't wanna be distributing GPS coordinates when they upload photos from their phone. Thanks!
|
|
# ? Oct 12, 2013 02:36 |
|
You can use PIL to edit exif data in images, but it will be a little more complex than using exiftool.
|
# ? Oct 12, 2013 02:38 |
Interesting...I'm using PIL to read the exif data, I didn't realize you could edit it as well. How do you do that?
|
|
# ? Oct 12, 2013 02:41 |
|
Hmm actually it might not be possible. Some quick googling led me to this: http://stackoverflow.com/questions/2831497/how-do-you-set-the-image-attributes-using-pil And here's an example of editing at least some tags in PIL: http://www.litster.org/blog/2010/05/30/python-and-exif-metadata-theres-more-than-one-way-to-do-it/
|
# ? Oct 12, 2013 02:46 |
|
If you wanted to be silly about it you could export to ppm or something that doesn't support metadata and re-import as JPG.
|
# ? Oct 12, 2013 02:54 |
|
|
# ? May 9, 2024 17:09 |
|
QuarkJets posted:Doing 'just fine' doesn't cut it when your job requires a lot of code development That's kind of what 'just fine' means, dogg. There's stuff not in osx that I miss (like click to focus, and I need to figure out Spaces) but all in all its a perfectly reasonable development environment.
|
# ? Oct 12, 2013 03:11 |