« first day (3712 days earlier)      last day (1237 days later) » 

1:07 AM
This was a rather fun exercise to figure out what happens under the hood of name resolutions for __init__.py stackoverflow.com/questions/65282049/…
nerd sniped so much that I forgot lunch
 
1:20 AM
Ha, that one threw me for a loop as well. Spent hours trying to figure it out, and then in hindsight it's so obvious :D
 
haha yeah exactly how I felt after staring at it for about 10 minutes
at least now we hope this might become a future canonical thread when we get dupes
 
2:10 AM
o.O
 
2:41 AM
questions that ask about how python works should be tagged , because those are usually interesting
(not to be confused with posts that ask about how metaclasses work)
 
3:27 AM
Just curious for the mods...is there an appeal process for a question being closed as duplicate? I had a question which a *subsequent* question referenced (saying it wasn't a dupe of my question), and one of the answerers of my Q marked mine as a dupe of the later Q. I don't care about the rep, it just seems...not correct, considering the timeline. Also, I believe they're not dupes, as my Q didn't involve improving/invalidating old data as much as adding correct data.
https://meta.stackoverflow.com/questions/348859/should-i-edit-or-delete-when-original-question-had-wrong-code?noredirect=1#c
Yes, I was...naiive then. I guess I'm just wondering the appeal process if the OP is not me, but someone new and the Q is on topic/relavent etc. Also how can a later Q be a dupe, that's like saying I look like my son (rather than him looking like me).
 
not sure if this would help, but one of my Q was marked as a dupe and a high rep user later removed that, afaik he was not a mod
I didnt appeal, he must have realized it just wasnt a dupe
 
 
1 hour later…
4:59 AM
@toonarmycaptain there is no requirement that the one closed (and removed) would be have to be the new one.
 
@AnttiHaapala Fair enough, just seems odd 3-4 years later
 
5:48 AM
so can you provide a link to your question? You still have it somewhere in history?
 
 
1 hour later…
6:49 AM
@Kevin Just saw your old 2018-11-29 post. It's counterintuitive that the OEIS formula uses ceil((1 + sum of preceding terms)/2) rather than floor(), isn't it?
 
7:37 AM
i dont know the context, but the two dont behave the same across all possibilities. for example, if sum of preceding terms is 10, then the function you wrote gives ceil(5.5) as 6, while a floor would have given floor(10/2) so floor(5) (with the assumption that if youre using floor, you dont add the +1)
If instead you were adding the 1 and then doing a floor, it would be easy enough to find another example. The main thing i'm noticing is that the function is essentially ceil(some_value + 0.5)
 
 
2 hours later…
9:39 AM
@cs95 are you recommending to retag interesting questions?
 
9:57 AM
Not all interesting questions are about metapython, but the converse is true, because python is fun to learn!
 
10:23 AM
Isn't that what the is for?
 
10:50 AM
i have two text files f1 and f2 with a number in each line, how can i use filecmp.cmp() to compare those two files and print out the numbers which are unique in f2
 
I guess that is doable with just normal file reading and set comparisons
set(f2.readlines()).difference(f1.readlines()) havent tested this
 
11:08 AM
ok
i got a module named difflib
 
you don't even need the readlines. Just set(f2).difference(f1) works and keeps only the unique elements in memory.
 
laurel, there is always a shorter way in python :D
iterating over a file is something I am aware but can never remember on first try
 
It's one of those things you learn quickly the first time things don't fit into memory. :P
 
11:40 AM
Really stuck on how to achieve the rightmost dataframe
I can repeat a series by doing something like df['Price'].repeat(df['Number of Prices'])
 
11:57 AM
Sorry nvm I got it lol. Simplifying the tables made it easier should've done this earlier lol
s = pd.Series(['can', 'tub', 'bowl'])

df = pd.DataFrame({'Item':['can', 'tub', 'bowl', 'kitten', 'dog', 'squirrel'], 'Price':[500,600,700,200,100,50], 'Number of Prices':[2,3,4,5,6,7]})

df_filtered = df[df['Item'].isin(s)]

df_new = pd.DataFrame()
df_new['Item'] = df_filtered['Item'].repeat(df_filtered['Number of Prices'])
df_new['Product'] = df_filtered['Price'].repeat(df_filtered['Number of Prices'])
 
Gmail and youtube having issues. Wonder if we'll see a spike in support questions on main.
And by "we" I mean other people who look at main
 
2020 is just having a final flex of its muscles
Hangouts are down too, everyone got booted from their meetings
 
yeah, I was trying to upload to Google Drive and the stupid status dashboard was saying everything's fine. </end rant>
 
@shad0w_wa1k3r ha, right
 
user13727121
hello :) just starting to learn Python3 and is currently creating a number guessing game.
 
