« first day (2532 days earlier)      last day (2641 days later) » 
01:00 - 18:0018:00 - 00:00

01:01
dododo
 
1 hour later…
02:24
Hey! Quick packaging question.
I have a setup.py script that I use with bdist to compile an executable and publish it to my organization's private pypi index. I want it to run on both macOS and Linux.
It builds just fine. I uploaded it with python setup.py bdist upload -r our-index after building on both macOS and Linux
now the index has two packages: foo-0.0.1.linux-x86_64.tar.gz and foo-0.0.1.macosx-10.12-intel.tar.gz
but I'm having issues using my foo package in other packages' setup.py's install_requires.
I have a package that says install_requires=['foo>=0.0.1,==0.*']
that seems to work for our non-bdist packages, but for this foo package, I get this:
oh, hang on.
Ok. My install_requires was like ['foo>=0.0.1,==0.*' 'bar>=1.0.2,==1.*'] (missing comma) and python concatenated the two, so of course that didn't work. :D
But it still doesn't work with that fixed, so I still have a case. :D
so I'm trying to install this bar package using pip install --upgrade . that depends on the foo package and I get this:
Could not find a version that satisfies the requirement foo==0.*,>=0.0.1 (from bar==1.6.12) (from versions: 0.0.1.linux-x86_64, 0.0.1.macosx-10.12-intel)
No matching distribution found for foo==0.*,>=0.0.1 (from bar==1.6.12)
I figure that it has to do with the trailing platform name, but I don't know what to do about it. What am I doing wrong?
 
3 hours later…
05:44
can someone help me login to sftp.mcxindia.com
I found out the div for user id and password field
<div class="username" id="UserNameID" style="visibility: visible;"><span class="fieldname">Login ID:</span><span class="fieldinput"><span id="UserNameInput"><span id="user" class="aw-system-control aw-item-control aw-ui-input aw-input-box "  title="" oncontextmenu="return false" onselectstart="return false" onactivate="AW(this,event)"><span id="user-box" class="aw-item-box "><span id="user-box-image" class="aw-item-image aw-image-none ">
06:21
hiya
anyone have a good one-liner to generate a [thing, thing_2, thing_3, thing_4, ...] sequence?
what im trying to do is `next(filter(validate, sequence))`
validate would be `username_available(str)`
of course i can do it with a `while True: break`
wondering if theres a more pythonic, more functional solution
06:39
Hey! Anyone with pygal experience? How do I label the subcategories in a multi-series pie pygal.org/en/stable/documentation/types/…
@wim All it'd say is that you shouldn't because it violates the Liskov Substitution Principle. Which one of the answers there already states.
06:54
cbg
07:35
cbg
@zneak * doesn't work in versions afaik.
@zneak ah it too does python.org/dev/peps/pep-0440
@zneak yeah, you really cannot do 2 sources in PyPI like that...
.tar.gz isn't a bdist either
jjj
jjj
cbg
07:55
@AnttiHaapala, what do you mean with "two sources"?
also, ".tar.gz isn't a bdist" => any idea on how that's what the stock python setup.py bdist upload generated then?
docs.python.org/2/distutils/builtdist.html calls the tar format a "dumb bdist"
with all that said, of course there has to be something that I'm doing wrong, because otherwise it would work and I wouldn't be here. But beyond pointing out what doesn't work, I'd be super happy if there was a solution that I could use to distribute platform-specific binary files with my Python packages. I can't be the first person to have this problem.
How do I get this to work?
karee = {'K3 compressors': 'a a a',
'K4 compressors': ['bbb', 'c cc', 'dd d']}
for k,v in karee.items():
tag_list = list(v)
for t in tag_list:
print(t)

I want the first one to print as "a a a"
just to confirm, but you know that list('a a a') is ['a', ' ', 'a', ' ', 'a'] and not ['a', 'a', 'a'] right?
I want to create a function that adds items together. If there is only one, it should just add that one.
I'm using strings, as I will use those strings to refer to pandas dataframe columns
Ahh I got it. This does the trick: tag_list = v if isinstance(v, list) else [v]
08:10
Cabbage
08:45
recbg
@zneak ah.
@zneak you wouldn't want to upload those in PyPI I guess.
Unfortunately the Python documentation itself is kind of out of touch with reality
@zneak the current preferred binary format are the wheels or whl
cbg @HieuNguyen
Hi
Traceback (most recent call last):
  File "recognitionScript.py", line 89, in <module>
    reps = getRep(imgFrame=imgFrame,  multiple=False)
