workspace stringclasses 1
value | channel stringclasses 1
value | sentences stringlengths 1 3.93k | ts stringlengths 26 26 | user stringlengths 2 11 | sentence_id stringlengths 44 53 | timestamp float64 1.5B 1.56B | __index_level_0__ int64 0 106k |
|---|---|---|---|---|---|---|---|
pythondev | help | How can I check if a string is a valid json object, even if the string uses single quotes?
Let’s say I have a string that looks like this:
```"{'apple': 1, 'orange': 2}"```
How can I determine if this is a valid json object? json.loads() doesn’t work because the string uses single quotes instead of double. Replacing... | 2019-02-09T20:53:06.512800 | Sherman | pythondev_help_Sherman_2019-02-09T20:53:06.512800 | 1,549,745,586.5128 | 7,521 |
pythondev | help | Ultimately, it's not valid json, so there's not a sane way to do that verification. | 2019-02-09T23:17:27.514500 | Carmen | pythondev_help_Carmen_2019-02-09T23:17:27.514500 | 1,549,754,247.5145 | 7,522 |
pythondev | help | Anything you do is going to be hacky to some extent or another. | 2019-02-09T23:17:37.514800 | Carmen | pythondev_help_Carmen_2019-02-09T23:17:37.514800 | 1,549,754,257.5148 | 7,523 |
pythondev | help | You could probably try something where you replace all the single quotes that aren't escaped, but there's no guarantee that won't mess up something deeper in your json string. | 2019-02-09T23:18:49.516200 | Carmen | pythondev_help_Carmen_2019-02-09T23:18:49.516200 | 1,549,754,329.5162 | 7,524 |
pythondev | help | what's wrong with this syntax in string interpolation? if `diff > 0` I want to assign `x` to `{diff} short of` otherwise it should be a empty string.
```
diff = 1
x = f"{diff 'short of' if diff > 0 else ''}"
``` | 2019-02-10T03:45:54.518900 | Lanny | pythondev_help_Lanny_2019-02-10T03:45:54.518900 | 1,549,770,354.5189 | 7,525 |
pythondev | help | <@Lanny> try this | 2019-02-10T03:53:04.519200 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T03:53:04.519200 | 1,549,770,784.5192 | 7,526 |
pythondev | help | same error | 2019-02-10T03:53:55.519400 | Lanny | pythondev_help_Lanny_2019-02-10T03:53:55.519400 | 1,549,770,835.5194 | 7,527 |
pythondev | help | None | 2019-02-10T03:53:59.519600 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T03:53:59.519600 | 1,549,770,839.5196 | 7,528 |
pythondev | help | plus why does it need to use `str` inside string interpolation anyway? | 2019-02-10T03:54:29.519900 | Lanny | pythondev_help_Lanny_2019-02-10T03:54:29.519900 | 1,549,770,869.5199 | 7,529 |
pythondev | help | as you are mixing conditional and f strings | 2019-02-10T04:03:23.520300 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T04:03:23.520300 | 1,549,771,403.5203 | 7,530 |
pythondev | help | if you use x = f"{ diff if diff > 0 else ''}" | 2019-02-10T04:03:45.520500 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T04:03:45.520500 | 1,549,771,425.5205 | 7,531 |
pythondev | help | that should work | 2019-02-10T04:03:48.520700 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T04:03:48.520700 | 1,549,771,428.5207 | 7,532 |
pythondev | help | but as you need concat the conditional result with "short of" | 2019-02-10T04:04:13.520900 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T04:04:13.520900 | 1,549,771,453.5209 | 7,533 |
pythondev | help | you can use | 2019-02-10T04:04:23.521100 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T04:04:23.521100 | 1,549,771,463.5211 | 7,534 |
pythondev | help | f"{str(diff) + 'short of' if diff > 0 else ''}" | 2019-02-10T04:04:31.521300 | Ashleigh | pythondev_help_Ashleigh_2019-02-10T04:04:31.521300 | 1,549,771,471.5213 | 7,535 |
pythondev | help | Hi ! I want to use gevent.ssl to support TLSv1.2 and the current code looks like this, but in case the server doesn't support tlsv1.2 I want the fallback on tlsv1.1 but I am bit confused on how to add that to support the lower versions .
options={'ssl_version':gevent.ssl.PROTOCOL_TLSv1_1,
'server_hostname':hos... | 2019-02-10T05:33:46.521800 | Lanelle | pythondev_help_Lanelle_2019-02-10T05:33:46.521800 | 1,549,776,826.5218 | 7,536 |
pythondev | help | who doesn't support tls 1.2? | 2019-02-10T05:35:12.522000 | Jettie | pythondev_help_Jettie_2019-02-10T05:35:12.522000 | 1,549,776,912.522 | 7,537 |
pythondev | help | I think you can safely assume tls 1.3 / 1.2 and forget about everything else | 2019-02-10T05:35:52.522600 | Jettie | pythondev_help_Jettie_2019-02-10T05:35:52.522600 | 1,549,776,952.5226 | 7,538 |
pythondev | help | <@Jettie> Everyone supports 1.2 but in a corner case if some one is still using 1.1 my program should handle the connection | 2019-02-10T05:37:09.524300 | Lanelle | pythondev_help_Lanelle_2019-02-10T05:37:09.524300 | 1,549,777,029.5243 | 7,539 |
pythondev | help | setting up my own testing app locally (flask mainly with some logging wrapping, new relic etc). I was gonna use gunicorn for starting it (mainly for self training) but I wanted to know how to keep a track of the startup command outside of having to remember `gunicorn ..... app:app` etc? I don’t have nginx etc running (... | 2019-02-10T05:37:25.524700 | Vanita | pythondev_help_Vanita_2019-02-10T05:37:25.524700 | 1,549,777,045.5247 | 7,540 |
pythondev | help | Also if a server supports 1.3 also then my program should handle 1.2 fallback situation also | 2019-02-10T05:37:37.524900 | Lanelle | pythondev_help_Lanelle_2019-02-10T05:37:37.524900 | 1,549,777,057.5249 | 7,541 |
pythondev | help | well, then you try tls 1.3, and if the handshake fails, you try with tls 1.2 | 2019-02-10T05:38:19.525500 | Jettie | pythondev_help_Jettie_2019-02-10T05:38:19.525500 | 1,549,777,099.5255 | 7,542 |
pythondev | help | actually, shouldn't this be automatic? I thought fallbacks are somewhat builtin | 2019-02-10T05:38:44.526200 | Jettie | pythondev_help_Jettie_2019-02-10T05:38:44.526200 | 1,549,777,124.5262 | 7,543 |
pythondev | help | <@Jettie> I am not sure if it is built-in | 2019-02-10T05:41:48.526500 | Lanelle | pythondev_help_Lanelle_2019-02-10T05:41:48.526500 | 1,549,777,308.5265 | 7,544 |
pythondev | help | yes precisely that's the question. how do we do that? do you have a rough strucutre or a code snippet? | 2019-02-10T05:42:27.526600 | Lanelle | pythondev_help_Lanelle_2019-02-10T05:42:27.526600 | 1,549,777,347.5266 | 7,545 |
pythondev | help | you do the same thing as you normally do to make a connection, but then catch early ssl-level errors. that would mean the cipher / protocol are not supported | 2019-02-10T05:43:19.526800 | Jettie | pythondev_help_Jettie_2019-02-10T05:43:19.526800 | 1,549,777,399.5268 | 7,546 |
pythondev | help | then you lower the protocol version and try again | 2019-02-10T05:43:26.527000 | Jettie | pythondev_help_Jettie_2019-02-10T05:43:26.527000 | 1,549,777,406.527 | 7,547 |
pythondev | help | ok I just made a server.py uWsgi config file and starting it with `gunicorn -c server.py app:app` | 2019-02-10T05:54:37.527200 | Vanita | pythondev_help_Vanita_2019-02-10T05:54:37.527200 | 1,549,778,077.5272 | 7,548 |
pythondev | help | Hello everyone
Am trying do loading screen when content is loading for one page.. Is it possible to load my templates using jinja2 template engine in my django application | 2019-02-10T06:37:17.530900 | Aimee | pythondev_help_Aimee_2019-02-10T06:37:17.530900 | 1,549,780,637.5309 | 7,549 |
pythondev | help | If any suggestions plz help me | 2019-02-10T06:37:37.531500 | Aimee | pythondev_help_Aimee_2019-02-10T06:37:37.531500 | 1,549,780,657.5315 | 7,550 |
pythondev | help | Do you know `tox`?
<https://tox.readthedocs.io/en/latest/config.html?highlight=extras#conf-extras>
What is `extras`?
> For example, extras = testing is equivalent to [testing] in a pip install command.
`testing` is folder? Or file? Don't understand. | 2019-02-10T07:05:18.532500 | Jung | pythondev_help_Jung_2019-02-10T07:05:18.532500 | 1,549,782,318.5325 | 7,551 |
pythondev | help | Hi, how do I use threading with writelines to speed up the process of generating random crypto string and writelines to a file. | 2019-02-10T08:43:48.535000 | Dung | pythondev_help_Dung_2019-02-10T08:43:48.535000 | 1,549,788,228.535 | 7,552 |
pythondev | help | <@Dung> are you generating multiple strings? And have you already broken up the generation into multiple threads? | 2019-02-10T11:56:24.538100 | Ashley | pythondev_help_Ashley_2019-02-10T11:56:24.538100 | 1,549,799,784.5381 | 7,553 |
pythondev | help | <@Jung> it's basically a section on your tox file to list dependencies IIRC | 2019-02-10T12:06:26.539100 | Ashley | pythondev_help_Ashley_2019-02-10T12:06:26.539100 | 1,549,800,386.5391 | 7,554 |
pythondev | help | None | 2019-02-10T13:07:23.539500 | Janessa | pythondev_help_Janessa_2019-02-10T13:07:23.539500 | 1,549,804,043.5395 | 7,555 |
pythondev | help | <@Janessa> I'd have to see more of the code, but that error means you are unpacking something with the `*` operator as you pass that into a function, and the number of things you are unpacking is more than the function has arguments to hold | 2019-02-10T13:11:09.542300 | Ashley | pythondev_help_Ashley_2019-02-10T13:11:09.542300 | 1,549,804,269.5423 | 7,556 |
pythondev | help | Does anyone know a way to extract based on a pattern but excluding part of the parttern?
For example: i want to find `59 reviews`
The pattern always has `reviews`, but i don’t need `reviews`
I only want the number | 2019-02-10T13:23:38.544000 | Autumn | pythondev_help_Autumn_2019-02-10T13:23:38.544000 | 1,549,805,018.544 | 7,557 |
pythondev | help | <@Autumn> One way to do that is with a regex "capture group". For instance `r"(\d+) reviews"` would match `"59 reviews"`, but the parentheses means that `"59"` would be separately available as group 1 of the match object. | 2019-02-10T13:29:18.545600 | Sasha | pythondev_help_Sasha_2019-02-10T13:29:18.545600 | 1,549,805,358.5456 | 7,558 |
pythondev | help | Awesome Thank you! <@Sasha> | 2019-02-10T13:40:25.545900 | Autumn | pythondev_help_Autumn_2019-02-10T13:40:25.545900 | 1,549,806,025.5459 | 7,559 |
pythondev | help | Hi guys, can someone help me figure why this doesn't give me a line break despite the \n? | 2019-02-10T14:14:13.546200 | Reina | pythondev_help_Reina_2019-02-10T14:14:13.546200 | 1,549,808,053.5462 | 7,560 |
pythondev | help | I get this instead.. | 2019-02-10T14:14:40.546500 | Reina | pythondev_help_Reina_2019-02-10T14:14:40.546500 | 1,549,808,080.5465 | 7,561 |
pythondev | help | <@Reina> That is because you are outputting the string object representation. If you pass it though a function that is meant for display it will work. Try changing your last line from `list_generator()` to `print(list_generator())` | 2019-02-10T14:16:47.548100 | Clemmie | pythondev_help_Clemmie_2019-02-10T14:16:47.548100 | 1,549,808,207.5481 | 7,562 |
pythondev | help | thanks! so the line break only works if it's called by the print function? | 2019-02-10T14:20:24.548900 | Reina | pythondev_help_Reina_2019-02-10T14:20:24.548900 | 1,549,808,424.5489 | 7,563 |
pythondev | help | It's more like Python is helpfully telling you "hey, you can't see the line break in this string, so I'm going to show you it as `\n` instead so you know it's there" when giving you debugging output. | 2019-02-10T14:23:48.550200 | Sasha | pythondev_help_Sasha_2019-02-10T14:23:48.550200 | 1,549,808,628.5502 | 7,564 |
pythondev | help | Same as putting quotes around strings which aren't really there in the data. | 2019-02-10T14:25:45.550800 | Sasha | pythondev_help_Sasha_2019-02-10T14:25:45.550800 | 1,549,808,745.5508 | 7,565 |
pythondev | help | Hi. I'm trying to decide between using `django-registration`: <https://django-registration.readthedocs.io/en/3.0/quickstart.html> and using the Sign Up with Confirmation e-mail method in this article: <https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html>? I'm leaning towards t... | 2019-02-10T14:31:52.552000 | Jamey | pythondev_help_Jamey_2019-02-10T14:31:52.552000 | 1,549,809,112.552 | 7,566 |
pythondev | help | <@Sasha>: ah ok... but still not sure why it doesn't let me see the line break | 2019-02-10T14:32:13.552600 | Reina | pythondev_help_Reina_2019-02-10T14:32:13.552600 | 1,549,809,133.5526 | 7,567 |
pythondev | help | Short answer is that it's just debugging output, not "real" output as when a program runs normally. | 2019-02-10T14:33:30.553400 | Sasha | pythondev_help_Sasha_2019-02-10T14:33:30.553400 | 1,549,809,210.5534 | 7,568 |
pythondev | help | oh!!! ok i got that!! thank u! was a little confused bcos jupyter notebook is so user-friendly | 2019-02-10T14:34:42.554200 | Reina | pythondev_help_Reina_2019-02-10T14:34:42.554200 | 1,549,809,282.5542 | 7,569 |
pythondev | help | <@Aimee> Yes, you can use jinja2 as the templating engine for Django. That's an separate issue from what your stated issue is, however. If you want a loading screen, you'll need to quickly serve-up the loading screen, and then use something like AJAX or Websockets to asynchronously load the actual content from the serv... | 2019-02-10T17:28:28.555000 | Carmen | pythondev_help_Carmen_2019-02-10T17:28:28.555000 | 1,549,819,708.555 | 7,570 |
pythondev | help | Hi All, I am trying to comment on the github issue using pygithub, has any one has the python syntax for the same... ? | 2019-02-10T23:16:27.000800 | Lynsey | pythondev_help_Lynsey_2019-02-10T23:16:27.000800 | 1,549,840,587.0008 | 7,571 |
pythondev | help | <@Lynsey> <https://pygithub.readthedocs.io/en/latest/github_objects/Issue.html#github.Issue.Issue.create_comment> | 2019-02-10T23:25:40.001000 | Chester | pythondev_help_Chester_2019-02-10T23:25:40.001000 | 1,549,841,140.001 | 7,572 |
pythondev | help | <@Chester> Thanks for the response and update, but when I use create_comment, I am getting the below error
AttributeError: 'Repository' object has no attribute 'create_comment' | 2019-02-10T23:36:01.001500 | Lynsey | pythondev_help_Lynsey_2019-02-10T23:36:01.001500 | 1,549,841,761.0015 | 7,573 |
pythondev | help | You only need to read and to understand the error :slightly_smiling_face:
You're trying to call this method on `Repository` object instead of an `Issue` object | 2019-02-10T23:36:53.001700 | Chester | pythondev_help_Chester_2019-02-10T23:36:53.001700 | 1,549,841,813.0017 | 7,574 |
pythondev | help | Hi all, Im trying to do some string manipulation. I have a string of lists for ex'[burger,burger,i need this sentence, burger,burger]', im trying to make everything into its own string for ex. '[', 'burger', but i want the 'i need this sentence' as a one entire string. Whats the best way of making the complete sentence... | 2019-02-11T00:01:09.004900 | Roselyn | pythondev_help_Roselyn_2019-02-11T00:01:09.004900 | 1,549,843,269.0049 | 7,575 |
pythondev | help | Your problem is a little confusing, but `data.split(',')` will probably get you a lot of the way there. | 2019-02-11T00:07:54.006200 | Sasha | pythondev_help_Sasha_2019-02-11T00:07:54.006200 | 1,549,843,674.0062 | 7,576 |
pythondev | help | Then you'll just need to split the first character off the first element, and the last character off the last element. | 2019-02-11T00:08:20.006800 | Carmen | pythondev_help_Carmen_2019-02-11T00:08:20.006800 | 1,549,843,700.0068 | 7,577 |
pythondev | help | Anyone here working on or has worked in past on dapps ? | 2019-02-11T00:09:57.007000 | Malika | pythondev_help_Malika_2019-02-11T00:09:57.007000 | 1,549,843,797.007 | 7,578 |
pythondev | help | got it, thanks! | 2019-02-11T00:13:27.007200 | Roselyn | pythondev_help_Roselyn_2019-02-11T00:13:27.007200 | 1,549,844,007.0072 | 7,579 |
pythondev | help | Anyone here who has worked on python with rethinkdb? | 2019-02-11T01:21:33.012800 | Johanne | pythondev_help_Johanne_2019-02-11T01:21:33.012800 | 1,549,848,093.0128 | 7,580 |
pythondev | help | <@Johanne> What challenge are you facing? | 2019-02-11T03:15:59.020600 | Valeri | pythondev_help_Valeri_2019-02-11T03:15:59.020600 | 1,549,854,959.0206 | 7,581 |
pythondev | help | Can someone please explain to me the difference between the 2 following snippets. Not so much syntax wise, but logically speaking. I am looking to get some clarifications pertaining to what’s happening in the second snippet, which may not be happening in the first.
1. My solution
```
def __init__(self,initialAge):
... | 2019-02-11T04:26:32.025700 | Stacia | pythondev_help_Stacia_2019-02-11T04:26:32.025700 | 1,549,859,192.0257 | 7,582 |
pythondev | help | <@Valeri>
The problem is that I can’t install RethinkDB on RaspberryPi and need a similarly flexible alternative of RethinkDB, currently I’m trying to turn my Code to CouchDB, however, I can’t find it as good as RethinkDB.
Also, if I can get any method of successfully install RethinkDB on Raspbian then I can make that ... | 2019-02-11T04:30:37.029500 | Johanne | pythondev_help_Johanne_2019-02-11T04:30:37.029500 | 1,549,859,437.0295 | 7,583 |
pythondev | help | <@Stacia> the issue is this line `elif (13 <= self.age) and (self.age < 18):` | 2019-02-11T04:34:01.030200 | Mica | pythondev_help_Mica_2019-02-11T04:34:01.030200 | 1,549,859,641.0302 | 7,584 |
pythondev | help | actually nm | 2019-02-11T04:35:35.030700 | Mica | pythondev_help_Mica_2019-02-11T04:35:35.030700 | 1,549,859,735.0307 | 7,585 |
pythondev | help | though you don't need `(13 <= self.age)` | 2019-02-11T04:35:45.031100 | Mica | pythondev_help_Mica_2019-02-11T04:35:45.031100 | 1,549,859,745.0311 | 7,586 |
pythondev | help | that's already assumed by the first `if` | 2019-02-11T04:35:52.031400 | Mica | pythondev_help_Mica_2019-02-11T04:35:52.031400 | 1,549,859,752.0314 | 7,587 |
pythondev | help | what error are you getting though? | 2019-02-11T04:35:57.031600 | Mica | pythondev_help_Mica_2019-02-11T04:35:57.031600 | 1,549,859,757.0316 | 7,588 |
pythondev | help | `Wrong Answer` | 2019-02-11T04:36:35.031800 | Stacia | pythondev_help_Stacia_2019-02-11T04:36:35.031800 | 1,549,859,795.0318 | 7,589 |
pythondev | help | I tried removing `(13 <= self.age)`, but i still get the same error when i do. | 2019-02-11T04:36:53.032200 | Stacia | pythondev_help_Stacia_2019-02-11T04:36:53.032200 | 1,549,859,813.0322 | 7,590 |
pythondev | help | what do you mean `wrong answer`? Is there an error log | 2019-02-11T04:37:52.032800 | Mica | pythondev_help_Mica_2019-02-11T04:37:52.032800 | 1,549,859,872.0328 | 7,591 |
pythondev | help | nope. i’m doing this on hackerrank | 2019-02-11T04:38:14.033200 | Stacia | pythondev_help_Stacia_2019-02-11T04:38:14.033200 | 1,549,859,894.0332 | 7,592 |
pythondev | help | <@Johanne> What problem are you facing exactly? | 2019-02-11T04:39:47.033800 | Valeri | pythondev_help_Valeri_2019-02-11T04:39:47.033800 | 1,549,859,987.0338 | 7,593 |
pythondev | help | <@Valeri> My main problem is I can’t find a DB as good as Rethinkdb to work with my python code. | 2019-02-11T04:40:33.034600 | Johanne | pythondev_help_Johanne_2019-02-11T04:40:33.034600 | 1,549,860,033.0346 | 7,594 |
pythondev | help | <@Stacia> you can run the code at the bottom, compare the outputs | 2019-02-11T04:44:10.035000 | Mica | pythondev_help_Mica_2019-02-11T04:44:10.035000 | 1,549,860,250.035 | 7,595 |
pythondev | help | what's the difference? | 2019-02-11T04:44:14.035200 | Mica | pythondev_help_Mica_2019-02-11T04:44:14.035200 | 1,549,860,254.0352 | 7,596 |
pythondev | help | moin moin!
I want to catch a succesful Termination of my qt-app
i'm trying to figure out, how i can test the exitcode (should be 0)
that's what i've tried so far:
```
try:
sys.exit(app.exec_())
except SystemExit as exitcode:
if exitcode is SystemExit(0): # catches exitcode 0 (=success)
... | 2019-02-11T05:01:27.037200 | Shawana | pythondev_help_Shawana_2019-02-11T05:01:27.037200 | 1,549,861,287.0372 | 7,597 |
pythondev | help | the outputs are similar. i get the expected output, but for some reason only #2 passes the test cases given to me.
my output is the exact same as the expected output. that’s what make this even more confusing for me. | 2019-02-11T05:05:06.037300 | Stacia | pythondev_help_Stacia_2019-02-11T05:05:06.037300 | 1,549,861,506.0373 | 7,598 |
pythondev | help | might be an issue on the site if it's identical | 2019-02-11T05:06:58.037500 | Mica | pythondev_help_Mica_2019-02-11T05:06:58.037500 | 1,549,861,618.0375 | 7,599 |
pythondev | help | Ahh, i managed to inspect exitcode with
`exitcode.__class__.__dict__.items()`
and naturally you can just access `exitcode.code` | 2019-02-11T05:15:35.038500 | Shawana | pythondev_help_Shawana_2019-02-11T05:15:35.038500 | 1,549,862,135.0385 | 7,600 |
pythondev | help | so for qt the code is
```
try:
sys.exit(app.exec_())
except SystemExit as sysexit:
if sysexit.code is 0:
pass # 'Successful Termination'
else:
raise
```
now | 2019-02-11T05:17:36.038900 | Shawana | pythondev_help_Shawana_2019-02-11T05:17:36.038900 | 1,549,862,256.0389 | 7,601 |
pythondev | help | oh shit :o | 2019-02-11T05:19:50.039300 | Jettie | pythondev_help_Jettie_2019-02-11T05:19:50.039300 | 1,549,862,390.0393 | 7,602 |
pythondev | help | ? | 2019-02-11T05:21:35.039500 | Shawana | pythondev_help_Shawana_2019-02-11T05:21:35.039500 | 1,549,862,495.0395 | 7,603 |
pythondev | help | what would lead to a non 0 exit code? | 2019-02-11T05:25:55.039800 | Jimmy | pythondev_help_Jimmy_2019-02-11T05:25:55.039800 | 1,549,862,755.0398 | 7,604 |
pythondev | help | why not just raised an exception and catching that ? they you know it's not a clean exit | 2019-02-11T05:26:15.040300 | Jimmy | pythondev_help_Jimmy_2019-02-11T05:26:15.040300 | 1,549,862,775.0403 | 7,605 |
pythondev | help | If the qt-app crashes - and doesn't get 'x-ed' I get an exception now.
With raising the exception in general I would get exceptions for everytime terminating the programm normally | 2019-02-11T05:31:30.041900 | Shawana | pythondev_help_Shawana_2019-02-11T05:31:30.041900 | 1,549,863,090.0419 | 7,606 |
pythondev | help | but your answers sound a bit, like I made a more or less terrible mistake :Q | 2019-02-11T05:44:06.042400 | Shawana | pythondev_help_Shawana_2019-02-11T05:44:06.042400 | 1,549,863,846.0424 | 7,607 |
pythondev | help | I'm a bit confused on why you need to do that. But I don't do any qt | 2019-02-11T05:45:54.042900 | Jimmy | pythondev_help_Jimmy_2019-02-11T05:45:54.042900 | 1,549,863,954.0429 | 7,608 |
pythondev | help | what's the return value of `app.exec_()` ? | 2019-02-11T05:46:24.043400 | Jimmy | pythondev_help_Jimmy_2019-02-11T05:46:24.043400 | 1,549,863,984.0434 | 7,609 |
pythondev | help | 0 ,when terminating normally | 2019-02-11T05:47:01.043700 | Shawana | pythondev_help_Shawana_2019-02-11T05:47:01.043700 | 1,549,864,021.0437 | 7,610 |
pythondev | help | so why not something like
```
exit_code = app.exec_()
if exit_code != 0:
# stuff
``` | 2019-02-11T05:47:37.044400 | Jimmy | pythondev_help_Jimmy_2019-02-11T05:47:37.044400 | 1,549,864,057.0444 | 7,611 |
pythondev | help | with the nested sys.exit(app.exec_()) I get the SystemExit-Instance directly | 2019-02-11T05:51:02.045400 | Shawana | pythondev_help_Shawana_2019-02-11T05:51:02.045400 | 1,549,864,262.0454 | 7,612 |
pythondev | help | is there any disadvantage of the try: except_ wrapper i forgot to think about? | 2019-02-11T05:51:54.045900 | Shawana | pythondev_help_Shawana_2019-02-11T05:51:54.045900 | 1,549,864,314.0459 | 7,613 |
pythondev | help | Since this is likely only going to occur once in your program it doesn't really apply - but generally it's a more "expensive" way to achieve the same thing. | 2019-02-11T05:52:34.046700 | Karoline | pythondev_help_Karoline_2019-02-11T05:52:34.046700 | 1,549,864,354.0467 | 7,614 |
pythondev | help | As a general style thing too flow control via exception handling is avoided if possible. | 2019-02-11T05:53:19.047500 | Karoline | pythondev_help_Karoline_2019-02-11T05:53:19.047500 | 1,549,864,399.0475 | 7,615 |
pythondev | help | how would you suggest temrinating any application using sys.exit(0) - this throws an exception all the time | 2019-02-11T05:55:12.048400 | Shawana | pythondev_help_Shawana_2019-02-11T05:55:12.048400 | 1,549,864,512.0484 | 7,616 |
pythondev | help | it shouldn't throw an exception - what's the exception? | 2019-02-11T05:57:56.048700 | Karoline | pythondev_help_Karoline_2019-02-11T05:57:56.048700 | 1,549,864,676.0487 | 7,617 |
pythondev | help | you also don't need to explicitly call `sys.exit(0)` it's the default | 2019-02-11T05:58:31.049300 | Karoline | pythondev_help_Karoline_2019-02-11T05:58:31.049300 | 1,549,864,711.0493 | 7,618 |
pythondev | help | ```
Exception: SystemExit
0
``` | 2019-02-11T05:59:05.049600 | Shawana | pythondev_help_Shawana_2019-02-11T05:59:05.049600 | 1,549,864,745.0496 | 7,619 |
pythondev | help | do you have something capturing and printing exceptions? | 2019-02-11T05:59:50.049900 | Karoline | pythondev_help_Karoline_2019-02-11T05:59:50.049900 | 1,549,864,790.0499 | 7,620 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.