12:09 PM
@CoreViSional welcome
 
user13727121
sorta stuck on whether or not an Else statement is necessary. I did some research on the web, some people say that it's better to have an Else statement while others say only use it when necessary.
 
@CoreViSional we'll need context with that. I'll go out on a limb and say an empty else serves no purpose.
 
user13727121
is it okay if i post the code here?
 
Saying that "you only need an else statement when it is necessary" is kinda tautological.
 
@CoreViSional you can see our rules here. If it's ~10 lines post it here, otherwise link a code paste site
 
12:24 PM
ooo... just found streamlit - looks like it might be worth a go - see how it compares to dashly/plotly stuff
3
 
How to fix this exception:
discord.errors.DiscordServerError: 500 Internal Server Error (error code: 0): 500: Internal Server Error
Even very simple bot doesn't load:
 
the internet is dying right now. it's kinda exciting!
 
Since the error happens internally in the server... fix the server.
 
so yeah...wait for it to fix itself, that bot error isnt on you right now.
 
I'll refrain from asking for a MCVE.
 
12:27 PM
```
 
miyagi, all discord bots went down i think. at least ours did
 
import asyncio
import discord
from discord.ext import commands

settings = {
...
}

bot = commands.Bot(command_prefix=settings['prefix'])


@bot.command()
async def echo(ctx, arg):
await ctx.send(arg)


bot.run(settings['token'])


import asyncio
import discord
from discord.ext import commands

settings = {
...
}

bot = commands.Bot(command_prefix=settings['prefix'])


@bot.command()
async def echo(ctx, arg):
await ctx.send(arg)


bot.run(settings['token'])
```
 
oh. never mind
 
@ParitoshSingh That still sounds like the servers need fixing. :P
@VictorVosMottor Please take a look at the code formatting guide linked in the room description.
 
user13727121
while guessNum != ranNum and guess_used < attempts:
    guessNum = int(input("Guess a number between 1 and 10: "))
    guess_used += 1
    if guessNum == ranNum:
        print("\nCongratulations, " + name + ", you managed to guessed the number in", guess_used, "tries")
    elif guessNum > ranNum:
        print("Your guessed number is too high. Please try again.\n")
    elif guessNum < ranNum:
        print("Your guessed number is too low. Please try again.\n")

if guess_used > attempts:
    print("No attempts left!")
 
12:29 PM
@MisterMiyagi ah, ok
 
Gmail has come back up for me but with a warning banner. I guess they're mid re-boot. Show's over, I guess :P
 
I saw a tweet saying it was an account issue, YouTube at incognito worked fine for me
my signed in YouTube gave an error
 
From the BBC: "Google has been contacted for comment, but one spokesperson said they were unable to access their email." lol
 
12:44 PM
@roganjosh this is how it ends
dashboard now all-red
@CoreViSional your third case should probably be else
assuming ranNum is an integer
@CoreViSional you might also want to take a look at f-string syntax, that would make building your first output much nicer
 
Hi, I have a very general question which may be closed for being a shopping question if posted on board. I am just curios in what language are GUI features of software like abaqus, csi sap, etabs, autocad, etc are written. I don't mean the GUI of menus, pop ups and drop downs, which can perfectly be coded in TCL or tkinter.
I want to write a very small GUI to receive data from user by drawing details by mouse, rotating sections, seeing a building in the viewer and edit it. I can not find a starting point for this.
 
@EngMyt I don't understand the question. What GUI features are you asking about if not the part that's the actual GUI?
 
user13727121
@AndrasDeak I already tried that, there was a bug in the output. The output will tell the user that their guessing number is too low even though they have won the game after their third tries, which is their last try.
 
@CoreViSional you probably had a different bug. guess_num == ran_num, guess_num < ran_num and guess_num > ran_num cover all possibilities.
also, you might find that most people prefer snake_case rather than camelCase for names in python
 
@AndrasDeak In most of engineering software, when the user opens it; there are some menus which s/he can click on, open windows and enter details like engineering materials, etc. This is very easy to be coded in tkinter or TCL. There is also a drawing area in which the user can see some details being plotted or drawn. The user can see what he is modelling by his eyes. This is what I can not find.
 
