« first day (2693 days earlier)      last day (2245 days later) » 
00:00 - 21:0021:00 - 00:00

12:10 AM
anyone every used pywin32 to get windows store certificate stuff?
 
@wim Totally works in python 3.4. Doesn't work in 3.6 though, you're right about that
@wim this (spoiler) works in 3.6
 
wim
12:38 AM
@Aran-Fey that works clap clap
now, round 2:
$ python3 -ic 'url = "http://httpbin.org/status/402"'
>>> del __builtins__.__import__, __builtins__
>>> # your code here
...
>>> requests.get(url).text
'F**k you, pay me!'
 
Whaaat, there's really a way to get the builtins back after they've been deleted? O.o
 
wim
they are not deleted
 
This is a lot harder when you can't use dir to look at everything's attributes
 
wim
only their ref count is decreased
 
>>> exit()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'exit' is not defined
:I
 
wim
12:44 AM
use ctrl + D
 
help
I'm on windows :D
>>> ^D^D^D^D^D^D
 
wim
turn your computer off and on again :P
 
cbg
I made it through another day as the office's Excel VBA programmer /whew
 
12:59 AM
This one's tough. No idea how to go about this.
Oh! Progress!
@wim I got it. view spoiler
 
 
2 hours later…
wim
3:33 AM
Well done! are you ready for round 3?
$ python3 -ic 'url = "http://httpbin.org/status/402"'
>>> del __builtins__.__import__
>>> globals().clear()
>>> # your code here
...
>>> requests.get(url).text
'F**k you, pay me!'
(yes, it is still possible)
 
 
2 hours later…
5:42 AM
do we have any broad canonical for "grok email contents"? I'm looking at Reading email attachments with SMTPServer in python 3 and hesitating about whether I should vote to close as too broad or somehow do something else .... but if there's a good canonical, marking it as a duplicate would be an elegant and possibly even helpful resolution
 
6:37 AM
@wim @Aran-Fey for example:
>>> [].__class__.__subclasses__()[1].__dict__['format'].__globals__['sys'].modules['importlib'].__import__
sorry that's ordering dependent :P
well
one can read the subclasses by name to find a proper subclass... basically you'd just find some python method whose globals have sys, then use sys.modules to find importlib... etc...
 
6:57 AM
@AnttiHaapala In which python version does that work? There's no importlib in sys.modules in a fresh repl session
in 3.6.4
...though, if you have access to sys.modules you can just grab the builtins module and re-import it
 
7:11 AM
importlib is there in 3.6.0 on python.org/shell.
 
7:29 AM
you have to import it of course
 
TIL _ is defined in builtins
almost hit the message length cap with that spoiler link
 
8:30 AM
cbg
 
>>> '_' in dir(__builtins__)
False
@Aran-Fey ?
 
Is that the first statement you executed?
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> '_' in dir(__builtins__)
False
>>> '_' in dir(__builtins__)
True
 
8:48 AM
Python 3.7.0a4 (default, Jan 11 2018, 09:25:11)
[GCC 5.4.0 20160609] on linux
dir(__builtins__)
# lots of output
'_' in dir(__builtins__)
False
'_' in dir(__builtins__)
False
 
Interesting. I guess it changed in 3.7?
 
jup, just tried my 3.6 env, I can replicate it in there
Python 3.6.4 (default, Dec 19 2017, 17:29:45)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '_' in dir(__builtins__)
False
>>> '_' in dir(__builtins__)
True
and i thought minor versions changes in python won't break anything.. now i have to update all my code that relied on this behavior. tsk tsk
 
weird, but that xkcd helps
 
 
1 hour later…
10:03 AM
@Aran-Fey Correction, pyCharm's interactive python console doesn't define _ in __builtins__, neither in 3.6 nor in 3.7. I guess I should have tested both environments in the same way.
 
10:47 AM
Huh, weird. How can the behavior be different? PyCharm uses the locally installed python, right? It doesn't ship its own interpreter?
 
