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 | I'll cheers to that haha, I'll earmark you're other solution though just in case I need it in the future. If there's one thing pyhton is real good at, it's creating the weirdest of situations . Thanks for the help | 2018-03-09T15:22:07.000311 | Shante | pythondev_help_Shante_2018-03-09T15:22:07.000311 | 1,520,608,927.000311 | 38,224 |
pythondev | help | very true, I've just been learning for funsies but I can imagine how wonky a production environment would get | 2018-03-09T15:25:04.000298 | Elisha | pythondev_help_Elisha_2018-03-09T15:25:04.000298 | 1,520,609,104.000298 | 38,225 |
pythondev | help | With python logging, is there a way to lazily evaluate the length of a list? For example I want:
```
logger.debug('Processing %d items', len(item_list))
```
But if debug isn't enabled there is no reason to do the `len` call manually | 2018-03-09T17:18:38.000398 | Rafael | pythondev_help_Rafael_2018-03-09T17:18:38.000398 | 1,520,615,918.000398 | 38,226 |
pythondev | help | <@Rafael> probably something in here: <https://stackoverflow.com/questions/21377020/python-how-to-do-lazy-debug-logging> | 2018-03-09T17:40:02.000439 | Huong | pythondev_help_Huong_2018-03-09T17:40:02.000439 | 1,520,617,202.000439 | 38,227 |
pythondev | help | No experience with it personally | 2018-03-09T17:40:08.000063 | Huong | pythondev_help_Huong_2018-03-09T17:40:08.000063 | 1,520,617,208.000063 | 38,228 |
pythondev | help | `/y=2018/m=03/d=08/` | 2018-03-09T18:58:19.000094 | Jenna | pythondev_help_Jenna_2018-03-09T18:58:19.000094 | 1,520,621,899.000094 | 38,229 |
pythondev | help | Can anyone help me the regex of this ^ | 2018-03-09T18:58:26.000098 | Jenna | pythondev_help_Jenna_2018-03-09T18:58:26.000098 | 1,520,621,906.000098 | 38,230 |
pythondev | help | first q to ask yourself | 2018-03-09T18:59:00.000211 | Shaun | pythondev_help_Shaun_2018-03-09T18:59:00.000211 | 1,520,621,940.000211 | 38,231 |
pythondev | help | do you _need_ regex? | 2018-03-09T18:59:08.000045 | Shaun | pythondev_help_Shaun_2018-03-09T18:59:08.000045 | 1,520,621,948.000045 | 38,232 |
pythondev | help | string methods are faster | 2018-03-09T18:59:15.000122 | Shaun | pythondev_help_Shaun_2018-03-09T18:59:15.000122 | 1,520,621,955.000122 | 38,233 |
pythondev | help | so the files have different year and date | 2018-03-09T18:59:40.000201 | Jenna | pythondev_help_Jenna_2018-03-09T18:59:40.000201 | 1,520,621,980.000201 | 38,234 |
pythondev | help | so, i think regex is nessarry | 2018-03-09T18:59:49.000009 | Jenna | pythondev_help_Jenna_2018-03-09T18:59:49.000009 | 1,520,621,989.000009 | 38,235 |
pythondev | help | `y=\d{4}\/m=\d{2}\/\d={2}` | 2018-03-09T18:59:52.000164 | Raelene | pythondev_help_Raelene_2018-03-09T18:59:52.000164 | 1,520,621,992.000164 | 38,236 |
pythondev | help | Thanks <@Raelene> <@Shaun> | 2018-03-09T19:01:24.000027 | Jenna | pythondev_help_Jenna_2018-03-09T19:01:24.000027 | 1,520,622,084.000027 | 38,237 |
pythondev | help | <@Raelene> :taco: | 2018-03-09T19:01:38.000082 | Shaun | pythondev_help_Shaun_2018-03-09T19:01:38.000082 | 1,520,622,098.000082 | 38,238 |
pythondev | help | thanks | 2018-03-09T19:01:44.000229 | Raelene | pythondev_help_Raelene_2018-03-09T19:01:44.000229 | 1,520,622,104.000229 | 38,239 |
pythondev | help | for a response in ~2 min | 2018-03-09T19:01:52.000144 | Shaun | pythondev_help_Shaun_2018-03-09T19:01:52.000144 | 1,520,622,112.000144 | 38,240 |
pythondev | help | regex :fire: | 2018-03-09T19:01:56.000247 | Shaun | pythondev_help_Shaun_2018-03-09T19:01:56.000247 | 1,520,622,116.000247 | 38,241 |
pythondev | help | <@Jenna>, quit working on a Friday night ! :stuck_out_tongue: | 2018-03-09T19:07:32.000123 | Shaun | pythondev_help_Shaun_2018-03-09T19:07:32.000123 | 1,520,622,452.000123 | 38,242 |
pythondev | help | lol | 2018-03-09T19:07:37.000243 | Jenna | pythondev_help_Jenna_2018-03-09T19:07:37.000243 | 1,520,622,457.000243 | 38,243 |
pythondev | help | SXSW is in town | 2018-03-09T19:07:40.000030 | Shaun | pythondev_help_Shaun_2018-03-09T19:07:40.000030 | 1,520,622,460.00003 | 38,244 |
pythondev | help | Hi Guys, has anyone experienced an issue with the ' . import ' statement for installed packages in pycharm? I've added two project folders inside a larger project which I want to use alongside. in one of the projects it relys on mock package for running test cases. for some reason I'm getting a lot of import issues w... | 2018-03-09T19:27:46.000205 | Meta | pythondev_help_Meta_2018-03-09T19:27:46.000205 | 1,520,623,666.000205 | 38,245 |
pythondev | help | <https://stackoverflow.com/questions/49203156/how-to-query-sqlalchemy-until-condition-is-met-in-rxpy-reactivex> | 2018-03-09T19:35:01.000017 | Garry | pythondev_help_Garry_2018-03-09T19:35:01.000017 | 1,520,624,101.000017 | 38,246 |
pythondev | help | Any thoughts on this ? | 2018-03-09T19:35:08.000206 | Garry | pythondev_help_Garry_2018-03-09T19:35:08.000206 | 1,520,624,108.000206 | 38,247 |
pythondev | help | <@Meta> did you get it fixed? Do you know what the import means when it’s “./“ ? | 2018-03-09T19:52:24.000018 | Kacie | pythondev_help_Kacie_2018-03-09T19:52:24.000018 | 1,520,625,144.000018 | 38,248 |
pythondev | help | <@Garry> that’s a thing? You want to perpetually keep hitting your db until you match a query? | 2018-03-09T19:53:31.000161 | Kacie | pythondev_help_Kacie_2018-03-09T19:53:31.000161 | 1,520,625,211.000161 | 38,249 |
pythondev | help | <@Kacie>the . import statement means search the current package I haven't got it fixed yet. | 2018-03-09T20:25:59.000004 | Meta | pythondev_help_Meta_2018-03-09T20:25:59.000004 | 1,520,627,159.000004 | 38,250 |
pythondev | help | What error should a function raise if it doesn't have any output? | 2018-03-10T03:12:43.000091 | Colby | pythondev_help_Colby_2018-03-10T03:12:43.000091 | 1,520,651,563.000091 | 38,251 |
pythondev | help | for example? | 2018-03-10T03:30:40.000051 | Barney | pythondev_help_Barney_2018-03-10T03:30:40.000051 | 1,520,652,640.000051 | 38,252 |
pythondev | help | if a return value of `None` can be reasonably seen as a normal operation, then you can just `return` or `return None` | 2018-03-10T03:31:40.000050 | Barney | pythondev_help_Barney_2018-03-10T03:31:40.000050 | 1,520,652,700.00005 | 38,253 |
pythondev | help | if it's truly is an exceptional event, I'd say it depends on why no output is possible | 2018-03-10T03:32:16.000030 | Barney | pythondev_help_Barney_2018-03-10T03:32:16.000030 | 1,520,652,736.00003 | 38,254 |
pythondev | help | If `def sqrt(num)` is called with a negative number, it's a ValueError (let's forget about complex numbers for a bit) | 2018-03-10T03:33:29.000028 | Barney | pythondev_help_Barney_2018-03-10T03:33:29.000028 | 1,520,652,809.000028 | 38,255 |
pythondev | help | <@Barney>
I have a function from a `card_reader` class called `scan` that is being continiously called inside a `while True` loop
when the correct card is placed, the function returns a string
but when a malformed card is placed, or no card was found, should the function return None or raise an error? | 2018-03-10T04:04:41.000086 | Colby | pythondev_help_Colby_2018-03-10T04:04:41.000086 | 1,520,654,681.000086 | 38,256 |
pythondev | help | I'd choose None when nothing was scanned, and an exception when a malformed data was obtained (since we handle the exception and notify the user maybe?)
BTW, even better would be to not return anything until the card is scanned | 2018-03-10T04:08:18.000016 | Barney | pythondev_help_Barney_2018-03-10T04:08:18.000016 | 1,520,654,898.000016 | 38,257 |
pythondev | help | no point in returning None over and over again when nothing is in the slot | 2018-03-10T04:08:33.000043 | Barney | pythondev_help_Barney_2018-03-10T04:08:33.000043 | 1,520,654,913.000043 | 38,258 |
pythondev | help | so you're saying that the scan function itself should contain a while loop that keeps scanning until *something* is found? | 2018-03-10T04:09:55.000061 | Colby | pythondev_help_Colby_2018-03-10T04:09:55.000061 | 1,520,654,995.000061 | 38,259 |
pythondev | help | I imagined a situation where you can block until anything is received, like with `socket.recv` and so on | 2018-03-10T04:12:10.000008 | Barney | pythondev_help_Barney_2018-03-10T04:12:10.000008 | 1,520,655,130.000008 | 38,260 |
pythondev | help | from what I can tell, I don't think that's possible | 2018-03-10T04:12:54.000006 | Colby | pythondev_help_Colby_2018-03-10T04:12:54.000006 | 1,520,655,174.000006 | 38,261 |
pythondev | help | so the device continuously spits out data, and the handling code must determine whether it's nothing or something? | 2018-03-10T04:13:36.000043 | Barney | pythondev_help_Barney_2018-03-10T04:13:36.000043 | 1,520,655,216.000043 | 38,262 |
pythondev | help | well specifically | 2018-03-10T04:14:52.000095 | Colby | pythondev_help_Colby_2018-03-10T04:14:52.000095 | 1,520,655,292.000095 | 38,263 |
pythondev | help | `scan` runs code to search for a card and then returns None if nothing was found | 2018-03-10T04:15:43.000028 | Colby | pythondev_help_Colby_2018-03-10T04:15:43.000028 | 1,520,655,343.000028 | 38,264 |
pythondev | help | don't you think not returning anything until a card is scanned would make the function more complex? | 2018-03-10T04:16:25.000030 | Colby | pythondev_help_Colby_2018-03-10T04:16:25.000030 | 1,520,655,385.00003 | 38,265 |
pythondev | help | yes, maybe | 2018-03-10T04:17:39.000079 | Barney | pythondev_help_Barney_2018-03-10T04:17:39.000079 | 1,520,655,459.000079 | 38,266 |
pythondev | help | but "userspace" code will be simpler instead:
```
for data in scan_card(...):
# data is guaranteed to be meaningful and correct each time
# otherwise an exception is raised
``` | 2018-03-10T04:18:40.000058 | Barney | pythondev_help_Barney_2018-03-10T04:18:40.000058 | 1,520,655,520.000058 | 38,267 |
pythondev | help | yeah I think that makes more sense, thanks :slightly_smiling_face: | 2018-03-10T04:23:58.000008 | Colby | pythondev_help_Colby_2018-03-10T04:23:58.000008 | 1,520,655,838.000008 | 38,268 |
pythondev | help | hello, I wrote a python 2.7 tool and inside a function I am using something like:
import mypackage.mymodule
to import all the files in mymodule
of course this doesn't work on python3 any suggestion on how to fix that without importing the files one by one | 2018-03-10T16:41:06.000057 | Basil | pythondev_help_Basil_2018-03-10T16:41:06.000057 | 1,520,700,066.000057 | 38,269 |
pythondev | help | so I would like to avoid: from mypackage.mymodule import filea, fileb | 2018-03-10T16:41:59.000107 | Basil | pythondev_help_Basil_2018-03-10T16:41:59.000107 | 1,520,700,119.000107 | 38,270 |
pythondev | help | Hey everyone. Need help with a line of code. I want to get a list of files in a folder, sorted by create date. This line should work:
files = sorted(os.listdir('/Users/bb/test'),key=os.path.getctime)
and it does, but only if ithe script is in the same folder. For any other folder, I get errors like:
FileNotFoundErro... | 2018-03-10T16:43:36.000040 | Karolyn | pythondev_help_Karolyn_2018-03-10T16:43:36.000040 | 1,520,700,216.00004 | 38,271 |
pythondev | help | <@Basil> Why would you not want to import each module (file) by name? Explicit is better than implicit.
To answer your question though, either import the package and access each file through the namespace ```from mypackage import mymodule
mymodule.filea.do_something()```
Or you can use wildcard import (discouraged for ... | 2018-03-11T04:46:24.000004 | Daina | pythondev_help_Daina_2018-03-11T04:46:24.000004 | 1,520,743,584.000004 | 38,272 |
pythondev | help | <@Karolyn> you are correct. os.listdir is only returning filenames, not paths. So, an option is to use a list comprehension with os.path.join.
```files = sorted([os.path.join(path, fl) for fl in os.listdir(path)], key=os.path.getctime)``` | 2018-03-11T04:50:03.000133 | Daina | pythondev_help_Daina_2018-03-11T04:50:03.000133 | 1,520,743,803.000133 | 38,273 |
pythondev | help | Anyone npyscreen guru? I can’t for the life of me work why this code isn’t working: <https://pastebin.com/r79y4h0a> | 2018-03-11T05:50:28.000006 | Celinda | pythondev_help_Celinda_2018-03-11T05:50:28.000006 | 1,520,747,428.000006 | 38,274 |
pythondev | help | <@Daina> That works, thanks! I understand what it is doing after reading what you gave, but I am not sure I would have came up with that on my own. I'll have to read up more on that for future use. Thanks again! | 2018-03-11T07:56:17.000109 | Karolyn | pythondev_help_Karolyn_2018-03-11T07:56:17.000109 | 1,520,754,977.000109 | 38,275 |
pythondev | help | None | 2018-03-11T12:09:40.000039 | Maya | pythondev_help_Maya_2018-03-11T12:09:40.000039 | 1,520,770,180.000039 | 38,276 |
pythondev | help | Hi, i am using PyCharm on a mac and have multiple (it seems) installations of python installed. When i do `which python3`, it points to `/usr/local/bin/python3` and there i imported the `requests` module with `pip`. When i now create a project in pycharm using the interpreter at `usr/local/bin/python3` it can’t find `r... | 2018-03-11T14:22:21.000010 | Wally | pythondev_help_Wally_2018-03-11T14:22:21.000010 | 1,520,778,141.00001 | 38,277 |
pythondev | help | <@Wally> Did pycharm create a virtualenv for the new project? | 2018-03-11T14:58:23.000137 | Porsha | pythondev_help_Porsha_2018-03-11T14:58:23.000137 | 1,520,780,303.000137 | 38,278 |
pythondev | help | That might be your issue | 2018-03-11T14:58:30.000025 | Porsha | pythondev_help_Porsha_2018-03-11T14:58:30.000025 | 1,520,780,310.000025 | 38,279 |
pythondev | help | yes it did | 2018-03-11T14:58:40.000019 | Wally | pythondev_help_Wally_2018-03-11T14:58:40.000019 | 1,520,780,320.000019 | 38,280 |
pythondev | help | ok so you need to activate the virtualenv and `pip install requests` | 2018-03-11T14:59:03.000083 | Porsha | pythondev_help_Porsha_2018-03-11T14:59:03.000083 | 1,520,780,343.000083 | 38,281 |
pythondev | help | if you launch the integrated terminal in pycharm it should default to launching in the activated virtualenv | 2018-03-11T14:59:31.000105 | Porsha | pythondev_help_Porsha_2018-03-11T14:59:31.000105 | 1,520,780,371.000105 | 38,282 |
pythondev | help | Use the `terminal` tab at the bottom of the editor | 2018-03-11T15:00:00.000019 | Porsha | pythondev_help_Porsha_2018-03-11T15:00:00.000019 | 1,520,780,400.000019 | 38,283 |
pythondev | help | you whould see `(env)` at the prompt | 2018-03-11T15:00:25.000155 | Porsha | pythondev_help_Porsha_2018-03-11T15:00:25.000155 | 1,520,780,425.000155 | 38,284 |
pythondev | help | thank you! | 2018-03-11T15:04:38.000104 | Wally | pythondev_help_Wally_2018-03-11T15:04:38.000104 | 1,520,780,678.000104 | 38,285 |
pythondev | help | Did it work? | 2018-03-11T15:04:56.000124 | Porsha | pythondev_help_Porsha_2018-03-11T15:04:56.000124 | 1,520,780,696.000124 | 38,286 |
pythondev | help | i installed it over `preferences` in pycharm now | 2018-03-11T15:05:33.000035 | Wally | pythondev_help_Wally_2018-03-11T15:05:33.000035 | 1,520,780,733.000035 | 38,287 |
pythondev | help | when i try to install `mysql-python` over the integrated terminal i get this error: `Command “python setup.py egg_info” failed with error code 1 in /private/tmp/pip-build-kk0p4zpt/mysql-python/` | 2018-03-11T15:07:07.000025 | Wally | pythondev_help_Wally_2018-03-11T15:07:07.000025 | 1,520,780,827.000025 | 38,288 |
pythondev | help | is mysql-python outdated? | 2018-03-11T15:12:33.000096 | Wally | pythondev_help_Wally_2018-03-11T15:12:33.000096 | 1,520,781,153.000096 | 38,289 |
pythondev | help | if it's this one - <https://pypi.org/project/MySQL-python/> - It looks like it hasn't been updated in about 4 years | 2018-03-11T15:15:08.000136 | Porsha | pythondev_help_Porsha_2018-03-11T15:15:08.000136 | 1,520,781,308.000136 | 38,290 |
pythondev | help | You might wan't to have a look at something like SQLAlchemy which is a nice abstraction layer/ORM over SQL | 2018-03-11T15:16:12.000009 | Porsha | pythondev_help_Porsha_2018-03-11T15:16:12.000009 | 1,520,781,372.000009 | 38,291 |
pythondev | help | it's really popular | 2018-03-11T15:16:27.000055 | Porsha | pythondev_help_Porsha_2018-03-11T15:16:27.000055 | 1,520,781,387.000055 | 38,292 |
pythondev | help | <https://pypi.org/project/SQLAlchemy/> | 2018-03-11T15:16:27.000134 | Porsha | pythondev_help_Porsha_2018-03-11T15:16:27.000134 | 1,520,781,387.000134 | 38,293 |
pythondev | help | <@Kieth> you can simplify `meta_method` a bit:
```
def meta_method(which_thing):
thing = mydict[which_thing].copy()
klass = thing.pop('type')
obj = klass(**thing)
return obj.my_method()
``` | 2018-03-11T22:47:00.000120 | Aleida | pythondev_help_Aleida_2018-03-11T22:47:00.000120 | 1,520,808,420.00012 | 38,294 |
pythondev | help | any one online ? | 2018-03-11T23:51:56.000093 | Refugia | pythondev_help_Refugia_2018-03-11T23:51:56.000093 | 1,520,812,316.000093 | 38,295 |
pythondev | help | <http://nohello.com|nohello.com> | 2018-03-11T23:55:44.000107 | Sadye | pythondev_help_Sadye_2018-03-11T23:55:44.000107 | 1,520,812,544.000107 | 38,296 |
pythondev | help | wow thats intresting site :smile: | 2018-03-12T00:02:05.000030 | Refugia | pythondev_help_Refugia_2018-03-12T00:02:05.000030 | 1,520,812,925.00003 | 38,297 |
pythondev | help | to be fair <@Refugia> did ask his question an hour before his hello :stuck_out_tongue: | 2018-03-12T00:03:32.000086 | Kieth | pythondev_help_Kieth_2018-03-12T00:03:32.000086 | 1,520,813,012.000086 | 38,298 |
pythondev | help | i need some help with sum of item in listoflist(kinda matrix), i did post my detail question just above my hello :smile: I am stuck n dont know how to access index position in enumeration for listoflist | 2018-03-12T00:04:05.000004 | Refugia | pythondev_help_Refugia_2018-03-12T00:04:05.000004 | 1,520,813,045.000004 | 38,299 |
pythondev | help | I know, but it's still relevant :slightly_smiling_face: | 2018-03-12T00:04:07.000133 | Sadye | pythondev_help_Sadye_2018-03-12T00:04:07.000133 | 1,520,813,047.000133 | 38,300 |
pythondev | help | without market name i was able to make sum of each column, ```tot=[]
for col in range(len(ticker)):
test=[]
for row in range(len(market)):
test.append(listoflist[row][col])
tot.append(sum(test))
print(tot)``` but that doest factor the market name | 2018-03-12T00:05:06.000188 | Refugia | pythondev_help_Refugia_2018-03-12T00:05:06.000188 | 1,520,813,106.000188 | 38,301 |
pythondev | help | i wanted the sum for each market ie ABC, BCD, CDE | 2018-03-12T00:05:37.000013 | Refugia | pythondev_help_Refugia_2018-03-12T00:05:37.000013 | 1,520,813,137.000013 | 38,302 |
pythondev | help | <@Refugia> something like that
```
from collections import OrderedDict
coins = OrderedDict()
for idx, name in enumerate(market):
name = name.split('-')[0]
row1 = coins.get(name, [0]*len(ticker))
row2 = listoflists[idx]
coins[name] = [sum(elem) for elem in zip(row1, row2)]
result = list(coins.values())
r... | 2018-03-12T00:11:57.000037 | Aleida | pythondev_help_Aleida_2018-03-12T00:11:57.000037 | 1,520,813,517.000037 | 38,303 |
pythondev | help | <@Aleida> thanks for the `**` tip I’m using it :slightly_smiling_face: | 2018-03-12T00:12:42.000222 | Kieth | pythondev_help_Kieth_2018-03-12T00:12:42.000222 | 1,520,813,562.000222 | 38,304 |
pythondev | help | <@Refugia> that snippet doesn't really work, I'm just showing you a path how to solve it | 2018-03-12T00:14:50.000049 | Aleida | pythondev_help_Aleida_2018-03-12T00:14:50.000049 | 1,520,813,690.000049 | 38,305 |
pythondev | help | sure <@Aleida> let me try OrderedDict, its new for me | 2018-03-12T00:16:57.000104 | Refugia | pythondev_help_Refugia_2018-03-12T00:16:57.000104 | 1,520,813,817.000104 | 38,306 |
pythondev | help | thanks again | 2018-03-12T00:17:06.000031 | Refugia | pythondev_help_Refugia_2018-03-12T00:17:06.000031 | 1,520,813,826.000031 | 38,307 |
pythondev | help | <@Refugia> <https://repl.it/repls/VioletredFrostyRom>
This is a working solution | 2018-03-12T00:28:16.000041 | Aleida | pythondev_help_Aleida_2018-03-12T00:28:16.000041 | 1,520,814,496.000041 | 38,308 |
pythondev | help | ```
coins = OrderedDict()
for idx, name in enumerate(market):
name = name.split('-')[0]
row1 = coins.get(name, [0]*5)
row2 = listoflist[idx]
coins[name] = [sum(elem) for elem in zip(row1, row2)]
result = list(coins.values())
result.append(
[sum(elem) for elem in zip(*coins.values())]
)
``` | 2018-03-12T00:28:23.000106 | Aleida | pythondev_help_Aleida_2018-03-12T00:28:23.000106 | 1,520,814,503.000106 | 38,309 |
pythondev | help | I'm using pyinstaller to create my <http://application.In|application.In> my django app, I'm using subprocess. When i execute pyinstaller in noconsole mode its throwing errors. No handle[6] occurs | 2018-03-12T01:36:10.000157 | Neil | pythondev_help_Neil_2018-03-12T01:36:10.000157 | 1,520,818,570.000157 | 38,310 |
pythondev | help | <@Aleida> great thanks for the code. i read bit about zip and OrderedDict to understand what do they do. i m little unclear how does it work, row1 = coins.get(name, [0]*5) ? i did print on each statement, i can see within for loop it takes the sum of recent list item from orderdict and list from listoflist. Could y... | 2018-03-12T02:30:01.000186 | Refugia | pythondev_help_Refugia_2018-03-12T02:30:01.000186 | 1,520,821,801.000186 | 38,311 |
pythondev | help | Correct. `[0] * 5` is (in this specific case) just a short way to write `[0, 0, 0, 0, 0]` | 2018-03-12T02:34:03.000262 | Aleida | pythondev_help_Aleida_2018-03-12T02:34:03.000262 | 1,520,822,043.000262 | 38,312 |
pythondev | help | `coins.get(name, [0] * 5)` means "get the current sum of coins by name, and if there's no coins for the name yet then return a list of 5 zeroes" | 2018-03-12T02:35:11.000239 | Aleida | pythondev_help_Aleida_2018-03-12T02:35:11.000239 | 1,520,822,111.000239 | 38,313 |
pythondev | help | I clocked out for the weekend, sorry. I'm either using Jupyter notebooks or Neovim for my development | 2018-03-12T05:55:52.000510 | Dierdre | pythondev_help_Dierdre_2018-03-12T05:55:52.000510 | 1,520,834,152.00051 | 38,314 |
pythondev | help | I think it's a mixture of mistrust of as large an application as PyCharm and of the need for imaginary geek creds :laughing: | 2018-03-12T05:58:06.000505 | Dierdre | pythondev_help_Dierdre_2018-03-12T05:58:06.000505 | 1,520,834,286.000505 | 38,315 |
pythondev | help | this django? it will return an empty queryset. so its up to you to handle it in that case | 2018-03-12T06:31:55.000104 | Floy | pythondev_help_Floy_2018-03-12T06:31:55.000104 | 1,520,836,315.000104 | 38,316 |
pythondev | help | if you’re rendering that queryset in a template, you should have an if conditional to check for whether results exist and render a block either way | 2018-03-12T06:33:03.000380 | Floy | pythondev_help_Floy_2018-03-12T06:33:03.000380 | 1,520,836,383.00038 | 38,317 |
pythondev | help | Hmm, I am serialising this data and retruning it as a JsonResponse to the template | 2018-03-12T06:37:03.000429 | Emmie | pythondev_help_Emmie_2018-03-12T06:37:03.000429 | 1,520,836,623.000429 | 38,318 |
pythondev | help | showing a no results found indicator is the responsibility of the template | 2018-03-12T06:38:11.000078 | Floy | pythondev_help_Floy_2018-03-12T06:38:11.000078 | 1,520,836,691.000078 | 38,319 |
pythondev | help | agreed, ok thanks for your help i will probably just edit my JsonResponse so it will be handled as i want in the template | 2018-03-12T06:44:15.000141 | Emmie | pythondev_help_Emmie_2018-03-12T06:44:15.000141 | 1,520,837,055.000141 | 38,320 |
pythondev | help | <@Aleida> I am sorry for incorrect explanation, There is small change in request for last row in the result list | 2018-03-12T06:52:39.000465 | Refugia | pythondev_help_Refugia_2018-03-12T06:52:39.000465 | 1,520,837,559.000465 | 38,321 |
pythondev | help | <@Refugia> and you can't do that by yourself? | 2018-03-12T06:53:39.000429 | Aleida | pythondev_help_Aleida_2018-03-12T06:53:39.000429 | 1,520,837,619.000429 | 38,322 |
pythondev | help | do i need to use numpy or any other library ? | 2018-03-12T06:53:49.000425 | Refugia | pythondev_help_Refugia_2018-03-12T06:53:49.000425 | 1,520,837,629.000425 | 38,323 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.