user13727121
12:52 PM
while guessNum != ranNum and guess_used < attempts:
    guessNum = int(input("Guess a number between 1 and 10: "))
    guess_used += 1
    if guessNum > ranNum:
        print("Your guessed number is too high. Please try again.\n")
    elif guessNum < ranNum:
        print("Your guessed number is too low. Please try again.\n")

if guessNum == ranNum:
    print("\nCongratulations, " + name + ", you managed to guessed the number in", guess_used, "tries")
    print("The number was", ranNum)
else:
    print("No attempts left!")
 
user13727121
i slightly changed some things in there and it somehow worked now...
 
user13727121
Instead of placing guess_num inside the while loop, I placed it outside because there was another bug where if guess_used > attempts won't display the message
 
user13727121
@AndrasDeak ahh yes, that's another thing which I was wondering, I watched a python tutorial on YouTube, the guy said that it's still alright to use camelCase in Python
 
@CoreViSional pro-tip: don't trust anything anybody says on youtube
@CoreViSional Use official sources as much as possible. Like docs.python.org/3/tutorial if you already know programming. And the official style guide (a bit heavy read in one sitting) is PEP 8.
@EngMyt you mean the core of the software that dozens of developers work on full-time and what the respective companies sell for huge sums?
I might be misunderstanding the question, because right now it sounds like "I want to write a small facebook" except it's not facebook but autocad
 
Hello, I have a short question about machine learning: If, in addition to my main dataset, I have another little dataset of expert opinions on what I'm trying to solve by ML, are there algorithms capable of being influenced by this expert dataset, and if so, how is this process called? This is not bias, is it?
 
1:05 PM
sounds like transfer learning
or are you just talking about about your validation set?
 
No not the validation set, I mean the input set
 
user13727121
@AndrasDeak He explains things clearly with sufficient examples for beginners, it was just me that did not follow the snake_case, Java was my first programming language and I was taught to use camelCase so whenever I hear that "it's alright" to use camelCase in a different programming language, I tend to use it without following the official style guide
 
Thanks I'll look into it
 
user13727121
@AndrasDeak thank you for providing the links, I'll make sure to read through it
 
1:22 PM
@CoreViSional it's alright in the sense that the code will run just fine, but python uses snake_case for everything except ClassNames. If you plan to stick to python, you should probably adopt its standards.
 
@AndrasDeak not the core of the software which does calculations, but the user interface of software like autocad which receives data through the drawings users do and show the users the resulting drawings.
 
user13727121
As a beginner in Python3, should I worry about Docstring? I read some parts about PEP 257 (Docstring Conventions) and the whole things seem like a convention for commenting codes
 
@AndrasDeak no exactly, since I have developed a programming code which does calculations for me perfectly. My problem is that everything is so numerical, solid and descriptive. I want to make a gui for my end user which enables him to draw the geometry of the sections and buildings he wants to do calculations over it. Not a gui which opens some forms. I want the user to be able to draw some shapes like what we have in autocad or any similar software.
 
@CoreViSional That's a weird question. Do you comment your code? If yes, you will need docstrings. If no, you should start commenting your code. So you will still need docstrings. Do you have to respect what PEP257 says? No, hardly anybody does.
 
1:40 PM
perfect question by you @AndrasDeak I was just thinking how to get a formula fitted to some multi-parameter scattered data by python.
111
Q: How can I perform two-dimensional interpolation using scipy?

Andras Deak This Q&A is intended as a canonical(-ish) concerning two-dimensional (and multi-dimensional) interpolation using scipy. There are often questions concerning the basic syntax of various multidimensional interpolation methods, I hope to set these straight too. I have a set of scattered two-dim...

 
user13727121
@Aran-Fey I do, but it's mostly for me to understand the processing steps and so far, I've only been using # to comment on my codes.
 
@CoreViSional yeah, use them to document your functions. When people do help(your_function) interactively they'll see it. Or at worst when they look up your source code they'll see the docstring. IDEs also support viewing docstrings, I bet.
The "how" is less crucial as long as the information is there/
@EngMyt thanks, but that's specifically about 2d interpolation. Sounds like you need 3d for which there's less tooling.
@EngMyt so is your issue the 3d visualization specifically?
 
