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
you really should follow python module convention
2018-02-24T08:03:55.000062
Floy
pythondev_help_Floy_2018-02-24T08:03:55.000062
1,519,459,435.000062
35,924
pythondev
help
as in each folder have a `__init__.py` file
2018-02-24T08:04:06.000038
Floy
pythondev_help_Floy_2018-02-24T08:04:06.000038
1,519,459,446.000038
35,925
pythondev
help
note the double understcores
2018-02-24T08:04:13.000061
Floy
pythondev_help_Floy_2018-02-24T08:04:13.000061
1,519,459,453.000061
35,926
pythondev
help
yeah I do have that
2018-02-24T08:04:53.000027
Suzette
pythondev_help_Suzette_2018-02-24T08:04:53.000027
1,519,459,493.000027
35,927
pythondev
help
it’s under that `core` folder
2018-02-24T08:05:14.000074
Suzette
pythondev_help_Suzette_2018-02-24T08:05:14.000074
1,519,459,514.000074
35,928
pythondev
help
its not apparent in your folder structure snippet
2018-02-24T08:05:29.000082
Floy
pythondev_help_Floy_2018-02-24T08:05:29.000082
1,519,459,529.000082
35,929
pythondev
help
added it in
2018-02-24T08:05:59.000074
Suzette
pythondev_help_Suzette_2018-02-24T08:05:59.000074
1,519,459,559.000074
35,930
pythondev
help
I have a feeling that it depends where I run the script from. so when I run `python core/hello.py` I guess at that point, it doesn’t know about `core`
2018-02-24T08:07:06.000092
Suzette
pythondev_help_Suzette_2018-02-24T08:07:06.000092
1,519,459,626.000092
35,931
pythondev
help
what path are you at when you run the commands
2018-02-24T08:07:25.000057
Floy
pythondev_help_Floy_2018-02-24T08:07:25.000057
1,519,459,645.000057
35,932
pythondev
help
at the root path, so wherever `init.py` is
2018-02-24T08:07:51.000044
Suzette
pythondev_help_Suzette_2018-02-24T08:07:51.000044
1,519,459,671.000044
35,933
pythondev
help
ok
2018-02-24T08:08:36.000017
Floy
pythondev_help_Floy_2018-02-24T08:08:36.000017
1,519,459,716.000017
35,934
pythondev
help
so is `init.py` actually `__init__.py`?
2018-02-24T08:08:47.000030
Floy
pythondev_help_Floy_2018-02-24T08:08:47.000030
1,519,459,727.00003
35,935
pythondev
help
no. it’s just `init.py`. I can call it `something_else.py`
2018-02-24T08:09:16.000038
Suzette
pythondev_help_Suzette_2018-02-24T08:09:16.000038
1,519,459,756.000038
35,936
pythondev
help
so it’s a custom one
2018-02-24T08:09:21.000078
Suzette
pythondev_help_Suzette_2018-02-24T08:09:21.000078
1,519,459,761.000078
35,937
pythondev
help
nothing to do with __init__
2018-02-24T08:09:30.000031
Suzette
pythondev_help_Suzette_2018-02-24T08:09:30.000031
1,519,459,770.000031
35,938
pythondev
help
problem is, you _need_ that file to tell python its a module
2018-02-24T08:09:31.000031
Floy
pythondev_help_Floy_2018-02-24T08:09:31.000031
1,519,459,771.000031
35,939
pythondev
help
which is how imports work
2018-02-24T08:09:40.000053
Floy
pythondev_help_Floy_2018-02-24T08:09:40.000053
1,519,459,780.000053
35,940
pythondev
help
do I need that in the root path as well?
2018-02-24T08:09:43.000067
Suzette
pythondev_help_Suzette_2018-02-24T08:09:43.000067
1,519,459,783.000067
35,941
pythondev
help
_any_ directory you are going to have python files in that are imported anywhere
2018-02-24T08:10:04.000119
Floy
pythondev_help_Floy_2018-02-24T08:10:04.000119
1,519,459,804.000119
35,942
pythondev
help
now, what is in the files you’re executing and getting the module error?
2018-02-24T08:11:24.000005
Floy
pythondev_help_Floy_2018-02-24T08:11:24.000005
1,519,459,884.000005
35,943
pythondev
help
I renamed my `init.py` to `start.py`
2018-02-24T08:12:24.000074
Suzette
pythondev_help_Suzette_2018-02-24T08:12:24.000074
1,519,459,944.000074
35,944
pythondev
help
alright.
2018-02-24T08:12:42.000059
Floy
pythondev_help_Floy_2018-02-24T08:12:42.000059
1,519,459,962.000059
35,945
pythondev
help
so if I run `python start.py`, and in that `hello.py`, if I have `from world import some_function`, then it doesn’t work
2018-02-24T08:13:25.000088
Suzette
pythondev_help_Suzette_2018-02-24T08:13:25.000088
1,519,460,005.000088
35,946
pythondev
help
but if I do `from core.world import some_function`, then it works
2018-02-24T08:13:44.000042
Suzette
pythondev_help_Suzette_2018-02-24T08:13:44.000042
1,519,460,024.000042
35,947
pythondev
help
so that happens when I do `python start.py` from the root
2018-02-24T08:14:00.000034
Suzette
pythondev_help_Suzette_2018-02-24T08:14:00.000034
1,519,460,040.000034
35,948
pythondev
help
which makes sense, coz it’s under `core` and it needs the full reference
2018-02-24T08:14:27.000033
Suzette
pythondev_help_Suzette_2018-02-24T08:14:27.000033
1,519,460,067.000033
35,949
pythondev
help
show your code in `start.py` and `world.py`
2018-02-24T08:14:30.000022
Floy
pythondev_help_Floy_2018-02-24T08:14:30.000022
1,519,460,070.000022
35,950
pythondev
help
ok just a sec
2018-02-24T08:14:36.000148
Suzette
pythondev_help_Suzette_2018-02-24T08:14:36.000148
1,519,460,076.000148
35,951
pythondev
help
now if I do this
2018-02-24T08:19:17.000061
Suzette
pythondev_help_Suzette_2018-02-24T08:19:17.000061
1,519,460,357.000061
35,952
pythondev
help
and then run `python core/hello.py`
2018-02-24T08:19:36.000061
Suzette
pythondev_help_Suzette_2018-02-24T08:19:36.000061
1,519,460,376.000061
35,953
pythondev
help
I get ``` Traceback (most recent call last): File "core/hello.py", line 1, in <module> from core.world import resolve_greeting ImportError: No module named 'core'```
2018-02-24T08:20:02.000044
Suzette
pythondev_help_Suzette_2018-02-24T08:20:02.000044
1,519,460,402.000044
35,954
pythondev
help
I think all your issues could be resolved with `__init__.py` in the same folder as `start.py`
2018-02-24T08:20:17.000096
Floy
pythondev_help_Floy_2018-02-24T08:20:17.000096
1,519,460,417.000096
35,955
pythondev
help
nope, still getting the same error
2018-02-24T08:21:02.000055
Suzette
pythondev_help_Suzette_2018-02-24T08:21:02.000055
1,519,460,462.000055
35,956
pythondev
help
you’re using python3, right?
2018-02-24T08:21:27.000109
Floy
pythondev_help_Floy_2018-02-24T08:21:27.000109
1,519,460,487.000109
35,957
pythondev
help
yes
2018-02-24T08:21:39.000087
Suzette
pythondev_help_Suzette_2018-02-24T08:21:39.000087
1,519,460,499.000087
35,958
pythondev
help
and `python start.py` works?
2018-02-24T08:21:47.000077
Floy
pythondev_help_Floy_2018-02-24T08:21:47.000077
1,519,460,507.000077
35,959
pythondev
help
at the moment yes
2018-02-24T08:21:59.000049
Suzette
pythondev_help_Suzette_2018-02-24T08:21:59.000049
1,519,460,519.000049
35,960
pythondev
help
and if you cd into `core`
2018-02-24T08:22:06.000112
Floy
pythondev_help_Floy_2018-02-24T08:22:06.000112
1,519,460,526.000112
35,961
pythondev
help
does `python hello.py` work?
2018-02-24T08:22:21.000074
Floy
pythondev_help_Floy_2018-02-24T08:22:21.000074
1,519,460,541.000074
35,962
pythondev
help
yeah that one doesn’t
2018-02-24T08:22:25.000031
Suzette
pythondev_help_Suzette_2018-02-24T08:22:25.000031
1,519,460,545.000031
35,963
pythondev
help
BUT if I change `from core.world ..` to `from world ..` then it works
2018-02-24T08:22:56.000074
Suzette
pythondev_help_Suzette_2018-02-24T08:22:56.000074
1,519,460,576.000074
35,964
pythondev
help
but then the `python start.py` stops working :smile:
2018-02-24T08:23:12.000109
Suzette
pythondev_help_Suzette_2018-02-24T08:23:12.000109
1,519,460,592.000109
35,965
pythondev
help
I have no clue, sorry
2018-02-24T08:26:57.000056
Floy
pythondev_help_Floy_2018-02-24T08:26:57.000056
1,519,460,817.000056
35,966
pythondev
help
something else must be going on
2018-02-24T08:27:10.000009
Floy
pythondev_help_Floy_2018-02-24T08:27:10.000009
1,519,460,830.000009
35,967
pythondev
help
ok thanks anyway
2018-02-24T08:27:22.000081
Suzette
pythondev_help_Suzette_2018-02-24T08:27:22.000081
1,519,460,842.000081
35,968
pythondev
help
:slightly_smiling_face:
2018-02-24T08:27:25.000004
Suzette
pythondev_help_Suzette_2018-02-24T08:27:25.000004
1,519,460,845.000004
35,969
pythondev
help
one thing
2018-02-24T08:27:43.000005
Floy
pythondev_help_Floy_2018-02-24T08:27:43.000005
1,519,460,863.000005
35,970
pythondev
help
python3 relies on absolute imports
2018-02-24T08:27:49.000082
Floy
pythondev_help_Floy_2018-02-24T08:27:49.000082
1,519,460,869.000082
35,971
pythondev
help
and you’re using an IDE.. which one?
2018-02-24T08:28:11.000094
Floy
pythondev_help_Floy_2018-02-24T08:28:11.000094
1,519,460,891.000094
35,972
pythondev
help
if you click on `resolve_greeting` in `world.py` does it show anything
2018-02-24T08:28:54.000080
Floy
pythondev_help_Floy_2018-02-24T08:28:54.000080
1,519,460,934.00008
35,973
pythondev
help
oh.. do you have the directory in `sys.path`?
2018-02-24T08:30:05.000059
Floy
pythondev_help_Floy_2018-02-24T08:30:05.000059
1,519,461,005.000059
35,974
pythondev
help
eg, start a python shell in the same directory as `start.py`
2018-02-24T08:30:18.000028
Floy
pythondev_help_Floy_2018-02-24T08:30:18.000028
1,519,461,018.000028
35,975
pythondev
help
and run ``` import sys print(sys.path)```
2018-02-24T08:30:29.000022
Floy
pythondev_help_Floy_2018-02-24T08:30:29.000022
1,519,461,029.000022
35,976
pythondev
help
ok just a sec
2018-02-24T08:30:43.000089
Suzette
pythondev_help_Suzette_2018-02-24T08:30:43.000089
1,519,461,043.000089
35,977
pythondev
help
umm
2018-02-24T08:32:12.000022
Suzette
pythondev_help_Suzette_2018-02-24T08:32:12.000022
1,519,461,132.000022
35,978
pythondev
help
it outputs this list
2018-02-24T08:32:16.000036
Suzette
pythondev_help_Suzette_2018-02-24T08:32:16.000036
1,519,461,136.000036
35,979
pythondev
help
```['', '/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python34.zip', '/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4', '/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin', '/usr/local/Cellar/py...
2018-02-24T08:32:20.000115
Suzette
pythondev_help_Suzette_2018-02-24T08:32:20.000115
1,519,461,140.000115
35,980
pythondev
help
yeah, which doesn’t include your directory
2018-02-24T08:32:37.000018
Floy
pythondev_help_Floy_2018-02-24T08:32:37.000018
1,519,461,157.000018
35,981
pythondev
help
<https://stackoverflow.com/questions/20099481/python3-importerror-no-module-named-myfile/20100251>
2018-02-24T08:32:51.000080
Floy
pythondev_help_Floy_2018-02-24T08:32:51.000080
1,519,461,171.00008
35,982
pythondev
help
oh so I need to do `sys.path.append('/path/to/this/dir')` somewhere in my code then
2018-02-24T08:34:41.000033
Suzette
pythondev_help_Suzette_2018-02-24T08:34:41.000033
1,519,461,281.000033
35,983
pythondev
help
hmm i didn’t realise it worked like that
2018-02-24T08:34:59.000009
Suzette
pythondev_help_Suzette_2018-02-24T08:34:59.000009
1,519,461,299.000009
35,984
pythondev
help
:smile:
2018-02-24T08:34:59.000057
Suzette
pythondev_help_Suzette_2018-02-24T08:34:59.000057
1,519,461,299.000057
35,985
pythondev
help
so modules are basically global scripts
2018-02-24T08:35:26.000035
Suzette
pythondev_help_Suzette_2018-02-24T08:35:26.000035
1,519,461,326.000035
35,986
pythondev
help
and not per - project stuff?
2018-02-24T08:35:34.000061
Suzette
pythondev_help_Suzette_2018-02-24T08:35:34.000061
1,519,461,334.000061
35,987
pythondev
help
a bit confusing
2018-02-24T08:35:56.000040
Suzette
pythondev_help_Suzette_2018-02-24T08:35:56.000040
1,519,461,356.00004
35,988
pythondev
help
not… really
2018-02-24T08:36:16.000046
Floy
pythondev_help_Floy_2018-02-24T08:36:16.000046
1,519,461,376.000046
35,989
pythondev
help
if you’re working on system python, then yeah, basically
2018-02-24T08:37:00.000113
Floy
pythondev_help_Floy_2018-02-24T08:37:00.000113
1,519,461,420.000113
35,990
pythondev
help
but if you’re working in a virtualenv, then its per-project
2018-02-24T08:37:15.000021
Floy
pythondev_help_Floy_2018-02-24T08:37:15.000021
1,519,461,435.000021
35,991
pythondev
help
where your code is importable only when that environment is activated
2018-02-24T08:37:30.000084
Floy
pythondev_help_Floy_2018-02-24T08:37:30.000084
1,519,461,450.000084
35,992
pythondev
help
yeah I’m working on system python
2018-02-24T08:38:17.000033
Suzette
pythondev_help_Suzette_2018-02-24T08:38:17.000033
1,519,461,497.000033
35,993
pythondev
help
&gt;Modules can import other modules. It is customary but not required to place all import statements at the beginning of a module (or script, for that matter). The imported module names are placed in the importing module’s global symbol table.
2018-02-24T08:38:23.000031
Floy
pythondev_help_Floy_2018-02-24T08:38:23.000031
1,519,461,503.000031
35,994
pythondev
help
<https://docs.python.org/3/tutorial/modules.html>
2018-02-24T08:38:27.000018
Floy
pythondev_help_Floy_2018-02-24T08:38:27.000018
1,519,461,507.000018
35,995
pythondev
help
thanks for your help
2018-02-24T08:39:45.000087
Suzette
pythondev_help_Suzette_2018-02-24T08:39:45.000087
1,519,461,585.000087
35,996
pythondev
help
I’ll look into the virtualenv now
2018-02-24T08:39:57.000055
Suzette
pythondev_help_Suzette_2018-02-24T08:39:57.000055
1,519,461,597.000055
35,997
pythondev
help
:thumbsup:
2018-02-24T08:40:27.000092
Floy
pythondev_help_Floy_2018-02-24T08:40:27.000092
1,519,461,627.000092
35,998
pythondev
help
basically, the thinking is that since much of your operating system utilites rely on that system python, and changing the code there is a bad idea, make your project dependencies isolated from that
2018-02-24T08:41:19.000035
Floy
pythondev_help_Floy_2018-02-24T08:41:19.000035
1,519,461,679.000035
35,999
pythondev
help
and available only when you activate the environment, which updates your envirnment variables to use that python location and its dependencies
2018-02-24T08:42:38.000024
Floy
pythondev_help_Floy_2018-02-24T08:42:38.000024
1,519,461,758.000024
36,000
pythondev
help
with symbolic links to the system python libs, so you have all that avaialbe to import, but nothing you install or do will affect the system python install at all
2018-02-24T08:43:16.000034
Floy
pythondev_help_Floy_2018-02-24T08:43:16.000034
1,519,461,796.000034
36,001
pythondev
help
I'm having issues with pipsi on macOS for some reason. The first link is what happens when I try to install youtube-dl or any other package, and the second is when I try re-installing pipsi: <http://dpaste.com/2GN9NSC> + <http://dpaste.com/1NPXGGR>
2018-02-24T08:51:33.000031
Roscoe
pythondev_help_Roscoe_2018-02-24T08:51:33.000031
1,519,462,293.000031
36,002
pythondev
help
$PATH seems to be as it should afaict
2018-02-24T08:51:55.000067
Roscoe
pythondev_help_Roscoe_2018-02-24T08:51:55.000067
1,519,462,315.000067
36,003
pythondev
help
I’ve already got pyenv set up.
2018-02-24T08:53:24.000060
Roscoe
pythondev_help_Roscoe_2018-02-24T08:53:24.000060
1,519,462,404.00006
36,004
pythondev
help
```$ echo $PATH /Users/darville/.pyenv/shims:/Users/darville/.local/bin:/opt/local/bin:/opt/local/sbin:/Users/darville/.rbenv/shims:/Users/darville/.rbenv/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/usr/local/git/bin:/Users/darville/Downloads/go/bin:/Users/darvil...
2018-02-24T08:54:52.000036
Roscoe
pythondev_help_Roscoe_2018-02-24T08:54:52.000036
1,519,462,492.000036
36,005
pythondev
help
makes sense <@Floy>
2018-02-24T09:01:14.000082
Suzette
pythondev_help_Suzette_2018-02-24T09:01:14.000082
1,519,462,874.000082
36,006
pythondev
help
well for what it’s worth, here’s my finished application :smile: <https://github.com/Bravilogy/euromillions>
2018-02-24T09:01:34.000081
Suzette
pythondev_help_Suzette_2018-02-24T09:01:34.000081
1,519,462,894.000081
36,007
pythondev
help
Any tkinter guru's here? Having trouble with the entry widget
2018-02-24T13:51:48.000087
Bette
pythondev_help_Bette_2018-02-24T13:51:48.000087
1,519,480,308.000087
36,008
pythondev
help
Trying to run: ``` entries = [e1, e2, e3, e4, e5, e6, e7, e8, e9] for i, v in entries(): v = Entry(root, raw_Entry) v.grid(row=i + 1, column=1) ``` but getting a name error: `NameError: name 'e1' is not defined` Tried a few different tweaks but I can't seem to solve it
2018-02-24T13:57:27.000085
Bette
pythondev_help_Bette_2018-02-24T13:57:27.000085
1,519,480,647.000085
36,009
pythondev
help
trying to avoid having to do ``` e1 = Entry(root) e1.grid(row=1, column=1) ``` all the way up to 9
2018-02-24T13:58:34.000028
Bette
pythondev_help_Bette_2018-02-24T13:58:34.000028
1,519,480,714.000028
36,010
pythondev
help
Got it - in case others need it, this worked: ``` entries = [] for i in range(9): e = Entry(root) e.grid(row=i + 1, column=1) entries.append(e) ```
2018-02-24T14:05:13.000052
Bette
pythondev_help_Bette_2018-02-24T14:05:13.000052
1,519,481,113.000052
36,011
pythondev
help
Not that it matters, but you could avoid the `+1` by starting at 1 and going to 10. `for i in range(1, 10):`
2018-02-24T14:21:54.000133
Garrett
pythondev_help_Garrett_2018-02-24T14:21:54.000133
1,519,482,114.000133
36,012
pythondev
help
True! Turns out it didn't actually work like I wanted to , it creates and positions everything fine so I guess technically that piece works, but because it's not storing e1 etc in the list
2018-02-24T14:44:02.000032
Bette
pythondev_help_Bette_2018-02-24T14:44:02.000032
1,519,483,442.000032
36,013
pythondev
help
when I call e1 later on the submit button, it's no longer defined :disappointed:
2018-02-24T14:44:22.000059
Bette
pythondev_help_Bette_2018-02-24T14:44:22.000059
1,519,483,462.000059
36,014
pythondev
help
So you have all of these things in `entries`
2018-02-24T14:45:09.000099
Garrett
pythondev_help_Garrett_2018-02-24T14:45:09.000099
1,519,483,509.000099
36,015
pythondev
help
And you want to make each one an `Entry` and then assign it to a grid position?
2018-02-24T14:46:25.000124
Garrett
pythondev_help_Garrett_2018-02-24T14:46:25.000124
1,519,483,585.000124
36,016
pythondev
help
Yeah - originally I was trying to get something like this to work: ``` entries = [e1, e2, e3, e4, e5, e6, e7, e8, e9] for i, v in entries(): v = Entry(root, raw_Entry) v.grid(row=i + 1, column=1) ``` So then later I can call e1 in other functions and do something like: ``` def defTemp(): """ Clears...
2018-02-24T14:48:18.000129
Bette
pythondev_help_Bette_2018-02-24T14:48:18.000129
1,519,483,698.000129
36,017
pythondev
help
correct!
2018-02-24T14:48:29.000009
Bette
pythondev_help_Bette_2018-02-24T14:48:29.000009
1,519,483,709.000009
36,018
pythondev
help
`entries` isn't a function so you can't call it, like in your first example
2018-02-24T14:48:37.000019
Garrett
pythondev_help_Garrett_2018-02-24T14:48:37.000019
1,519,483,717.000019
36,019
pythondev
help
What you came up with w/ the `range()` call will work but you won't have `e1` available because you didn't create it in the first place (and in an outer scope)
2018-02-24T14:50:05.000088
Garrett
pythondev_help_Garrett_2018-02-24T14:50:05.000088
1,519,483,805.000088
36,020
pythondev
help
But you'd be able to do `entries[0]` to get the first item from the `entries` list
2018-02-24T14:50:26.000102
Garrett
pythondev_help_Garrett_2018-02-24T14:50:26.000102
1,519,483,826.000102
36,021
pythondev
help
Hmmm
2018-02-24T14:53:51.000003
Bette
pythondev_help_Bette_2018-02-24T14:53:51.000003
1,519,484,031.000003
36,022
pythondev
help
I can't figure out how to make that work
2018-02-24T14:56:19.000107
Bette
pythondev_help_Bette_2018-02-24T14:56:19.000107
1,519,484,179.000107
36,023