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
Translating: INSERT INTO *DOMAINS*(DOMAIN VALUES( )
2017-12-09T06:47:45.000089
Tangela
pythondev_help_Tangela_2017-12-09T06:47:45.000089
1,512,802,065.000089
103,003
pythondev
help
<@Tangela>: Okay, so according to that, your CSV is a single column, not two, so the query should be `(%s)` instead of `(%s, %s)`.
2017-12-09T06:48:35.000008
Louis
pythondev_help_Louis_2017-12-09T06:48:35.000008
1,512,802,115.000008
103,004
pythondev
help
Your query has to fit the structure of the data you're inserting. :)
2017-12-09T06:48:46.000040
Louis
pythondev_help_Louis_2017-12-09T06:48:46.000040
1,512,802,126.00004
103,005
pythondev
help
Why do you have `{}s {}`? That doesn't make sense.
2017-12-09T06:49:22.000004
Louis
pythondev_help_Louis_2017-12-09T06:49:22.000004
1,512,802,162.000004
103,006
pythondev
help
You should only have the table name there.
2017-12-09T06:49:41.000071
Louis
pythondev_help_Louis_2017-12-09T06:49:41.000071
1,512,802,181.000071
103,007
pythondev
help
What are you passing in as the `table_name`?
2017-12-09T06:50:16.000034
Louis
pythondev_help_Louis_2017-12-09T06:50:16.000034
1,512,802,216.000034
103,008
pythondev
help
When try with *execute* got this: _mysql_exceptions.ProgrammingError: not all arguments converted during string formatting
2017-12-09T06:50:43.000031
Tangela
pythondev_help_Tangela_2017-12-09T06:50:43.000031
1,512,802,243.000031
103,009
pythondev
help
Hey everyone. In console i see this. ```INFO:root:Length stock id = 311 Length stock id = 311 INFO:root:Length stock name = 311 Length stock name = 311 ``` ```logging.basicConfig(level=<http://logging.INFO|logging.INFO>) logger = logging.getLogger() logger.addHandler(logging.StreamHandler()) ``` ``` <http://log...
2017-12-09T06:51:04.000034
Georgeann
pythondev_help_Georgeann_2017-12-09T06:51:04.000034
1,512,802,264.000034
103,010
pythondev
help
<@Louis> My table name is Domains, my Column is Domain
2017-12-09T06:51:52.000021
Tangela
pythondev_help_Tangela_2017-12-09T06:51:52.000021
1,512,802,312.000021
103,011
pythondev
help
<@Tangela>: It needs to be `executemany` when you're inserting multiple rows, not `execute`.
2017-12-09T06:52:11.000003
Louis
pythondev_help_Louis_2017-12-09T06:52:11.000003
1,512,802,331.000003
103,012
pythondev
help
<@Tangela>: Do the table and column names actually have to be dynamic here?
2017-12-09T06:53:14.000020
Louis
pythondev_help_Louis_2017-12-09T06:53:14.000020
1,512,802,394.00002
103,013
pythondev
help
Yep, I saw now that I am not inside a for loop:sweat_smile:
2017-12-09T06:53:19.000040
Tangela
pythondev_help_Tangela_2017-12-09T06:53:19.000040
1,512,802,399.00004
103,014
pythondev
help
Should be good dynamic because after probably I'll add about 160 columns :sweat_smile:
2017-12-09T06:59:23.000061
Tangela
pythondev_help_Tangela_2017-12-09T06:59:23.000061
1,512,802,763.000061
103,015
pythondev
help
Maybe is dealing the "." as a separator?
2017-12-09T07:01:30.000002
Tangela
pythondev_help_Tangela_2017-12-09T07:01:30.000002
1,512,802,890.000002
103,016
pythondev
help
<@Tangela>: Does this actually need to be CSV at all?
2017-12-09T07:02:23.000001
Louis
pythondev_help_Louis_2017-12-09T07:02:23.000001
1,512,802,943.000001
103,017
pythondev
help
It shouldn't; your previous examples showed it being parsed as expected.
2017-12-09T07:02:56.000064
Louis
pythondev_help_Louis_2017-12-09T07:02:56.000064
1,512,802,976.000064
103,018
pythondev
help
Not in really
2017-12-09T07:05:42.000071
Tangela
pythondev_help_Tangela_2017-12-09T07:05:42.000071
1,512,803,142.000071
103,019
pythondev
help
could be txt
2017-12-09T07:05:54.000082
Tangela
pythondev_help_Tangela_2017-12-09T07:05:54.000082
1,512,803,154.000082
103,020
pythondev
help
But even using text file instead csv show the same error
2017-12-09T07:13:57.000027
Tangela
pythondev_help_Tangela_2017-12-09T07:13:57.000027
1,512,803,637.000027
103,021
pythondev
help
Forget it, I did remove :grimacing: but the error persist
2017-12-09T07:43:34.000036
Tangela
pythondev_help_Tangela_2017-12-09T07:43:34.000036
1,512,805,414.000036
103,022
pythondev
help
There's probably too many small errors and unknowns and not enough info for me to help debug further. :/
2017-12-09T07:45:41.000043
Louis
pythondev_help_Louis_2017-12-09T07:45:41.000043
1,512,805,541.000043
103,023
pythondev
help
<@Tangela> it's coming along nicely. Starting too look more polished.
2017-12-09T12:37:36.000106
Glinda
pythondev_help_Glinda_2017-12-09T12:37:36.000106
1,512,823,056.000106
103,024
pythondev
help
Much more! I could use ORM but first I want make this way work:grin:
2017-12-09T12:38:49.000028
Tangela
pythondev_help_Tangela_2017-12-09T12:38:49.000028
1,512,823,129.000028
103,025
pythondev
help
I remember your original question was "where do I put try... except"
2017-12-09T12:39:12.000017
Glinda
pythondev_help_Glinda_2017-12-09T12:39:12.000017
1,512,823,152.000017
103,026
pythondev
help
Looks like you didn't end up needint it
2017-12-09T12:39:22.000031
Glinda
pythondev_help_Glinda_2017-12-09T12:39:22.000031
1,512,823,162.000031
103,027
pythondev
help
Not for now
2017-12-09T12:40:55.000089
Tangela
pythondev_help_Tangela_2017-12-09T12:40:55.000089
1,512,823,255.000089
103,028
pythondev
help
Quick question, how can I use a patch decorator to patch a private static method?
2017-12-09T12:41:58.000021
Micheline
pythondev_help_Micheline_2017-12-09T12:41:58.000021
1,512,823,318.000021
103,029
pythondev
help
`@patch('SomeClass.__some_method')` is giving me an error saying that it cannot find the module `SomeClass`
2017-12-09T12:43:04.000098
Micheline
pythondev_help_Micheline_2017-12-09T12:43:04.000098
1,512,823,384.000098
103,030
pythondev
help
<https://stackoverflow.com/questions/32193264/can-i-patch-a-static-method-in-python>
2017-12-09T12:43:14.000020
Glinda
pythondev_help_Glinda_2017-12-09T12:43:14.000020
1,512,823,394.00002
103,031
pythondev
help
I've tried that, it doesn't seem to work
2017-12-09T12:43:28.000010
Micheline
pythondev_help_Micheline_2017-12-09T12:43:28.000010
1,512,823,408.00001
103,032
pythondev
help
My class is in a file called `someclass`, if I try `@patch('someclass.SomeClass.__some_method')` the result it the same
2017-12-09T12:44:37.000011
Micheline
pythondev_help_Micheline_2017-12-09T12:44:37.000011
1,512,823,477.000011
103,033
pythondev
help
Oddly, if I make my method non private, it seems to work.
2017-12-09T12:47:15.000110
Micheline
pythondev_help_Micheline_2017-12-09T12:47:15.000110
1,512,823,635.00011
103,034
pythondev
help
Why are you trying to make a method private?
2017-12-09T12:48:28.000001
Glinda
pythondev_help_Glinda_2017-12-09T12:48:28.000001
1,512,823,708.000001
103,035
pythondev
help
The method is only helpful for that class and not any other classes, so I think it should be private.
2017-12-09T12:49:15.000009
Micheline
pythondev_help_Micheline_2017-12-09T12:49:15.000009
1,512,823,755.000009
103,036
pythondev
help
It's my understanding that the "were all consenting adults" philosphy means if it' works without making it private don't make it private
2017-12-09T12:51:30.000137
Glinda
pythondev_help_Glinda_2017-12-09T12:51:30.000137
1,512,823,890.000137
103,037
pythondev
help
But can you do the patching while keeping it private?
2017-12-09T12:53:01.000023
Micheline
pythondev_help_Micheline_2017-12-09T12:53:01.000023
1,512,823,981.000023
103,038
pythondev
help
not sure about the patching, but if you do prefer to mark something as an implementation detail and not relevant to anybody else, prefixing with a _ is the pythonic way of doing that
2017-12-09T12:53:34.000017
Lachelle
pythondev_help_Lachelle_2017-12-09T12:53:34.000017
1,512,824,014.000017
103,039
pythondev
help
it could be that by marking it private, it's preventing the patching from not working, because you're trying to access a private method.
2017-12-09T12:54:10.000058
Glinda
pythondev_help_Glinda_2017-12-09T12:54:10.000058
1,512,824,050.000058
103,040
pythondev
help
I'm not really sure
2017-12-09T12:54:25.000022
Glinda
pythondev_help_Glinda_2017-12-09T12:54:25.000022
1,512,824,065.000022
103,041
pythondev
help
double underscore prefixes should generally be avoided
2017-12-09T12:54:40.000112
Lachelle
pythondev_help_Lachelle_2017-12-09T12:54:40.000112
1,512,824,080.000112
103,042
pythondev
help
agreed
2017-12-09T12:54:51.000074
Nicole
pythondev_help_Nicole_2017-12-09T12:54:51.000074
1,512,824,091.000074
103,043
pythondev
help
Ah I'll change it single underscore then
2017-12-09T12:56:46.000021
Micheline
pythondev_help_Micheline_2017-12-09T12:56:46.000021
1,512,824,206.000021
103,044
pythondev
help
Thanks!
2017-12-09T12:56:47.000038
Micheline
pythondev_help_Micheline_2017-12-09T12:56:47.000038
1,512,824,207.000038
103,045
pythondev
help
hello, I want to break the following across a few lines for formatting. Not turn it into multiple statements, just format it across multiple lines so it's more notebook friendly `return soup.find_all('table')[3].find('table').find_all('table')`
2017-12-09T13:38:24.000078
Lester
pythondev_help_Lester_2017-12-09T13:38:24.000078
1,512,826,704.000078
103,046
pythondev
help
if I just throw an enter before the . like I normally do it's not playing nice, what's the generally pythonic way to format lines like that across lines?
2017-12-09T13:39:12.000065
Lester
pythondev_help_Lester_2017-12-09T13:39:12.000065
1,512,826,752.000065
103,047
pythondev
help
Parentheses can help.
2017-12-09T13:52:38.000118
Nicole
pythondev_help_Nicole_2017-12-09T13:52:38.000118
1,512,827,558.000118
103,048
pythondev
help
``` return (soup.find_all('table')[3] .find('table') .find_all('table')) ```
2017-12-09T13:52:56.000056
Nicole
pythondev_help_Nicole_2017-12-09T13:52:56.000056
1,512,827,576.000056
103,049
pythondev
help
ok cool , I like the explicitness of that thanks
2017-12-09T13:53:40.000128
Lester
pythondev_help_Lester_2017-12-09T13:53:40.000128
1,512,827,620.000128
103,050
pythondev
help
Python joins lines wrapped in parentheses, brackets, or braces. <https://www.python.org/dev/peps/pep-0008/#indentation>
2017-12-09T13:57:16.000015
Nicole
pythondev_help_Nicole_2017-12-09T13:57:16.000015
1,512,827,836.000015
103,051
pythondev
help
Hello, Can we use multiprocessing in python ansible module to perform installation of master and slave node parallel?
2017-12-10T10:16:30.000022
Criselda
pythondev_help_Criselda_2017-12-10T10:16:30.000022
1,512,900,990.000022
103,052
pythondev
help
It shouldn't be necessary. Ansible can run roles in serial or in parallel
2017-12-10T11:32:09.000099
Ciera
pythondev_help_Ciera_2017-12-10T11:32:09.000099
1,512,905,529.000099
103,053
pythondev
help
I want to scan a website for few keywords and store the count on each webpage. I tried bs4, looking for urls recursively and then making dom of each page to look for the keywords. It has exponential time complexity. Any way to speed this up? Is their an Open source project which I can benchmark against?
2017-12-10T11:36:33.000002
Rivka
pythondev_help_Rivka_2017-12-10T11:36:33.000002
1,512,905,793.000002
103,054
pythondev
help
hi guys. iam interested in programing a raspbery pi and look for advices, or something to read about building small lego technic robots. does anyone here does something, knows blogs, where python is used on sensors with lego technic? i appriciate your links. may the code be with you :slightly_smiling_face:
2017-12-10T14:16:42.000088
Blaine
pythondev_help_Blaine_2017-12-10T14:16:42.000088
1,512,915,402.000088
103,055
pythondev
help
hello guys
2017-12-10T20:32:42.000116
Alishia
pythondev_help_Alishia_2017-12-10T20:32:42.000116
1,512,937,962.000116
103,056
pythondev
help
is there any django developer
2017-12-10T20:36:44.000102
Alishia
pythondev_help_Alishia_2017-12-10T20:36:44.000102
1,512,938,204.000102
103,057
pythondev
help
Should I be trying to subclass logging to create a new `logger.new_method` call if I wish to have a separate logging name for different types, or is there a better way of specifying specific events go to certain files?
2017-12-10T22:45:16.000023
Glinda
pythondev_help_Glinda_2017-12-10T22:45:16.000023
1,512,945,916.000023
103,058
pythondev
help
<@Glinda> use different handlers, <https://docs.python.org/3/howto/logging.html#logging-advanced-tutorial>
2017-12-10T22:47:17.000138
Collette
pythondev_help_Collette_2017-12-10T22:47:17.000138
1,512,946,037.000138
103,059
pythondev
help
if I use `<http://logger.info|logger.info>('some thing')` it works, should I be using `logger.new_member('some thing')` to access this new handler?
2017-12-10T22:57:32.000014
Glinda
pythondev_help_Glinda_2017-12-10T22:57:32.000014
1,512,946,652.000014
103,060
pythondev
help
You need to have two logger instances: `logger = getLogger(__name__)` for general-purpose log messages and `new_event_logger = getLogger(f'{__name__}.new_member')` for "new_member" log messages
2017-12-10T23:00:52.000101
Collette
pythondev_help_Collette_2017-12-10T23:00:52.000101
1,512,946,852.000101
103,061
pythondev
help
And you configure "info_file_handler" to work only with your "my_module" logger, but "new_member_event" handler - with "my_module.new_member" logger
2017-12-10T23:01:44.000004
Collette
pythondev_help_Collette_2017-12-10T23:01:44.000004
1,512,946,904.000004
103,062
pythondev
help
Then `<http://logger.info|logger.info>("...")` goes to, say, "info_file_handler" handler and `<http://new_event_logger.info|new_event_logger.info>("...")` goes to "new_member_event" handler
2017-12-10T23:04:04.000066
Collette
pythondev_help_Collette_2017-12-10T23:04:04.000066
1,512,947,044.000066
103,063
pythondev
help
So I have that working. But I think I'm directing the output to console somehow. ```ERROR:src.app:test a ERROR:src.app.new_member:test b```
2017-12-10T23:12:57.000031
Glinda
pythondev_help_Glinda_2017-12-10T23:12:57.000031
1,512,947,577.000031
103,064
pythondev
help
That's because you also configured "root" logger with all handlers
2017-12-10T23:14:59.000129
Collette
pythondev_help_Collette_2017-12-10T23:14:59.000129
1,512,947,699.000129
103,065
pythondev
help
oh darn
2017-12-10T23:19:13.000076
Glinda
pythondev_help_Glinda_2017-12-10T23:19:13.000076
1,512,947,953.000076
103,066
pythondev
help
It's because it's not finding the config file
2017-12-10T23:19:18.000129
Glinda
pythondev_help_Glinda_2017-12-10T23:19:18.000129
1,512,947,958.000129
103,067
pythondev
help
```import json import logging.config import os logger = logging.getLogger(__name__) new_event_logger = logging.getLogger(f'{__name__}.new_member') def setup_logging( default_path='log_config.json', default_level=<http://logging.INFO|logging.INFO>, env_key='LOG_CFG' ): file_path =...
2017-12-10T23:26:17.000066
Glinda
pythondev_help_Glinda_2017-12-10T23:26:17.000066
1,512,948,377.000066
103,068
pythondev
help
That did it :slightly_smiling_face: Thanks
2017-12-10T23:26:32.000012
Glinda
pythondev_help_Glinda_2017-12-10T23:26:32.000012
1,512,948,392.000012
103,069
pythondev
help
Cool
2017-12-10T23:27:09.000073
Collette
pythondev_help_Collette_2017-12-10T23:27:09.000073
1,512,948,429.000073
103,070
pythondev
help
You could try looking into scrapy - this seems to be its MO.
2017-12-11T07:21:51.000168
Fabiola
pythondev_help_Fabiola_2017-12-11T07:21:51.000168
1,512,976,911.000168
103,071
pythondev
help
i ask here, there are no ppl around in the learning python channel. dont be mad for repost
2017-12-11T09:06:27.000715
Blaine
pythondev_help_Blaine_2017-12-11T09:06:27.000715
1,512,983,187.000715
103,072
pythondev
help
hi guys, i ask myselft and you :slightly_smiling_face: can this somehow be asked in boolean return ```Traceback: in &lt;module&gt; in test in abbreviate AttributeError: 'list' object has no attribute 'split'``` i want to konw if split would work, and if not, due its only one word, do somethng else [15:00] ...
2017-12-11T09:06:29.000240
Blaine
pythondev_help_Blaine_2017-12-11T09:06:29.000240
1,512,983,189.00024
103,073
pythondev
help
if split doesn't match anything in the string, then it returns a list with the string as the first item
2017-12-11T09:09:13.000295
Lachelle
pythondev_help_Lachelle_2017-12-11T09:09:13.000295
1,512,983,353.000295
103,074
pythondev
help
```&gt;&gt;&gt; 'word'.split(' ') ['word']```
2017-12-11T09:09:18.000149
Lachelle
pythondev_help_Lachelle_2017-12-11T09:09:18.000149
1,512,983,358.000149
103,075
pythondev
help
your two splits appear to be inconsistent. the first is an empty string, the second splits on a space.
2017-12-11T09:10:37.000158
Lachelle
pythondev_help_Lachelle_2017-12-11T09:10:37.000158
1,512,983,437.000158
103,076
pythondev
help
So <@Blaine> You want to take in a single string with and split it on spaces to see if there's multiple words?
2017-12-11T09:14:11.000082
Glinda
pythondev_help_Glinda_2017-12-11T09:14:11.000082
1,512,983,651.000082
103,077
pythondev
help
Now instead of splitting them why not check if you have a space
2017-12-11T09:14:31.000057
Glinda
pythondev_help_Glinda_2017-12-11T09:14:31.000057
1,512,983,671.000057
103,078
pythondev
help
``` def is_string_words(input_str): return ' ' in inpu_str```
2017-12-11T09:15:01.000246
Glinda
pythondev_help_Glinda_2017-12-11T09:15:01.000246
1,512,983,701.000246
103,079
pythondev
help
i want to iterate over different args, they might be one word as string, but they might also be mulitple words in one string, i need to seperate them and distinguish(my english?) between them. i know soelved it with this for now ```def abbreviate(s): list_of_words = s.split(' ') def doit(word): ...
2017-12-11T09:16:31.000216
Blaine
pythondev_help_Blaine_2017-12-11T09:16:31.000216
1,512,983,791.000216
103,080
pythondev
help
<@Glinda> thanks also a good solution
2017-12-11T09:17:07.000604
Blaine
pythondev_help_Blaine_2017-12-11T09:17:07.000604
1,512,983,827.000604
103,081
pythondev
help
```def is_string_words(input_str): return ' ' in inpu_str def abbreviate(s): if not is_string_words(s): print('is solo string') return doit(s) else: ret_string = '' for elem in list_of_words: #do fo```
2017-12-11T09:18:26.000385
Glinda
pythondev_help_Glinda_2017-12-11T09:18:26.000385
1,512,983,906.000385
103,082
pythondev
help
What do you use in order to communicate to Celery?
2017-12-11T10:56:08.000552
Jacki
pythondev_help_Jacki_2017-12-11T10:56:08.000552
1,512,989,768.000552
103,083
pythondev
help
do you use rpc or rest api?
2017-12-11T10:56:22.000158
Jacki
pythondev_help_Jacki_2017-12-11T10:56:22.000158
1,512,989,782.000158
103,084
pythondev
help
Celery is generally running on redis or rabbitMQ
2017-12-11T10:56:59.000406
Patty
pythondev_help_Patty_2017-12-11T10:56:59.000406
1,512,989,819.000406
103,085
pythondev
help
yes
2017-12-11T10:57:06.000578
Jacki
pythondev_help_Jacki_2017-12-11T10:57:06.000578
1,512,989,826.000578
103,086
pythondev
help
but, let say that you have to send tasks to the application where celery runs
2017-12-11T10:57:27.000523
Jacki
pythondev_help_Jacki_2017-12-11T10:57:27.000523
1,512,989,847.000523
103,087
pythondev
help
i was wondering how to you communicate with it
2017-12-11T10:57:47.000089
Jacki
pythondev_help_Jacki_2017-12-11T10:57:47.000089
1,512,989,867.000089
103,088
pythondev
help
is this using a web app?
2017-12-11T10:57:50.000782
Meg
pythondev_help_Meg_2017-12-11T10:57:50.000782
1,512,989,870.000782
103,089
pythondev
help
no
2017-12-11T10:57:53.000634
Jacki
pythondev_help_Jacki_2017-12-11T10:57:53.000634
1,512,989,873.000634
103,090
pythondev
help
only backend services
2017-12-11T10:57:58.000325
Jacki
pythondev_help_Jacki_2017-12-11T10:57:58.000325
1,512,989,878.000325
103,091
pythondev
help
ok. I use django, which integrates well with celery
2017-12-11T10:58:12.000101
Meg
pythondev_help_Meg_2017-12-11T10:58:12.000101
1,512,989,892.000101
103,092
pythondev
help
so you have your `tasks` module
2017-12-11T10:58:25.000209
Meg
pythondev_help_Meg_2017-12-11T10:58:25.000209
1,512,989,905.000209
103,093
pythondev
help
Can you expand on “communicate”? Are you looking to send tasks, receive them, etc?
2017-12-11T10:58:39.000331
Patty
pythondev_help_Patty_2017-12-11T10:58:39.000331
1,512,989,919.000331
103,094
pythondev
help
let say I have a serviceA which has tasks to be consumerd
2017-12-11T10:59:38.000386
Jacki
pythondev_help_Jacki_2017-12-11T10:59:38.000386
1,512,989,978.000386
103,095
pythondev
help
consumed
2017-12-11T10:59:42.000876
Jacki
pythondev_help_Jacki_2017-12-11T10:59:42.000876
1,512,989,982.000876
103,096
pythondev
help
and let say that serviceB is my Celery application in charge of dealing with tasks
2017-12-11T11:00:19.000792
Jacki
pythondev_help_Jacki_2017-12-11T11:00:19.000792
1,512,990,019.000792
103,097
pythondev
help
how I can request to serviceB to run tasks?
2017-12-11T11:00:42.000142
Jacki
pythondev_help_Jacki_2017-12-11T11:00:42.000142
1,512,990,042.000142
103,098
pythondev
help
so, in other words,
2017-12-11T11:01:09.000639
Jacki
pythondev_help_Jacki_2017-12-11T11:01:09.000639
1,512,990,069.000639
103,099
pythondev
help
how do you expose the APIs of the serviceB
2017-12-11T11:01:25.000518
Jacki
pythondev_help_Jacki_2017-12-11T11:01:25.000518
1,512,990,085.000518
103,100
pythondev
help
?
2017-12-11T11:01:26.000062
Jacki
pythondev_help_Jacki_2017-12-11T11:01:26.000062
1,512,990,086.000062
103,101
pythondev
help
<@Patty>, yes i am looking to send tasks
2017-12-11T11:01:59.000610
Jacki
pythondev_help_Jacki_2017-12-11T11:01:59.000610
1,512,990,119.00061
103,102