@AndrasDeak yes, spent some time to study multi-variable curve-fitting and understand how reliable the fitting is.
@AndrasDeak just two-dimensional gui. some people propose opengl features. but I do not think this is what commercial softwares are built upon.
 
@EngMyt no idea
I still don't understand what you're asking, but I wouldn't be the one to be able to answer anyway, so I'll just give up
 
2:11 PM
I guess layman terms, you simply want a paint-like interface for the user, they draw a line, but then that line is understood and converted into numbers and equations/calculations internally, yes?
 
user13727121
@AndrasDeak So basically, # is mostly used to comment out a single line of code or for those who just want to look at your code, whereas triple quotes are used to comment on long and descriptive lines of code and can also turn it into documentation?
 
@CoreViSional no
 
# is for comments (helping developers understand your code), docstrings are for documentation (helping users understand your interface)
 
# are comments, triple-quoted strings are multiline strings. The latter are optimized away unless they are docstrings. This is why some people say you can use them as comments but I've never seen that in the wild and it would be really distracting to me. Docstrings are a special use of strings at the top of a function definition, which serves as a kind of built-in documentation. When you do help(foo) interactively you are shown the docstring of foo assuming it's a function.
 
user13727121
2:39 PM
ooo, i get it now. These explanations are much clearer than the ones I read on Quora.
 
Quora is such a joke
 
@CoreViSional quora is the same quality as youtube tutorials
 
Even worse I'd say
 
user13727121
@Aran-Fey so it is better to use docstring for documentation rather than comment, right? If there's a need to comment, just use #, to help developers understand the code better in particular?
 
yes
 
user13727121
2:42 PM
@AndrasDeak I use both, but I don't really stay on one platform, I only utilize them to get the answer that I want, other than that, I don't use it as the only source to my questions
 
@smci might be able to get away with that in Norway, where it's dark for an entire 6months at a time
 
@CoreViSional Correct. Comments help people who need to read your code. Docstrings help people who need to use your code.
 
user13727121
I'm now learning Python3 on codeacademy because there are some missing tutorials from the one on YouTube. Like formatting the print output and such
 
user13727121
@holdenweb Thank you for the clarification :D
 
@inspectorG4dget why would you hate it, the articles sound so cool :)
 
2:54 PM
@CoreViSional a source that often misleads you is useless until you're good enough to realise that it's misleading
 
@smci was that pun intended, sir?
 
user13727121
3:08 PM
@AndrasDeak that is indeed very true. I'm glad to have found this chatroom because I'm still a Python beginner and oftentimes, I'm confused with the answers posted on other sources. To be honest with you, I did not expect my first chatroom or a place to ask and discuss to be on Stackoverflow because I have applied to join some programming clubs and societies at my University and it has been months now, still there's no response
 
@inspectorG4dget wow, I was wondering what happened to that experiment. Amazing that it seems to work
 
@Hakaishin I think the conclusion was that they had lower failure rates because people couldn't access the servers to break them
 
@AndrasDeak I took it more to be the different atmosphere, but I guess we gotta wait for their analysis
 
@CoreViSional this chatroom is quite nice, but there is also the official python ircs, and the in-official but very active python dicsord if you want to diversify your input =)
 
user13727121
3:28 PM
@Arne Thank you for introducing new chatrooms to me :D currently having some difficulty navigating to the page that lets me register my nickname, but it shouldn't be a big issue
 
the pain of setting up IRC is what stops me from participating in that room
 
@Arne YES! I can't believe that IRC is still a thing
 
maybe they stick to that platform to throttle the influx of new users?
 
probably honestly. I don't see any good other reason. Might even work better than the Rep limit on SO, because you can kinda cheat yourself trough that, not trough setting up IRC :D
 
That's a bit like saying "I can't believe FTP is still a thing"
 
user13727121
3:32 PM
Oh, I thought I was the only one having difficulty setting up an IRC account. When I hover the arrow over the Start button, it turns to a stop-sign.
 
It's unfortunate that most IRC clients seem to be newbie-unfriendly, but I wouldn't count that as a strike against the protocol
 
@Kevin wait, it is? D:
 
:D
 
Anything that makes it into an RFC can never truly die
 
next you'll tell me that people still use ethernet over copper wires
 
3:36 PM
Significant parts of my factory dashboard required FTP; from remote monitoring units taking product counts, to forms submitted by people using a webapp on ipods
 
user13727121
Oh nevermind, apparently, they don't accept spaces when registering a nickname, so they auto-assigned an unused nickname to me
 
