|
Yeah, missing qoutes around the key.
|
# ¿ Mar 30, 2018 21:22 |
|
|
# ¿ May 12, 2024 22:54 |
|
He's doing that. Just send the email as plain text so the newlines work. Otherwise you'll need something like pygments to generate stylized HTML. Bare minimum would be replacing newlines with <br> tags.
|
# ¿ Apr 11, 2018 23:06 |
|
If you parse it then pprint you get the native representation. But that wouldn't help with the case of injecting that output into an email any more than the JSON.dump(indent=4) approach would.
|
# ¿ Apr 12, 2018 01:22 |
|
There's an entry in SecurityGroups that doesn't have a Tags key, which would throw that error. You probably want to make sure the Tags key exists before reading it!
|
# ¿ May 8, 2018 23:59 |
|
That error means one of the securitygroup iterations does not have a key "Tags" defined, so the error is thrown. You basically want:code:
|
# ¿ May 9, 2018 00:33 |
|
Just do f"shared.string.{i}" edit almost
|
# ¿ May 24, 2018 00:37 |
|
https://github.com/asottile/future-fstrings/blob/master/README.md ?
|
# ¿ Jun 20, 2018 14:09 |
|
Based on the name I would think not, but the name could be more clear with like get_top_item_from_queue. Always returning a list for even single item gets seems annoying as hell from a usage perspective. Don't make me destructure/unwrap every time I use a method.
|
# ¿ Jun 21, 2018 22:21 |
|
Master_Odin posted:Is there a good list of released python versions somewhere that is easy to grep? I'm trying to make a docker image that's based on stretch-slim but can be used for python 3.4+ (as one of the dependencies of the project will produce a different output depending on version so I can't use python:3.4-jessie-slim and python:3.5-stretch-slim). Alpine also isn't an option as it requires me to build several of my dependencies and include a third-party glibc layer which somewhat ruins the point of using alpine for me. Not a single file but you could clone pyenv and look at the list of version files: https://github.com/pyenv/pyenv/tree/master/plugins/python-build/share/python-build
|
# ¿ Jun 25, 2018 22:37 |
|
It has backports of new python features.
|
# ¿ Jun 25, 2018 23:41 |
|
Sort of. Its so new behaviors can be introduced without breaking older releases. https://docs.python.org/3/reference/simple_stmts.html#future-statements https://docs.python.org/3/library/__future__.html
|
# ¿ Jun 26, 2018 00:02 |
|
All operators are magic methods, no? Like < is __lt__? Reference those instead perhaps. There's also the operator library: https://docs.python.org/3.4/library/operator.html edit: not sure if you can do this for and/or.
|
# ¿ Jul 2, 2018 19:39 |
|
I don't think using PureWindowsPath would help here, but I could be wrong. If all you need is the extension to ignore case use glob syntax: *.[pP][yY]. edit: On using PureWindowsPath, the implementation of #match is from the superclass PurePath. Each of the "flavors" has a case-folding method applied to the input, and on Windows it simply "to-lowers" the input. Using that on a Linux system would cause even more issues with case sensitivity! necrotic fucked around with this message at 21:28 on Jul 3, 2018 |
# ¿ Jul 3, 2018 21:23 |
|
MacOS is not Linux and is not case sensitive by default.
|
# ¿ Jul 3, 2018 21:54 |
|
mr_package posted:On MacOS, Path instances are PosixPath by default. That's pretty nutty... the OSX file system is case insensitve, I'd expect my Path/Glob library to treat pretend access the same. The Windows implementation does the downcase to emulate this, I assumed they did the same for OSX.
|
# ¿ Jul 4, 2018 17:27 |
|
Double linked lists with fixed length blocks, with new block data starting in the center of the block. https://github.com/python/cpython/blob/master/Modules/_collectionsmodule.c
|
# ¿ Jul 23, 2018 15:15 |
|
Linear Zoetrope posted:I wish PyLint and PEP8 checkers were better about metaclasses, but there's only so much you can do. It's a running problem for me because I'm using protobuf and the generated files are 100% metaclasses and I hate to turn helpful lints off just because a bunch of classes from one file break the poor linter's brain when used. flake8 lets you configure directories or files to exclude entirely, not sure about pylint.
|
# ¿ Jul 31, 2018 21:42 |
|
That is the server telling you it will not accept the request for not matching whatever schema it expects. Inspecting the traffic wouldn't help you there. It does look like you're using requests correctly. Does the API also expect a body in the request instead of only the file part?
|
# ¿ Dec 17, 2018 22:21 |
|
What would you proposed it look like instead?
|
# ¿ Dec 18, 2018 15:42 |
|
Looks like it is expecting a specific mime type on the file payload. I dont know how to do that with requests off the top of my head, but look around for customizing the mime type on the file in the request.
|
# ¿ Dec 18, 2018 16:43 |
|
No, the file itself is attached with a different content type. It's multipart, like email. here https://stackoverflow.com/questions/15746558/how-to-send-a-multipart-related-with-requests-in-python
|
# ¿ Dec 18, 2018 16:48 |
|
baka kaba posted:Can't you just do it like this? Yeah that looks way better. I just did a phone search
|
# ¿ Dec 18, 2018 20:50 |
|
Do any scripting languages allow using main as an entry point, without explicitly calling it?
|
# ¿ Dec 18, 2018 21:31 |
|
IntelliJ IDEs have known performance issues with Retina displays and I've been unable to use them as my daily driver because of it. Noticable lag moving the cursor around or typing, and even worse lag resizing or using GUI elements.
|
# ¿ Mar 24, 2019 13:46 |
|
Lambdas in python are purposefully awful which is unfortunate.
|
# ¿ Apr 13, 2019 05:43 |
|
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 |
|
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 |
|
Can you just use the official docker container as your base? https://www.tensorflow.org/install/docker
|
# ¿ May 16, 2019 01:13 |
|
Sad Panda posted:Is there a way to find the changelogs for packages that are updated but don't necessarily have anything useful? For example I'm using PyAutoGui. 3 days ago 0.9.43 was released. If I look at the Github (https://github.com/asweigart/pyautogui/commits/master) the latest is 0.9.42 but PyPi (https://pypi.org/project/PyAutoGUI/0.9.43/#history) shows that 0.9.43 exists but I have no idea what changed. I'd open an issue on the repo and ask why there are releases but no changes to the repo. Their changes document hasn't been updated since 0.9.40 either. They just released another one today, even. You're only option at this point is to diff the package contents.
|
# ¿ May 30, 2019 20:28 |
|
You're just counting how many strings are literally just the letter entered.
|
# ¿ Jun 25, 2019 20:19 |
|
You can do that on an instance of any class. https://docs.python.org/3/tutorial/classes.html#odds-and-ends
|
# ¿ Jul 18, 2019 23:11 |
|
KICK BAMA KICK posted:e: wtf how does it pull an Ubuntu image in 26mb? Its not the same as the server ISO, which includes a lot of packages. The image is basically just the rootfs. https://github.com/tianon/docker-brew-ubuntu-core/blob/9db8c72dd02e8f9fd5dba82ff9266174b088e2e6/bionic/Dockerfile Docker images can grow in size pretty quickly if you aren't good about cleaning up each run step. I went through one of ours recently and stripped out nearly a gig of trash from the image. It's still 600mb, but the majority of that are artifacts for the application itself.
|
# ¿ Aug 15, 2019 02:00 |
|
The output is a single binary with everything embedded.
|
# ¿ Aug 16, 2019 18:54 |
|
Use while true and set the answer at the top of the loop. As written you only read the input once.
|
# ¿ Aug 28, 2019 14:31 |
|
The break is already in the right spot, but an input other than Y will not reach it and loop forever without requesting a new input.
|
# ¿ Aug 28, 2019 18:09 |
|
Given the "problem" requires repeating the question unless "Y" is given, and having different responses for "N" vs any other character, that doesn't seem like a great approach... edit: I'm pretty sure you just wanted to give an example of the approach but it totally fails for the "problem" presented.
|
# ¿ Aug 30, 2019 00:43 |
|
If you've already pushed you have to either force push the newly amended commit, or do what PyCharm is making you do. Maybe a setting changed and it's pushing automatically, if you didn't do that manually. Or it just force pushed before and they realized that was dumb, so now it doesn't.
|
# ¿ Sep 6, 2019 03:44 |
|
If you can't rename them then a for i in range(len(file_list)) and constructing the filename from i+1 would be easy, assuming no numbers are skipped in the filenames.
|
# ¿ Oct 12, 2019 21:19 |
|
Use pyenv or anaconda to use different python versions.
|
# ¿ Nov 4, 2019 20:27 |
|
|
# ¿ May 12, 2024 22:54 |
|
It could be timeouts on the wait for. Not sure how the python driver works but it bit me in the past with random slow page loads. We increased the default timeout and that fixed it. Edit: though that doesn't look to involve a full page load. Still worth a quick check.
|
# ¿ Jan 15, 2020 03:02 |