11:13 AM
@Arne can't repro
Python 3.7.0a4 (v3.7.0a4:07c9d8547c, Jan 18 2018, 15:34:46)
>>> '_' in dir(__builtins__)
False
>>> '_' in dir(__builtins__)
True
Python 3.7.0b1+ (heads/3.7:4d6543005d, Feb  1 2018, 17:23:26)
>>> '_' in dir(__builtins__)
False
>>> '_' in dir(__builtins__)
True
Python 3.7.0a4 (v3.7.0a4:07c9d8547c, Jan 18 2018, 15:34:46)
>>> dir(__builtins__)
#snip
>>> '_' in dir(__builtins__)
True
>>> '_' in dir(__builtins__)
True
 
Inconsistency... That's why it's still beta :-p
Also, weirdly amusing subreddit of the day - reddit.com/r/WeirdEggs
 
@AndrasDeak Yeah, I corrected that statement. It was due to my PyCharm console, not the different version
 
ah, sorry, I didn't make the connection with the pycharm remarks
 
probably because I explained it very badly
 
well it can't be my fault
 
11:27 AM
@AndrasDeak Why are all your timestamps back in time? Am I in the future?
 
I think those might be build dates
 
@AshishNitinPatil ^
 
yeah, makes sense, just tried on mine
All this time, I have been thinking that's the current datetime... Need to go dive somewhere.
 
New thing in 3.7 I did not know about: breakpoint() built-in
 
recbg
 
11:39 AM
cbg
 
@Aran-Fey It uses the one linked in project settings. Also:
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/home/..'])
PyDev console: starting.
Python 3.7.0a4 (default, Jan 11 2018, 09:25:11)
[GCC 5.4.0 20160609] on linux
'_' in __builtins__
False
'_' in __builtins__
True
'_' in dir(__builtins__)
False
x.x
 
I find your lack of >>> disturbing
 
nooo, too late. They got lost in the copypaste-void
grep -rwn ~/programs/pycharm-community-2017.3.2/helpers/pydev -e '__builtin__' | wc -l -> 54, at that point I just accept that their console does weird things with builtins.
 
11:58 AM
Oh yeah, __builtins__ is a dict sometimes and other times it's the actual module ¯\_(ツ)_/¯
 
TIL grep -r, here I've been grepping like an animal
 
12:49 PM
also learn grep -c
though for summarizing results over a number of files wc -l still has a place
 
1:48 PM
How much will I regret it if I create this table without a primary key
Because I'm too lazy to remember how to set up an autoincrement trigger in Oracle
 
@Kevin Which Oracle?
 
God, there's more than one? I didn't know this plague was also an epidemic.
 
if it's just to torture yourself, why are you using Oracle? If sqlite is insufficient for what you are trying, laziness is probably not a valid reason for anything
 
Because I have no control over the configuration of the prod server and they use Oracle.
stackoverflow.com/questions/840162/… says "yes, make a primary key" so I guess that's that
 
@Kevin From what I read 12c and up support NUMBER GENERATED ... AS IDENTITY
 
1:57 PM
Oh, rad.
Not sure if I couldn't find that on my own because making primary key columns is an unusual and rare thing to want to do (as compared to, say, creating a composite primary key entirely from meaningful data columns), or if I'm just dumb
Today's pet peeve: the fact that google image search removed its "view image" button so now you have to visit the actual page and hope that they didn't bury it underneath a lot of other irrelevant content, or disable right clicking, or just not display it entirely.
Pet peeve part 2: the people that say "actually it's not really a problem because you can just right click the image in the google search results and choose 'view image' from there", because that doesn't take you to pics.me.me/am-i-disabled-sg-12708637.png, it takes you to data:image/jpeg;base64,/9j/[13,000 bytes of hex data goes here]2Q== which chat won't accept as an upload
 
hi all
 
Or, sometimes it gives you the data:, and sometimes it gives you the real url, which is somehow just as annoying despite being apparently better at face value
 
I'm struggling with what is supposedly very easy - organizing the structure of my project/repo - modules, packages, imports and all
 
DSM
@Kevin: belated birthday cabbage, by the way! I think I missed it.
 
I try to model it on Kenneth Reitz's tablib
so putting everything in a folder named the same as the project (that serves as the root package) and as long as I don't prepend imports in the root package with its name it works
but as soon as I try to do it like it's in tablibI get ModuleNotFoundError
what I mean by "like it's in tablib"
 
2:15 PM
@DSM Thanks. You're within a reasonable margin of error. I had celebratory dinner three days before the actual day, so I would be remiss to rebuff the good wishes of others three days after the day.
 