After SO chat, slack and discord I'd miss the permanent transcript
 
I joined the #python IRC to judge for myself how difficult the setup is. Connecting to the IRC server is painless if you use the web client -- choose a user name and click "I'm not a robot", and that's it. Joining the python room specifically requires a couple extra steps because they want registered accounts only.
freenode.net/kb/answer/registration is fairly straightforward. If you have experience with command line interfaces, then you should be able to compose a syntactically valid command in a few tries. Possible stumbling blocks: not knowing where to enter the command, not knowing that they're picky about spaces in names
 
user13727121
YES! Finally, got my account registered
 
The whole process took me about five minutes, most of which were me picking out a name and password
 
user13727121
3:49 PM
only thing I must remember is my nick password, because I read somewhere that the process of resettings password is possible but will be a little bit complex
 
Just like forgetting your password on any other site, I imagine
 
user13727121
@Kevin that's alright, I understand that they take their security very seriously, hence the registered accounts only
 
according to the registration guide linked from the python IRC page you can register an email with nickserv, I bet it's easy to get a password reset from there
 
user13727121
yeah, I think it's SENDPASS and then my account name. But I'm not sure the steps if I'm logged out and forgot my password
 
Log in using a non-registered no-password account, then use SENDPASS?
 
3:56 PM
I mean I'd look for a "forgot password" link
 
user13727121
@Kevin /msg NickServ SENDPASS youraccountnamehere it says on the website
 
Forgot password links? You think we got highfalutin hyperlinks? This ain't HTTP, it's IRC baby
 
user13727121
but there's a post on Reddit, answered by a Freenode staff member, saying that the quickest way to fix this issue is to join the #freenode channel and ask a Freenode staff member to initiate the password reset
 
I meant on freenode's website
 
I miss IRC... use to be a +O on a few servers and a channel services/nickserv admin in the "old days" :)
 
user13727121
4:00 PM
@AndrasDeak I don't think there's a link, the official website only shows the instructions to reset your password
 
If you try logging in with a bad password, the web client just says "We couldn't connect to the server :( [newline] Invalid login" with no suggestions for further action
 
> The email address that you select will not be given out by staff, and is mainly used to allow us to help you recover the account in the event that you forget your password. For this reason, you are required to use a real, non-disposable, email address.
 
highfalutin, what a great new word I learned :D
 
That's what I read. I guess it's all manual, according to finest tradition.
 
user13727121
4:03 PM
I guess you can just log in with a nickname closer to your account and join the channel without a password
 
I used to spend immense amount of time on IRC in my youth
 
user13727121
that's what i did before registering my password
 
Manual as in "you have to type the command yourself" -- seems like it. manual as in "you have to contact a real human" -- I think that's optional, reserved for those not confident in their CLI powers
 
@Kevin OK, I guess I should read more into how it adds together. Never used freenode.
 
I mean, you know about as much as me. I haven't tried resetting my password, so I'm just speculating based on what I've read
Maybe you do need to contact a human, and pull on the third candelabra in the library to get to the shrine of the silver monkey, where the password reset amulet resides
 
4:08 PM
actual lol
 
ah OK, you were talking about freenode.net/kb/answer/sendpass, hence sendpass
 
Yes. And yet -- I've read enough docs that turned out not to reflect actual reality, that I'm not totally confident it works as seamlessly as advertised
 
So I don't understand the whole issue. I'd expect sendpass to work from any user, sending a reset request to the owner's email address.
being logged in to be able to recover your forgotten password would be... suboptimal UX
 
"Ah yeah, that sendpass page is out of date", says the hypothetical nickserv admin, "we migrated away from that in '97. Only Carl knows how to change the docs, and he's in Pakistan climbing K2 right now"
 
Laughing at your jokes makes me feel like this alien: youtube.com/watch?v=KJQY36ZRoKg
 
4:15 PM
This guy gets it 👆( ͡° ͜ʖ ͡°)👆
 
user13727121
I typed /server #python, forgot that it's a channel and now the server to #python is forever connecting...
 
Ok, admittedly, having commands that can hang your client is not the friendliest user experience
 
user13727121
4:31 PM
Apparently, reloading the page clears it and I finally joined the channel.
 
Oh hey, Ned Batchelder is in #python. Brushing with greatness~
 
user13727121
Also, it seems like to login, you just input your username and password, leaving the channel's field empty, otherwise, Freenode will auto-assign a nickname to you if you join that channel
 
