workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
How do you construct the paths for what the script does?
2018-02-01T17:37:54.000235
Rafael
pythondev_help_Rafael_2018-02-01T17:37:54.000235
1,517,506,674.000235
32,524
pythondev
help
What I am getting at here is if your script does `with open('./path/to/file.txt')`, it will be relative to where cron calls it from _not where the script is located_
2018-02-01T17:38:38.000590
Rafael
pythondev_help_Rafael_2018-02-01T17:38:38.000590
1,517,506,718.00059
32,525
pythondev
help
full paths ``` Traceback (most recent call last): File "/usr/local/bin/cron_scripts/Daily_Reports/reports_that_day.py", line 91, in <module> Object1 = salesforce_data_dump() File "/usr/local/bin/cron_scripts/Daily_Reports/reports_that_day.py", line 88, in __init__ self.main() File "/usr/local/bin/cr...
2018-02-01T17:38:44.000265
Titus
pythondev_help_Titus_2018-02-01T17:38:44.000265
1,517,506,724.000265
32,526
pythondev
help
there goes my theory :confused:
2018-02-01T17:39:17.000260
Rafael
pythondev_help_Rafael_2018-02-01T17:39:17.000260
1,517,506,757.00026
32,527
pythondev
help
Does it work if you add this at the beginning of your script? ``` import os abspath = os.path.abspath(__file__) os.chdir(os.path.dirname(abspath)) ```
2018-02-01T17:47:26.000165
Nancy
pythondev_help_Nancy_2018-02-01T17:47:26.000165
1,517,507,246.000165
32,528
pythondev
help
I ended up doing a workaround for tonights crontab run
2018-02-01T18:34:04.000032
Titus
pythondev_help_Titus_2018-02-01T18:34:04.000032
1,517,510,044.000032
32,529
pythondev
help
I wrote a bash file that cd's to the directory and runs the script
2018-02-01T18:34:19.000097
Titus
pythondev_help_Titus_2018-02-01T18:34:19.000097
1,517,510,059.000097
32,530
pythondev
help
will work for tonight but going to look more into this tomorrow
2018-02-01T18:34:28.000208
Titus
pythondev_help_Titus_2018-02-01T18:34:28.000208
1,517,510,068.000208
32,531
pythondev
help
need help, going crazy with this import madness
2018-02-01T21:44:19.000063
Alisia
pythondev_help_Alisia_2018-02-01T21:44:19.000063
1,517,521,459.000063
32,532
pythondev
help
β”œβ”€β”€ src β”‚ └── twittercli β”‚ β”œβ”€β”€ cli.py β”‚ β”œβ”€β”€ config.py β”‚ β”œβ”€β”€ helpers.py β”‚ β”œβ”€β”€ __init__.py β”œβ”€β”€ tests β”‚ └── test_cli.py
2018-02-01T21:44:54.000051
Alisia
pythondev_help_Alisia_2018-02-01T21:44:54.000051
1,517,521,494.000051
32,533
pythondev
help
Why cant i import helpers into cli
2018-02-01T21:45:04.000208
Alisia
pythondev_help_Alisia_2018-02-01T21:45:04.000208
1,517,521,504.000208
32,534
pythondev
help
how do you perform an import?
2018-02-01T21:45:17.000184
Sadye
pythondev_help_Sadye_2018-02-01T21:45:17.000184
1,517,521,517.000184
32,535
pythondev
help
while running my test
2018-02-01T21:45:19.000055
Alisia
pythondev_help_Alisia_2018-02-01T21:45:19.000055
1,517,521,519.000055
32,536
pythondev
help
ok, it's clear then :slightly_smiling_face:
2018-02-01T21:45:30.000254
Sadye
pythondev_help_Sadye_2018-02-01T21:45:30.000254
1,517,521,530.000254
32,537
pythondev
help
When you're running your tests, your src not in a sys.path I think
2018-02-01T21:45:54.000092
Sadye
pythondev_help_Sadye_2018-02-01T21:45:54.000092
1,517,521,554.000092
32,538
pythondev
help
yeah but im forcing it with `PYTHONPATH=./src pytest -v`
2018-02-01T21:46:13.000308
Alisia
pythondev_help_Alisia_2018-02-01T21:46:13.000308
1,517,521,573.000308
32,539
pythondev
help
and im getting an error about not being able to import the helper file
2018-02-01T21:46:35.000152
Alisia
pythondev_help_Alisia_2018-02-01T21:46:35.000152
1,517,521,595.000152
32,540
pythondev
help
ImportError while importing test module '/mnt/Projects/twittercli/tests/test_cli.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: tests/test_cli.py:2: in <module> from twittercli import cli src/twittercli/cli.py:3: in <module> from helpers import * E ModuleNotFou...
2018-02-01T21:47:37.000094
Alisia
pythondev_help_Alisia_2018-02-01T21:47:37.000094
1,517,521,657.000094
32,541
pythondev
help
I generally discourage the "src" directory for python projects
2018-02-01T21:48:23.000009
Rafael
pythondev_help_Rafael_2018-02-01T21:48:23.000009
1,517,521,703.000009
32,542
pythondev
help
Well, I know that kenneth recommends to explicitly do the path trick
2018-02-01T21:48:31.000126
Sadye
pythondev_help_Sadye_2018-02-01T21:48:31.000126
1,517,521,711.000126
32,543
pythondev
help
<https://pyslackers.com/blog/testing-a-python-library-with-pytest/>
2018-02-01T21:48:38.000149
Rafael
pythondev_help_Rafael_2018-02-01T21:48:38.000149
1,517,521,718.000149
32,544
pythondev
help
I did this post on the topic, actually
2018-02-01T21:48:45.000043
Rafael
pythondev_help_Rafael_2018-02-01T21:48:45.000043
1,517,521,725.000043
32,545
pythondev
help
But I suggest you to just run `pip install -e .`
2018-02-01T21:48:48.000113
Sadye
pythondev_help_Sadye_2018-02-01T21:48:48.000113
1,517,521,728.000113
32,546
pythondev
help
it'll install your program in an editable mode and add it to the path
2018-02-01T21:49:10.000092
Sadye
pythondev_help_Sadye_2018-02-01T21:49:10.000092
1,517,521,750.000092
32,547
pythondev
help
and yeah, good point about `src` from <@Staci>
2018-02-01T21:49:38.000248
Sadye
pythondev_help_Sadye_2018-02-01T21:49:38.000248
1,517,521,778.000248
32,548
pythondev
help
I avoid that too, I like testing against the source code and the installed library separately
2018-02-01T21:49:40.000212
Rafael
pythondev_help_Rafael_2018-02-01T21:49:40.000212
1,517,521,780.000212
32,549
pythondev
help
β”œβ”€β”€ tests β”‚ └── test_cli.py β”œβ”€β”€ twittercli β”‚ β”œβ”€β”€ cli.py β”‚ β”œβ”€β”€ config.py β”‚ β”œβ”€β”€ helpers.py β”‚ └── __init__.py
2018-02-01T21:50:14.000211
Alisia
pythondev_help_Alisia_2018-02-01T21:50:14.000211
1,517,521,814.000211
32,550
pythondev
help
Yes, I favor that
2018-02-01T21:50:21.000188
Rafael
pythondev_help_Rafael_2018-02-01T21:50:21.000188
1,517,521,821.000188
32,551
pythondev
help
`PYTHONPATH=. pytest -v tests/`
2018-02-01T21:50:25.000051
Alisia
pythondev_help_Alisia_2018-02-01T21:50:25.000051
1,517,521,825.000051
32,552
pythondev
help
same error
2018-02-01T21:50:27.000039
Alisia
pythondev_help_Alisia_2018-02-01T21:50:27.000039
1,517,521,827.000039
32,553
pythondev
help
Then do `python -m pytest tests`
2018-02-01T21:50:29.000244
Rafael
pythondev_help_Rafael_2018-02-01T21:50:29.000244
1,517,521,829.000244
32,554
pythondev
help
Which implicitly adds the cwd to the PYTHONPATh
2018-02-01T21:50:52.000001
Rafael
pythondev_help_Rafael_2018-02-01T21:50:52.000001
1,517,521,852.000001
32,555
pythondev
help
Oh duh, also use `relative` imports: `from .helpers import *`
2018-02-01T21:51:21.000067
Rafael
pythondev_help_Rafael_2018-02-01T21:51:21.000067
1,517,521,881.000067
32,556
pythondev
help
Note the leading dot
2018-02-01T21:51:24.000324
Rafael
pythondev_help_Rafael_2018-02-01T21:51:24.000324
1,517,521,884.000324
32,557
pythondev
help
Once we deal with this issue, let's circle back to the `*` import (that's generally discouraged). But that's an issue for later
2018-02-01T21:52:02.000087
Rafael
pythondev_help_Rafael_2018-02-01T21:52:02.000087
1,517,521,922.000087
32,558
pythondev
help
yeah i just put it as a placeholder
2018-02-01T21:52:27.000016
Alisia
pythondev_help_Alisia_2018-02-01T21:52:27.000016
1,517,521,947.000016
32,559
pythondev
help
Sorry that "duh" was for me, it's a non-obvious issue)
2018-02-01T21:52:29.000225
Rafael
pythondev_help_Rafael_2018-02-01T21:52:29.000225
1,517,521,949.000225
32,560
pythondev
help
wanted to first load those damn functions
2018-02-01T21:52:35.000340
Alisia
pythondev_help_Alisia_2018-02-01T21:52:35.000340
1,517,521,955.00034
32,561
pythondev
help
Good debugging :smile:
2018-02-01T21:52:45.000129
Rafael
pythondev_help_Rafael_2018-02-01T21:52:45.000129
1,517,521,965.000129
32,562
pythondev
help
Does the relative import work?
2018-02-01T21:52:51.000284
Rafael
pythondev_help_Rafael_2018-02-01T21:52:51.000284
1,517,521,971.000284
32,563
pythondev
help
What python version, if not
2018-02-01T21:52:56.000060
Rafael
pythondev_help_Rafael_2018-02-01T21:52:56.000060
1,517,521,976.00006
32,564
pythondev
help
nein!
2018-02-01T21:52:56.000103
Alisia
pythondev_help_Alisia_2018-02-01T21:52:56.000103
1,517,521,976.000103
32,565
pythondev
help
3.6.4
2018-02-01T21:53:00.000145
Alisia
pythondev_help_Alisia_2018-02-01T21:53:00.000145
1,517,521,980.000145
32,566
pythondev
help
Same error or different?
2018-02-01T21:53:25.000279
Rafael
pythondev_help_Rafael_2018-02-01T21:53:25.000279
1,517,522,005.000279
32,567
pythondev
help
ima try something
2018-02-01T21:53:26.000169
Alisia
pythondev_help_Alisia_2018-02-01T21:53:26.000169
1,517,522,006.000169
32,568
pythondev
help
ModuleNotFoundError: No module named 'twython
2018-02-01T21:54:10.000134
Alisia
pythondev_help_Alisia_2018-02-01T21:54:10.000134
1,517,522,050.000134
32,569
pythondev
help
k now we getting into virtualenv madness
2018-02-01T21:54:19.000052
Alisia
pythondev_help_Alisia_2018-02-01T21:54:19.000052
1,517,522,059.000052
32,570
pythondev
help
Yessir
2018-02-01T21:54:23.000009
Rafael
pythondev_help_Rafael_2018-02-01T21:54:23.000009
1,517,522,063.000009
32,571
pythondev
help
leading dot fixed that
2018-02-01T21:54:25.000023
Alisia
pythondev_help_Alisia_2018-02-01T21:54:25.000023
1,517,522,065.000023
32,572
pythondev
help
one step at a time!
2018-02-01T21:54:27.000205
Rafael
pythondev_help_Rafael_2018-02-01T21:54:27.000205
1,517,522,067.000205
32,573
pythondev
help
much appreciated
2018-02-01T21:54:28.000231
Alisia
pythondev_help_Alisia_2018-02-01T21:54:28.000231
1,517,522,068.000231
32,574
pythondev
help
Are you going to spin on that issue for a bit, or need a :rubberduck: too?
2018-02-01T21:54:42.000143
Rafael
pythondev_help_Rafael_2018-02-01T21:54:42.000143
1,517,522,082.000143
32,575
pythondev
help
ima go read pipenv docs a bit
2018-02-01T21:54:54.000232
Alisia
pythondev_help_Alisia_2018-02-01T21:54:54.000232
1,517,522,094.000232
32,576
pythondev
help
and give it a go
2018-02-01T21:54:57.000018
Alisia
pythondev_help_Alisia_2018-02-01T21:54:57.000018
1,517,522,097.000018
32,577
pythondev
help
Awesome!
2018-02-01T21:55:03.000142
Rafael
pythondev_help_Rafael_2018-02-01T21:55:03.000142
1,517,522,103.000142
32,578
pythondev
help
seems like my problem is that my --dev depdendencies cannot be used when i use them in a terminal
2018-02-01T22:04:34.000176
Alisia
pythondev_help_Alisia_2018-02-01T22:04:34.000176
1,517,522,674.000176
32,579
pythondev
help
I don't follow you there?
2018-02-01T22:05:22.000005
Rafael
pythondev_help_Rafael_2018-02-01T22:05:22.000005
1,517,522,722.000005
32,580
pythondev
help
or the env got corrupted
2018-02-01T22:05:23.000247
Alisia
pythondev_help_Alisia_2018-02-01T22:05:23.000247
1,517,522,723.000247
32,581
pythondev
help
which is most likely
2018-02-01T22:05:27.000064
Alisia
pythondev_help_Alisia_2018-02-01T22:05:27.000064
1,517,522,727.000064
32,582
pythondev
help
1st time using pipenv
2018-02-01T22:05:30.000243
Alisia
pythondev_help_Alisia_2018-02-01T22:05:30.000243
1,517,522,730.000243
32,583
pythondev
help
so i prolly screwed it up
2018-02-01T22:05:37.000111
Alisia
pythondev_help_Alisia_2018-02-01T22:05:37.000111
1,517,522,737.000111
32,584
pythondev
help
You can easily recreate it with pipenv: `pipenv install --three/two --dev`
2018-02-01T22:05:41.000232
Rafael
pythondev_help_Rafael_2018-02-01T22:05:41.000232
1,517,522,741.000232
32,585
pythondev
help
It will kill/recreate the env
2018-02-01T22:05:48.000250
Rafael
pythondev_help_Rafael_2018-02-01T22:05:48.000250
1,517,522,748.00025
32,586
pythondev
help
pipenv --fix-plz
2018-02-01T22:06:06.000204
Alisia
pythondev_help_Alisia_2018-02-01T22:06:06.000204
1,517,522,766.000204
32,587
pythondev
help
Oh you said you're on 3.6.4, so ignore the `/two`
2018-02-01T22:06:07.000018
Rafael
pythondev_help_Rafael_2018-02-01T22:06:07.000018
1,517,522,767.000018
32,588
pythondev
help
welp. not working, guess it will be another debugging session for tomorrow
2018-02-01T22:12:44.000028
Alisia
pythondev_help_Alisia_2018-02-01T22:12:44.000028
1,517,523,164.000028
32,589
pythondev
help
thanks <@Rafael>
2018-02-01T22:12:49.000195
Alisia
pythondev_help_Alisia_2018-02-01T22:12:49.000195
1,517,523,169.000195
32,590
pythondev
help
Hey I'm trying to call a function every five minutes, so is it best to call the function inside a while True loop with time.sleep? Or is there any other better alternative?
2018-02-02T07:49:20.000148
Ellen
pythondev_help_Ellen_2018-02-02T07:49:20.000148
1,517,557,760.000148
32,591
pythondev
help
<https://github.com/dbader/schedule>
2018-02-02T07:51:26.000330
Floy
pythondev_help_Floy_2018-02-02T07:51:26.000330
1,517,557,886.00033
32,592
pythondev
help
&gt; Python &lt;something&gt; for humans
2018-02-02T08:11:02.000447
Barney
pythondev_help_Barney_2018-02-02T08:11:02.000447
1,517,559,062.000447
32,593
pythondev
help
:face_with_rolling_eyes:
2018-02-02T08:11:08.000097
Barney
pythondev_help_Barney_2018-02-02T08:11:08.000097
1,517,559,068.000097
32,594
pythondev
help
As an FYI, there is a <#C8UK1J3DM|pipenv> channel
2018-02-02T08:20:00.000354
Dominica
pythondev_help_Dominica_2018-02-02T08:20:00.000354
1,517,559,600.000354
32,595
pythondev
help
Hi guys, I'm using pytest-mock for the first time I have this class and I want to test start method ``` class Timer: def __init__(self, name, tags): self.timer = statsd.Timer(name=name + tags) def start(self): self.timer.start() ``` here is my test: ``` def test_timer_start_should_call_start_wi...
2018-02-02T10:40:59.000147
Lesley
pythondev_help_Lesley_2018-02-02T10:40:59.000147
1,517,568,059.000147
32,596
pythondev
help
<@Lesley> It might be because you are testing `start` on the `Timer` class instead of on the `timer` instance which the method was actually called on
2018-02-02T10:48:30.000430
Leanora
pythondev_help_Leanora_2018-02-02T10:48:30.000430
1,517,568,510.00043
32,597
pythondev
help
but `start` in `Timer` class calls `statsD.Timer.start`
2018-02-02T10:51:18.000736
Lesley
pythondev_help_Lesley_2018-02-02T10:51:18.000736
1,517,568,678.000736
32,598
pythondev
help
You are using this module right? I am getting that it doesn't have a Timer attribute, is there more code we are missing? <https://pypi.python.org/pypi/statsd>
2018-02-02T10:54:13.000344
Henrietta
pythondev_help_Henrietta_2018-02-02T10:54:13.000344
1,517,568,853.000344
32,599
pythondev
help
do people make `makefiles` for their python projects or justt `setup.py`
2018-02-02T10:55:20.000503
Kelsey
pythondev_help_Kelsey_2018-02-02T10:55:20.000503
1,517,568,920.000503
32,600
pythondev
help
It depends on the project and the complexity of the build
2018-02-02T10:55:38.000332
Rafael
pythondev_help_Rafael_2018-02-02T10:55:38.000332
1,517,568,938.000332
32,601
pythondev
help
<@Henrietta> I'm using python-statsd 2.1.0 it has Timer class and start method
2018-02-02T10:56:02.000689
Lesley
pythondev_help_Lesley_2018-02-02T10:56:02.000689
1,517,568,962.000689
32,602
pythondev
help
Ah, okay let me get that version and see if it works on mine then
2018-02-02T10:56:29.000570
Henrietta
pythondev_help_Henrietta_2018-02-02T10:56:29.000570
1,517,568,989.00057
32,603
pythondev
help
Matt, that makes sense
2018-02-02T10:56:31.000597
Kelsey
pythondev_help_Kelsey_2018-02-02T10:56:31.000597
1,517,568,991.000597
32,604
pythondev
help
<@Lesley> still getting the same error :confused:
2018-02-02T10:59:55.000246
Henrietta
pythondev_help_Henrietta_2018-02-02T10:59:55.000246
1,517,569,195.000246
32,605
pythondev
help
<@Henrietta> :confused:
2018-02-02T11:00:38.000663
Lesley
pythondev_help_Lesley_2018-02-02T11:00:38.000663
1,517,569,238.000663
32,606
pythondev
help
Oh well, sorry I can't be of more help
2018-02-02T11:00:50.000561
Henrietta
pythondev_help_Henrietta_2018-02-02T11:00:50.000561
1,517,569,250.000561
32,607
pythondev
help
nw, thanks for the try
2018-02-02T11:01:32.000014
Lesley
pythondev_help_Lesley_2018-02-02T11:01:32.000014
1,517,569,292.000014
32,608
pythondev
help
Are you sure you should be mocking after instanciation?
2018-02-02T11:01:48.000381
Barney
pythondev_help_Barney_2018-02-02T11:01:48.000381
1,517,569,308.000381
32,609
pythondev
help
no, I'm not sure, being said first type using this mocker
2018-02-02T11:02:15.000538
Lesley
pythondev_help_Lesley_2018-02-02T11:02:15.000538
1,517,569,335.000538
32,610
pythondev
help
also, are you sure you shouldn't patch a method instead of a whole class?
2018-02-02T11:02:20.000058
Barney
pythondev_help_Barney_2018-02-02T11:02:20.000058
1,517,569,340.000058
32,611
pythondev
help
I'm not really friendly with mocking yet, just speculating
2018-02-02T11:02:43.000223
Barney
pythondev_help_Barney_2018-02-02T11:02:43.000223
1,517,569,363.000223
32,612
pythondev
help
let me try to move things around
2018-02-02T11:02:57.000115
Lesley
pythondev_help_Lesley_2018-02-02T11:02:57.000115
1,517,569,377.000115
32,613
pythondev
help
i'd patch `start`, but idk
2018-02-02T11:03:20.000172
Barney
pythondev_help_Barney_2018-02-02T11:03:20.000172
1,517,569,400.000172
32,614
pythondev
help
lol
2018-02-02T11:03:24.000641
Lesley
pythondev_help_Lesley_2018-02-02T11:03:24.000641
1,517,569,404.000641
32,615
pythondev
help
you right
2018-02-02T11:03:30.000103
Lesley
pythondev_help_Lesley_2018-02-02T11:03:30.000103
1,517,569,410.000103
32,616
pythondev
help
but damn the idea of mocking is to mock the whole object I assume
2018-02-02T11:04:10.000499
Lesley
pythondev_help_Lesley_2018-02-02T11:04:10.000499
1,517,569,450.000499
32,617
pythondev
help
Unrelated, does purest-mock provide something that the built in pytest fixture `monkeypatch` doesn’t? <https://docs.pytest.org/en/latest/monkeypatch.html>
2018-02-02T11:04:45.000324
Rafael
pythondev_help_Rafael_2018-02-02T11:04:45.000324
1,517,569,485.000324
32,618
pythondev
help
purest -- sounds tasty :slightly_smiling_face:
2018-02-02T11:05:45.000215
Barney
pythondev_help_Barney_2018-02-02T11:05:45.000215
1,517,569,545.000215
32,619
pythondev
help
dunno, I picked something which poped up first in google search and started to play with it :slightly_smiling_face:
2018-02-02T11:05:54.000304
Lesley
pythondev_help_Lesley_2018-02-02T11:05:54.000304
1,517,569,554.000304
32,620
pythondev
help
I'll try that one too, thanks <@Rafael>
2018-02-02T11:06:15.000023
Lesley
pythondev_help_Lesley_2018-02-02T11:06:15.000023
1,517,569,575.000023
32,621
pythondev
help
Haha, silly phone autocorrect
2018-02-02T11:06:21.000709
Rafael
pythondev_help_Rafael_2018-02-02T11:06:21.000709
1,517,569,581.000709
32,622
pythondev
help
Sorry to suggest an alternative when you’re having an issue, it may not be worth the distraction
2018-02-02T11:06:48.000619
Rafael
pythondev_help_Rafael_2018-02-02T11:06:48.000619
1,517,569,608.000619
32,623