he has only two modules in the root package: core.py and compat.py and i.e. in core.py he uses `from tablib.compat import OrderedDict, unicode'
 
@o'rety I don't have any constructive advice, but I consider project organization quite difficult. So you're not alone.
 
what I can do analogically is from compat import OrderedDict, unicode but as soon as I add the root package name (so in this example 'from tablib.compat`) I get an error
yeah, but I'm sure I'm missing something obvious
I read his tutorial: docs.python-guide.org/en/latest/writing/structure and there's nothing on it, so it has to be some common knowledge, right?
I see all kinds of projects structured like this and using those kind of imports (example: github.com/borgbackup/borg) so I gather it's a well established practice
 
Perhaps this is vague bordering on useless, but the last time I tried to make a project that had fancier structure than "everything in one directory", I got ModuleNotFoundErrors too until I used pip to install the project as a package on my own machine
Just dropping all your files somewhere on the computer isn't sufficient, apparently; you need to notify Python of its existence before it knows to search the right places during import
 
:) well, so I guess I should congratulate myself because it works with the s
proper structure just not with exactly the same analogical imports like I see in those projects
 
DSM
2:23 PM
Maybe I'm missing something, but that should work, unless you're actually running python core.py from within the tablib directory.
(Or the analogous example.)
If you do import tablib.core from the outside, it should be able to resolve tablib.compat to compat.py successfully.
 
yes I'm runnig it from the root package folder - that's wrong?
 
DSM
Give me a second to whip up an example.
 
but it's natural, isn't it? If I have my main.py in this directory as I should?
 
DSM
Too many uses of "it's" and "this" when discussing package structure lead to confusion..
 
ok, let's say I have a repo named foo, then I made a folder inside of it named also foo - that's what I call root package folder
 
DSM
2:29 PM
Rather than sentences, let's look at things like this.
This is the behaviour I expect. Is that not what you were expecting?
 
then I make bunch of .py files inside this folder - those are the modules of the root package, main.py that runs the app among them
now I what works are imports using the modules' names inside those modules
lets say we have bar.py and baz.py. I can do "from baz import ImportantClass" inside of bar.py but I cannot do "from foo.baz import ImportantClass"
and that is what I see in the projects I mentioned
 
DSM
I just did from tablib.compat import compat_var in the example I gave you; how does it differ from what you want to do?
 
It doesn't (if I get it right), but then the question is how does it work in the majority of projects on Github?
but I guess we answered this already
 
DSM
It did work in the example I gave, and I did look at that project. That's what I was trying to mirror, and why my modules are called "core" and "compat", which would have been an astonishing coincidence otherwise.
 
the code is probably run from outside of the root package folder
 
DSM
2:38 PM
It's probably pip-installed as a package, as Kevin mentioned earlier.
 
it wouldn't because I mentioned them, so you hadn't to look at the repo
 
DSM
Fair enough, I suppose.
 
yeah, I told you I'm asking something obvious :)
that is what beginners do
 
DSM
Nothing about package structure is obvious (we haven't even talked about __init__.py and what it does), and now I'm once again repeating Kevin, as usual. :-/
 
well the funny thing is that is seems not many people noticed it's no longer a must. I even had a question making this erroneous assumption at a job interview :)
 
2:42 PM
garlic
 
\o cbg
 
cbg!
 
recbg
 
2:57 PM
Me: Is X possible? How do I do it?
Well-meaning listener: yes, X is possible.
[conversation changes to something else at this point]
;_;
How am I supposed to do the needful under these conditions
 
so I made a little wrapper for `/foo/foo/main.py` with a code in `/foo/run.py` like this: `from foo.main import main
main()`
and it works
thx for the help folks
 
So, mysteriously, my following program just completely ignores the 2nd chunk (worked for 1,3,4,5,6,7 till now)
chunks = 50
if index%chunks == chunks-1 or index == len(products):
    filepath = str(base_dir.path(f'data/fetched_{index//chunks+1}.csv'))
    with open(filepath, 'w') as f:
        writer = csv.DictWriter(f, fieldnames=products[0].keys())
        writer.writeheader()
        writer.writerows(products[index-(index%chunks):])
    print(f'Wrote products {index-(index%chunks)}:{index} to {filepath}')
    time.sleep(8)
 
it still boggles my mind why Reitz both in the tutorial on his blog and in his book or Python Cookbook for that matter wouldn't say a word about this practice
too obvious :)
 