Streaming Advent of Code day 14! twitch.tv/davidism
 
Benefit of IRC: if you post code with asterisks in it and forget to use code blocks, it won't delete the asterisks and make random parts of your message bold
Instead, it retains the asterisks and makes random parts bold, which is unironically much better
If I never see "init" again, it will be too soon
 
5:09 PM
@Kevin benefit of IRC #1, it is from Uni Oulu, therefore I am a celebrity!
 
5:24 PM
You're already a star to me (◕‿◕)
 
@davidism sorry I didn't notice sooner... are you planning on these about the same time every day?
@AnttiHaapala errr.... barely use twitch and so not sure how the chat thingy works - does it show old messages that you can scroll up for!?
 
yeah, I've streamed every day so far, starting some time between 7:30 and 8:30am PST
 
cool... I'll actually try and get in from the start tomorrow then rather than the last 5 minutes :)
 
at least you saw me on a good day, yesterday was two hours of deriving a math theorem that I didn't want to look up
 
heh
oh... I clicked the notifications thingy... that might help as well
think the only reason I signed up to twitch was to watch MTG Arena games or something like that
think I had one a while back I no longer have the login for that was fun watching tristan play FTL
 
5:45 PM
@JonClements I've been working with streamlit for a few months. It's super handy. Feel free to ring the g4dget hotline if you'd like to know where I skinned my knees
 
@inspectorG4dget oh cool - appreciate that... I probably won't even get around to looking at it this year but it does look kinda funky and very easy to just get the basics going... so might well take you up on that :)
 
@JonClements the builtin plot (though super flashy) were not the easiest to manipulate. I think I ended up learning to use altair charts which struck the right balance of flashy/extensible/easy for that one project
 
6:01 PM
Is there a way to mix endianness in one struct.unpack call? I have a bytes object containing one little-endian uint16, and one big-endian uint16, and I'd like to extract both at the same time.
>>> import struct
>>> x = b"\x12\x34\x56\x78"
>>> struct.unpack("<HH",x)
(13330, 30806)
>>> struct.unpack(">HH",x)
(4660, 22136)
>>> #desired output: (13330, 22136)
struct.unpack("<H>H",x) crashes with struct.error, for the record
It's easy enough to do this if I'm willing to make more than one call, for example struct.unpack("<Hxx", x) + struct.unpack(">xxH", x). But it doesn't generalize neatly to the kinds of formats I'm interested in unpacking
 
@Kevin I'm afraid to ask, but why?
 
I'm still working on my project to reverse-engineer the network packet structure of this third party program. I have identified two fields that I believe to be uint16s, and they have differing byte orders.
The first field appears at the second and third byte, and seems to be a periodically increasing timestamp. It ticks up from 0x0000, 0x0001, 0x0002, ... 0x00FF, 0x0100, so it is certainly big-endian.
The second field is at the 12th/13th byte, and it always equals the length of the remainder of the packet following it, if I interpret the bytes as a little-endian uint16
My guess is that the program unpacks the packet in multiple layers, with each layer specified and implemented by a different developer with their own ideas about the One True Endianness
Ultimately the program is quite reliable, so I can't argue with their results.
I can only introduce a developer to my cluebat if they make silly design decisions in their public API. This is the opposite of a public API.
 
6:25 PM
I think you've discovered an over-specific assumption in struct's design. There's little reason why the endianness shouldn't be changed, it was just never seen as a requirement.
 
Maybe I should submit a patch, alongside my patch for the "uMedium" three byte integer
 
umm... interesting... I actually for some reason though it supported a " " in the string so it could reset and that something like: <H >H was valid
 
struct: per item endianess specification. Closed in 2010 because "I don't see any reasonale reason for mixing endianess inside a struct, and don't know of any real-life protocol using per-item endianess."
Which, honestly, fair
 
@JonClements I've used twitch only like for a week to watch... David's streams
@Kevin use C :D
 
Decline
 
6:37 PM
@Kevin fair or not, I don't like this "some old guy comes and says 'we don't do that'"
 
Eh, that's feature triage for you. Gotta focus on the things that lots of people want
 
well, like with "typing" some guy called Guy-do comes and says "we don't support that. Why'd anyone wanna write that anyway..."
 
I admit feeling a flash of annoyance when I read "no one else seems to be interested by this issue" when the problem I have open on my other monitor would be instantaneously solved by this issue
 
