|
Hi! I'm a novice (primarily web) developer/student with experience in javascript (and html/css)/php development at an internship. I want to learn a different backend language that isn't nodejs (too new) or php (too lovely). Is Python a good choice? I'm going to be working on mobile stuff at my next job so it might be more important to start learning java. Kind of interested in whatever random bits of input y'all might have. Thanks!
|
# ? Apr 17, 2015 18:19 |
|
|
# ? Jun 13, 2024 06:14 |
|
Hed posted:On my personal projects at home I mainly dick around with Django/DRF sites and keep up with what's hot in front end land (Angular to Ember and now React). Would that still be helpful? It looked like I'd need web storm / IntelliJ to get the JS piece. PyCharm is a basically a superset of WebStorm. I use PyCharm for my JS/HTML/CSS projects that don't have any python in them at all. I say "basically" because webstorm gets new JS stuff first, then they get rolled into PyCharm in future updates. That usually happens pretty quickly, though.
|
# ? Apr 17, 2015 20:32 |
|
QuarkJets posted:Have you tried creating two subplots in the same figure? Or how about a small plot that's a zoomed portion of the plot that you want, like what's done here? There are many ways to have two plots in the same figure size, if you're worried about space It could be an ok thing to do if the unusual nature of the plot is communicated by easily noticeable visual cues. For example, the portion of the plot that's at a different scale is marked by a band with a different colour background.
|
# ? Apr 17, 2015 20:37 |
|
The banded idea is smart. Here is something similar where it scales differently in different regions along the X-axis (but there is no explicit x-axis labeling, which is problem for me, and looking at the code the data is scaled): http://miso.readthedocs.org/en/fastmiso/_images/sashimi-plot-example.png
|
# ? Apr 17, 2015 23:28 |
|
Thermopyle posted:
Serious question: is PyCharm worth allowing Java to be installed on my machine? I've kept it off of all my computers for the last 6+ years due to security paranoia. I use MacVim and love it, but all the folks loving PyCharm had me wanting to try it, but then Java.
|
# ? Apr 18, 2015 01:58 |
|
Lumpy posted:Serious question: is PyCharm worth allowing Java to be installed on my machine? I've kept it off of all my computers for the last 6+ years due to security paranoia. I use MacVim and love it, but all the folks loving PyCharm had me wanting to try it, but then Java. Install Java, disable the browser plugin.
|
# ? Apr 18, 2015 02:04 |
|
Lumpy posted:Serious question: is PyCharm worth allowing Java to be installed on my machine? I've kept it off of all my computers for the last 6+ years due to security paranoia. I use MacVim and love it, but all the folks loving PyCharm had me wanting to try it, but then Java. I certainly think so. I just don't allow Java to run in the browser and I keep on top of updates. Then again, I do all my development in a virtual machine, so I'm not quite as exposed as others might be.
|
# ? Apr 18, 2015 02:12 |
|
Thermopyle posted:I certainly think so. I just don't allow Java to run in the browser and I keep on top of updates. Me too! But not because I was worried about security -- my employer gave me a macbook and I hated the OS so much that I started doing everything in a linux VM
|
# ? Apr 18, 2015 03:13 |
|
QuarkJets posted:Me too! But not because I was worried about security -- my employer gave me a macbook and I hated the OS so much that I started doing everything in a linux VM Yeah, I run a VM because development on a Linux machine is nicer than development on a Windows machine. I hadn't even really considered the security implications when making the decision to do that.
|
# ? Apr 18, 2015 03:43 |
|
Firefox disables Java by default and Chrome yanked out the entire API so you don't really need to worry about the plug-ins anyway. The bad thing about PyCharm being Java is that it doesn't use the native font rendering, and at least on Linux it's simply way worse. Which kinda sucks for something that needs to display text all the time.
|
# ? Apr 18, 2015 12:29 |
|
Skuto posted:Firefox disables Java by default and Chrome yanked out the entire API so you don't really need to worry about the plug-ins anyway. I find the font rendering to be about the same. Like, maybe I can tell it's different, but I wouldn't call it better or worse.
|
# ? Apr 18, 2015 15:20 |
|
You can find many posts about this problem, it's really pretty obvious because even things like font sizes don't match up. JetBrains has said they're aware of the problem but their entire GUI toolkit is Swing based so there's nothing they can do. The solution usually involves rolling your own patched Java JDK/JRE. Or just try all fonts till something isn't too eyebleeding. IIRC Source Code Pro from Adobe renders decently in Swing. The differences are much more subtle on Win/Mac so it's unlikely to be an issue there.
|
# ? Apr 18, 2015 21:55 |
|
Skuto posted:You can find many posts about this problem, it's really pretty obvious because even things like font sizes don't match up. JetBrains has said they're aware of the problem but their entire GUI toolkit is Swing based so there's nothing they can do. I immediately switch every editor and IDE I use to Source Code Pro.
|
# ? Apr 18, 2015 23:45 |
|
Cultural Imperial posted:Python 2 is still the default interpreter for a lot of base Linux installs. If you're a computer janitor, this could be important to you. Meanwhile everyone else is smart enough to have "python" run python2 like existing scripts expect and "python3" run python3, even when 100% of the system components are python3. Distro scripts, for what it's worth, should explicitly declare the version of python they expect (eg #!/usr/bin/python2.7 or #!/usr/bin/python3.4) -- this tells you what remains to be tested and ported when you the distro maker are considering dropping an older version of python (say, 3.3). Sometimes porting is as simple as changing that line and seeing if anything breaks.
|
# ? Apr 19, 2015 00:21 |
|
Part of my PyCharm JVM error code -4 problem might have been that I'd changed installation locations sometime between 3.something and 4.something, but Launchy kept launching the old PyCharm. I haven't had the problem since uninstalling the old PyCharm, but I am noticing that debugging on 4.0.6 is going noticeably slower than previously. Even a simple assignment with no function calls takes about a second in the debugger. Any ideas why?
|
# ? Apr 19, 2015 14:58 |
|
ShadowHawk posted:Python2 will always be what gets run in the "python" command because it is brain-dead moronic for a Linux distribution to override that and break user scripts. Only one distro to my knowledge is hostile enough to users to have done that (I think Arch?) Yep it is definitely arch.
|
# ? Apr 19, 2015 22:30 |
|
Python 2 will be EoL'd in 2020 so you should start new projects in Python 3 where and when possible. Is it possible to get the f_locals from an exception raising frame in an except clause?
|
# ? Apr 19, 2015 23:26 |
|
What are my options for creating a new window to display a jpeg for a fixed amount of time before closing? The rest of my app is curses-style, using blessings. I'm on linux, and my first attempt was using Popen to call to eog, then killing it. This works alright with the -f option for fullscreen, but the user will be pressing the arrow keys in other parts of the app and I can't have an accidental arrow-key press switching the image. I could put each of the images in its own directory, but I wonder if there's a native way to do this. I could use a matplotlib figure I suppose but that seems like overkill. Thoughts?
|
# ? Apr 21, 2015 01:46 |
|
an skeleton posted:Hi! I'm a novice (primarily web) developer/student with experience in javascript (and html/css)/php development at an internship. I want to learn a different backend language that isn't nodejs (too new) or php (too lovely). Is Python a good choice? I'm going to be working on mobile stuff at my next job so it might be more important to start learning java. Kind of interested in whatever random bits of input y'all might have. Thanks! Yes yes and yes. Even though I primarily program mobile, *all* my back-end work uses django and django-rest-framework. Its the ultimate glue language, imho. You can learn Java as well I guess, but ehhhhhh.........
|
# ? Apr 21, 2015 02:20 |
|
I was planning on learning python 2 because eventually I want to get into the web end of things and on the "which version should I use?" page on the python website it says twisted and gevent are not ported and they look fairly important. Is that a decent reason to learn python 2 rather than 3 now?
|
# ? Apr 21, 2015 13:20 |
|
No, it isn't. The fact that a not insignificant percentage of the codebases you'd be working with as a web developer will be in 2 might be. If you're just looking to do your own stuff though definitely learn 3 first.
|
# ? Apr 21, 2015 14:16 |
|
Stringent posted:No, it isn't. The fact that a not insignificant percentage of the codebases you'd be working with as a web developer will be in 2 might be. No, it isn't a decent reason to learn 2? The rest of your reply implies the opposite... I am looking to do my own stuff, on the web, and I will likely want to use other peoples codebases than just redoing what they've already done.
|
# ? Apr 21, 2015 14:20 |
|
Don't use Python 2 if you can possibly avoid it. The Twisted project has made great progress, and gevent seems like it's coming along (albeit slowly). Most other things that you're likely to use have supported Python 3 for a while. EDIT: Though note that some of the "standard" solutions for Python 2 have been completely abandoned, like https://pypi.python.org/pypi/MySQL-python . There are high-quality Python 3 alternatives and ports for things like that, and this is not indicative of anything like the lack of a MySQL module for Python 3. Lysidas fucked around with this message at 18:58 on Apr 21, 2015 |
# ? Apr 21, 2015 14:27 |
|
Crack posted:No, it isn't a decent reason to learn 2? The rest of your reply implies the opposite... gevent and twisted not being ported yet isn't a good reason to learn 2 instead of 3. At this point everything really important has been ported or has a substitute.
|
# ? Apr 21, 2015 14:30 |
|
Stringent posted:gevent and twisted not being ported yet isn't a good reason to learn 2 instead of 3. At this point everything really important has been ported or has a substitute.
|
# ? Apr 21, 2015 17:29 |
|
Guess I'll learn version 3 then! I suppose by the time I would have learnt enough of python 3 to need to use a codebase that has not been ported, I could probably learn the differences in versions and python 2 easily enough without a massive time investment. E: Does anyone have a suggestion on a MOOC that is up to date with version 3? E2: Given it's written for python 2, is it worth me paying up for Learn Python the Hard Way? Crack fucked around with this message at 18:18 on Apr 21, 2015 |
# ? Apr 21, 2015 18:00 |
|
With asyncio in Python 3, there's a decent chance you wouldn't need gevent or twisted anyway!
|
# ? Apr 21, 2015 22:23 |
|
I've been meaning to get this working correctly, and I just did, so I'm going to write it down here in case anyone else cares... PyCharm as of version 4.0 supports function annotations with types via JukkaL's typing module. This works like this: Python code:
A few things to note: 1. Function annotations are built in to Python 3 and when executing your program Python ignores them completely. This means that this is not static-typing for Python! It's purpose is for usage in tools like PyCharm and linters of various sorts. 2. The functionality of the typing library is supposed to come to core python in 3.5 via PEP-484. (the author of the typing library, Jukka Lehtosalo is one of the authors of the PEP) 3. PyCharm support is still preliminary as of PyCharm EAP 141.583 (PyCharm 4.5), mainly because the PEP is not finalized. This means it's not as robust as it could be. For example, it doesn't provide any warnings if I try to use something other than a Tuple[list, str] with a_list in the above example. I would still include that type information for the contents of a_list even though it doesn't currently help because it will help in the future. 4. The typing module that comes with mypy (even though mypy is also by JukkaL) isn't as up-to-date as the typing module linked above and thus, even if you're using mypy, you have to install the typing module above. Thermopyle fucked around with this message at 18:16 on Apr 22, 2015 |
# ? Apr 22, 2015 18:11 |
|
That's really cool, thanks Thermopyle. Of course now I'm going to be even worse at remembering whether I'm coding Python or Scala.
|
# ? Apr 22, 2015 20:18 |
|
Dunno how new it is, but it is amusing to see SA in the Google style guide for python: https://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Lint#Lint
|
# ? Apr 22, 2015 22:50 |
|
The phrase "something awful" is not exclusively licensed by these forums or anything
|
# ? Apr 23, 2015 01:16 |
|
No Safe Word posted:The phrase "something awful" is not exclusively licensed by these forums or anything Enjoy your imagination. It's python, with import antigravity and all.
|
# ? Apr 23, 2015 03:14 |
|
I'm in charge of a very exciting project at work that involves filtering results of an API and standardizing/storing the information in a database so that we can do in depth analysis on the data set. I'm pretty confident in my ability to write Python but this is the first time I've built my own database. Should I be using SQLAlchemy as an ORM? This book was published in 2008, would it still be relevant to me? http://shop.oreilly.com/product/9780596516147.do
|
# ? Apr 24, 2015 15:53 |
|
TheOtherContraGuy posted:I'm in charge of a very exciting project at work that involves filtering results of an API and standardizing/storing the information in a database so that we can do in depth analysis on the data set. I'm pretty confident in my ability to write Python but this is the first time I've built my own database. Should I be using SQLAlchemy as an ORM? This book was published in 2008, would it still be relevant to me? http://shop.oreilly.com/product/9780596516147.do I found SQLAlchemy easy enough to pick up more or less at the same time I've been learning Python from scratch -- didn't know the first thing about databases either -- so maybe just give it a shot and ask questions here. My tips would be stick with what they call the declarative syntax for defining your models if possible, keep all those definitions in the same package, and really take a minute to understand the concept of the Session before you start designing the guts of the application. This is a good article; not an actual tutorial but it points out some common mistakes.
|
# ? Apr 24, 2015 16:18 |
|
I'm finally making myself use conda instead of virtualenv for a project I'm just starting, and I'm a little confused about something. So, conda can install packages. It also installs pip when you create an environment. Should I be using conda or pip to install packages into my new environment?
|
# ? Apr 24, 2015 18:15 |
|
KICK BAMA KICK posted:SQLAlchemy just went 1.0 like a week ago and that book was written for 0.5 I think. I'm sure a lot of it still works but I bet the gritty details you'd hope to learn from a textbook are precisely the things that are now out of date. Haven't read it myself though for that reason. Thanks!
|
# ? Apr 24, 2015 18:34 |
|
Thermopyle posted:Should I be using conda or pip to install packages into my new environment? Try to install the package with conda and if conda doesn't have it then resort to pip.
|
# ? Apr 24, 2015 18:36 |
|
Thermopyle posted:I'm finally making myself use conda instead of virtualenv for a project I'm just starting, and I'm a little confused about something. It doesn't matter, they work together. Conda won't install packages from PyPI though (only official continuum stuff, binstar packages, or stuff you've already downloaded).
|
# ? Apr 24, 2015 18:40 |
|
Nippashish posted:Try to install the package with conda and if conda doesn't have it then resort to pip.
|
# ? Apr 25, 2015 04:40 |
|
|
# ? Jun 13, 2024 06:14 |
|
I'm using joblib. I have a list of 47 entities. When I callcode:
code:
So results has 15 empty fields, results2 has 29. So the output list has the correct length, and the filled fields have the correct content. f is a fairly long, complicated and badly written function so I don't want to bother anybody with it. When I run it outside of the parallel loop, it works. list_of_items has not been changed. joblib prints: code:
|
# ? Apr 26, 2015 17:52 |