|
Err. Now it worked after all for some reason. Nevermind then
|
# ? Apr 15, 2019 09:18 |
|
|
# ? Jun 3, 2024 23:07 |
|
Umbreon posted:Noted. Thanks guys, I'm gonna give codecademy a try and see how things roll. I've never actually coded/programmed anything before but it always bothered me that I just assumed I couldn't do it without actually giving learning it a fair shake. Codecademy's free course is for Python2. If you're just signing up for the first time you can definitely get through the Python3 course during the trial period. Otherwise they explain the key differences to you about Python3 during the Python2 course.
|
# ? Apr 15, 2019 12:18 |
Treehouse's python content is decent imo.
|
|
# ? Apr 15, 2019 15:22 |
|
I'm late to the party...Sad Panda posted:Do people find that inner functions are a good idea? I usually use them to define a traverser for some data structure that is fit for only a specific purpose. This is when the traverser is too long for a single-line lambda.
|
# ? Apr 15, 2019 16:23 |
|
Thermopyle posted:The official tutorial is pretty good. OK, I'll give another crack at the official one. I want to make something very simple to store my bike routes so I can quickly log that I did Ride A or whatever on a certain day.
|
# ? Apr 15, 2019 21:37 |
|
Bundy posted:Treehouse's python content is decent imo. Would you happen to know how it compares to codecademy's version?
|
# ? Apr 15, 2019 22:24 |
|
I keep reading cacodemon
|
# ? Apr 15, 2019 22:28 |
|
A few weeks ago Mozilla introduced Iodide which is some kind of notebook-like clone but for Javascript and I think one of the selling points is that it runs entirely in your browser, no external server needed. Yesterday they introduced Pyodide which as you probably guessed in Iodide but with Python, and it also runs entirely in your browser. quote:Pyodide is an experimental project from Mozilla to create a full Python data science stack that runs entirely in the browser. Here's an example notebook (and here's another one). It seems neat at first glance but I can't really imagine a scenario where the running in my browser thing would be something I'd use. If I'm on a laptop then spinning up a jupyter notebook server takes no effort, so for me the useful thing would be if this could be run on like an iPad. Speaking of iPads, I've been using jupyter notebooks with the "Juno" app and running them on Azure Notebooks and it's pretty great. Boris Galerkin fucked around with this message at 14:59 on Apr 17, 2019 |
# ? Apr 17, 2019 14:54 |
|
Boris Galerkin posted:A few weeks ago Mozilla introduced Iodide which is some kind of notebook-like clone but for Javascript and I think one of the selling points is that it runs entirely in your browser, no external server needed. Why code on an ipad?
|
# ? Apr 17, 2019 15:42 |
|
I don’t really, but I like being able to open up a notebook and redraw a figure or something. The auto completion that you get from the notebook itself is pretty good and not annoying. I guess I should mention that I’m talking about an iPad with a physical keyboard, which makes all the difference.
|
# ? Apr 17, 2019 16:00 |
|
Sometimes you're on a train and can't be bothered to whip out a keyboard I do find it rather annoying that the shift key in Juno is a toggle instead of a single letter.
|
# ? Apr 17, 2019 17:06 |
|
I'm messing around with Python and tkinter and I'm wondering if someone can explain why when I run my script the text "third" appears in the text box despite only declaring the variable and not actually using it? code:
|
# ? Apr 18, 2019 04:32 |
Spaseman posted:I'm messing around with Python and tkinter and I'm wondering if someone can explain why when I run my script the text "third" appears in the text box despite only declaring the variable and not actually using it? Print the value of vvv. It's probably None, because you called a method to insert the text, and didn't store the text.
|
|
# ? Apr 18, 2019 05:10 |
|
All three of those text.inserts are evaluated the same way. The third one is just assigning its return value, which is probably None, to vvv.
|
# ? Apr 18, 2019 05:26 |
|
Oof anybody try to throw a linter into an existing (super messy) set of projects? Some of my team is like 'yeah pylint me baby' but this seems like it would hurt pretty bad and we'd have config drift unless we solved that problem. This is going to be a 'lint all changed files after X grandfathered commit' implementation both at commit time and on the build server. I do want to do better than barebones flake8 (mostly PEP8 and bad syntax police) but yikes at the current pylint output, even with a bunch of poo poo ignored. Is flake8 a good baby step to make in this situation? pylint feels like a full blown can of worms.
|
# ? Apr 18, 2019 14:58 |
|
Our approach for awful projects like that was to say if you touched a file in a change you fixed it then. This made the up front lift small, but could cause small changes to take longer. It was worth it and eventually only 10% of files which were never touched remained and somebody just went in and fixed them later. This is tricky with CI though since you can only run the lint against files changed in the commit or it'll fail for you constantly.
|
# ? Apr 18, 2019 15:07 |
|
necrotic posted:This is tricky with CI though since you can only run the lint against files changed in the commit or it'll fail for you constantly. Fortunately (I mean, sort of, maybe a bad idea) TeamCity does have a check out mode where your project looks like a real git clone with .git metadata instead it just being a bag of files. So it should be possible to figure this stuff out.
|
# ? Apr 18, 2019 15:12 |
|
Boris Galerkin posted:A few weeks ago Mozilla introduced Iodide which is some kind of notebook-like clone but for Javascript and I think one of the selling points is that it runs entirely in your browser, no external server needed. I guess it's like, one step further than Jupyter in portability... to use Jupyter you have to have a giant stack that takes forever to install on a slow machine. Im sure this thing would be slow in Firefox, but its entirely based off the internet and needs no stack running on the server, or can be zipped and sent in email or whatever
|
# ? Apr 18, 2019 16:23 |
|
necrotic posted:Our approach for awful projects like that was to say if you touched a file in a change you fixed it then. This made the up front lift small, but could cause small changes to take longer. It was worth it and eventually only 10% of files which were never touched remained and somebody just went in and fixed them later. Yeah, this is what I've done for large projects that hadn't yet been linted continuously. Just defined each file individually within whatever the ignore file format is (.flake8 -> exlude=) and then just over time submit a PR that fixes all style issues in a file and remove it from that list. Prevents any new files from not following the style, and then can overtime fix up old code. I do prefer to not mix PRs of bugfixes/features with PRs fixing style changes as that just leads to it being a pain to actually properly review a change amongst all the noise.
|
# ? Apr 18, 2019 17:15 |
|
Yeah, mixing lint fixes in with a PR can get messy. We tried to enforce a "first commit has the lint fixes" which worked most of the time (you could review all but that commit easily enough), but sometimes a mid-PR change would then touch another file.
|
# ? Apr 18, 2019 18:02 |
|
Boris Galerkin posted:It seems neat at first glance but I can't really imagine a scenario where the running in my browser thing would be something I'd use. If I'm on a laptop then spinning up a jupyter notebook server takes no effort, so for me the useful thing would be if this could be run on like an iPad. Everything that lets Javascript be a thing of the past like ruby, perl or php is welcome.
|
# ? Apr 18, 2019 18:22 |
|
modern JS is pretty good and new PEP's are lifting a lot of ideas from it and its cousin TypeScript. But, python won't replace JS in the browser because stuff like V8 has bajillions of dollars of optimization put in to it (node is faster than python), and downloading the python interpreter and whatever modules for every page and translating calls to the DOM is just going to have too large of a performance hit. That being said, I'd much rather write python.
|
# ? Apr 18, 2019 19:05 |
|
Would you guys say the codecademy membership is worth it? The price looks pretty steep for a monthly charge, but I've actually been enjoying the lessons so far for python 3
|
# ? Apr 20, 2019 08:09 |
|
Umbreon posted:Would you guys say the codecademy membership is worth it? The price looks pretty steep for a monthly charge, but I've actually been enjoying the lessons so far for python 3 I'm not sure what the point of a longer term sub is. You'll finish the Python course and then what? Sure they have SQL and whatever else but if you're wanting to focus on Python then what else do they have that you'd use?
|
# ? Apr 20, 2019 09:13 |
|
Sad Panda posted:I'm not sure what the point of a longer term sub is. You'll finish the Python course and then what? Sure they have SQL and whatever else but if you're wanting to focus on Python then what else do they have that you'd use? Oh I agree, I'm only asking about the monthly sub, I wouldn't get anything longer than that. I'm saying that even $40 a month feels really expensive for something like this, I just want to make sure it's worth it. (as things stand, it feels like it's worth it, but I've only done the first few lessons so I want to make sure it doesn't lower in quality later on or anything like that)
|
# ? Apr 20, 2019 09:22 |
|
Umbreon posted:Oh I agree, I'm only asking about the monthly sub, I wouldn't get anything longer than that. I'm saying that even $40 a month feels really expensive for something like this, I just want to make sure it's worth it. If you're using it to do personal projects maybe its a little costly...I'd probably just move on to projects from there. (e.g. if you want to learn python to do data science/deep learning, go here, it is free: https://course.fast.ai/videos/?lesson=1) If you're trying to do your current job better get your company to pay for it If you're trying to do a new job it is dirt cheap relative to a code bootcamp or other more formal training scenario
|
# ? Apr 20, 2019 13:06 |
|
What's the suggest structure for tests for a module that is not installable? I've got the standard structure of:pre:pkg/ __init__.py module_1.py tests/ __init__.py test_module_1.py and so I can use code:
code:
|
# ? Apr 20, 2019 16:22 |
|
I'd suggest invoking through pytest instead yeah. Tends to be less finicky that way.
|
# ? Apr 21, 2019 14:10 |
|
Neslepaks posted:I'd suggest invoking through pytest instead yeah. Tends to be less finicky that way. e: Actually, I think I found why I'm so confused on the manner. Using the example from above, why it is that unittest seems to choke if I do an import like this: code:
Master_Odin fucked around with this message at 20:14 on Apr 21, 2019 |
# ? Apr 21, 2019 19:53 |
|
Probably relevant, sounds like you may need to remove __init__.py https://stackoverflow.com/questions/41748464/pytest-cannot-import-module-while-python-can/41752043
|
# ? Apr 21, 2019 20:36 |
|
A simple dict mapping strings to strings (can guarantee they're short, alphanumeric, no whitespace) that I want to read/write from disk -- is pickle the best option or would you rather write it as a text file? Few hundred entries at most, accessed/modified a only few times a day. Portability between implementations and platforms would be a huge plus.
|
# ? Apr 29, 2019 00:10 |
|
KICK BAMA KICK posted:A simple dict mapping strings to strings (can guarantee they're short, alphanumeric, no whitespace) that I want to read/write from disk -- is pickle the best option or would you rather write it as a text file? Few hundred entries at most, accessed/modified a only few times a day. Portability between implementations and platforms would be a huge plus. I do a lot of pickle reading/writing and csv reading/writing with the pandas implementation of each. Pickle is an order of magnitude faster, would take a pickle every time. (Bonus that it handles mixed data types)
|
# ? Apr 29, 2019 00:21 |
|
KICK BAMA KICK posted:A simple dict mapping strings to strings (can guarantee they're short, alphanumeric, no whitespace) that I want to read/write from disk -- is pickle the best option or would you rather write it as a text file? Few hundred entries at most, accessed/modified a only few times a day. Portability between implementations and platforms would be a huge plus. quote:A “shelf” is a persistent, dictionary-like object. The difference with “dbm” databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects — anything that the pickle module can handle. This includes most class instances, recursive data types, and objects containing lots of shared sub-objects. The keys are ordinary strings.
|
# ? Apr 29, 2019 00:57 |
|
I'd probably use json. Easy to read by "hand" if need be.
|
# ? Apr 29, 2019 01:17 |
Thermopyle posted:I'd probably use json. Easy to read by "hand" if need be. Seconding this, why use something as awful as pickle when json exists?
|
|
# ? Apr 29, 2019 01:59 |
|
I get the impression that I should pickle an object if and only if I’m too lazy to create a method to serialize it to a dict (and then save as json). Is that accurate? Never dealt with pickles before.
|
# ? Apr 29, 2019 13:06 |
|
Bundy posted:Seconding this, why use something as awful as pickle when json exists? This is what I was thinking as I read that, but then I thought maybe they know something I don't. A simple dictionary is exactly the kind of case where json is super convenient, particularly if you want it to be easy to use with whatever else.
|
# ? Apr 29, 2019 13:52 |
|
I think reading/writing pickle objects is marginally faster than text files like JSON, so if that's a concern pickling is probably superior. Otherwise yeah working with JSON files is much nicer in every way.
|
# ? Apr 29, 2019 14:07 |
|
Why are we discussing performance for a task that will take a couple milliseconds a day
|
# ? Apr 29, 2019 14:38 |
|
|
# ? Jun 3, 2024 23:07 |
|
Lol they even said in their initial question it would have a few hundred values at most
|
# ? Apr 29, 2019 14:38 |