The 8th chunk was also written to it's corresponding file... glitch in the matrix...
Happened again for index 500 499, hmm.
 
Interesting. Well, if you come up with an MCVE, I'd be interested in poking around in it.
 
3:06 PM
The if condition doesn't get executed (since no print statement and new file) for corresponding indexes (99 & 499)
 
Ok, it turns out our old project that used EF doesn't use EF anymore because the developer got frustrated with it and tore the whole thing out. So much for my "blindly copy-paste a working example" approach.
 
DSM
EF?
 
Entity Framework, the hot new cool ORM used by C#
I intended to post that in the C# room. Don't look at my shame.
 
DSM
I regularly post things here which are meant for my console, which is probably worse, so I can't throw stones.
 
@DirtyPenguin welcome, please read our room rules: sopython.com/chatroom
 
3:13 PM
Ah, never mind, some horrible use of the or statement I have, which doesn't explain the skip yet, but is most likely to blame :/
(No glitch in the matrix, just usual human errors... curses the matrix anyway)
 
oops, sorry. I can't seem to figure out the syntax
 
I think you should read the rules. Mainly the part about dpaste. I think that is what davidism was getting at. But I may be wrong.
 
Or the part in the rules linking to how to format code.
But mostly about dpaste, yes.
 
(hint: you can't format multiline code + comments)
 
yep, again my apologies
My code: http://dpaste.com/2NJPJKB

When I run the coverage tool, the html report shows that 1 class attribute is "missed".
my questions:

1. Should class attributes be tested at all?
2. If not, how do I tell coverage to not check for coverage of attributes?
 
3:20 PM
@AshishNitinPatil well yesterday way late in the night i couldn't bind Enter key in `tkinter. Whatever I tried, it just didn't work. You know what was the problem? I didn't effing called the damn binding method anywhere in my code!
I guess that tops anything in a dumb errors category
 
One time I spent an entire week debugging my program because I opened a file in "r" mode instead of "rb". One keypress fixed it.
5
 
One time at band camp.....
 
@DirtyPenguin I can't reproduce your issue. Running coverage on that example shows 100% coverage.
 
@davidism Hmm, this is the output when I run coverage:
c:\coverage_test_tmp>coverage report -m foo.py
Name     Stmts   Miss  Cover   Missing
--------------------------------------
foo.py       3      1    67%   3
 
This is the second question today where I wished that the community had a standard system for replicating environments more complicated than just one source file. Wouldn't it be cool if you could fetch Dirty Penguin's exact project directory with a single button click? Python IDEs, please implement an "export" option that does this, TIA
 
3:28 PM
That would be terrifying.
 
Making it free from security holes is beyond my meager powers, but I don't think it's impossible
 
I could push this to github :p
but in all seriousness, my folder only has foo.py and test_foo.py, both of which I've pasted in the link earlier.
 
I was just about to say "github kinda does this but I'm imagining something that doesn't require an external host"
 
@davidism I actually don't know if terrifying means 'good' or 'bad' in this context.
 
Yes.
 
3:29 PM
haha
i guess a more general question is, should class attributes be tested at all?
 
Sure, why not?
You should test the things you want tested.
 
but wouldn't that be like testing a constant?
perhaps I'm incorrectly assuming that constants shouldn't be tested
 
I'll re-emphasize that - "You should test the things you want tested"
 
I don't see anything wrong with being more paranoid than necessary when it comes to testing ;-)
assert GRAVITY == 9.8 will make sure none of your descendants will change your important magic numbers
 
i'll rephrase my question "what is the best practice with regards to testing constants"?
 
3:37 PM
No clue my dude but we have three votes for "do it if you want" so at least in this miniature ecosystem the direction of the wind seems clear
 
ok cool
thank you fellow pythonistas :)
 
hmm having a brain fart atm, working with a dictionary having a key defined range. for example maybe having a dictionary defined as {range(0,6):0, range(6,10):1} is there a quick way to get the value 0 for the given key 2 (since 2 is with in range of 0-5, therefore the value is 0). I know you can generate the key values while checking the range before adding to the dictionary, but that creates duplicate values and was hoping to avoid creating a massive "key list".
Is there a better way than: repl.it/repls/PositiveTrimDeals , I'm not happy with having to loop through each keys to find the key my input belongs too..
 
