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 | anyway i need to learn it for some HTML stuff later on | 2019-01-26T16:28:09.679600 | Coleen | pythondev_help_Coleen_2019-01-26T16:28:09.679600 | 1,548,520,089.6796 | 4,521 |
pythondev | help | <@Sasha> two things I think would benefit bringing jinja or a template engine into this. I can easily see the output needing to be changed, whether by <@Coleen> or someone else that takes over this code. Using existing convention lowers the difficulty of someone else taking over. In addition, chances are Andrei will... | 2019-01-26T16:31:39.682100 | Hiroko | pythondev_help_Hiroko_2019-01-26T16:31:39.682100 | 1,548,520,299.6821 | 4,522 |
pythondev | help | Fair enough. I just worry about the tendency to use a pneumatic hammer-drill just to hang a picture. :wink: | 2019-01-26T16:33:19.682900 | Sasha | pythondev_help_Sasha_2019-01-26T16:33:19.682900 | 1,548,520,399.6829 | 4,523 |
pythondev | help | In all fairness I would have to use jinja later on for some HTML generation so that's a valid point. | 2019-01-26T16:33:52.683800 | Coleen | pythondev_help_Coleen_2019-01-26T16:33:52.683800 | 1,548,520,432.6838 | 4,524 |
pythondev | help | oh, for sure, and I do as well, Its a balance, being pragmatic and thinking long term | 2019-01-26T16:33:53.684000 | Hiroko | pythondev_help_Hiroko_2019-01-26T16:33:53.684000 | 1,548,520,433.684 | 4,525 |
pythondev | help | but I also feel a half hour or a half day’s effort to apply good practices when working on similar code saves myself alot of swearing at the idiot who did this piece of crap (and I was usually said idiot) | 2019-01-26T16:35:27.685400 | Hiroko | pythondev_help_Hiroko_2019-01-26T16:35:27.685400 | 1,548,520,527.6854 | 4,526 |
pythondev | help | this is the question I really want answering | 2019-01-26T16:35:29.685500 | Jonas | pythondev_help_Jonas_2019-01-26T16:35:29.685500 | 1,548,520,529.6855 | 4,527 |
pythondev | help | "why use requests when we have urllib?", isn't this the same argument? | 2019-01-26T16:35:58.686100 | Jonas | pythondev_help_Jonas_2019-01-26T16:35:58.686100 | 1,548,520,558.6861 | 4,528 |
pythondev | help | It's similar. I personally wouldn't necessarily fault someone for using urllib if they didn't require more advanced functionality. | 2019-01-26T16:38:48.687000 | Sasha | pythondev_help_Sasha_2019-01-26T16:38:48.687000 | 1,548,520,728.687 | 4,529 |
pythondev | help | So how would I convert to jinja, wrap the whole thing in `Template`? | 2019-01-26T16:49:42.687900 | Coleen | pythondev_help_Coleen_2019-01-26T16:49:42.687900 | 1,548,521,382.6879 | 4,530 |
pythondev | help | I use urllib pretty often instead of requests. if I'm not doing a ton it's often just as easy, and it makes it so I don't need another dependency | 2019-01-26T17:32:49.689300 | Karoline | pythondev_help_Karoline_2019-01-26T17:32:49.689300 | 1,548,523,969.6893 | 4,531 |
pythondev | help | Totally agree. Less dependencies is nice. It is good to have the option of a framework, though. <@Karoline> :taco: | 2019-01-26T17:37:12.689500 | Somer | pythondev_help_Somer_2019-01-26T17:37:12.689500 | 1,548,524,232.6895 | 4,532 |
pythondev | help | Hi all,
question for you-
how does one extracts the value of "Name" (1) from this output, which according to Python, type = bytes (or str, depends on how you run the command that outputs this thing. btw don't know if it matters but it's the output of the docker-hub command.. which you can get the cli by installing it v... | 2019-01-26T17:54:23.691000 | Bridget | pythondev_help_Bridget_2019-01-26T17:54:23.691000 | 1,548,525,263.691 | 4,533 |
pythondev | help | <@Bridget> if you expect output to be *always* in the above form, then something like below will work:
```
lines = command_output.split('\n') # split output into individual lines
my_line = lines[-2] # get second line from the end
item_name = my_line.split('|')[1].lstrip().rstrip() # split by |, get second entry and str... | 2019-01-26T18:33:02.692000 | Leonie | pythondev_help_Leonie_2019-01-26T18:33:02.692000 | 1,548,527,582.692 | 4,534 |
pythondev | help | I'll definitely try it. Thanks! | 2019-01-26T20:03:27.692400 | Bridget | pythondev_help_Bridget_2019-01-26T20:03:27.692400 | 1,548,533,007.6924 | 4,535 |
pythondev | help | hii, im new to programming. how do i open an .in file? | 2019-01-26T20:11:42.693000 | Reina | pythondev_help_Reina_2019-01-26T20:11:42.693000 | 1,548,533,502.693 | 4,536 |
pythondev | help | I suspect there may be more to your question, but the simple answer is: `f = open("<http://filename.in|filename.in>", "r")` | 2019-01-26T20:13:49.693900 | Sasha | pythondev_help_Sasha_2019-01-26T20:13:49.693900 | 1,548,533,629.6939 | 4,537 |
pythondev | help | My newest notebook:
<https://github.com/paulgureghian/Flask_apps/blob/master/Build_a_Flask_API%20.ipynb> | 2019-01-26T20:18:33.694300 | Clayton | pythondev_help_Clayton_2019-01-26T20:18:33.694300 | 1,548,533,913.6943 | 4,538 |
pythondev | help | I use POSTMAN to test my REST API. Now trying to Automate it using PYTHON
# Open the API sample .JSON in READ Mode
file = open(sampleFile, "r")
# Read the file content and in the form of string
json_input = file.read()
print(type(json_input))-->String
# Convert from string to JSON
request_json = json.loads(json_... | 2019-01-26T21:16:47.697200 | Shad | pythondev_help_Shad_2019-01-26T21:16:47.697200 | 1,548,537,407.6972 | 4,539 |
pythondev | help | Please use the snippet feature, or backticks, when sharing code. You can do so by clicking on the :heavy_plus_sign: on the left of the input box for a snippet.
For more information on snippets click <https://get.slack.help/hc/en-us/articles/204145658-Create-a-snippet|here>.
For more information on inline code formattin... | 2019-01-26T21:21:24.697300 | Leana | pythondev_help_Leana_2019-01-26T21:21:24.697300 | 1,548,537,684.6973 | 4,540 |
pythondev | help | Is the API expecting a form post or a JSON string as the payload? You may want to look at `response.text` to see whether it's sending what you expect. | 2019-01-26T21:23:39.698300 | Sasha | pythondev_help_Sasha_2019-01-26T21:23:39.698300 | 1,548,537,819.6983 | 4,541 |
pythondev | help | API is expecting JSON . In the POSTMAN I select "raw" and JSON(application/json) | 2019-01-26T21:29:45.699200 | Shad | pythondev_help_Shad_2019-01-26T21:29:45.699200 | 1,548,538,185.6992 | 4,542 |
pythondev | help | I think I don't need to convert from string to JSON using loads. I got a valid response. Thanks EdKeyes | 2019-01-26T21:40:56.700200 | Shad | pythondev_help_Shad_2019-01-26T21:40:56.700200 | 1,548,538,856.7002 | 4,543 |
pythondev | help | As my Python automation script works, would like to move the script to Jenkins. Appreciate guidance/suggestion | 2019-01-26T23:15:44.701700 | Shad | pythondev_help_Shad_2019-01-26T23:15:44.701700 | 1,548,544,544.7017 | 4,544 |
pythondev | help | :+1: | 2019-01-27T03:10:28.703400 | Leonie | pythondev_help_Leonie_2019-01-27T03:10:28.703400 | 1,548,558,628.7034 | 4,545 |
pythondev | help | Hi All, I need one help, I have a dictionary file with array name as attachment, in this attachment i have one dictionary file index 0, I need to add another dictionary file below to this attachment as index 1.. (screenshot attached for reference) | 2019-01-27T06:19:11.706200 | Lynsey | pythondev_help_Lynsey_2019-01-27T06:19:11.706200 | 1,548,569,951.7062 | 4,546 |
pythondev | help | None | 2019-01-27T06:19:19.706300 | Lynsey | pythondev_help_Lynsey_2019-01-27T06:19:19.706300 | 1,548,569,959.7063 | 4,547 |
pythondev | help | how can I add it, please help me | 2019-01-27T06:19:46.706800 | Lynsey | pythondev_help_Lynsey_2019-01-27T06:19:46.706800 | 1,548,569,986.7068 | 4,548 |
pythondev | help | How can I align text in a `jinja2` template? | 2019-01-27T06:43:45.707300 | Coleen | pythondev_help_Coleen_2019-01-27T06:43:45.707300 | 1,548,571,425.7073 | 4,549 |
pythondev | help | ```
j = {{param.j}} ! resulting j of ph-pairs
parity = {{param.parity}} ! parity of ph-pairs 1:+ 0:-
``` | 2019-01-27T06:45:11.708200 | Coleen | pythondev_help_Coleen_2019-01-27T06:45:11.708200 | 1,548,571,511.7082 | 4,550 |
pythondev | help | The column containing the question marks is not aligned when rendering the template, due to the different width of the two `param` fields. | 2019-01-27T06:46:29.709300 | Coleen | pythondev_help_Coleen_2019-01-27T06:46:29.709300 | 1,548,571,589.7093 | 4,551 |
pythondev | help | There are several functions here which might help: <http://jinja.pocoo.org/docs/2.10/templates/#list-of-builtin-filters> | 2019-01-27T07:50:12.709900 | Raven | pythondev_help_Raven_2019-01-27T07:50:12.709900 | 1,548,575,412.7099 | 4,552 |
pythondev | help | `center` looks like a possible candidate | 2019-01-27T07:50:21.710200 | Raven | pythondev_help_Raven_2019-01-27T07:50:21.710200 | 1,548,575,421.7102 | 4,553 |
pythondev | help | just use `my_list.append({'blah': 'xxx'})` ? | 2019-01-27T08:05:00.710300 | Jody | pythondev_help_Jody_2019-01-27T08:05:00.710300 | 1,548,576,300.7103 | 4,554 |
pythondev | help | I have many details inside the dictionary, how can I update the dictionary itself? | 2019-01-27T09:08:50.710600 | Lynsey | pythondev_help_Lynsey_2019-01-27T09:08:50.710600 | 1,548,580,130.7106 | 4,555 |
pythondev | help | Looks like there's also a `format` filter to apply Python-style string formatting, in which case you can use width-padding specifiers. | 2019-01-27T09:20:30.711700 | Sasha | pythondev_help_Sasha_2019-01-27T09:20:30.711700 | 1,548,580,830.7117 | 4,556 |
pythondev | help | Thanks! | 2019-01-27T09:47:11.711900 | Coleen | pythondev_help_Coleen_2019-01-27T09:47:11.711900 | 1,548,582,431.7119 | 4,557 |
pythondev | help | You can probably add extra whitespace inside the `{{ }}` that will be stripped out if you want the template to still visually line up. | 2019-01-27T09:51:03.712600 | Sasha | pythondev_help_Sasha_2019-01-27T09:51:03.712600 | 1,548,582,663.7126 | 4,558 |
pythondev | help | i was just wondering about that! | 2019-01-27T09:52:44.712900 | Coleen | pythondev_help_Coleen_2019-01-27T09:52:44.712900 | 1,548,582,764.7129 | 4,559 |
pythondev | help | Well.. to update a dictionary (if you know the key) you can write `mydict['mykey'] = 'value' ` | 2019-01-27T10:01:25.714700 | Jody | pythondev_help_Jody_2019-01-27T10:01:25.714700 | 1,548,583,285.7147 | 4,560 |
pythondev | help | if you don’t, just add an `if` clause, something like `if 'blah' in mydict.keys(): do_something` | 2019-01-27T10:01:57.715300 | Jody | pythondev_help_Jody_2019-01-27T10:01:57.715300 | 1,548,583,317.7153 | 4,561 |
pythondev | help | <@Shad> make a class that lets you interact with the REST API much more easily (make sure it's all documented). Give each endpoint of the API it's own method for each request method they support (e.g. `get_user_info`/`set_user_info`). It should be a tool that you can easily use in your command line instead of postman. ... | 2019-01-27T10:03:57.718000 | Ashley | pythondev_help_Ashley_2019-01-27T10:03:57.718000 | 1,548,583,437.718 | 4,562 |
pythondev | help | <@Ashley>: Thanks for your inputs. Appreciate if you can point me into that direction. | 2019-01-27T10:27:10.719000 | Shad | pythondev_help_Shad_2019-01-27T10:27:10.719000 | 1,548,584,830.719 | 4,563 |
pythondev | help | <@Shad> here's a quick link for you about general best practices | 2019-01-27T10:27:58.719300 | Ashley | pythondev_help_Ashley_2019-01-27T10:27:58.719300 | 1,548,584,878.7193 | 4,564 |
pythondev | help | I forget if it's mentioned there,but make sure you keep your tests isolated. They shouldn't depend on each other being run in order to work. THey should assumee they are the only test being run at any given moment | 2019-01-27T10:29:36.720500 | Ashley | pythondev_help_Ashley_2019-01-27T10:29:36.720500 | 1,548,584,976.7205 | 4,565 |
pythondev | help | also, try to make sure that if you run your tests in parallel, they won't interfere with each other | 2019-01-27T10:30:20.721100 | Ashley | pythondev_help_Ashley_2019-01-27T10:30:20.721100 | 1,548,585,020.7211 | 4,566 |
pythondev | help | to help make that happen, make sure any code that would change the state of your test subject is never in a test function/method, and is in a fixture | 2019-01-27T10:31:41.722000 | Ashley | pythondev_help_Ashley_2019-01-27T10:31:41.722000 | 1,548,585,101.722 | 4,567 |
pythondev | help | make sure your fixtures do/return 1 thing, and are named appropriately. YOu don't want to have one fixture that does 7 steps for you. INstead, just make those steps individual fixtures that you can reuse several places | 2019-01-27T10:32:37.723000 | Ashley | pythondev_help_Ashley_2019-01-27T10:32:37.723000 | 1,548,585,157.723 | 4,568 |
pythondev | help | <@Ashley> Link please | 2019-01-27T10:37:03.723400 | Shad | pythondev_help_Shad_2019-01-27T10:37:03.723400 | 1,548,585,423.7234 | 4,569 |
pythondev | help | oh sorry | 2019-01-27T10:37:24.723900 | Ashley | pythondev_help_Ashley_2019-01-27T10:37:24.723900 | 1,548,585,444.7239 | 4,570 |
pythondev | help | it didn't paste | 2019-01-27T10:37:26.724100 | Ashley | pythondev_help_Ashley_2019-01-27T10:37:26.724100 | 1,548,585,446.7241 | 4,571 |
pythondev | help | <https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices> | 2019-01-27T10:37:28.724300 | Ashley | pythondev_help_Ashley_2019-01-27T10:37:28.724300 | 1,548,585,448.7243 | 4,572 |
pythondev | help | Thanks <@Ashley> | 2019-01-27T10:52:56.725100 | Shad | pythondev_help_Shad_2019-01-27T10:52:56.725100 | 1,548,586,376.7251 | 4,573 |
pythondev | help | np! | 2019-01-27T10:53:12.725300 | Ashley | pythondev_help_Ashley_2019-01-27T10:53:12.725300 | 1,548,586,392.7253 | 4,574 |
pythondev | help | I wanted to add new dictinary itself below the existing dictionary in the new array or index | 2019-01-27T11:07:43.725600 | Lynsey | pythondev_help_Lynsey_2019-01-27T11:07:43.725600 | 1,548,587,263.7256 | 4,575 |
pythondev | help | how can I do that.. as you can see in the screenshot, there is index 0 below the attachment (below the original message) | 2019-01-27T11:08:28.725800 | Lynsey | pythondev_help_Lynsey_2019-01-27T11:08:28.725800 | 1,548,587,308.7258 | 4,576 |
pythondev | help | any advice.. | 2019-01-27T11:08:34.726000 | Lynsey | pythondev_help_Lynsey_2019-01-27T11:08:34.726000 | 1,548,587,314.726 | 4,577 |
pythondev | help | Hi, I'm trying to write a python program that would verify if email address exists on an email server. I know how to do that in terminal/command prompt with SMTP. The program needs to check MX records and if the address is existing. Is there any way to do that in python? | 2019-01-27T12:29:33.731200 | Emily | pythondev_help_Emily_2019-01-27T12:29:33.731200 | 1,548,592,173.7312 | 4,578 |
pythondev | help | Check out smtplib <https://docs.python.org/3/library/smtplib.html> | 2019-01-27T12:44:45.731300 | Jonas | pythondev_help_Jonas_2019-01-27T12:44:45.731300 | 1,548,593,085.7313 | 4,579 |
pythondev | help | I take it you're just attempting to determine if the mail server comes back with an error when you do 'rcpt to: ' in an SMTP session? | 2019-01-27T13:02:12.731500 | Diane | pythondev_help_Diane_2019-01-27T13:02:12.731500 | 1,548,594,132.7315 | 4,580 |
pythondev | help | Even if it's not the right fit for your problem it's good to know about :slightly_smiling_face: | 2019-01-27T13:41:44.731700 | Bethany | pythondev_help_Bethany_2019-01-27T13:41:44.731700 | 1,548,596,504.7317 | 4,581 |
pythondev | help | Exactly | 2019-01-27T14:53:53.732300 | Emily | pythondev_help_Emily_2019-01-27T14:53:53.732300 | 1,548,600,833.7323 | 4,582 |
pythondev | help | how can i check if a float is 0? | 2019-01-27T18:28:19.733300 | Coleen | pythondev_help_Coleen_2019-01-27T18:28:19.733300 | 1,548,613,699.7333 | 4,583 |
pythondev | help | a = 0. | 2019-01-27T18:29:22.733500 | Coleen | pythondev_help_Coleen_2019-01-27T18:29:22.733500 | 1,548,613,762.7335 | 4,584 |
pythondev | help | a == 0 # True | 2019-01-27T18:29:30.733800 | Coleen | pythondev_help_Coleen_2019-01-27T18:29:30.733800 | 1,548,613,770.7338 | 4,585 |
pythondev | help | is this ok? | 2019-01-27T18:31:44.734000 | Coleen | pythondev_help_Coleen_2019-01-27T18:31:44.734000 | 1,548,613,904.734 | 4,586 |
pythondev | help | check <https://docs.python.org/3/whatsnew/3.5.html#pep-485-a-function-for-testing-approximate-equality> | 2019-01-27T18:35:02.734200 | Hiroko | pythondev_help_Hiroko_2019-01-27T18:35:02.734200 | 1,548,614,102.7342 | 4,587 |
pythondev | help | thing is, floats are weird | 2019-01-27T18:35:08.734400 | Hiroko | pythondev_help_Hiroko_2019-01-27T18:35:08.734400 | 1,548,614,108.7344 | 4,588 |
pythondev | help | ```In [4]: a = 0.0
In [5]: a
Out[5]: 0.0
In [7]: math.isclose(a, b)
Out[7]: True``` | 2019-01-27T18:36:13.734700 | Hiroko | pythondev_help_Hiroko_2019-01-27T18:36:13.734700 | 1,548,614,173.7347 | 4,589 |
pythondev | help | Decimals all the way :moneybag: | 2019-01-27T19:32:12.734900 | Somer | pythondev_help_Somer_2019-01-27T19:32:12.734900 | 1,548,617,532.7349 | 4,590 |
pythondev | help | depends, whether you need speed with some inaccuracy or high precision | 2019-01-27T19:41:55.735100 | Hiroko | pythondev_help_Hiroko_2019-01-27T19:41:55.735100 | 1,548,618,115.7351 | 4,591 |
pythondev | help | floats, with python 3.5 and up, use the hardware floating point registers when available, and that’s high speed indeed, whereas decimal uses scalar or a software implementation | 2019-01-27T19:42:36.735300 | Hiroko | pythondev_help_Hiroko_2019-01-27T19:42:36.735300 | 1,548,618,156.7353 | 4,592 |
pythondev | help | I’m running a 2013 MBP, and just ran this in python 3.7:
```import decimal
test = [<tel:100.0897463|100.0897463>, 1.099999939393,1.37382829829393,29.1937462874847272,2.095478262874647474]
test2 = [decimal.Decimal('<tel:100.0897463|100.0897463>'), decimal.Decimal('1.09999993939'), decimal.Decimal('1.37382829829'), deci... | 2019-01-27T19:46:48.735500 | Hiroko | pythondev_help_Hiroko_2019-01-27T19:46:48.735500 | 1,548,618,408.7355 | 4,593 |
pythondev | help | naive and very basic, sure. but also pretty revealing about the perf distinctions | 2019-01-27T19:47:33.735700 | Hiroko | pythondev_help_Hiroko_2019-01-27T19:47:33.735700 | 1,548,618,453.7357 | 4,594 |
pythondev | help | My new Flask script:
<https://github.com/paulgureghian/Flask_apps/blob/master/Hello%20World%20in%20Flask.py> | 2019-01-27T22:30:45.736400 | Clayton | pythondev_help_Clayton_2019-01-27T22:30:45.736400 | 1,548,628,245.7364 | 4,595 |
pythondev | help | For one of my scripts that runs continuously, how do I catch when I lose internet connection? I have tried catching this one `requests.exceptions.ConnectionError` , but failed | 2019-01-27T23:46:55.737700 | Conchita | pythondev_help_Conchita_2019-01-27T23:46:55.737700 | 1,548,632,815.7377 | 4,596 |
pythondev | help | Anyone would like to help reviewing a project before releasing it as an open source project?
It's a backend framework. I'm already using it (forks of it) in few projects, so when it comes to production-ready state I can assume it's okay. But, I'd still welcome any input about it. Also, documentation is almost a BIG ZER... | 2019-01-28T00:35:50.741100 | Lessie | pythondev_help_Lessie_2019-01-28T00:35:50.741100 | 1,548,635,750.7411 | 4,597 |
pythondev | help | <@Lessie> push it to github and post the link here | 2019-01-28T00:56:58.741700 | Chester | pythondev_help_Chester_2019-01-28T00:56:58.741700 | 1,548,637,018.7417 | 4,598 |
pythondev | help | it's already in github, in a private repo. You suggest making it public? | 2019-01-28T00:58:09.742200 | Lessie | pythondev_help_Lessie_2019-01-28T00:58:09.742200 | 1,548,637,089.7422 | 4,599 |
pythondev | help | Sure | 2019-01-28T00:58:47.742400 | Chester | pythondev_help_Chester_2019-01-28T00:58:47.742400 | 1,548,637,127.7424 | 4,600 |
pythondev | help | Nobody will ever stumble upon your github project unless you explicitly promote it many times on different platforms (reddit, HN, slack groups, etc) - because github is sooo huge and there are sooo many projects in there | 2019-01-28T00:59:40.743300 | Chester | pythondev_help_Chester_2019-01-28T00:59:40.743300 | 1,548,637,180.7433 | 4,601 |
pythondev | help | Agree. Honestly, I'm not expecting it to become project of the year just by posting it. It's rather a gesture from my side to the FOSS community that helped my during the past decade in learning and gaining huge knowledge otherwise I'd have none now without them. So, I just wanted to clear things before making it publi... | 2019-01-28T01:02:01.745300 | Lessie | pythondev_help_Lessie_2019-01-28T01:02:01.745300 | 1,548,637,321.7453 | 4,602 |
pythondev | help | I'll take your advice. I'll add few things here and there and then public-ise it. hopefully, by day end. | 2019-01-28T01:02:39.746200 | Lessie | pythondev_help_Lessie_2019-01-28T01:02:39.746200 | 1,548,637,359.7462 | 4,603 |
pythondev | help | def score(dice):
rolls = []
score = 0
for n in dice:
rolls.append(n)
if [1,1,1] in rolls:
score += 1000
rolls.remove(1,1,1)
else:
pass
if [2,2,2] in dice:
score += 200
else:
pass
if [3,3,3] in dice:
score += 300
else:
pa... | 2019-01-28T01:41:31.746700 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:41:31.746700 | 1,548,639,691.7467 | 4,604 |
pythondev | help | This keeps yielding 250, instead of 300. Can any of you guys identify why? I can't figure it out | 2019-01-28T01:42:11.747400 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:42:11.747400 | 1,548,639,731.7474 | 4,605 |
pythondev | help | It's problematic to remove an item from a list you're iterating through, which is probably causing one of the 5's to get skipped over. Try using `for n in rolls[:]:` to make a copy of the list. | 2019-01-28T01:44:47.748600 | Sasha | pythondev_help_Sasha_2019-01-28T01:44:47.748600 | 1,548,639,887.7486 | 4,606 |
pythondev | help | I don't really know how to implement this but i'm looking it up now. I think you're right though and my program might be removing the wrong 5, i will probably have to update the one for 1 aswell | 2019-01-28T01:54:34.748700 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:54:34.748700 | 1,548,640,474.7487 | 4,607 |
pythondev | help | Yes, you'd want to change both `for` loops where you're altering the list. | 2019-01-28T01:55:50.748900 | Sasha | pythondev_help_Sasha_2019-01-28T01:55:50.748900 | 1,548,640,550.7489 | 4,608 |
pythondev | help | By the way, you can remove all of the `else: pass` clauses, as they don't do anything. An `else` is not required in an `if` statement. | 2019-01-28T01:56:30.749100 | Sasha | pythondev_help_Sasha_2019-01-28T01:56:30.749100 | 1,548,640,590.7491 | 4,609 |
pythondev | help | I tried to be clever and update the remove statement to rolls.remove(n) so the program was sure which one i was talking about. It didn't work which was surprising | 2019-01-28T01:57:03.749400 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:57:03.749400 | 1,548,640,623.7494 | 4,610 |
pythondev | help | Oh okay thanks. I'll get rid of them now | 2019-01-28T01:57:11.749600 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:57:11.749600 | 1,548,640,631.7496 | 4,611 |
pythondev | help | It'll always remove the first matching value it comes across. | 2019-01-28T01:57:39.749800 | Sasha | pythondev_help_Sasha_2019-01-28T01:57:39.749800 | 1,548,640,659.7498 | 4,612 |
pythondev | help | Do you understand the underlying problem? | 2019-01-28T01:58:37.750000 | Sasha | pythondev_help_Sasha_2019-01-28T01:58:37.750000 | 1,548,640,717.75 | 4,613 |
pythondev | help | Maybe not. But i also don't know how to really use list slicing either | 2019-01-28T01:59:08.750200 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:59:08.750200 | 1,548,640,748.7502 | 4,614 |
pythondev | help | I think maybe when i iterate through my perimeter it's picking up on a 5 adding the 50 points. but then removing the other 5 so it never adds the second set of 50 points | 2019-01-28T01:59:44.750400 | Demetrice | pythondev_help_Demetrice_2019-01-28T01:59:44.750400 | 1,548,640,784.7504 | 4,615 |
pythondev | help | But my understanding of the problem might be wrong because if that's the case it should be clarified when i told it to remove n instead of 5. but that didn't fix it. | 2019-01-28T02:00:13.750600 | Demetrice | pythondev_help_Demetrice_2019-01-28T02:00:13.750600 | 1,548,640,813.7506 | 4,616 |
pythondev | help | Imagine there's a line of people, and you're a ticket-taker, walking along and punching their tickets one by one. Now, when you're not looking carefully, someone steps out of a line, and everyone moves forward. Wait... whose ticket have you punched, and who do you still have to do? | 2019-01-28T02:01:08.750800 | Sasha | pythondev_help_Sasha_2019-01-28T02:01:08.750800 | 1,548,640,868.7508 | 4,617 |
pythondev | help | That's what removing an item from a list does if you're iterating over it at the time... the `for` gets confused about which item it's on, since the one it was working on just disappeared, and everyone else scooted forward, so the 3rd item is now the 2nd, etc. | 2019-01-28T02:02:04.751000 | Sasha | pythondev_help_Sasha_2019-01-28T02:02:04.751000 | 1,548,640,924.751 | 4,618 |
pythondev | help | I don't know if i'm thinking about it too literally, but wouldn't that depend on who it was that stepped out of line? | 2019-01-28T02:02:24.751200 | Demetrice | pythondev_help_Demetrice_2019-01-28T02:02:24.751200 | 1,548,640,944.7512 | 4,619 |
pythondev | help | Okay, okay. I think i get that | 2019-01-28T02:02:32.751400 | Demetrice | pythondev_help_Demetrice_2019-01-28T02:02:32.751400 | 1,548,640,952.7514 | 4,620 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.