TypeError: getRep() takes at least 2 arguments (2 given)
    while(True):
        ret, imgFrame = cap.read()
        cv2.imshow('frame',imgFrame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

        reps = getRep(imgFrame=imgFrame,  multiple=False)
def getRep(self, imgFrame, multiple=False):
    bgrImg = imgFrame.copy()
@LandonZeKepitelOfGreytBritn I guess you've got an old python version.
@AnttiHaapala yes I know, but that's the one I need
08:54
cbg
@HieuNguyen o\
@LandonZeKepitelOfGreytBritn I mean the old python version doesn't produce a helpful error message
@AnttiHaapala okay
But I see what the error is, based on what it complained about
but idk how to solve this
>>> def getRep(self, imgFrame, multiple=False):
...     pass
...
>>> getRep(imgFrame='frame',  multiple=False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: getRep() missing 1 required positional argument: 'self'
this is the error message on Python 3.6
Your method has self as if it was a method in a class...
but it isn't in one.
I guess just removing the self would fix the problem.
Oh yes right!
I only have to use the keyword "self" when it is inside a class!
08:58
upgrading to python 3.6 suggested ;)
Which is not my case
Thanks!
@AnttiHaapala The opensource framework I use needs python2
there have been quite a many improvements in error messages and so on...
@LandonZeKepitelOfGreytBritn which one is that?
@AnttiHaapala it s called openface
some opensource project
@LandonZeKepitelOfGreytBritn you pasted the same msg to me twice, about C++ :D
Though I'd agree with the first comment...
> No. The rule of thumb is don't ever call yourself a c++ expert.
@AnttiHaapala yhea the last link is just a link to the first comment, while the former is a link to the entire discussion
09:05
if you want to be a C++ expert, first you must be at least C-level expert on the undefined behaviour
09:20
@LandonZeKepitelOfGreytBritn self is not a keyword
09:35
>>> class Foo:
...     def bar(jimmy_jim,val):
...         print(f'I am {jimmy_jim} and I got {val}')
...
>>> Foo().bar(42)
I am <__main__.Foo object at 0x7fccf0429c50> and I got 42
10:24
format strings are great
do you have any idea guys when will they get ported to python 2.7? ( ͡° ͜ʖ ͡°)
In 2020
For Python 2.8
April 1st, 2020
according to some from the JS room
which sounds plausible
seems legit to me
I wish Python’s format strings worked like C#’s though
by format strings i meant this f' string thing
I know
10:31
does c# even has it?
C# has interpolated strings, which work with $"…" (instead of Python’s f"…")
does it make an object instead of a string?
yea...
we need that in python. I call them i'strings'
And in C# $"foo {bar} baz" is actually a FormattableString:
FormattableString foo = $"foo {bar} baz";
foo.Format // => "foo {0} baz"
foo.GetArgument(0) // the value of `bar`
yeah that can be useful sometimes
10:34
That FormattableString has an implicit type conversion to string, so you can use it anywhere a normal string is used, and its ToString() basically just formats that string, so it does what you would expect.
But having the FormattableString as a separate type allows nice things.
write to csv using pandas is much more easy
For example, the new EntityFramework (the ORM) allows you to write SQL queries that way: $"SELECT * FROM table WHERE col = {foo}" gets then turned into "SELECT * FROM table WHERE col = @p1" with { p1 = foo } as arguments.
So you get automatically parameterized SQL queries
(Maybe you can tell, I was super excited when I found out about this)
@poke so let's write a pep
you can do a similar thing with JavaScript
ok!
10:43
@AnttiHaapala :(
But it seems that the discussion focuses on the JS syntax (haven’t read everything)? Maybe we can still go the C# route that would not change the syntax but only the semantics?
@poke it could be possible yes...
would that be a bit messy though? it would need to be a string subclass...
jjj
jjj
Anyone has any idea why is Guido against?
guido is always against anything that is too handy :D
but somewhat obscure :d
there are a lot of libs for templating
i guess he wants to keep core of the language small and tidy
although its really cool feature
jjj
jjj
I kinda like this approach, but I understand this can kill the fun sometimes :)
11:05
@AnttiHaapala Yeah, the type system would make this a bit complicated since Python has no type conversion :/
@SohaibAsif Oh, I remember that!
11:23
Oh, I made the mistake to read that HN…
People are terrible.
“Here’s a wild claim” – “insert argument or follow-up question” – *tumbleweed rolling through the screen*
> This is a cute pet project for naftaliharris , and he can be only wished best of luck with it, and so far he chose the right name for the project: "placeholder" is confusing, but the whole project is confusing, so naming is on par.
lol
Strings are things you can display to a human.
11:55
> > Unlike 2.7 code, Python 2.8 wouldn't be able to guarantee exact 3.x compatibility, since there are some python scripts that will run under both Python 2.7 and Python 3.x but produce different output, and Python 2.8 chooses the 2.7 behavior in these cases.

> What a terrible, terrible situation. Now you'll have "python" code that will neither run on 2.7 nor run compliantly on 3.x. As for the latter, please explain how that will alleviate anything on the following point, since behaviour at runtime will be subtly different:
cbg
Does anyone know how to make and edit shortcuts in Python?
what shortcuts?
useful ones
Like shortcuts on your desktop
Do you know how to make them?
Cos I am trying to make a new python script for that
shortcut on windows is a file with *.ink extension as far I know
or lnk, whatever
12:03
Yeah, I need to know how to make new ones and edit them
It's for a game. Well Technical it will be a service for a game
call this command using subprocess
That's not what I want... (I think)
I would like python to make them it self
I just don't understand this ^
Anyways gtg
12:23
Hi everybody


How can I use python and openCV in mono develop on ubuntu?
You can use them however you like.
jjj
jjj
@Ahadaghapour I guess what Kevin is trying to say is that you should be more specific if you want someone to answer
Sure, that's one way of looking at it.
@jjj I want to use OpenCV and python in my monodevelop project
in linux
That's not so much being more specific as it is taking the words in your original question and putting them in a different order.
When we ask for more detail it's not because we're playing a cruel game where we already know the answer and we want to make you put forth pointless effort, which you can circumvent just by changing your sentence around a little bit. We really can't answer your question until we know what the question is.
12:34
should I use Emgucv(openCv wrapper) in monodevelop?
ok, let me explain my question
I want to use python and opencv in ubuntu with GUI
then Tkinter is old and not good to design Gui
"Monodevelop" sounds like a .net-on-linux kind of thing, which I don't think you need if using Python or OpenCV on ubuntu
then I thinking about to move monodelvelope to design my gui and write my python code in mono
@Ahadaghapour Consider using a different Python-native GUI library, such as PyQt. I suspect that will be easier than bringing in .NET just to use their gui libraries.
Why does no one ever mention wx as a UI lib any more?
Wx slips my memory easily, as I have never used it.
I already have QT in the "GUIs with two-letter names" slot in my brain and there's no room for anything else
12:41
@Kevin Yes, I try to do that, in Qt designer I designed a *.ui file and then try to convert it to python file with pyuic.bat dll
And I guess Kivy is the new hotness, though I stubbed my toe on it when I tried installing so I went on to something else.
@Ahadaghapour sounds like there is a "but X didn't work" coming
@PaulMcG what do you mean?
You used the word "try" twice in your comment, and it didn't finish with "... and it worked great!"
cbg all
12:45
yes, I get problem to convert it to *.py file
but I will solve it
Those are the kind of specific questions that we are better at than a broad one like your first post. Try making a simple simple simple UI first, like just a single input field, and take that through your full conversion process. Then start adding complexity a bit at a time toward your desired app. This will help you deal with small problems one or two at a time, instead of a tangle of two dozen problem that all amplify each other.
If all else fails, you can always give up and try a non-Tkinter non-QT GUI
Three cheers for more than one way to do things!
Or separate your function from your UI (probably a good idea anyway), and try driving it just from the command line first.
13:03
Has anyone here dabbled with Processing? Its default/initial implementation was Java, but they have incorporated a Python mode into their shipped development environment (uses Jython to leverage the core Processing Java libs).
I've seen a bit of Processing's output - it looked fun! Never coded stuff with it though
I dipped my toe in a while back since there were so many demos that looked exactly like the kind of weird geometrical nonsense I like to make. My impression was that it was probably nice, but I never got around to digging deep enough to see if there were any toys that would give me more power than just doing everything manually with PIL and ImageMagick
It seems extremely likely to me that those toys exist, I just didn't look very hard.
hello anyone can help me to update mysql one json field with python??
sql="UPDATE tt_table SET refresh_dtls = " + JSON_SET(refresh_dtls, '{"elb":"name2","last_refreshtime":' + str(last_time) + '}') + +' where id = 1;'
cursor.execute(sql)
my cod above trying..getting error JSON_SET not defined
I can see how that would be a problem - what is JSON_SET supposed to be?
My uninformed wild guess is that JSON_SET is a SQL function and not a Python function.
If so, then you can only call it from inside a string literal
13:08
here tt_table is my table name..last time is the updated variable ..suppose last_time=30 earlier ..now want to update with last_time=100
refresh_dtls is my field name
i don't know PaulMcG what it menas..absolute new to mysql..
JSON_SET
CONNECTING WITH MYMYSQL
pymysql
sorry
If you don't know what it means, where did you get the idea to use it? From a tutorial or StackOverflow post, perhaps? Got a link? Maybe we can figure out its proper usage from context.
Googling for "mysql json_set example" turns up this: dev.mysql.com/doc/refman/5.7/en/…
i read this doc..there are JSON_REPLACE also we can use in the place of JSON SET
SAME ISSUE WILL ARRISE
FYI you can edit your chat messages for a minute or two after sending them, if you want to correct things such as capitalization problems.
2
A: inserting json to mysql using python

Kishor KundanYou have missed the quote around last_time Correct the line with cursore.execute to cursor.execute(sql, ('2','elb','{"vot": [{"elb":"name1","last_refreshtime":' + last_time + '}, {"elb":"name2","last_refreshtime":' + last_time+ '}]}')) To avoid such issues in future, you might con...

check this link..i asked today..u can see from the photo there my exact output
jjj
jjj
13:15
Wow, this Processing thingy looks so great, thanks for sharing
I am now 99% confident in my previous assessment. You can only call JSON_SET from inside a string.
from the photo u see my refresh_dtls field have last_refresh time..2344..i want to update that 2344 to some new suppose 10000
ok kevin let me try
@Bhaskar - you need to have a clear understanding of which is python and which is SQL, and when you are building a SQL statement using concatenation (which is some bad advice you were given, by the way), which parts are SQL and which are python.
ya true PaulMcG
I can see that..
13:19
\o cbg
Since you are absolutely new to mysql, can I suggest you start with a table that has just one integer key and one character field, and learn how to CRUD that (Create/Read/Update/Delete). You should learn how to build a SQL statement with ? place holders, which you then pass as additional arguments to cursor.execute. Then add your JSON field to this little table, and work through the CRUD process again. But do not use string concatenation to build up your SQL statements! Use ?s.
@MooingRawr what u mena
mean
He was just saying "hello" in the chosen salad-oriented patois of this chat room
ok thanks @PaulMcG for ur advice..
oh sorry i am unaware salad-oriented patois rule :-)
13:31
It looks like these JSON_XXX functions are the way to store and update documents in your mysql tables, like you would use a document db like MongoDB
yes..i can either use JSON_SET OR JSON_REPLACE in my case..
but both getting same issue..
trying
cabbage
stackoverflow.com/q/46344722 recommendation / too broad
ugh, I feel like has been worse than usual lately
13:50
@bhaskar Looking further at the mysql docs, it looks like they use %s placeholders, not ?s. The point is, avoid using Python string operations to insert values into your SQL statements, and use placeholders and cursor.execute args instead
ok @PaulMcG GOOD ADVICE
stop shouting
@davidism what's wrong
The problem is that you keep sending messages written in all capital letters. All-cap messages are typically interpreted as yelling, which is impolite.
ok..sorry guys..i didn't knew it..
14:39
If we've got a dupe target for "after I append this mutable object multiple times to a list, why does mutating one instance mutate them all?", this could use it
@Kevin perhaps the one about mutating matrices?
bit specific though
14:58
Andras I looked up the lyrics yesterday night. You were right soul crushing.... :\ Ended up listening to Yui - Again for the drive in today :D
but it's just so beautiful :)
together with the sound
it was quite powerful when I noticed the lyrics when I was watching the anime for the first time
well, I understood very little, but enough to realize that I should google the lyrics ;)
wim
wim
15:10
has anyone noticed that SQL programmers like to shout a lot
4
15:20
morning cabbage
@wim SELECT 'WHAAAT???' FROM DUAL;
jjj
jjj
15:38
@AndrasDeak what anime is this?
Btw. I was never curious enough to check, but arent ALL_CAPS the correct style for SQL programming?
define correct. and AD was talking about Full Metal Alchemist
First google result for "sql style guidelines" says "Always use uppercase for the reserved keywords like SELECT and WHERE".
I doubt that this is an "official" document but at least it demonstrates that at least one conscientious non-crackpot SQL user thinks that this is a valid style
jjj
jjj
yeah, thats what I suspected. @MooingRawr thanks!
If by correct you mean generally accepted by community sure. If you mean that it's the syntax, then no it's not...
Curious that that page suggests lowercase for column names but doesn't say anything one way or the other for table names
15:47
Misclicked and wasted my vote :/
At a glance it looks like all of his example table names are lowercase
TLDR: caps for keywords, lowercase everywhere else
@jjj Fullmetal Alchemist
...as MooingRawr already explained, sorry
@vaultah no close vote is wasted until you retract it :P
jjj
jjj
yes, but thank you too :)
@AndrasDeak "but who the yam voted to close this as a tool request???"
meh, once it gets closed that info is lost
16:11
cabbage, @jsbueno
If I have two parametrized pytest fixtures, will the resulting tests be run against all combinations of those fixtures (i.e. a cross product)?
@Code-Apprentice I'd think so
hrmm....that's not what I want in this situation ;-(
ATM, I have a fixture with a list of dicts as its params. The problem is that some of the elements of the dict need to be optional.
time to make an MCVE, me thinks...
In today's news, my lead decided to wear pants to the office today.
@Code-Apprentice normally he doesnt?
nope
interesting that you assumed "my lead" refers to a "he" =p
16:23
its good to wear underwear, healthy
in this case the assumption is correct.
He usually wears shorts. But it has been much colder here the last week or so.
he sleeps in the office?
not that I know
but then I leave at a reasonable time each day, so who knows?
wim
wim
ugh, I'm struggling to explain the test to this guy
he keeps insisting that I should be asserting on the exception message
Who's good in person-to-person communication, does anyone have a better suggestion for how I can describe the requirement?
@wim "not get working properly" isn't a proper problem description though!
16:48
@wim what if you would mock logger object and after app.potato() check assert_called_once_with('Unhandled exception', ...) ?
@AnttiHaapala that is serious
17:03
@AnttiHaapala interesting
Never heard of that
Coconut seems a better solution to version stuff than Python 2.8, providing you were already using it :)
The Internet has ruined me -- every time I see the word coconut, I think of that stupid "NUT" button meme
Coco (NUT)
I dont really get the idea of this coconut
why someone invested so much time to do something like that
@marxin that question is way too vague. What specifically do you think makes it not worth making?
I can give personal testimony that you do not need to have a practical objective in mind to make a programming language.
17:11
I think having a custom grammar, for example replacing lambda x: x**2 with x -> x ** 2 is quite strange
@Kevin as soon as KS 0.1 is done we are promoting the hell out of it at trade shows until the corporates start biting with giant licence fees
it reminds me someone who has other language in mind but HAS to use python and then he comes up with solution like this
Marketing tip: always multiply the real version number by 20 when you're publishing it
I would really want to know what is an advantage of this syntax, if it ever makes a single person in the world more productive than when using pure python
@marxin lambda: is very noisy.
it is the only thing there that is pure sugar
17:16
and if you're being cool and functional you don't need to say "lambda", it goes without saying
Sep 29 '16 at 16:41, by Kevin
Nov 2 '15 at 20:36, by Kevin
Python devs, please integrate "λ" as a keyword, thanks in advance
yeah, I'd accept that too
Please integrate reverse "shiot" as a keyword?
I got to use λ as an identifier in this parsing question: stackoverflow.com/questions/44912212/…
17:34
I was just now trying to figure out if there was a keyboard shortcut in Windows that inserts λ without me having to google "unicode lambda" every time. I knew that some symbols have shortcuts; for example, © is Alt-0169. So in principle it's possible. fileformat.info/info/unicode/char/03bb/index.htm says that the shortcut is Alt - plus key on the num pad - 03BB. But when I try that, when I press "B" it just opens the Firefox bookmarks menu.
Conclusion: Windows is dumb.
try alt+955 or maybe alt+0955
Tried 'em, they give me » and ╗ respectively
now that I find weird
fileformat.info/tip/microsoft/enter_unicode.htm suggests that I may need to alter a value in my registry, which is Next Level Dumb.
might actually be a windows thing
17:37
Can math.π, math.τ and math.φ be far behind? Or Σ as synonym for sum?
They can, should, and must.
01:00 - 18:0018:00 - 00:00

« first day (2532 days earlier)      last day (2641 days later) »