I don't think a dict is a good match for this.
 
I didn't think so either, but I was just wondering if I'm over seeing something within this constraint, (other than the massive fact of I should use a basic if statement or what not.)
 
Either you generate key values for every int in the range, which is O(total_size_of_all_ranges), or you iterate through every range during lookup, which is O(number of ranges). Neither is particularly attractive for largeish data.
 
3:46 PM
key // 6
For that particular dictionary
 
well it's an example Vault, :P of course it scales and different keys
 
Perhaps a 1d quadtree? Then you'd have, uh... O(log(total_size_of_all_ranges)) lookup and O(1) setitem
Or something.
 
and that goes into the range of not worth the effort for what an if statement / math based solution can provide lol
 
Do the ranges ever overlap? I don't think it matters for the quadtree approach, but it might matter for other approaches.
 
no range will never over lap
 
3:47 PM
@MooingRawr that should work for sequential ranges mapping to sequential values
 
it's always one or another, if it's below 0 it will be something, if it's past our range it will be the same value as below 0
so i can use a default dict / else to cover that much
@vaultah but what if i have multiple ranges and they aren't equal in size ?
idk I'm beginning to think this isn't worth thinking about :P (it's nothing practical just theory)
 
@MooingRawr yeah, I assumed that all the ranges have the same size
Can I have a mountaineering metaphor for what I just did, please? :D
 
It's like you've plan to hike a slight steady incline up a hill in the back country, only to realized the sign lied and you've been on the path to climb a mountain instead.
or something like that
 
If I'd come to EuroPython or PyCon UK, I might bring one or two of these:
 
4:10 PM
@MooingRawr Here is my sloppy implementation of a 1d quadtree. No guarantees to its correctness, but it works on your input.
You can't delete items from it and you have to specify a range that all your other ranges will fall in, but it's fast and works with overlapping ranges
 
hey guys
 
interest, thanks Kevin,
\o cbg Andy
 
stackoverflow.com/a/35287351/2301450 yet another alternative solution
 
Hmm, if overlapping can absolutely never occur, maybe you could get O(log(n)) access if you just do a binary search on a list of tuples-of-ranges-and-values
Ah, vaultah beat me to it
 
@MooingRawr sup man?
 
jjj
4:24 PM
recbg peoples
@Kevin I downloaded your minesweeper clone, it looks nice but, uhmm, is it playable on osx? Becuase I couldn't figure out how to mark mines (ctrl+click wouldn't work)
 
Does right clicking work? Do osx mouses have right mouse buttons?
 
DSM
Do Macs even have mice these days? Or do you just wave your hand in front of the camera?
 
jjj
4:39 PM
:) right click is usually ctrl+click, and this doesn't work.
 
Well if you want to integrate support for that into stateView.clicked that would be keen
 
jjj
sure (some day ;) )
 
DSM
@Kevin: could you rename your .PNG files to .png? Some of us use case-sensitive filesystems. ;-)
 
Is there any easy way to crop a line plot to fit the size of a contour plot?
i tried masking the line plot data using the dimensions of the contour, but its not square, so it cant just mask or i'll have x,y data that isnt the same dimensionality
 
@DSM Not without wrecking the file history. I never figured out how to rename files such that git knows what happened.
 
DSM
4:54 PM
I don't think you can. You either use the handwavy follow stuff or you have to rewrite all of history.
(Disclaimer: not a git expert)
 
@jjj
i think you can just enable right click in the settings
 
jjj
you mean osx settings? or Kevins' minesweeper settings?
@DSM I feel I should say it: I'm a proud linux user at home :P (and yes I wanted to slack a bit during work time)
 
i use right click on my mac all the time, im pretty sure you can just enable it under the osx settings
 
jjj
Oh, yes. But unfortunately my mac-mouse has only one button.
 
if its a magic mouse itll still work
 
jjj
5:06 PM
wow, didn't know about that. Thanks. But this doesn't help with the game sadly.
 
@DSM Welp, I tried and failed. I thought git mv 1.PNG 1.png would be a slam dunk but my history got obliterated. Oh well
 