@AndrasDeak question is as simple as how gui is made in engineering softwares like autocad, abaqus, etc which have huge interaction with the user. refering to your past comments, I know there are lots of commercial software and many people are working on them. I want to know which language should be used to make a gui for my project which is not too complex; but having a gui will help my user to better build his own model in my program to do calculations on.
 
@AnttiHaapala h-we-do? :P
 
6:44 PM
I will not be dying on this particular hill, however
 
@AndrasDeak Probably I am not expressing my question correctly. If so, could you please help me by asking some questions so that we can bring our ideas closer to each other?
 
@EngMyt I understand why you want a GUI. But you also said "I don't mean the GUI of menus, pop ups and drop downs, which can perfectly be coded in TCL or tkinter.". Hence my confusion.
perhaps if I knew GUI design I'd understand better (although I'm a bit doubtful)
 
"some people propose opengl features. but I do not think this is what commercial softwares are built upon." -- I disagree, I do think this is what commercial softwares are built upon
 
Sounds to me like the requirement is to be able to draw wireframes diagrams and manipulate them in 3-D?
 
6:47 PM
At least ones that need more sophisticated UI elements than buttons and stuff
 
@EngMyt I've asked all I could to try and figure it out, sorry
 
You can use OpenGL in Python, incidentally. But it is considerably more of a pain in the butt than tkinter or pyqt, etc
 
@AndrasDeak I see. So I should make my question here a little clear. I have see two types of gui's. One is very simple, it has some fields and forms. User should only enter some numbers and run the program. The other one I have in mind is very flexible. The user is not restricted to the fields of the form in the GUI. They draw a line in the gui and it calculates the length of the line for instance. I want the second one.
 
@AndrasDeak One stabs in the dark in the absence of a description of the task. Clearly tkinter/pyqt/wxPython could all handle the GUI work, it's just a matter of what the interactions are supposed to achieve. I was present for the earlier discussion, but still unable to understand it.
 
@EngMyt you do not use opengl to draw the windows and controls, usually, but you absolutely do use it to render any 3D graphics in the high-end commercial software
 
6:50 PM
It may be worthwhile to create a prototype of what you need using tkinter's Canvas widget. You can draw arbitrary lines, polygons, curves, and pixels on it, so in principle it can do anything.
If the canvas prototype is functional yet slow, use its design as the basis for a faster implementation in OpenGL and perhaps C. If the canvas prototype is fast enough, great, just keep it
 
@Kevin Is this the thing professional softwares do as well? They start by canvas for instance and the rest would be work of graphical coders to make it work smoothly?
 
I can think of at least one professional that does it that way, yes
 
@Kevin fantastic... now I have a better picture on how I should make a better gui for my program.
 
More generally, my advice is to not get too fixated on what professional developers are doing, and just go with the first thing that satisfies your requirements. In some cases, there is no "professional" way to do something, because every professional does it differently
 
usually the problem is not only the speed, the canvas implementation might look f-ugly
 
6:55 PM
Your users will not care whether you're using tkinter or opengl if the outcome looks the same
 
corollary ^ :D
 
(big "if" there, when it comes to tkinter ;-) )
 
@AnttiHaapala I am too woried that the gui's made through tkinter seem like too simple. I mean, entering data in the fields may be more professional than bothering drawing with canvas. this is what always stops me in ktinker or similar packages. But I can not find a good source on making nice gui's.
 
9
Q: Why are the Tkinter canvas lines jagged?

user1653363The lines drawn on a Tkinter.Canvas are not smooth. How can they be made smooth? Here's what I tried: from Tkinter import * root = Tk() cv = Canvas(root,bg = 'white') rt1 = cv.create_rectangle(10,10,110,110,width = 8,tags = ('r1','r2','r3')) def printRect(event): print 'rectangle' d...

 
6:57 PM
f-ugly: adjective
    visually similar to an f-string with nested replacement fields
 
@EngMyt nevertheless, it very likely is easier to get started with Tk.
 
this is drawn in canvas and is very similar to paint not softwares like autocad, freecad, etc!
 
@EngMyt ever seen a screenshot of Photoshop 1.0
 
@AnttiHaapala exactly
@AnttiHaapala no
 
6:59 PM
Oh, that reminds me, one hundred demerits to effbot.org for going down, thus invalidating a zillion sites that refer to it
 
that's where it started...
 
