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 | it seems that your editor may treat tabs and spaces the same <@Walton> | 2019-05-14T17:48:52.179600 | Lawrence | pythondev_help_Lawrence_2019-05-14T17:48:52.179600 | 1,557,856,132.1796 | 23,821 |
pythondev | help | `linter-flake8`? | 2019-05-14T17:48:53.179700 | Maricruz | pythondev_help_Maricruz_2019-05-14T17:48:53.179700 | 1,557,856,133.1797 | 23,822 |
pythondev | help | yep! | 2019-05-14T17:49:09.180000 | Lawrence | pythondev_help_Lawrence_2019-05-14T17:49:09.180000 | 1,557,856,149.18 | 23,823 |
pythondev | help | <@Lawrence> thank you :taco:! | 2019-05-14T17:49:16.180400 | Maricruz | pythondev_help_Maricruz_2019-05-14T17:49:16.180400 | 1,557,856,156.1804 | 23,824 |
pythondev | help | well i'll try it again, but thank you for confirming that my logic was sound | 2019-05-14T17:49:22.180500 | Walton | pythondev_help_Walton_2019-05-14T17:49:22.180500 | 1,557,856,162.1805 | 23,825 |
pythondev | help | do you use VS Code as your main editor? | 2019-05-14T17:49:43.180900 | Lawrence | pythondev_help_Lawrence_2019-05-14T17:49:43.180900 | 1,557,856,183.1809 | 23,826 |
pythondev | help | these are some helpful settings for setting tabs to spaces ```// The number of spaces a tab is equal to.
"editor.tabSize": 4,
// Insert spaces when pressing Tab.
"editor.insertSpaces": true,
// When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.
"editor.detectIndentation": true``` | 2019-05-14T17:50:34.181400 | Lawrence | pythondev_help_Lawrence_2019-05-14T17:50:34.181400 | 1,557,856,234.1814 | 23,827 |
pythondev | help | well you were write about the spaces | 2019-05-14T18:17:36.181700 | Walton | pythondev_help_Walton_2019-05-14T18:17:36.181700 | 1,557,857,856.1817 | 23,828 |
pythondev | help | however it started counting to infinity | 2019-05-14T18:17:45.182000 | Walton | pythondev_help_Walton_2019-05-14T18:17:45.182000 | 1,557,857,865.182 | 23,829 |
pythondev | help | i'll have to address that tomorrow | 2019-05-14T18:18:03.182200 | Walton | pythondev_help_Walton_2019-05-14T18:18:03.182200 | 1,557,857,883.1822 | 23,830 |
pythondev | help | i'll add those settings in, thank you for that | 2019-05-14T18:18:29.183100 | Walton | pythondev_help_Walton_2019-05-14T18:18:29.183100 | 1,557,857,909.1831 | 23,831 |
pythondev | help | I also found it handy to turn on displaying whitespace in vscode (especially if I'm troubleshooting something that seems to be just that). If you File --> Preferences --> Settings (or `CTRL + ,` ) and then search for whitespace, you can change it from `none` (which is default) to `all` | 2019-05-14T18:19:39.184300 | Marth | pythondev_help_Marth_2019-05-14T18:19:39.184300 | 1,557,857,979.1843 | 23,832 |
pythondev | help | ah, thanks Dan I'll check that out as well | 2019-05-14T18:29:13.184700 | Walton | pythondev_help_Walton_2019-05-14T18:29:13.184700 | 1,557,858,553.1847 | 23,833 |
pythondev | help | What is the best way to add an image that can be chosen by a novice in tkinter, my idea is to put a thermometer on one side, as a static image and an image of a degree selector that changes the image every time they click | 2019-05-14T18:49:41.185800 | Melia | pythondev_help_Melia_2019-05-14T18:49:41.185800 | 1,557,859,781.1858 | 23,834 |
pythondev | help | could you elaborate? | 2019-05-14T19:17:21.186500 | Nenita | pythondev_help_Nenita_2019-05-14T19:17:21.186500 | 1,557,861,441.1865 | 23,835 |
pythondev | help | <@Melia> | 2019-05-14T19:18:07.186700 | Nenita | pythondev_help_Nenita_2019-05-14T19:18:07.186700 | 1,557,861,487.1867 | 23,836 |
pythondev | help | like just adding an image that the person can actually click on? | 2019-05-14T19:18:30.187000 | Nenita | pythondev_help_Nenita_2019-05-14T19:18:30.187000 | 1,557,861,510.187 | 23,837 |
pythondev | help | <@Nenita> this image will be static | 2019-05-14T19:20:32.187100 | Melia | pythondev_help_Melia_2019-05-14T19:20:32.187100 | 1,557,861,632.1871 | 23,838 |
pythondev | help | and this will change | 2019-05-14T19:20:55.187400 | Melia | pythondev_help_Melia_2019-05-14T19:20:55.187400 | 1,557,861,655.1874 | 23,839 |
pythondev | help | when click i want to change the image and will return de temperture depending if image is C or F | 2019-05-14T19:22:18.189600 | Melia | pythondev_help_Melia_2019-05-14T19:22:18.189600 | 1,557,861,738.1896 | 23,840 |
pythondev | help | oh i see. Ive only worked with icons when it comes to images in tkinter. but i dont use images in tkinter anymore because sadly when you run/compile-then-run on a computer using pyinstaller or auto py to exe, it will always look for the exact directory the image is in. in otherwords, it doesn't really compile the image into the exe. | 2019-05-14T19:23:06.190400 | Nenita | pythondev_help_Nenita_2019-05-14T19:23:06.190400 | 1,557,861,786.1904 | 23,841 |
pythondev | help | but as far as what your looking to do | 2019-05-14T19:23:12.190700 | Nenita | pythondev_help_Nenita_2019-05-14T19:23:12.190700 | 1,557,861,792.1907 | 23,842 |
pythondev | help | you will need to create your image object then bind it using "<<Button-1>>" or something similar | 2019-05-14T19:23:34.191300 | Nenita | pythondev_help_Nenita_2019-05-14T19:23:34.191300 | 1,557,861,814.1913 | 23,843 |
pythondev | help | I'm going to try, thank you | 2019-05-14T19:25:02.191500 | Melia | pythondev_help_Melia_2019-05-14T19:25:02.191500 | 1,557,861,902.1915 | 23,844 |
pythondev | help | not sure if there is a hover bind and even searching google right now, it looks like there may not be :shrug: | 2019-05-14T19:25:27.192000 | Nenita | pythondev_help_Nenita_2019-05-14T19:25:27.192000 | 1,557,861,927.192 | 23,845 |
pythondev | help | here is a good example | 2019-05-14T19:26:57.192200 | Nenita | pythondev_help_Nenita_2019-05-14T19:26:57.192200 | 1,557,862,017.1922 | 23,846 |
pythondev | help | <https://www.c-sharpcorner.com/blogs/basics-for-displaying-image-in-tkinter-python> | 2019-05-14T19:26:59.192400 | Nenita | pythondev_help_Nenita_2019-05-14T19:26:59.192400 | 1,557,862,019.1924 | 23,847 |
pythondev | help | then add this | 2019-05-14T19:28:34.192700 | Nenita | pythondev_help_Nenita_2019-05-14T19:28:34.192700 | 1,557,862,114.1927 | 23,848 |
pythondev | help | if your looking to change those other images, then i suggest making a function that would use attributes based on what is changing those images and then change the images based on those inputed attributes. call that function with the bind line above | 2019-05-14T19:31:23.194400 | Nenita | pythondev_help_Nenita_2019-05-14T19:31:23.194400 | 1,557,862,283.1944 | 23,849 |
pythondev | help | Hi, is there a faster way of getting a `sqlalchemy` relationship count?
```
from app import db
class Account(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(200), nullable=False)
class Address(db.Model):
id = db.Column(db.Integer, primary_key=True)
account_id = db.Column(db.Integer, db.ForeignKey('account.id'), nullable=False, primary_key=True)
account = db.relationship('Account', backref=db.backref('address', lazy=True))
account_list = db.session.query(Account).all()
for account in account_list:
address_count = len(account.address)
```
I feel like using `len` is not efficient. | 2019-05-14T23:34:21.195900 | Philip | pythondev_help_Philip_2019-05-14T23:34:21.195900 | 1,557,876,861.1959 | 23,850 |
pythondev | help | <https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.count> | 2019-05-14T23:35:39.196100 | Chester | pythondev_help_Chester_2019-05-14T23:35:39.196100 | 1,557,876,939.1961 | 23,851 |
pythondev | help | I see, so its much better to do a count query rather than getting the count from the relationship? | 2019-05-14T23:36:39.196300 | Philip | pythondev_help_Philip_2019-05-14T23:36:39.196300 | 1,557,876,999.1963 | 23,852 |
pythondev | help | A count query is being made on the database side, while `len()` is being made on the client side; the database side is more performant, as usual | 2019-05-14T23:37:24.196500 | Chester | pythondev_help_Chester_2019-05-14T23:37:24.196500 | 1,557,877,044.1965 | 23,853 |
pythondev | help | Noted, thank you <@Chester> ! :taco: | 2019-05-14T23:38:22.196700 | Philip | pythondev_help_Philip_2019-05-14T23:38:22.196700 | 1,557,877,102.1967 | 23,854 |
pythondev | help | ```TypeError: the JSON object must be str, bytes or bytearray, not dict``` | 2019-05-14T23:40:37.197200 | Conchita | pythondev_help_Conchita_2019-05-14T23:40:37.197200 | 1,557,877,237.1972 | 23,855 |
pythondev | help | > `request_json = request.get_json(silent=True)`
This already returns a parsed dictionary, you don't need to `json.loads` it again | 2019-05-14T23:41:56.198400 | Chester | pythondev_help_Chester_2019-05-14T23:41:56.198400 | 1,557,877,316.1984 | 23,856 |
pythondev | help | Aha - so this is simply fixed by removing `obj = json.loads(request_json)`? | 2019-05-14T23:42:29.199000 | Conchita | pythondev_help_Conchita_2019-05-14T23:42:29.199000 | 1,557,877,349.199 | 23,857 |
pythondev | help | And `targets = request_json['targets']`? | 2019-05-14T23:43:28.199900 | Conchita | pythondev_help_Conchita_2019-05-14T23:43:28.199900 | 1,557,877,408.1999 | 23,858 |
pythondev | help | Yes, it should work | 2019-05-14T23:44:34.200200 | Chester | pythondev_help_Chester_2019-05-14T23:44:34.200200 | 1,557,877,474.2002 | 23,859 |
pythondev | help | Try it | 2019-05-14T23:44:36.200400 | Chester | pythondev_help_Chester_2019-05-14T23:44:36.200400 | 1,557,877,476.2004 | 23,860 |
pythondev | help | Tested, works! | 2019-05-14T23:46:29.200600 | Conchita | pythondev_help_Conchita_2019-05-14T23:46:29.200600 | 1,557,877,589.2006 | 23,861 |
pythondev | help | Thanks <@Chester> :taco: | 2019-05-14T23:46:40.200900 | Conchita | pythondev_help_Conchita_2019-05-14T23:46:40.200900 | 1,557,877,600.2009 | 23,862 |
pythondev | help | Yes, I have two cluster hosted on different server, i want to call a service from cluster1 in cluster2. | 2019-05-15T02:46:09.201500 | Darcie | pythondev_help_Darcie_2019-05-15T02:46:09.201500 | 1,557,888,369.2015 | 23,863 |
pythondev | help | Could anyone recommend a library for auto retrying aiohttp requests? | 2019-05-15T04:46:31.202400 | Pura | pythondev_help_Pura_2019-05-15T04:46:31.202400 | 1,557,895,591.2024 | 23,864 |
pythondev | help | could just wrap it in a try / catch and a while | 2019-05-15T05:01:59.202800 | Mica | pythondev_help_Mica_2019-05-15T05:01:59.202800 | 1,557,896,519.2028 | 23,865 |
pythondev | help | None | 2019-05-15T05:04:06.202900 | Mica | pythondev_help_Mica_2019-05-15T05:04:06.202900 | 1,557,896,646.2029 | 23,866 |
pythondev | help | that should work i think? | 2019-05-15T05:04:16.203300 | Mica | pythondev_help_Mica_2019-05-15T05:04:16.203300 | 1,557,896,656.2033 | 23,867 |
pythondev | help | then you could create a decorator from it | 2019-05-15T05:04:22.203500 | Mica | pythondev_help_Mica_2019-05-15T05:04:22.203500 | 1,557,896,662.2035 | 23,868 |
pythondev | help | I just committed to git, but I can't see my master branch. What should I do? | 2019-05-15T06:14:29.204200 | Javier | pythondev_help_Javier_2019-05-15T06:14:29.204200 | 1,557,900,869.2042 | 23,869 |
pythondev | help | That's very useful | 2019-05-15T06:16:35.204300 | Valeri | pythondev_help_Valeri_2019-05-15T06:16:35.204300 | 1,557,900,995.2043 | 23,870 |
pythondev | help | Thanks <@Neely> :taco: | 2019-05-15T06:16:42.204500 | Valeri | pythondev_help_Valeri_2019-05-15T06:16:42.204500 | 1,557,901,002.2045 | 23,871 |
pythondev | help | Did you push to `remote` after commiting? | 2019-05-15T06:20:42.205700 | Madonna | pythondev_help_Madonna_2019-05-15T06:20:42.205700 | 1,557,901,242.2057 | 23,872 |
pythondev | help | no | 2019-05-15T06:22:50.206300 | Javier | pythondev_help_Javier_2019-05-15T06:22:50.206300 | 1,557,901,370.2063 | 23,873 |
pythondev | help | <@Madonna> :taco: | 2019-05-15T06:23:10.206600 | Javier | pythondev_help_Javier_2019-05-15T06:23:10.206600 | 1,557,901,390.2066 | 23,874 |
pythondev | help | thanks i was looking for a library that had some backoff strategy implemented | 2019-05-15T07:39:52.207500 | Pura | pythondev_help_Pura_2019-05-15T07:39:52.207500 | 1,557,905,992.2075 | 23,875 |
pythondev | help | ah right, not too sure :confused: | 2019-05-15T08:06:57.207700 | Mica | pythondev_help_Mica_2019-05-15T08:06:57.207700 | 1,557,907,617.2077 | 23,876 |
pythondev | help | def requests_retry_session(
retries=3,
backoff_factor=0.3,
status_forcelist=(500, 502, 504),
session=None,
:disappointed:
session = session or requests.Session()
retry = Retry(
total=retries,
read=retries,
connect=retries,
backoff_factor=backoff_factor,
status_forcelist=status_forcelist,
)
adapter = HTTPAdapter(max_retries=retry)
session.mount('http://', adapter)
session.mount('https://', adapter)
return session | 2019-05-15T08:08:03.208100 | Harley | pythondev_help_Harley_2019-05-15T08:08:03.208100 | 1,557,907,683.2081 | 23,877 |
pythondev | help | I am using this HTTP request Adapter to try when i have got 5XX errors from requests library | 2019-05-15T08:08:37.208800 | Harley | pythondev_help_Harley_2019-05-15T08:08:37.208800 | 1,557,907,717.2088 | 23,878 |
pythondev | help | None | 2019-05-15T08:09:31.208900 | Harley | pythondev_help_Harley_2019-05-15T08:09:31.208900 | 1,557,907,771.2089 | 23,879 |
pythondev | help | I have using this HTTPAdaptor to getting from HTTPS endpoint using requests_retry_session <http://function.It|function.It> works well ben when i want to getting 5XX error when i remove http rule at ELB Security Group from backend.I can not get any timeout or connection error exception. | 2019-05-15T08:12:30.209300 | Harley | pythondev_help_Harley_2019-05-15T08:12:30.209300 | 1,557,907,950.2093 | 23,880 |
pythondev | help | Why I can not getting any exception when i break communication between this lambda function and backend endpoint | 2019-05-15T08:13:11.210400 | Harley | pythondev_help_Harley_2019-05-15T08:13:11.210400 | 1,557,907,991.2104 | 23,881 |
pythondev | help | your question is quite unclear | 2019-05-15T08:14:01.210600 | Jonas | pythondev_help_Jonas_2019-05-15T08:14:01.210600 | 1,557,908,041.2106 | 23,882 |
pythondev | help | are you saying that there is no exception thrown, *and* no response returned? How can this be true? | 2019-05-15T08:14:16.211000 | Jonas | pythondev_help_Jonas_2019-05-15T08:14:16.211000 | 1,557,908,056.211 | 23,883 |
pythondev | help | are you saying that it will just hang forever? | 2019-05-15T08:14:28.211600 | Jonas | pythondev_help_Jonas_2019-05-15T08:14:28.211600 | 1,557,908,068.2116 | 23,884 |
pythondev | help | Sorry i think i paste wrong code.Yes exactly when i append my code with try except block but although there has been occured connection error between lambda and backend http endpoint the code did not raise an exception and getting lambda execution timeout (60 second) | 2019-05-15T08:17:13.214100 | Harley | pythondev_help_Harley_2019-05-15T08:17:13.214100 | 1,557,908,233.2141 | 23,885 |
pythondev | help | I write correct code block again now | 2019-05-15T08:17:21.214400 | Harley | pythondev_help_Harley_2019-05-15T08:17:21.214400 | 1,557,908,241.2144 | 23,886 |
pythondev | help | None | 2019-05-15T08:17:57.214500 | Harley | pythondev_help_Harley_2019-05-15T08:17:57.214500 | 1,557,908,277.2145 | 23,887 |
pythondev | help | None | 2019-05-15T08:18:26.214800 | Harley | pythondev_help_Harley_2019-05-15T08:18:26.214800 | 1,557,908,306.2148 | 23,888 |
pythondev | help | The below execption block do not raise any exception when i remove SG rule between lambda and backend API so lambda execute code and goes down to the lambda timeout without any exeception.I have increase lambda timeout value from 60 to 600 step by step each test but everytime i have got only lambda timeout so it did not hang and raise any exception. | 2019-05-15T08:33:16.218200 | Harley | pythondev_help_Harley_2019-05-15T08:33:16.218200 | 1,557,909,196.2182 | 23,889 |
pythondev | help | Is it possible to use list comprehension to "extend" a list during creation?
Something like:
```
a_list = ['three', 'four']
awesome_list = ['one', 'two', x for x in a_list]
``` | 2019-05-15T09:04:35.219600 | Jolynn | pythondev_help_Jolynn_2019-05-15T09:04:35.219600 | 1,557,911,075.2196 | 23,890 |
pythondev | help | Such that `awesome_list == ['one', 'two', 'three', 'four']` | 2019-05-15T09:05:06.220300 | Jolynn | pythondev_help_Jolynn_2019-05-15T09:05:06.220300 | 1,557,911,106.2203 | 23,891 |
pythondev | help | ```
>>> a_list = ['three', 'four']
>>> awesome_list = ['one', 'two', *[x for x in a_list]]
>>> awesome_list
['one', 'two', 'three', 'four']
``` | 2019-05-15T09:08:59.220500 | Chester | pythondev_help_Chester_2019-05-15T09:08:59.220500 | 1,557,911,339.2205 | 23,892 |
pythondev | help | ```
>>> ['one', 'two'] + [x for x in a_list]
['one', 'two', 'three', 'four']
```
works too | 2019-05-15T09:09:35.220800 | Chester | pythondev_help_Chester_2019-05-15T09:09:35.220800 | 1,557,911,375.2208 | 23,893 |
pythondev | help | Does anyone have any info about the memory cost of `print()` vs using `logging` module? I have a project with TONS of `print()` calls, and wondering if switching to `logging` will reduce the overall memory footprint of the program. | 2019-05-15T09:36:53.222100 | Clarita | pythondev_help_Clarita_2019-05-15T09:36:53.222100 | 1,557,913,013.2221 | 23,894 |
pythondev | help | if anything, I think logging would be much more flexible | 2019-05-15T09:41:28.222500 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:41:28.222500 | 1,557,913,288.2225 | 23,895 |
pythondev | help | because you can then route your log output to a handler which can execute different things | 2019-05-15T09:41:42.222900 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:41:42.222900 | 1,557,913,302.2229 | 23,896 |
pythondev | help | eg, send an email with too many ERRORs occurring | 2019-05-15T09:41:56.223200 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:41:56.223200 | 1,557,913,316.2232 | 23,897 |
pythondev | help | post to a log aggregator | 2019-05-15T09:42:01.223400 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:42:01.223400 | 1,557,913,321.2234 | 23,898 |
pythondev | help | etc | 2019-05-15T09:42:03.223600 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:42:03.223600 | 1,557,913,323.2236 | 23,899 |
pythondev | help | in other words, <@Clarita> I would kill print in favor of logging just because | 2019-05-15T09:42:33.224300 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:42:33.224300 | 1,557,913,353.2243 | 23,900 |
pythondev | help | using lots of print statements over logging in a project is a major code smell to me | 2019-05-15T09:42:51.224900 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:42:51.224900 | 1,557,913,371.2249 | 23,901 |
pythondev | help | undoubtedly logging is superior for flexibility, can’t argue that. but i’m trying to reduce memory use first and foremost, and since I don’t really know the internals of `print` just wondering if it is somehow a very costly process | 2019-05-15T09:44:53.226700 | Clarita | pythondev_help_Clarita_2019-05-15T09:44:53.226700 | 1,557,913,493.2267 | 23,902 |
pythondev | help | print uses the OS system calls, IIRC | 2019-05-15T09:45:18.227300 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:45:18.227300 | 1,557,913,518.2273 | 23,903 |
pythondev | help | so its pretty low level | 2019-05-15T09:45:24.227600 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:45:24.227600 | 1,557,913,524.2276 | 23,904 |
pythondev | help | certainly in terms of time print is killing our program | 2019-05-15T09:45:33.227900 | Clarita | pythondev_help_Clarita_2019-05-15T09:45:33.227900 | 1,557,913,533.2279 | 23,905 |
pythondev | help | FWIW, you really should be using levels in output | 2019-05-15T09:45:47.228400 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:45:47.228400 | 1,557,913,547.2284 | 23,906 |
pythondev | help | eg, INFO, WARN, ERROR, DEBUG | 2019-05-15T09:45:53.228800 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:45:53.228800 | 1,557,913,553.2288 | 23,907 |
pythondev | help | sounds like lots of your output is debug and could be avoided with proper logging levels | 2019-05-15T09:46:14.229300 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:46:14.229300 | 1,557,913,574.2293 | 23,908 |
pythondev | help | eg, you want one env to have debug output, but not another. just change the log level in the env config | 2019-05-15T09:46:34.230100 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:46:34.230100 | 1,557,913,594.2301 | 23,909 |
pythondev | help | thanks <@Hiroko>, unfortunately I work with a bunch of non-engineers who built this code base who didn’t about logging, and this is what I’m working with now :disappointed: | 2019-05-15T09:47:48.231100 | Clarita | pythondev_help_Clarita_2019-05-15T09:47:48.231100 | 1,557,913,668.2311 | 23,910 |
pythondev | help | gotcha | 2019-05-15T09:48:59.231300 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:48:59.231300 | 1,557,913,739.2313 | 23,911 |
pythondev | help | you have my sympathies :slightly_smiling_face: | 2019-05-15T09:49:09.231700 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:49:09.231700 | 1,557,913,749.2317 | 23,912 |
pythondev | help | and re: logging. I can’t recall if you have log level set to ERROR will a statement like `<http://logging.INFO|logging.INFO>(f'{calculate_string()}')` actually execute and compile that string and not print it? or does it skip the entire line like a no-op? | 2019-05-15T09:55:50.233400 | Clarita | pythondev_help_Clarita_2019-05-15T09:55:50.233400 | 1,557,914,150.2334 | 23,913 |
pythondev | help | logging is a heriarchy | 2019-05-15T09:57:09.233700 | Hiroko | pythondev_help_Hiroko_2019-05-15T09:57:09.233700 | 1,557,914,229.2337 | 23,914 |
pythondev | help | if you just wanted to test the effect, you could assign like `<http://logging.info|logging.info>` to `print` globally and run your application and observe the difference | 2019-05-15T09:58:09.234500 | Karoline | pythondev_help_Karoline_2019-05-15T09:58:09.234500 | 1,557,914,289.2345 | 23,915 |
pythondev | help | I'd be shocked if it really made a noticeable difference but maybe in some tight loops. | 2019-05-15T09:58:26.235000 | Karoline | pythondev_help_Karoline_2019-05-15T09:58:26.235000 | 1,557,914,306.235 | 23,916 |
pythondev | help | ahhhhh that’s brilliant. I’ll try this | 2019-05-15T09:58:38.235100 | Clarita | pythondev_help_Clarita_2019-05-15T09:58:38.235100 | 1,557,914,318.2351 | 23,917 |
pythondev | help | Thank you! | 2019-05-15T10:02:26.235800 | Jolynn | pythondev_help_Jolynn_2019-05-15T10:02:26.235800 | 1,557,914,546.2358 | 23,918 |
pythondev | help | hey guys, supposed I have a list of datetime.times...
```
times = ['9:00', '9:30', '9:45', '10:15', '10:30', '10:30']
```
and I want to sort them into buckets 9:00-10:00 and 10:00-11:00.
Is there a cleaner/more pythonic way to do this than:
```
time_9am = []
time_10am = []
for a_time in times:
if a_time >= '9:00' and a_time < '10:00':
time_9am.append(a_time)
elif a_time >= '10:00' and a_time < '11:00':
time_10am.append(a_time)
``` | 2019-05-15T11:28:34.239100 | Magdalena | pythondev_help_Magdalena_2019-05-15T11:28:34.239100 | 1,557,919,714.2391 | 23,919 |
pythondev | help | you can bucket them by the value in `x.split(':')[0]` which will give you the hour portion of each string | 2019-05-15T11:30:46.240700 | Clemmie | pythondev_help_Clemmie_2019-05-15T11:30:46.240700 | 1,557,919,846.2407 | 23,920 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.