DSM
Oh noes! That's what I meant by "I don't think you can [rename files such that git knows what happened]". Git follow helps a little, but can be fooled.
 
git status showed renamed: images/1.PNG -> images/1.png so I figured the right hand knew what the left was doing, but nope
 
DSM
I'll go have a turkey wrap in solidarity with your difficulties.
 
Play me a nocturne on the world's smallest violin to commemorate this nanoTragedy
 
5:11 PM
really dumb python question: how do i find the shortest of 2 lists? i tried min([a,b], key=len) where a and b are lists but it did not work
 
Strange, works on my machine:
>>> a = [1,2,3]
>>> b = [1,2]
>>> min([a,b], key=len)
[1, 2]
Make sure you didn't overwrite your min or len functions
 
huh. so it must be something else wrong then
oh wonder if its because they are np arrays
ah swapping len for np.size worked haha
 
wim
@Aran-Fey You got it
getting there via attribute access on a literal is how I had in mind. And I can't think of a way to make the puzzle any more difficult currently.
 
jjj
5:31 PM
^nice puzzle, I like it
 
5:57 PM
cbg
 
user4229770
Guys what do You think, is django worth learning ?
 
Yeah. Go ahead and learn it.
 
user4229770
Kevin, I am considering to move from c# to python...
 
Ok, do that.
 
user4229770
I mean job
 
6:05 PM
@Marius Nah, unless it's a job requirement
 
Hey! Anyone here used plotly before? I'm struggling a bit with adding multiple traces that are functions of a slider value
 
DO IT!
django is great!
 
user4229770
@Code-Apprentice Thanks man, main reason why I would switch to Python a job, because I find Python persons are more passionate about programming, well in my area.
 
sounds good
find a meetup in your area and attend regularly. You will learn a lot and meet people.
 
user4229770
Yeah, that's a good idea :)
 
6:19 PM
**Using plotly**
I'm struggling a bit to create this https://pastebin.com/mLTkauDy to work with a slider with the deposit being the sliding variable
Here is the other function used in that piece of code https://pastebin.com/HyjWkSDr
I hacked together this https://pastebin.com/tmb2mBYX
Now I just need to get it working for multiple traces (the "terms")...
This is my attempt, but it fails https://pastebin.com/S2frx8DW

Anyone that can assist?
 
wim
6:30 PM
@Marius If you're interested in web development, definitely
It's probably the most popular and widely used Python web framework
@Kevin what does git mv not do that it should do?
I never had any issue with it ...
 
It doesn't show me the three commits I made to github.com/kms70847/Minesweeper/commits/master/images/1.png prior to renaming it from 1.PNG
"It" here actually referring to "Github", not "git mv", but git mv is ultimately responsible by my reckoning
 
recbg
 
cbg @AndrasDeak
@Kevin I bet that's actually a github issue
oh huh. Nope
 
@Kevin How are you viewing the change history of the renamed file? Did you try git log --follow?
 
6:44 PM
@Kevin you're supposed to hate it
also happy belated birthday (h/t DSM) :)
 
so - git log -- 1.png will show the single commit
git log --follow 1.png shows the full history
 
@Mierzen I tried looking at plotly once for a question on SO, it seemed to me that their documentation was accidentally replaced by PR Division Weekly Newsletter
it was very pretty, very fancy, no actual information on how to use
 
Yeah that's something I'm finding a bit frustrating. The documentation isn't really comprehensive
 
So why use plotly?
Oh, sliders and stuff. Those are probably suboptimally appealing in matplotlib
 
Using it for interactive charts. Want to use a slider to change a parameter's value as input to a function
I got it working for one line, now i just need to get it to work for more lines on the same chart
 
6:56 PM
matplotlib can do widgets, but I guess they aren't that pretty (at least by default, I only have cursory experience with them)
 
@Kevin looks to me like GitHub runs git log -- 1.png and not git log --follow 1.png.
 
I'm growing increasingly sure that this conversation has occurred before, many moons ago
 
I have the memory of a goldfish
 
