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
does anyone here use command line utilities to compress PDFs? something like ghostscript? we're trying to replace a paid service with our own PDF compression and we suspect that they use ghostscript. however for some files our own ghostscript output PDF is blank, even though the compressed size is identical to the paid...
2019-02-01T05:14:54.514700
Conrad
pythondev_help_Conrad_2019-02-01T05:14:54.514700
1,548,998,094.5147
5,821
pythondev
help
I'm trying to import from the same directory. My directory is marked as "Sources root" but my imports still cant find what they need from my first script. Anyone see what I'm missing? ps, db + others come from "basic.py"
2019-02-01T07:23:33.515500
Randal
pythondev_help_Randal_2019-02-01T07:23:33.515500
1,549,005,813.5155
5,822
pythondev
help
where is `db`?
2019-02-01T07:24:54.516200
Mica
pythondev_help_Mica_2019-02-01T07:24:54.516200
1,549,005,894.5162
5,823
pythondev
help
which file
2019-02-01T07:24:56.516400
Mica
pythondev_help_Mica_2019-02-01T07:24:56.516400
1,549,005,896.5164
5,824
pythondev
help
you need to do `from <specific file> import db`
2019-02-01T07:25:08.516700
Mica
pythondev_help_Mica_2019-02-01T07:25:08.516700
1,549,005,908.5167
5,825
pythondev
help
also `Puppy`, `Toy` and `Owner` are undefined
2019-02-01T07:25:42.517100
Mica
pythondev_help_Mica_2019-02-01T07:25:42.517100
1,549,005,942.5171
5,826
pythondev
help
You'll need to import those too
2019-02-01T07:26:00.517800
Mica
pythondev_help_Mica_2019-02-01T07:26:00.517800
1,549,005,960.5178
5,827
pythondev
help
you also need an `__init__.py` file in the directory to make it a python package
2019-02-01T07:26:15.518100
Hiroko
pythondev_help_Hiroko_2019-02-01T07:26:15.518100
1,549,005,975.5181
5,828
pythondev
help
so you need something like ``` rela __init__.py df.py basic.py ```
2019-02-01T07:26:58.518800
Hiroko
pythondev_help_Hiroko_2019-02-01T07:26:58.518800
1,549,006,018.5188
5,829
pythondev
help
<@Conrad> not sure what you mean. when you output from ghostscript, what you you mean by blank?
2019-02-01T07:27:41.519400
Hiroko
pythondev_help_Hiroko_2019-02-01T07:27:41.519400
1,549,006,061.5194
5,830
pythondev
help
as in entirely white/black?
2019-02-01T07:27:46.519600
Hiroko
pythondev_help_Hiroko_2019-02-01T07:27:46.519600
1,549,006,066.5196
5,831
pythondev
help
apparently this might be a known issue? lots of things pop up when googling `ghostscript blank pages`
2019-02-01T07:28:35.519900
Hiroko
pythondev_help_Hiroko_2019-02-01T07:28:35.519900
1,549,006,115.5199
5,832
pythondev
help
<@Hiroko> it turned out to be macOS's preview app misbehaving. I went through all of that. the same PDF opens up in the browser fine.
2019-02-01T07:29:37.521000
Conrad
pythondev_help_Conrad_2019-02-01T07:29:37.521000
1,549,006,177.521
5,833
pythondev
help
huh, interesting
2019-02-01T07:29:50.521500
Hiroko
pythondev_help_Hiroko_2019-02-01T07:29:50.521500
1,549,006,190.5215
5,834
pythondev
help
and it's a problem with the preview app only on my system
2019-02-01T07:29:53.521600
Conrad
pythondev_help_Conrad_2019-02-01T07:29:53.521600
1,549,006,193.5216
5,835
pythondev
help
on my boss's system it renders.
2019-02-01T07:29:58.521800
Conrad
pythondev_help_Conrad_2019-02-01T07:29:58.521800
1,549,006,198.5218
5,836
pythondev
help
does your boss have osx too?
2019-02-01T07:30:08.522100
Hiroko
pythondev_help_Hiroko_2019-02-01T07:30:08.522100
1,549,006,208.5221
5,837
pythondev
help
macos sierra yeah. both of us had to upgrade because of slack a while ago lol
2019-02-01T07:30:27.522500
Conrad
pythondev_help_Conrad_2019-02-01T07:30:27.522500
1,549,006,227.5225
5,838
pythondev
help
why it appears completely white/blank (no selectable text, not a color problem) I have no idea.
2019-02-01T07:30:56.522900
Conrad
pythondev_help_Conrad_2019-02-01T07:30:56.522900
1,549,006,256.5229
5,839
pythondev
help
so turns out that I could just use ghostscript. I'll test it some more on a bunch of pdfs.
2019-02-01T07:31:19.523300
Conrad
pythondev_help_Conrad_2019-02-01T07:31:19.523300
1,549,006,279.5233
5,840
pythondev
help
huh, odd.
2019-02-01T07:32:25.523500
Hiroko
pythondev_help_Hiroko_2019-02-01T07:32:25.523500
1,549,006,345.5235
5,841
pythondev
help
I’m on high sierra on both machines (work and personal), and haven’t had that issue
2019-02-01T07:32:50.524000
Hiroko
pythondev_help_Hiroko_2019-02-01T07:32:50.524000
1,549,006,370.524
5,842
pythondev
help
oh, and if this was a command line thing on osx, we do have <#C6E28H1HV|os_mac> for specific operating system topics
2019-02-01T07:33:52.524500
Hiroko
pythondev_help_Hiroko_2019-02-01T07:33:52.524500
1,549,006,432.5245
5,843
pythondev
help
<@Mica> They are all in basic.py
2019-02-01T07:39:06.525100
Randal
pythondev_help_Randal_2019-02-01T07:39:06.525100
1,549,006,746.5251
5,844
pythondev
help
you'll want to add the `__init__.py` as <@Hiroko> suggested and then do `from .basic import db, Toy, Puppy, Owner`
2019-02-01T07:39:41.525800
Mica
pythondev_help_Mica_2019-02-01T07:39:41.525800
1,549,006,781.5258
5,845
pythondev
help
the `.basic` is a relative import vs. an abs import which would be `from rela.basic import ...`
2019-02-01T07:40:56.526800
Mica
pythondev_help_Mica_2019-02-01T07:40:56.526800
1,549,006,856.5268
5,846
pythondev
help
<https://realpython.com/absolute-vs-relative-python-imports/>
2019-02-01T07:41:26.527100
Mica
pythondev_help_Mica_2019-02-01T07:41:26.527100
1,549,006,886.5271
5,847
pythondev
help
is adding the __init__ a python 2 thing? I've never had to do that before?
2019-02-01T07:47:01.527700
Randal
pythondev_help_Randal_2019-02-01T07:47:01.527700
1,549,007,221.5277
5,848
pythondev
help
no
2019-02-01T07:48:47.527900
Hiroko
pythondev_help_Hiroko_2019-02-01T07:48:47.527900
1,549,007,327.5279
5,849
pythondev
help
it defines a directory as a python package
2019-02-01T07:48:54.528200
Hiroko
pythondev_help_Hiroko_2019-02-01T07:48:54.528200
1,549,007,334.5282
5,850
pythondev
help
FYI, you should be using python 3, if you can
2019-02-01T07:49:07.528500
Hiroko
pythondev_help_Hiroko_2019-02-01T07:49:07.528500
1,549,007,347.5285
5,851
pythondev
help
python 2 is end of life in about 14 months
2019-02-01T07:49:31.529200
Hiroko
pythondev_help_Hiroko_2019-02-01T07:49:31.529200
1,549,007,371.5292
5,852
pythondev
help
I am using python 3. Never used pythong 2 before:flushed:
2019-02-01T07:52:25.529900
Randal
pythondev_help_Randal_2019-02-01T07:52:25.529900
1,549,007,545.5299
5,853
pythondev
help
so I create a module, name it __init__.py. What goes inside the module?
2019-02-01T07:52:49.530800
Randal
pythondev_help_Randal_2019-02-01T07:52:49.530800
1,549,007,569.5308
5,854
pythondev
help
you haven’t done anything with python before, have you?
2019-02-01T07:53:39.531600
Hiroko
pythondev_help_Hiroko_2019-02-01T07:53:39.531600
1,549,007,619.5316
5,855
pythondev
help
Hi :slightly_smiling_face: Anyone here who ever used celery? I've been experiencing some weird behaviour that isnt described anywhere :confused:
2019-02-01T07:54:27.532500
Geneva
pythondev_help_Geneva_2019-02-01T07:54:27.532500
1,549,007,667.5325
5,856
pythondev
help
how so?
2019-02-01T07:55:25.532700
Hiroko
pythondev_help_Hiroko_2019-02-01T07:55:25.532700
1,549,007,725.5327
5,857
pythondev
help
and <@Randal> I feel it would be a better approach for you to use a tutorial or python beginners youtube series to get the basics of the language
2019-02-01T07:56:12.535000
Hiroko
pythondev_help_Hiroko_2019-02-01T07:56:12.535000
1,549,007,772.535
5,858
pythondev
help
I'm a beginner. I've done a few projects, lots of imports but Its my first time working with flask and SQLalchemy. This is the first time i'm experiencing such issues
2019-02-01T07:56:38.536200
Randal
pythondev_help_Randal_2019-02-01T07:56:38.536200
1,549,007,798.5362
5,859
pythondev
help
Well, I normally run django (with gunicorn) + celery as supervisor demons to serve my app backend on AWS. but since today, without any code changes the celery just wont start. Tried reinstalling it with pip, but no luck. It gives literally 0 output to console, just hangs after the command execution
2019-02-01T07:57:05.536800
Geneva
pythondev_help_Geneva_2019-02-01T07:57:05.536800
1,549,007,825.5368
5,860
pythondev
help
Now its working..?
2019-02-01T07:58:43.536900
Randal
pythondev_help_Randal_2019-02-01T07:58:43.536900
1,549,007,923.5369
5,861
pythondev
help
<@Geneva> have you added `DEBUG=True` to your celery config?
2019-02-01T08:01:47.538000
Hiroko
pythondev_help_Hiroko_2019-02-01T08:01:47.538000
1,549,008,107.538
5,862
pythondev
help
yes, I even ran it with `-l debug` as inline option
2019-02-01T08:03:23.539800
Geneva
pythondev_help_Geneva_2019-02-01T08:03:23.539800
1,549,008,203.5398
5,863
pythondev
help
or go to debug log mode for your worker?
2019-02-01T08:03:24.539900
Hiroko
pythondev_help_Hiroko_2019-02-01T08:03:24.539900
1,549,008,204.5399
5,864
pythondev
help
My main issue before the importing problem, was that when the code would run, it ran fine. But it would not create a .db file once I ran the code. Meaning I cant see it in my left hand tab even though I have used db.create_all()
2019-02-01T08:03:27.540100
Randal
pythondev_help_Randal_2019-02-01T08:03:27.540100
1,549,008,207.5401
5,865
pythondev
help
and nothing?
2019-02-01T08:03:29.540500
Hiroko
pythondev_help_Hiroko_2019-02-01T08:03:29.540500
1,549,008,209.5405
5,866
pythondev
help
nothing, not even message about it starting, but when i intentionally make a typo in app name, it gives me the stack trace, so it shouldn't be a sys issue
2019-02-01T08:04:09.541300
Geneva
pythondev_help_Geneva_2019-02-01T08:04:09.541300
1,549,008,249.5413
5,867
pythondev
help
what version celery?
2019-02-01T08:06:55.541500
Hiroko
pythondev_help_Hiroko_2019-02-01T08:06:55.541500
1,549,008,415.5415
5,868
pythondev
help
latest - 4.2.1
2019-02-01T08:09:35.541700
Geneva
pythondev_help_Geneva_2019-02-01T08:09:35.541700
1,549,008,575.5417
5,869
pythondev
help
you’re on AWS, right?
2019-02-01T08:10:34.541900
Hiroko
pythondev_help_Hiroko_2019-02-01T08:10:34.541900
1,549,008,634.5419
5,870
pythondev
help
yes
2019-02-01T08:10:45.542400
Geneva
pythondev_help_Geneva_2019-02-01T08:10:45.542400
1,549,008,645.5424
5,871
pythondev
help
could your workers be rate limited if you’re on burst instances?
2019-02-01T08:10:49.542500
Hiroko
pythondev_help_Hiroko_2019-02-01T08:10:49.542500
1,549,008,649.5425
5,872
pythondev
help
Im very new to AWS, (been using IBM cloud until now) . I've just created micro instance where it runs, and based on monitoring for last day, cpu utilization was max at 30% , so I thought this wouldnt be instance issue :confused:
2019-02-01T08:12:20.543900
Geneva
pythondev_help_Geneva_2019-02-01T08:12:20.543900
1,549,008,740.5439
5,873
pythondev
help
it very well may be
2019-02-01T08:12:34.544500
Hiroko
pythondev_help_Hiroko_2019-02-01T08:12:34.544500
1,549,008,754.5445
5,874
pythondev
help
but if your on T2 instances, you accrue cpu credits if your instance works under a certain load, and spend cpu credits if it goes above that
2019-02-01T08:13:16.545500
Hiroko
pythondev_help_Hiroko_2019-02-01T08:13:16.545500
1,549,008,796.5455
5,875
pythondev
help
and with your cpu utilization over the past day, I believe your balance would be spent, which would cap your cpu at 1/10 of normal
2019-02-01T08:13:48.546300
Hiroko
pythondev_help_Hiroko_2019-02-01T08:13:48.546300
1,549,008,828.5463
5,876
pythondev
help
that’s one of the things you have to be aware of when using “burstable” instances
2019-02-01T08:14:20.546900
Hiroko
pythondev_help_Hiroko_2019-02-01T08:14:20.546900
1,549,008,860.5469
5,877
pythondev
help
they’re alot like a sprinter, can go all out over short distanes but would move fairly slowly over a marathon
2019-02-01T08:14:47.547400
Hiroko
pythondev_help_Hiroko_2019-02-01T08:14:47.547400
1,549,008,887.5474
5,878
pythondev
help
But I dont think this looks like what you are describing tbh, but I may be wrong
2019-02-01T08:15:40.547800
Geneva
pythondev_help_Geneva_2019-02-01T08:15:40.547800
1,549,008,940.5478
5,879
pythondev
help
huh, from your description, I’d expect the cpu credits to be much lower
2019-02-01T08:16:08.548700
Hiroko
pythondev_help_Hiroko_2019-02-01T08:16:08.548700
1,549,008,968.5487
5,880
pythondev
help
or to zero
2019-02-01T08:16:10.548900
Hiroko
pythondev_help_Hiroko_2019-02-01T08:16:10.548900
1,549,008,970.5489
5,881
pythondev
help
yup, thats why im saying it doesnt look like that
2019-02-01T08:17:09.549500
Geneva
pythondev_help_Geneva_2019-02-01T08:17:09.549500
1,549,009,029.5495
5,882
pythondev
help
what OS are you running on?
2019-02-01T08:19:02.549900
Hiroko
pythondev_help_Hiroko_2019-02-01T08:19:02.549900
1,549,009,142.5499
5,883
pythondev
help
and when you do `ps aux | grep -i celery` are there any other processes running?
2019-02-01T08:19:28.550300
Hiroko
pythondev_help_Hiroko_2019-02-01T08:19:28.550300
1,549,009,168.5503
5,884
pythondev
help
I am using the linux AMI , which is basicaly a RHEL
2019-02-01T08:21:24.550600
Geneva
pythondev_help_Geneva_2019-02-01T08:21:24.550600
1,549,009,284.5506
5,885
pythondev
help
and no, when I grep for celery, I only see the command i ran that hangs and the grep itself
2019-02-01T08:22:40.551400
Geneva
pythondev_help_Geneva_2019-02-01T08:22:40.551400
1,549,009,360.5514
5,886
pythondev
help
can you show your daemon config?
2019-02-01T08:24:24.551700
Hiroko
pythondev_help_Hiroko_2019-02-01T08:24:24.551700
1,549,009,464.5517
5,887
pythondev
help
you’re using systemd, right?
2019-02-01T08:25:03.552200
Hiroko
pythondev_help_Hiroko_2019-02-01T08:25:03.552200
1,549,009,503.5522
5,888
pythondev
help
supervisord
2019-02-01T08:26:30.552600
Geneva
pythondev_help_Geneva_2019-02-01T08:26:30.552600
1,549,009,590.5526
5,889
pythondev
help
but i canceled the demonization now, killed all processes and tried it by hand, so it shouldnt be demonization issue
2019-02-01T08:28:42.553300
Geneva
pythondev_help_Geneva_2019-02-01T08:28:42.553300
1,549,009,722.5533
5,890
pythondev
help
Does anyone know if setting blank variables in functions would cause cases to fail when I'm passing in actual information during my function calls? I can provide an example if need be.
2019-02-01T10:28:55.556700
Granville
pythondev_help_Granville_2019-02-01T10:28:55.556700
1,549,016,935.5567
5,891
pythondev
help
Please do provide examples. It is not completely obvious what you are asking
2019-02-01T10:34:02.557700
Clemmie
pythondev_help_Clemmie_2019-02-01T10:34:02.557700
1,549,017,242.5577
5,892
pythondev
help
Certainly
2019-02-01T10:34:10.557900
Granville
pythondev_help_Granville_2019-02-01T10:34:10.557900
1,549,017,250.5579
5,893
pythondev
help
you mean something like this? ``` def name(param=''): pass ```
2019-02-01T10:41:14.558500
Agustina
pythondev_help_Agustina_2019-02-01T10:41:14.558500
1,549,017,674.5585
5,894
pythondev
help
So for some reason, when I run this, my output continues to fail on the first case with the function call at the bottom
2019-02-01T10:42:43.559200
Granville
pythondev_help_Granville_2019-02-01T10:42:43.559200
1,549,017,763.5592
5,895
pythondev
help
I would think a better solution would be: ``` def name(param=None): if param == None: param = '' # Do something else here ```
2019-02-01T10:43:26.559500
Agustina
pythondev_help_Agustina_2019-02-01T10:43:26.559500
1,549,017,806.5595
5,896
pythondev
help
well, an empty string is evaluated to `False
2019-02-01T10:45:40.560400
Hiroko
pythondev_help_Hiroko_2019-02-01T10:45:40.560400
1,549,017,940.5604
5,897
pythondev
help
with this example, you should get back `{'Year': '2012'}`, right?
2019-02-01T10:47:41.561100
Agustina
pythondev_help_Agustina_2019-02-01T10:47:41.561100
1,549,018,061.5611
5,898
pythondev
help
Correct
2019-02-01T10:47:54.561500
Granville
pythondev_help_Granville_2019-02-01T10:47:54.561500
1,549,018,074.5615
5,899
pythondev
help
so what are you actually getting?
2019-02-01T10:48:01.561800
Agustina
pythondev_help_Agustina_2019-02-01T10:48:01.561800
1,549,018,081.5618
5,900
pythondev
help
also, for optional arguments, `None` is recommended instead of a blank string as the default value
2019-02-01T10:48:11.562200
Ashley
pythondev_help_Ashley_2019-02-01T10:48:11.562200
1,549,018,091.5622
5,901
pythondev
help
also, it returns `{'Year': '2012', 'code': ''}`
2019-02-01T10:48:46.562500
Ashley
pythondev_help_Ashley_2019-02-01T10:48:46.562500
1,549,018,126.5625
5,902
pythondev
help
{'Year': '2012', 'code': ''}
2019-02-01T10:48:50.562700
Granville
pythondev_help_Granville_2019-02-01T10:48:50.562700
1,549,018,130.5627
5,903
pythondev
help
the reason being `combined=calyear.update(prgmcode)`
2019-02-01T10:49:05.563000
Ashley
pythondev_help_Ashley_2019-02-01T10:49:05.563000
1,549,018,145.563
5,904
pythondev
help
And never use empty objects (i.e. [], {}, etc.) as you won’t get what you expect because they’re passed by reference!
2019-02-01T10:49:06.563100
Agustina
pythondev_help_Agustina_2019-02-01T10:49:06.563100
1,549,018,146.5631
5,905
pythondev
help
it updates the `calyear` dict to also have the stuff from `prgmcode`
2019-02-01T10:49:42.564200
Ashley
pythondev_help_Ashley_2019-02-01T10:49:42.564200
1,549,018,182.5642
5,906
pythondev
help
<@Ashley> I see that part, but wouldn't the return fail on the first `if` statement and return nothing?
2019-02-01T10:50:29.565000
Granville
pythondev_help_Granville_2019-02-01T10:50:29.565000
1,549,018,229.565
5,907
pythondev
help
to put that in other words, they can be mutable types, and the default value is hardcoded by reference, so it's the same `[]` object every time you call that function
2019-02-01T10:50:46.565100
Ashley
pythondev_help_Ashley_2019-02-01T10:50:46.565100
1,549,018,246.5651
5,908
pythondev
help
nope
2019-02-01T10:50:55.565400
Ashley
pythondev_help_Ashley_2019-02-01T10:50:55.565400
1,549,018,255.5654
5,909
pythondev
help
no, because you have an `else`
2019-02-01T10:51:00.565700
Hiroko
pythondev_help_Hiroko_2019-02-01T10:51:00.565700
1,549,018,260.5657
5,910
pythondev
help
because `year` isn't Falsey
2019-02-01T10:51:07.566300
Ashley
pythondev_help_Ashley_2019-02-01T10:51:07.566300
1,549,018,267.5663
5,911
pythondev
help
that’s a catch-all in case all others fail
2019-02-01T10:51:08.566400
Hiroko
pythondev_help_Hiroko_2019-02-01T10:51:08.566400
1,549,018,268.5664
5,912
pythondev
help
ah, so I have it backwards then
2019-02-01T10:51:12.566600
Granville
pythondev_help_Granville_2019-02-01T10:51:12.566600
1,549,018,272.5666
5,913
pythondev
help
it returns from `elif not code:`
2019-02-01T10:51:29.566900
Ashley
pythondev_help_Ashley_2019-02-01T10:51:29.566900
1,549,018,289.5669
5,914
pythondev
help
he’s saying that the calyear variable content are updated IN PLACE… it doesn’t return a new value like an immutable object does.
2019-02-01T10:51:58.567600
Agustina
pythondev_help_Agustina_2019-02-01T10:51:58.567600
1,549,018,318.5676
5,915
pythondev
help
^
2019-02-01T10:52:08.567800
Ashley
pythondev_help_Ashley_2019-02-01T10:52:08.567800
1,549,018,328.5678
5,916
pythondev
help
so the `if` conditions are working fine, but the object you’re returning has been changed
2019-02-01T10:52:28.568300
Agustina
pythondev_help_Agustina_2019-02-01T10:52:28.568300
1,549,018,348.5683
5,917
pythondev
help
technically, it returns `None` from `update`
2019-02-01T10:53:02.568500
Ashley
pythondev_help_Ashley_2019-02-01T10:53:02.568500
1,549,018,382.5685
5,918
pythondev
help
because everything returns `None` by default
2019-02-01T10:53:26.568800
Ashley
pythondev_help_Ashley_2019-02-01T10:53:26.568800
1,549,018,406.5688
5,919
pythondev
help
so `combined` is `None`
2019-02-01T10:53:39.569100
Ashley
pythondev_help_Ashley_2019-02-01T10:53:39.569100
1,549,018,419.5691
5,920