martineau's seven-times upvoted answer is now more useless than the once-upvoted answer
 
@AnttiHaapala no way! I will start with canvas as soon as possible :))
 
Fun fact, the Knoll brothers ^ wrote that Photoshop 1.0. One of them John Knoll is better known for special effects to many Star Wars films and other blockbusters and for having pitched the idea for the Rogue One film.
 
At least the wayback machine has a copy... Oh, it only works with Python 2.7 and below. Never mind.
 
7:04 PM
@Kevin time to flag :D
 
^ That's the one. "Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* "
 
no it means it works from 3.4 onwards
You need a C++ compiler to build this extension.
 
Or, does it mean that the maintainer hasn't updated the version requirements since 3.3's release?
 
import aggdraw
import random
import Tkinter

root = Tkinter.Tk()

size = 400, 300

# create a Dib surface
draw = aggdraw.Dib("RGB", size)

# draw something
x0 = random.randint(0, size[0])
y0 = random.randint(0, size[1])
for i in range(500):
    x1 = random.randint(0, size[0])
    y1 = random.randint(0, size[1])
    draw.line((x0, y0, x1, y1), aggdraw.Pen("black"))
    x0 = x1; y0 = y1

# display the image
frame = Tkinter.Frame(root, width=size[0], height=size[1], bg="")
frame.bind("<Expose>", lambda e: draw.expose(hwnd=e.widget.winfo_id()))
 
Perhaps you're thinking "It would be really dumb if maintainers had to log onto pypi every eight months or so to update their requirement list to add that the newest version of python is not compatible with their library". Perhaps, but it wouldn't be the first dumb design choice in Python's packaging ecosystem
 
7:11 PM
I don't have windopws, so can't try.
 
And I don't feel like trying. In the absence of evidence, I concede that you are likely correct that it's 3.4+ compatible.
 
@Kevin or... instead of speculating you could click on the releases tab in pypi...
funny... having said I do not have windows I realized that I am writing this comment on windows...
 
No 3.4 release, the requirements listing is still inaccurate even when I read it properly ಠ_ಠ
 
The biggest hurdle to overcome with many beginners is hesitancy to answer their own questions with the interactive interpreter.
 
hmmm
@Kevin I can't see anything...
not even a window...
hmm added main loop but...
 
7:16 PM
Reminds me of my days working with OpenGL. Obstacles one and two are opening a window and drawing a triangle on it. Everything after that is easy.
(for certain definitions of easy)
 
well it doesn't crash there. I just don't see anything on the window...
 
Obstacle two has many possible causes. You forgot to blit the buffer to the other buffer, you forgot to flush, you used the wrong coordinate system and accidentally wrote into your file system...
 
@Kevin one of my obstacles these days is drawing some points with cartesian coordinates in opengl
 
"Don't look at me," says OpenGL, "I drew the triangle at x=0, y=10000000000000, exactly as you asked"
 
@Kevin the expose event is not triggered.
frame.bind("<Expose>", lambda e: (print("exposed"), draw.expose(hwnd=e.widget.winfo_id())))
 
7:20 PM
"Not my fault the camera view spans from y=0 to y=1"
 
@EngMyt ^confirmed, works in Python 3.8 and gets you antialiased lines. just copy all of the lines including those hidden behind "show more.." :D
 
@AnttiHaapala ^__^
 
Ooh, neat. I'm usually satisfied with jaggies but I will make a mental note if I need something nicer in the future
 
pip install aggdraw.
 
do you want to talk about it, Antti?
 
7:25 PM
@AndrasDeak naa. I just drew my soul.
 
Cleary a Rolling Stones fan? :p
 
 
2 hours later…
9:12 PM
Would be cool if when you specified __slots__ you could also specify the type
 
wrong language
 
although... you might be able to implement that with an asserting decorator
 
I think Mikhail wants runtime checks in production
 
9:36 PM
Hey, you take that back! I want runtime checks in debug!
I discovered the real use of things like boost::python and pybind11, to motivate the team to rewrite everything in C++ :-)
Objects adding themselves to structures was the real show stopping moment because there was no clear way to get the underlying python allocated object at the C++ structure call site. (You couldn't just grab the this pointer and wrap it in a shared pointer, etc)
Flip side is that my optimized C++ code looks like its more than 50x faster.
 
👏
now you just need to convince your team that processor time is more valuable than developer time, and you're golden
 
 

« first day (3712 days earlier)      last day (1237 days later) »