@Marius Even if you don't want to go into proper web development, I've found myself using Django and Flask in loads of situations just to slap a front end on things
@Marius A good example was a vehicle routing system I was working on. It worked just fine (our problems were in Operations) but it was just a load of JSON flying around some backend systems. No less than 6 companies were entertained by the CEO with flashy front-ends. Their system was identical, and would suffer the same issues, but it was a major selling point. In the end, I learned Django purely to get some interactive maps for our system.
@Marius no more 3rd Party nonsense
 
I don't think you need to ping him so much unless they are directed replies
 
7:05 PM
Fair enough, habit sorry
 
user4229770
It is fine, I do not mind :) Thanks @roganjosh
 
sure:)
 
user4229770
At least pinging sound is not annoying :D
 
But yeah, even if you have a crude understanding of Django it's enough to start throwing data into a browser and using some really fancy JavaScript libraries on it.
 
user4229770
What JavaScript libraries are you using ? :)
 
7:08 PM
For plots, plotlyjs, for vehicle routing LeafletRoutingMachine
In Analytics and Data Science, the ability to throw outputs into an interactive browser gives major traction when working with staff/management outside of Tech
Even if that site would be torn apart in seconds if it was ever exposed to the internet
 
user4229770
Never used any of these libraries
 
Hey, someone experienced with sqlalchemy (or orms in general)? - What is better usage: to constantly create new sessions or to keep reusing old sessions?
 
You probably wouldn't have. For vehicle routing though, we had a fleet of 100+ vehicles with their routes solved every day and to be able to create a map showing the exact route of every vehicle with markers for each stop was amazing... I don't know how you'd get something like that in Python alone
Although maybe plotlyjs, that's pretty cool and general-purpose :)
 
7:28 PM
@paul23 flask-sqlalchemy takes care of that for you
presumably if you're not using django then you're using flask, anyway :D
 
@WayneWerner not using flask (it's not a webserver)
The python application is actually a persistent process spawned by my webserver.
 
then I'd probably keep a session open the whole time the process is running
 
It relates to "flask-sqlalchemy takes care of that for you"
 
I was thinking of the wrong kind of session sorry
 
np lol, no need to feel sorry - others might be confused too.
 
7:41 PM
cbg
I'm seeing "from tkinter import *" in a couple of different tutorials - is this normal, or is there a better way? I was under the impression import * was semi-verboten?
 
It is. The majority of tkinter tutorials are written by newbies copying other tutorials written by newbies
import tkinter will do. If you don't like prepending all your names with tkinter., then from tkinter import [all the things you want to use go here] will do
 
Or import tkinter as tk
 
Yeah.
 
wim
@user2357112 you around?
 
so unfortunately some newbies get to write official documentation complete with star imports ;)
 
wim
7:56 PM
@Kevin Can you reproduce it with an actual source file, not a .png?
 
@AndrasDeak On the main documentation it has that. smh thats not good.
 
wim
the way git handles renames is kinda special
This answer is a bit misleading. Git does "detect renames," but very late in the game; the question is asking how you ensure Git tracks renames, and someone reading this can easily infer that Git detects them automatically for you and makes note of it. It does not. Git has no real handling of renames, and instead there are merge/log tools that attempt to figure out what happened - and rarely get it right. Linus has a mistaken but vehement argument as to why git should never just do it the right way and track renames explicitly. So, we're stuck here. — Chris Moschini Apr 10 '14 at 18:19
on a related note, if you're storing binaries and static .png files in version control, you're doing git wrong in the first place
 
how would you store those with a project?
 
Well I'm not going to force my users to download the source from one place and the pictures from another if that's what you're saying
 
wim
your users don't necessarily do that.
you need some kind of make or installation that knows how/where to collect static
and (ab)using the vcs for this is not the right approach
 
8:02 PM
I'm not going to pay for web hosting when Github is free, if that's what you're saying
 
wim
github is not for hosting your static content
for one thing, if you abuse this too much it can really slows down git
"I don't care enough to do it properly" is a lame excuse :P
 
When github bans the uploading of .png files, I will nod and say "this is perfectly within their rights and mission statement" but until such time as that occurs I will continue to abuse 500 kb worth of their good faith
 
I'm actually using a svg as documentation
I find a flowchart is often better documentation of a full program than textual descriptions.
 
8:37 PM
@Aran-Fey This I like better. Thanks @Kevin, that's what I expected.
 
00:00 - 21:0021:00 - 00:00

« first day (2693 days earlier)      last day (2245 days later) »