#python-discussion
1 messages Β· Page 131 of 1
the getitem syntax for lists and dicts are the same.
k so .get seems redundant kinda
it's not
expound
it's used when you don't want to error if the key does not exist
there's an important difference: if you try to get a key that isn't there, you get None, instead of causing an error
ahahaahhhhh
Quick question I'm not sure how to Google... How can I exclude the first item in a list when using a function such as max?
you can also specify a different default than None with a second argument to the method
ChainMap is the thing I was thinging of. Looks up values from 2 or more dicts.
from collections import ChainMap
users_by_id = dict((user.id, user) for user in users)
users_by_email = dict((user.email, user) for user in users)
user_lookup = ChainMap(users_by_id, users_by_email)
print(user_lookup[123]) # by id
print(user_lookup["bob@email.com"]) # by email
with slicing
xs[1:]
oh interesting
Thank you!
but you should only use dict.get if you have a plan for what you'd do if you get the default value. if a missing key means that the program is actually wrong, you should just let yourself get the key error.
also i think i see whats going on
what does lambda mean though
kinda weird name
it lets you have a function as an expression.
you don't use () in lambdas
Lambda means "this is a thing to calculate every time it's used."
in fact it's a syntax error
>>> lambda (a, b): a + b
File "<python-input-0>", line 1
lambda (a, b): a + b
^^^^^^
SyntaxError: Lambda expression parameters cannot be parenthesized
I hardly ever use lambdas to be honest
Very nice. I'm going to have to look more into that
so is lambda for functions or can you use it for other thingamabobs aswell?
it's a greek letter, and also from "lambda calculus"
it's only for defining functions as expressions in Python
ok
Any place that you want an expression as a function
so defining functions as expressions
because def is a statement
stuff like this is why I strongly feel python has the best standard library
So basically, if it expects a function, and you only need it to evaluate an expression, you can prefix the expression with lambda, and a capture group (the parameters to that function) and what expression you want it to do with those parameters
never heard "capture group" in the context of functions
I know that capture group is a concept from regex
I mean, you keep saying use functions as expressions and it's more accurately the inverse. Where a function object is expected, you can use a lambda to just use an expression instead of creating a function and then putting the name of the function without parentheses or parameters in its place.
so can i do something like ```py
arbitraryOperations = lambda a, b, c: a * b + c
print(arbitraryOperations(5, 3, 1))
` output == 16`
?
no
you could do that, but it's considered bad style
oh that kinda sucks
C++ describes it that way. I've also seen it in other "lambda/closure" contexts described in those words
well, this isn't C++
and closures != lambdas
seems efficient though if I have a bunch of values I get that I wanna put together in specific ways every time
Words are words. As long as they convey the idea, they work
this seems awesome actually
I noticed, but the idea is the same even if you're using a closure
I don't agree. Using the correct words for the domain is important.
ohhhhhh this is interesting so using .get() also acts as a bool sometimes
like if i did
there is no "capturing" going on with the parameters of a lambda
it doesn't make sense in Python
wdym by "acts as a bool"?
if codeWordsForChristmasMission.get("THE RED CLAW"):
print("he's here")
else:
print("WHERE IS SANTA")
None is falsy
since "THE RED CLAW" is a key in my dictionary
is there something like conhost but on linux?
you will also run the else if the value associated with that key is falsy, such as empty string, list, 0, etc
i dont have to do codeWordsForChristmasMission.get("THE RED CLAW") != None
which is cool
cuz like if it returns anything thats acting as "True"
if "THE RED CLAW" in codeWordsForChristmasMission:
print("he's here")
else:
print("WHERE IS SANTA")
this is "more correct"
Maybe I should expand this to lambdas, not sure how this would work https://github.com/decorator-factory/py2-nostalgia
@nostalgia
def print_point(label: "(", x, y: ")"):
print(f"({x},{y}); label={label}")
print_point("origin", (420, 69))
what if it returns an empty string? or the number 0? these act as False (are falsy in python lingo, but are entirtely valid pieces of data to be passing around. for this is doesn't seem to matter, but it's worth thinking about
hm rad
thats how they make you do import typing
seems more readable
ns(lambda label, _L0, x, y, _R0: f"({x},{y}); label={label}")
Yes. But just to clarify, get() isn't acting as a boolean. The value it returns is evaluated by an if which does the value -> boolean conversion.
alright yeah checks out
hello
this mindset is flawed
yeah im flawed see you're getting it
can you stop please
It's fun that three different if statements have been shown with three different logical outcomes. The "correct" is the one that does what is expected. Nothing more than that.
because you are relying on the value associated with that key to check if the key exists, when using .get() like that
ah yeah i guess that'd be less efficient than just checking if the key is there in the first place
cutting the middle man
it's not about efficiency, they have different outcomes
expound
I have already
there are "possible" ways then there are "good" ways like codeWordsForChristmasMission.get("THE RED CLAW") != None this will get the job done but isnt pythonic
d = {"a": 0}
if d.get("a"):
print(1)
if "a" in d:
print(2)
2
if checking if a key in a list is there at all
Good timezone
thanks i take pride in living in the right place
Do you now
.get will try to find a value for that key in a dictionary , if a value is found , it will return the value , if not , it will return None
whereas in just checks if the key is present in the dictionary at all , it doesnt care about the value of that key
im confused, why is 1 not printing?
a is there!!!
0 is Falsy.
a is still with us!!!
treated as false in boolean contexts
no , just another way of saying "false like value"
thought you were being playful but yeah feels proper to make that distinction
THATS WHY YOU SAID THIS EARLIER ALEC!!
vals = ["", [], {}, (), 0, 0.0]
for val in vals;
print(bool(val))
False
False
False
False
False
False
Thought it would still return true to be honest
I gotta go now
good to know these falsys
thank you very much for the help!
oh well yeah
bye
i read about truthy and falsy..but i forgot
bye!
also None is falsy but something is false and something is None are very different
Excuse me, it's me again. It says the name of my list of lists is not defined. How can I define it? When I try to Google "how to declare lists" I only find ways to declare a list with elements that are already known, but I need to add elements after I define it
""
0
0.0
[]
{}
()
all of these values in different data types are falsys
they are pieces of data but they are read in terms of booleans as false
are you talking about type hinting ?
because you can just do
list1 = [] and store anything even another list
so a falsy is just false in the perspective of mr boolean
my_list = [1,2,3]
my_list.append(4)
no, only where implicit bool conversion is done.
mhm
oh. wait huh
implicit bool conversion?
basically wherever python expects a bool [] is considered as false
oh
just write yourlist = []. you can modify (add elements, etc) later
if can only ever be true or false. So it does the impliciat conversion to bool. But return can return any value so it does not do any conversion. It returns the real value.
if statements , while statements etc
ohhhh
see wizard we're both learning
Probably "true value" is not a good wording
it will return an empty list , which will get evaluated to false in the expression it is used
def foo():
return []
print(type(foo()))
this will print the type as class list
Fixed.
so in @bronze dragon's situation
..
it will be false?
in that code , yourlist is a list
but if you do something like
yourlist = []
if(!yourlist):
print("falsy")
else:
print("truthy")
it will print falsy
ohhhhhhhhhhhhhhh ok so yeah its for if statements it seems
OHHHHHHH DUDE PEOPLE HAVE BEEN TELLING ME TO PUT ! BEFORE SMT AS A REVERSE OPERATOR
IT NEVER WORKED BUT I HAD TO PUT IT IN PARENTHESES??
! isn't valid Python though
thoe worms
in python you'd write not yourlist
wow ok nvm
so this guy is wrong?
grah those worms x2
i sometimes get confused with != operator(i think what it is called)
On the intenet?! π
can you explain
instead of
if(!yourlist)
you would just write
if not yourlist
rest of the stuff remains the samae
well, the syntax is wrong
yeah ! except behind a = is invalid........
yeah , thats not valid python
inequality operator
Hmm, i want to record information at runtime about code objects, but I don't know how to uniquely tie them back to source code. This is a problem:
a, b = (lambda x: 1), (lambda x: 2)
This is two code objects with the same file name and line number π
for example if we did ```py
if 0 != 1:
print("zero aint 1")
treat "!=" as " is not "
well......
its the direct opposite of ==
Fun fact, not also does impliciy bool conversions since it's meant to negate bools. So
my_list = []
print(not my_list) # prints True
return my_list # returns [] (not True/False)
erm guys I learnt about pyhton in GCSE but only the basics and I'm trying to program a model that can just give me values on a quadratic graph but i've got this error I've never seen before and its basically saying that I have an "Invalid literal for int() with base 10" I dont know what that means
Its been like ages since I've done coding dont slime me
those two != and is not have two actual different meanings in python
not not foo is bool(foo)
show us the code, but the short version is, you're trying to use int() on something that can't be converted to an int properly
i dont think this is conversion
ok when im saying " is not " treat it as english
Okay how do you show code
not python syntax grah im bad at explaining
!code
!paste or this if the code is too big for discord
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
this bot does wonders!
i was about to ask this
guys am i wrong about this
afaik it access dunder not
and doesnt coerce
i think python doesnt have coercion in general
Count = 0
Horizontal = 0
HorizontalMultiplier1 = input(int("What is the exponent multiplier?"))
HorizontalMultiplier2 = input(int("What is the second x coefficient multiplier?"))
Y_intercept = input(int("What is the Y-Intercept value?"))
Height = HorizontalMultiplier1*Horizontal^2 + HorizontalMultiplier2*Horizontal + Y_intercept
print("Horizontal Value (x axis) is at position: " + str(Horizontal))
print("Vertical Value (Y axis) is " + str(Height) + " at x position: " + str(Horizontal))
for i in range(0,20):
Horizontal = Horizontal + 0.5
print("--------------------------------------- Value Number: " + str(Count) + " ---------------------------------------")
print("Horizontal Value (x axis) is at position: " + str(Horizontal))
print("Vertical Value (Y axis) is " + str(Height) + " at x position: " + str(Horizontal))
print("----------------------------------------------------------------------------------------------------------------")
Hey @lapis sedge!
Make sure you put your code on a new line following py. There must not be any spaces after py.
Here is an example of how it should look:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
It's close enough for someone learning about why if statements care about Truthyness
conversion, coersion, indoctrination, whatever π
oh sure i dont know the context here i just logged on
im just asking if im horribly mistaken
hi = 0
if hi == False:
print('hello')
Dont shoot me i'm SO buns but I have to make sure I don't get rusty its been 6 months
its more like an "operator" i would say
is this code correct?
run it π
i cant find a clear thing on how dunder not is defined for lists
i am on mobile
I'm not sure there's a precise definition of coercion that applies across languages.
'correct' is a weird way to describe code
it sure wont give an error
just prefix it with !e and you can run code in #bot-commands
It's invalid , ! Is not in C++ ,
empty lists are false, others are true. not inverts that.
but i dont know what you wish for it to achieve
I would describe implicit conversion to bool as the same kind of conversion that JavaScript does when you add a number and a string
but it IS in C++ π
yes but is that defined in dunder bool? tbh i dont understand dunders for the builtin types since... arent int and bois written in c?
before this -> ```py
(i havent tried terribly hard to dig into it)
interestingggggggggggggg
they are written in C, but the true/false aspect is still documented.
yes
!e
```py
#python code
```
sure but is it valid to say they have a dunder not? /gen
Is there a designated place to discuss computer vision?
data science channel is there
if you look at dir([]), it has those methods. They are implemented in C.
okay thanks! i might check it out later
last time i tried to dig in into the source code i couldnt find the file that defines them rip
Excuse me, me again. Am I allowed to do this?
table=[[" "]*(int)maxx]*(int)maxy
The error message just says "invalid syntax"
that is not Python
(int)x is not how you make an int from x.
int(x), but is maxx already an int?
Thats c style typecast
I can't figure out if it is or not, but it said it wasn't
int(x)
Thank you!
in which library Measures of central tendency formulas exist?
!d statistics -- you've got all the common ones like mean, median, mode, stdev, and so on
Added in version 3.4.
Source code: Lib/statistics.py
This module provides functions for calculating mathematical statistics of numeric (Real-valued) data...
@cosmic moat but also, you will find that 2D board shares data between cells, so you need to make it differently.
why C cast not supported in C Python :'(
Beware that this might not be making the list of lists as you think it is.
What does it do? I will investigate as well
!e
this is valid syntax though
def convert_to_int(string):
return reinterpret_cast<int>(string)
:warning: Your 3.14 eval job has completed with return code 0.
[No output]
What is the best free python course and resource
HUH π
!e
blah = [[]] * 5
blah[0].append('oh no')
print(blah)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
[['oh no'], ['oh no'], ['oh no'], ['oh no'], ['oh no']]
is it possible that bot will import and run libraries in the server here
Oh, I don't need to append, I'll be working with individual cells
(this is why Rust invented the turbofish syntax, which would be reinterpret_cast::<int>())
try it. assigning to the cells will also be a problem.
looks like just some symbols moved around compared to C++π
This is reinterpret_cast < int > string
π’
!e
blah = [[" "]*3]*3
blah[0][0] = "oh no"
print(blah)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
[['oh no', ' ', ' '], ['oh no', ' ', ' '], ['oh no', ' ', ' ']]
I see...
yeah thats why i said π xd
foo<bar>(baz) in ambiguous, it could be foo < bar > baz or a templated method call. foo::<bar>(baz) is unambiguously a templated call
!res general
this has some good ones, Automate the Boring Stuff with Python and Harvard's CS50P are frequently recommended here and both are free online.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
this feels a lot like C
Do I need to make it something like blah[0][0][0]= 'oh no'?
π
!e something like this is fine in this case
blah = [[" "]*3 for _ in range(3)]
blah[0][0] = "yay"
print(blah)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
[['yay', ' ', ' '], [' ', ' ', ' '], [' ', ' ', ' ']]
Ooh, okay!
codeWordsForChristmasMission = {
"THE RED CLAW" : "Santa Claus",
"LITTLE LAMB" : "Present Delta",
"GRAZE VICTIM" : "Christmas Tree"
}
flashCards = codeWordsForChristmasMission.items()
print("alright agent elf, here are the necessary codewords")
for codeWord, definition in flashCards:
print(f"{codeWord} means {definition}")
rad.
the three strings in each [" "]*3 will be the same string, but it doesn't matter in this case
dictionaries are easyyyyyyyyyy
(because you can't mutate strings)
That makes sense!
Hello, I want a Python code that calculates a countdown to New Year's and sends "Merry Christmas" messages.
you can ask claude
What data structure is dict built on?
python
im sorry i dont know how to answer that question
Rip
Purple
Who should I ask?
Dictionaries are called hashmaps in some other languages.
And welp, that's what they are: hashmaps (or hash tables).
claude ai bro
Perhaps orange
oh do u not know how to code in python
Do you have specific questions about your attempts to create this that was can help you with?
we try very hard not to tell people to ask AI
I don't even need to try. It comes naturally.
i try very hard to not be too absolute with people
i got afraid for a sec why everyone's name is followed by 00:00
but then i realised its 12:00 am here
!rule 10 see here
This is the first time I've heard of it. I only know Gemini, ChatGPT, and grok
I'm never absolute.
but claude can teach him better actually i think
I don't. Ever. Period. π
hey wait a second...
I'm a beginner
Does print() normally add a return carriage after it runs? Can I make it not do that?
what have you learned about his needs that made you think that?
Add end=""
disappointed to see this joke not get appreciated
How so?
you can specify end, but there will probably be a better way to do what you're trying to do
oh ok
I appreciated it but I can't emoji.
uhh so like when does this timer start?
we demand peasent rights riots
Can you teach me?
well im not suited to help you since im a beginner myself
That's what we're asking you. We help people learn python here. So where have you started with this project of yours?
do you want this timer to be usable or just like a short exercise
hes a beginner who is looking for a finished project, who'd probably end up more mystified and intrigued w coding more after seeing beauty in seeing working program from code
Interesting
We don't teach as in lead you, but we'll happy answer questions when you try something and need help getting past it.
when does it send christmas messages? right at 12:00 am on christmas day?
Code, google, ask questions, learn etc. no one had time to hold your hand
how often does it send christmas messages and when does it stop?
compared to having a bunch of people randomly telling him x,y and leading him down potential unrequested paths
e.g. doing complex output formatting with end is probably better done with string formatting, and then printing the final formatted string
I want to achieve my dream
it could be that he'd be happy with that, but it could also be bad. It's a policy here that we don't tell people to google things, and we don't tell them to ask AI.
What have you started already?
people come here to talk to people.
ok np bro
aside from the fact that they'll almost certainly learn more from having a go themselves, people choose to ask questions here because they would like a response from people, not from an AI tool. I think we should respect that
i havent used ai at all so far in my python learning cuz it feels gross
Guys when I run code in vscode why doesnβt it appear in output
i know i will at some point but it feels so satisfying to have some random person who just helps people then help me
you have to save it first
cuz like we're both satisfied in this situation
maybe you arent running it
does the code have anything that produces visible output, and are you sure that those lines were executed?
Facts
u should be happy to embrace the unknown brother π
I am still studying
i'm glad with where i've reached
yes I believe so
show code?

ok
where should I send it
yo zm tell us like the exact goal of this timer and be as specific as possible
Do you have python installed
!code
How are you running it? Are you using the terminal? If so, the output will just appear in the terminal. But if you configure something in launch.json or tasks.json then the output tab MAY be an option. I forget if that's one of the output options for those.
discord lets you format text with colors and a font like python
oh if you are checking output tab its not there
I want to work in cybersecurity
Il just copy and paste it, itβs only like 10 lines from a tutorial
no not your goal, the timer's goal
the project goal
i have not used ai for coding ever
because your explanation was a bit vague
altho i do ask it for code reviews and to bounce ideas off it
No, it's been my goal since I was little.
e.g.
for i in range(3):
for j in range(5):
print(i+j, end='')
print()
for i in range(3):
items = [str(i+j) for j in range(5)]
print(''.join(items))
yeah im not asking about your goal right now, what do you need help with. a program
e.g.
then ur not doing the best dev work
do you want help with a specific program you want to make
possible
hey guys im new to python and i wanted to ask how like im supposed to deal with OOP
like i come from C++ and im used to like having an object own its data and have functions do stuff to that data but it honestly almost feels inappropriate when there's no such thing as private members in python
do i just, do it anyways? use that _ prefix and call it a day? it just feels wrong
That's not a productive comment to make, nor do you have any basis to measure it.
you certainly can
I choose not to bite on that bait. Today.
Yes, I want a program that counts down to New Year's Eve and, at the end of the countdown, sends a private message saying "Merry Christmas".
i dont know if its discouraged
ok so a private message to who?
whats 'a private message'
Merry Christmas
is_student = False
print(f"are you a student? {is_student}")
if is_student:
print("you are a student")
else:
print("you aren't a student")
print("what are you then?")
Hey @winter pewter!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
@steady rain
do you want this timer to actually work in a real world or are you just doing an exercise
?? (not being argumentative first off), also I'm measuring it the same as like using autocomplete or intellisense lol it's just more efficient
For myself, because no one remembers me
Classes with their own instance data is perfectly normal in Python.
Yes theres no true "private" variables, but we treat the next developer using the object as a consenting adult who uses it properly or improperly in a way we can't control.
Yeah underscore for built in stuff such as constructor
Just write the class as you need it. Don't overthink the defensives of private or public. If you want to tell the next-dev "this is internal implementation" then use the _ prefix to communicate that.
do i just, do it anyways? use that _ prefix and call it a day? it just feels wrong
Yes. Python has a different design philosophy than C++, namely that other developers are adults who can decide if want to use functionality that isn't part of the interface.
alright a bit sad but dont dwell on that
scribe your work on a piece of rock
Private message
uhhh wait lemme check smt
okay, what action did you perform to run this?
through what software?
And operator overloading is the sams idea polymorphism is simpler no virtual...
like a push notif?
is this an email?
Is this supposed to make sense?
I don't have friends
maybe im overly paranoid from working in c and c++ too long
im sure your os has a way to send notifs through the terminal
LOL
so use that
Folks "private message" == "direct message" or DM
the correct answer is to do this in bash
I clicked arrow button to the right and I clicked βrun codeβ
It is obvious this person isn't genuinly seeking python help.
was a follow up to this ?? (not being argumentative first off), also I'm measuring it the same as like using autocomplete or intellisense lol it's just more efficient
Suggest something
well they didnt exactly make it clear
It's a slightly older term for the same thing. From forum days
uhh i dunno through discord i guess?
no its just reddit terminology
There were other options though, like βrun codeβ, βrun python fileβ, βrun python file in dedicated terminalβ, βrun current file in interactive windowβ, and βrun as taskβ
just click the green button
How
But this isnt a statement it doesnt result in true or false
They got it from forums. π
There is no green button
he could check if its new year by just seeing when the day and month of his device is "1/1" right?
i feel like i remember this person saying theyre like 13
i dunno im brainstorming here im just trying to see your exact goal
You aren't measure anything at all. You have no numbers. You're claiming one cannot be as productive without any backing to that at all. It's a useless argument that just baits or incites. You program how you want too. Let others do what they want too. Don't try and correct what you cannot see.
not python, but mildly related (and funny)
https://github.com/reactjs/react.dev/issues/3896
we cant do anything with your idea until we get where it should be done

do not use it
@cobalt flax mate hows your learning going
By default the output is in a terminal in a separate "Python Debug Console" terminal tab. At least using the microsoft Python extension.
though this said "is it safe to be in funerals"
but it is also wrong if one thinks it is a good idea to smack your head on the wall...we should advise the other if we know better
Do you know, forget it, I'm leaving. See you tomorrow.
kinda paused for a few days after cracking the pascals triangle but now im back and i have just learned dictionaries
I would have just written "I couldn't have made myself any clearer" and closed the issue.
are you sure? what suggests it's not fine to use?
good night my friend!
I'm not sure how that relates to the conversation I was having. You are correct. Asking is a powerful skill to learn.
this is why it feels inappropriate to me
You too
ooh cool
Alright, I've done it. Thank you for your help, everyone π
i recommend learning fairly deeply about data structures from the start
quintessential web developer mindset right here
savage
is this a stereotype?
much helpful i think
You reply emotionally rather than logically. I said that not using, compared to using it, AI is less efficient from its basis of being able to act as a fast autocomplete, it's just like using intellisense.
So youβre saying itβs in terminal?
does C even have this?
at least better than wondering in the future how to implement a hash map without knowing what a hash map is
like lists, tuples, sets and that jazz?
try to make statements that are not so absolute.
(I guess there is static)
Okay.
i've seen those
yes and what they do, where we would use the,m ,etc
private members no but we usually do opaque pointers and such in c
in school i was just taught what they are (tuples are immutable etc), and their methods, which isnt very helpful information in the real world
Guys are there any other better ideβs than vs code (blue one) for a beginner
i think i have a baseline understanding of their differences
i know (after aoc)
ill forget again until next year
you aren't being logical yourself. so you say that, where's the numbers?
(an ill-advised user could cast an opaque pointer)
It's not worth pursuing the conversation futher, is it?
yes but you won't kill the internal implementation unless you do some byte manipulation screwery
wouldn't you?
by the way quick question
i've been told that lists are faster
faster in what way? how faster?
faster than?
for what?
faster than lists

what?
i have no idea how i would manipulate a struct through an opaque pointer given that the struct could literally be comprised of anything at any given moment lol
i should try that
That... lists are faster than lists?
This can be a shared point. In python we loudly mark something as internal implementation. Does it stop anyone? No. Nothing will stop a determined programmer. It's just a sign that says "Do not use".
tuples are faster
okay thats not true
im a word jumble (i jumble words)
yes they are
fast in terms of what ? fast in terms of eating burritos ?
faster than tuples for what?
objects do not have speed. actions do.
i think its because for tuples the values are stored near each other in memory
the speeds don't matter.
ok k ok ok let me restate my question without jumbling words
Both are pretty bad at that activity I think
xd
altho im not quite sure
How are tuples faster than other data structures, and in what way are they faster?
both lists and tuples are an array of pyobject pointers in C.
tuples might be faster, but probably not in a way that matters in most cases
and i cant imagine it matters.
they aren't faster in any meaningful way
hm ok
you can bypass c++ if you really try hard enough by manipulating the binary at runtime LOL
i dare you to find a program where you can measure the difference.
hi
okay then
alright guys thanks for ur help im gonna work on my project now and maybe come back here to chat soon
just use the most apt structure for what you need
wait why do tuples exist if you can just have a list and.... not change it
tuples can be hashed
in any case even if they were faster it doesnt matter since you wouldnt use a tuple instead of a list
expound
We usually use tuples of a known size and with known types for each element.
And we usually use lists that have a homogeneous type but an unknown size.
Beyond that, you'll need to actually benchmark your use case.
they can be hashed. (look up hasing)
tuples can be elements of sets or keys in dictionaries. lists can't, bcause they can't be hashed.
You can bypass anything in any language if you try hard enough. And devs do. Python is more relaxed than that. We all agree to read the sign and stay out of internal implementations. If we don't, it's our fault when it breaks.
also its so you cant exactly change them
they're faster because in the python interpreter it doesnt have to worry about ever changing it
i can't exactly say why/how that works i just know that's how it is from the quick python book
I am currently navigating a career transition where my only viable options are remote work or further education. However, social media updates from peers are causing significant 'comparison trap' issues, making me feel pressured to pursue traditional roles that aren't right for me. I don't know if i study or do work from home jobs..btw the internships and jobs offered to me are not satisfactory
if you make a tuple it makes it very clear that this is not a container you should fuck with much
any suggestions?
alrighty
don't lists have an additional pointer indirection?
yes. does it matter?
"The hash value is an integer that is used to quickly compare dictionary keys while looking at a dictionary."
At work we have a few places we reach info django internals and call or overwrite some _ method. I don't like it. Fortunately it's not often. It's contained.
huh?
that works for now
Moral of the story is, tuples are immutable. Once you create one, you can't add new elements or remove any: you have to make a new one.
Some operations may be quicker with tuples for that reason, because the container can know its size without having to recompute it ever.
there's a semantic difference. but it's kind of hard to explain.
usually, all the elements in a list are the same type, and the exact number of elements in the list usually can't be known just from looking at the code.
tuples, on the other hand: it's usually visibly apparent in the code exactly how many elements are in the tuple, and what types they are. and they often aren't the same type.
its a unique value that can be assigned to each object
"compare" is such a broad term for me
oh
wait hold on thats just indexing a list by using []
A great example of why putting too much effort into defensive programming isn't worth the time. The next-dev will do what they feel they must to achieve what they want.
you literally can define a dunder hash that tells you how to hash them
i will now google dunder hash because that is the funniest sounding phrase i have heard today
its not exactly relevant
it's just a way to quickly check if two things are equal
DOUBLE UNDER OH
i didmt code today
__ bingo
That's always fun, making a custom __hash__ to use my own class as a dict key. π
Usually I just run tuple.__hash__(()) on some of the elements of that class.
Usually a AoC thing though.
you haven;'t yet coded today
yeah. its just in c++ its the norm to instead of putting up a sign, put up a fence. they'd have to jump over the fence to screw around. that's how i learnt to program, c++ was my first language and hell my only language (except c) until recently trying to learn python.
its just a lot looser than i learnt was acceptable when i was a impressionable beginner so. i mean its about the only way to do things in python so, i shall do it. just brand new to me
yeah import dataclass import cache
the original comment made it seem like they are the same thing
an extra pointer indirection can matter, but in the context of python where basically everything is already a pointer indirection, not much
lol. "dunder" is Double underscore methods like __str__ common in python to control behavior or implement protocols like __hash__.
the way i learned to think about it is that python and c++ both have reflection APIs, it's just that python's is much easier to use
if hashing is just assigning an integer value to an item in a tuple
i can also do that in a list??
no
it assigns a value to the whole object
(it's not unique)
just have a list and then list[number]
mhan u r so positive,thx,i will do a small one today
the WHOOLE object hm ok ok ok
i guess it doesnt have to be but for built in types i think it is?
it's not
right. tuples are nanoscopically faster than lists. It won't matter. It's definitely not a reason to choose between tuples and lists.
difficulty of use was never an issue for me. c++ is overwhelming not difficult, too much standard lib nonsense. at least for me. python also has a big stdlib which i don't like but at least it's not a complete train wreck. coding in python is a lot faster but i wouldn't say any easier. at the end of the day programming is programming, whether or not you have to deal with pointers and spam semicolons
It's a familiar struggle for me. I work in a .Net and Java shop. Bringing those devs into python always hits this point. "What do you mean I can't make it private?" 
LOL
this is also bashing me with a light stick
i wasn't commenting on the difficulty of the languages in general, just talking about the reflection API
so let me define hash right now
a hash is an integer value designated to the whole data structure object in question
yay or nay?
very much nay i think
dang i've been nayed so much today
i dont see why it has to be an integer
it is an integer
but is it a value?
I did say earlier that it's not a performance difference that is likely to matter and to just pick the more apt data structure for what you're doing :P
we should be precise when we say "data structure". each instance of an object may have a different hash. so it's not each data structure, it's each instance of a data structure
like ok here here here ```py
myTuple = (1, 2, 3)
how would i "hash" this tuple
and what would it give me
!d hash
hash(object, /)```
Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys during a dictionary lookup. Numeric values that compare equal have the same hash value (even if they are of different types, as is the case for 1 and 1.0).
Note
For objects with custom [`__hash__()`](https://docs.python.org/3/reference/datamodel.html#object.__hash__) methods, note that [`hash()`](https://docs.python.org/3/library/functions.html#hash) truncates the return value based on the bit width of the host machine.
you dont have to
well yeah
hash (usually) is a function that takes in an arbitrary size of data and produce output string of fixed size
hash for different data should be different , otherwise we say the hashes "collide"
also what reflection api c++ doesnt have one (to be added in c++26 tho)
there's RTTI sure but like
correct me if im wrong though i never really explored the stdlib i was fine reinventing the wheel if i didn't have to deal with the stdlib lol
ok HASH VALUES ARE INTEGERS ok ok so thats settled
i was fine reinventing the wheel
average C dev
!e
print(hash(42))
print(hash(42 + 2**61 - 1))
:white_check_mark: Your 3.14 eval job has completed with return code 0.
001 | 42
002 | 42
and then "They are used to quickly compare dictionary keys during a dictionary lookup."
once i made my own math.h
that loses me
"likely". It won't matter.
must have been an exercises lol
wait is this some like insane backend thing
is this storage size
(so much for not speaking in absolutes :)
you can try it: print(hash( (1, 2, 3) ))
yes, sometimes it's warranted when talking about things other than people!
kind of i just wanted to see how math.h worked made my own sin() and cos() and all those functions
this requires a bit more detail. dictionaries are essentially a list internally. they store elements by using the hash as an index into the list. so to check if two things are equal, you hash them, and check if they are the same hash (then you can check for equality after)
it gives me 529344067295497451
???????????????????????
What were you expecting?
so this is 100% some backend thing
lmfao
the hash function isn't meant to be understandable or make sense. The important thing is that equal values have equal hashes.
I dont know. I dont know what a hash is and i am struggling here RAJU
yeah i guess i was speaking a bit hand-wavey
(and that unequal values have likely unequal hashes)
so i can just use it to see if two lists are the same??
wait until you see the SHA's
Yes, but it helps if you articulate why you're surprised. If you are.
quick question, what kind of job can you get with python?
no, because you can't hash lists, which is where we started.
I'm surprised because I dont know whats going on
sorry right yeah tuples
to see if two lists are the same, use list1 == list2
even there, no. Two unequal values can have equal hashes.
hi all
Traceback (most recent call last):
File "C:\Users\...\.py", line 13, in <module>
print(hash( [1, 2] ))
~~~~^^^^^^^^^^
TypeError: unhashable type: 'list'
are you talking about hash collision?
ok i mean if a hash is just giving me an id for a tuple
Technically yes but very very low chance of that
i guess it makes sense why it'd have to be an unchanging thing
or fo you mean __repr__
yes
Note that there is a separate thing in Python called id, which is not the same as a hash. Everything has an id, even lists.
ok so lets just pretend that doesnt exist right now because i cant afford this hole to get any deeper
yep yep! it's called being mutable as a technical term btw (tuples are immutable)
raise HoleTooDeepException
now, ol' nedbat over here said that hashes of tuples arent meant to be understandable but are useful when checking if two tuples have the same hashes
do functions in other modules become methods or functions in a class becomes methods
at the risk of deepening the hole, you could hash lists, at the risk of loosing it in a dict. other languages let you do this. python chooses to not let you hash lists, though
wouldnt the only cases in which tuples have identical hashes if the tuples themselves are identical?
methods are specifically functions in a class
in the spirit of this I would say ignore the bash collision and repr stuff nedbat and i discussed, just know that in rare edge cases you can get a false positive of their equality, yes every program in the world faces it, no we don't have a easy solution, typically we just accept it as is and move in
think of a hash as a shortcut hint about the likelihood that two things are equal.
ok lets stay on python island
not quite. remember that two things that are unequal might still have the same hash
ok
Why do logging messages not appear in mu debug mode
*hash collision
ok i think im understanding this a bit more
so how is hash collision a practical thing to use
if two tuples have unequal hashes, you know for sure that they are unequal.
if they have equal hashes, they may or may not be equal. you need to actually compare their values to be sure.
it is generally not good
oh ok i had the wrong idea this whole time lol
thought hashes were useful
hashes are. hash collisions are not.
but you might be conflating hash collision with two things having the same hash
(like cars!)
if hash(x) != hash(y) then for sure x != y
so then just, compare the values from the start?
hash collision is a very rare thing which typically requires a bery large amount of computing to do intentionally. The annual GDP of a small country worth of computing would be needed to do it intentionally to trick Bitcoin into accepting something. it happens in nature, you don't worry about it
why would some random backend integer number be useful for your daily programming life
Oh ok thats pretty cool
it's useful for making a dict, and dicts are very useful for daily programming life.
||modulo erroneous implementations of eq and hash||
this is a different kind of hashing
Hash collision is when two things mistakenly have the same hash.
hash comparison is the day to day thing you want to use
you can turn a tuple into a dictionary?
using hashes?
Yes and no, cryptosecure hashing yeah I know but also this is to reassure this guy of how rare it is
it's easy in Python to make two tuples with the same hash.
you can use a tuple as a key in a dictionary, because they are hashable.
so the value (tuple's hash) of a key (the tuple)
?
the value can be whatever you want
the idea of a dict is to let you quickly look up values by their key. as a fact of implementation, it uses hashes to achieve this efficiently.
Ok so if I had a tuple variable and put that variable into a dictionary
the dictionary is referring to the tuple variable by the tuple's hash?
i think you should get more familiar with dictionaries before learning how they work internally
yay or nay?
collisions are rare until you have weird data distributions
i have another question
if there's no private members then why would i need setters and getters?
like i would imagine there's a place for them, but where? thread safety? like if i have just a game object and this object has velocity and stuff do i have a setter and getter for all of its member variables even if i can just tap into them directly and set them? that just seems like a waste of code?
i understand why you would need the illusion of private members at all, 100% but like, when it comes to stuff that is accessible, i would usually just make everything private and give it a setter/getter in c++
internally it uses the tuple's hash to look up the associated value, yes.
i should've stopped when i realised this was an internal backend thing but sunk-cost fallacy
EURIKA!
sunk-cost fallacy suggest that you should stop
I probably wont use this knowledge much as the dictionary is using it not me BUT
You usually don't. For setters and getters, we have attributes and properties.
you generally don't need setters and getters
hello everyone
i appreciate the help so thank you very very very super ultra duper very much my friend
e.g. if you let users provide integers that you use as dict keys, a malicious user can do fun stuff to slow your code down significantly
think of it like this: a box has a fixed shape. Cloth does not. a cloth bag that fits 2 boxes now might fit two differently shaped boxes later, or might have more than one box, so you can't compare two cloth bags by the shape. you can compare two boxes by the shape.
cloth is a list.
box is a tuple, an integer, a string, or some such data type that can be compared.
the hash is like if you took the shape of an object & made a shitty (but consistently shitty) drawing of it. a special machine can look at the drawing and understand kiinda what the original might look like, but you can only look at it and scratch your head as it is. On the other hand, you can compare two drawings just fine.
alright all my questions have been answered
thanks all, gonna go work now
yeah but again malicious user.exe might be able to do the math by hand or might need a supercomputer to do it depending on hashing algorithm and yes data distribution. hence cryptosecure algorithms vs non-secure algorithms
mhmmmmm got it
a real cryptosecure algorithm would need a very very specific dataset to maximize chance of collision
great explanation
you're talking about supercomputers, but data collisions in Python aren't about expensive computations
comparisons are computationally easy, that's what people do in Python all the time. a hash collision attack is difficult. Difficulty scales based on the hashing algorithm used. python doesn't use a cryptosecure algorithm for dictionaries (tho implementations with secure hashes do exist, I made one myself using sha256 and a simpler hashing later to minimize memory usage)
you're welcome!
hash collisions in Python data are not difficult computationally.
i think it's important to distinguish between cryptographic hashing and the kinds of hashes Python uses for data.
dude i think you're not reading what i said... yes python uses a weak algorithm that's what i said, that doesn't impact the fact that you can use a more secure one if you want
I see that you said that. I think it's important to be very very clear and not mix the two in the same paragraphs, because it's easy to confuse them.
hm well that's a different story then yes
and data collisions are really really easy. If you build a web service that accepts stringified tuples, and stores them in a set as actual tuples, it's easy for me to attack you.
"TypeError: dict.get() takes no keyword arguments"
wh, YEAH YOU DO!!!
context:
while True:
missionInfo = input("What will you be expecting on the mission, agent elf? ")
print(codeWordsForChristmasMission.get(missionInfo, __default="Huh?"))
# codeWordsForChristmasMission is a dictionary defined previously
if you're ever wondering if you're wrong or the stdlib is wrong, always assume it's you until you've exhausted other possibilities.
in that case, you cannot pass __default as a kwarg
yeah i know im wrong i just have no idea how
i trust my computer...
where did you find this __default parameter?
also, yeah, you can't pass it that way. it has to be .get(key, default)
oh yeah the __default was bad
^^
see the definition here:
π€¨
lol ive never seen it before
i dunno i thought i could and it showed up for me
that trailing / makes it positional args only
true true
heres the doc on .get()
"Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError."
so like i gave a default
how else do i give a default
where did you see it with the double underscore like that?
it just showed up in the little dropdown that you see in IDEs
typically you don't use dunder variables unless you're messing with things python level
so i thought its valid if its given to me!!!
in fact, in the docs if you hove ryour mouse over that trailing slash it tells you what it does
which IDE
i'd be curious to see an image of that?
alright where do i send it
i'll just do off topic
I've only ever used dunder variables (double underscore) when I was messing around with repr so I can make a d20 function that gets a random number and load it into a python interactive terminal and then be lazy and type d20 instead of d20() or d(20)
certainly possible but no sane person would consider the effort spent to be worth it, especially when you can just make it a script that takes user input instead lol
iirc str and repr both had to be edited, and i used 3 layers of abstraction with decorators to get it working
dunder methods are intended to be written
that's normal
do you mean common ones like init ? or in general?
dunder methods (with two underscores leading and trailing) are very different than __variables
fair, I've been smashing my head into js too much recently, yes there's a difference btw dunder variables and methods π
in js my brain just treats everything as a variable even methods
Can I beginner ask questions here ??
I wonder, would anyone be interested in a quiz about re similar to https://fstrings.wtf/? It seems like I'm learning new WTF moments every time I open the re docs.
I would make it python-independent but I don't know much about other languages' flavours
yes!
i'm not sure i've heard people call __variables "dunder" much
another similar quiz (not python): https://this.quiz.is.fckn.gay/
really? I do it all the time and I've worked with people who do
Well I have just started learning Python and I know basic OOP but I want to practice it well like what's the best way to do that ??
idk that link looks gay
pick a project and build it.
i think most people use "dunder" to mean __variable__
This is how I learned that this is not Undefined Behavior in Rust ```rs
unsafe {
_ = *std::ptr::null::<u32>();
}
Project as in ??? I am sorry if I sound dumb but I am at a very beginner level so are there projects that I can do as well
!kind
The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
Thanks kind sir
common advice is to not use __variables anyway, so maybe a lot of people don't have much reason to talk about them.
re module in particular, or regex in general?
I would make it python-independent but I don't know much about other languages' flavours
so just re
ah ok
but the $ thing for example is inherited from PCRE
do you mean "end of string"? That's older than PCRE
end of string but not including a trailing \n
I meant the behaviour where it matches before the final \n, e.g. re.search("^123$", "123\n") is not None
apparently in PCRE there's a flag to disable this
is it just a single \n?
i see
I guess that normally won't matter
because python translates the ||icky|| CRLF to ||nice|| LF
(by default, at least)
when reading a file
yeah
LF(G)
liquefied factual gas
yep pretty much. one of the scripts at a place i worked used a weird ass thing which modified and then reset some __vars, they used to call em dunder vars
who thinks I should make a website a bit like bit.ly but for short links, image upload and pastebin
The end-of-line vs newline thing really only matters when searching multiline text, where there's a choice about whether you want $ to mean and end-of-line eg a newline or end-of-string. Personally I usually want end-of-string for $.
If you're not doing multiline stuff, just rstrip("\n") and not worry.
for line in file:
line = line.rstrip("\n")
regexp matching here, with no $ ambiguity
that would be cool π
if you want to make it you should.
It matters because you might think you're validating more strictly than you do. For example, you might accidentally accept 123\n into the system and pass it to other system that only expects digits, breaking some kind of process
Stupid question
New computer, what Python version should I install
I think the reason for the existence of url shorteners mostly doesn't exist anymore. With the exception of QR codes maybe?
Of course, once you know about this, you will rstrip or just use \A and \Z
Have long URLs stopped existing?
I mean sure lol, but I want it to also be used by other people, not just a useless peice of project
maybe I start slow and then pick up the pace
No, but microblogging platforms now count links with a fixed number of chars
Yah. Or in my case, since I often treat matching as token parsing, checking that m.end() == len(s).
it['s hard to get people to use things. Build what you want, use it, add things you want to use.
(I'm not counting human-readable short URLs in this take)
start with 3.12
Here's a usecase: some code playgrounds save their entire state in the URL hash (e.g. pyright, typescript). it is stateless, cool and hip in practice until your URL hits 2000 characters and you can't send it over Discord anymore
A few times in the last weeks I've needed to hand type a URL, with no copy/paste as an alternative. A short URL is a win there.
Okay.. very specific exception
Do you really prefer url.xx/3b6D9L over example.com/2024/foo-bar-bat in that scenario?
3.13
If you use pyenv/uv, you can install all of them very easily when you want
For something that short? No, i much prefer a readable descriptive URL. But a 40 character URL whose long part is a hashcode or other "random string" part? Which, also, must be perfectly correct? Ugh.
or I guess the py launcher works too
does python have a wrapper for windows console api or a tui lib for it like it have curses, termios etc for unix
in stdlib
Don't get me started on mailers with 100+ char URLs split over lines.
!pypi windows-curses
Yeah okay. In that case the short URL is kind of ephemeral and only used to send a tab from one device to another?
forgot to mention, stdlib
no idea, sorry
How do i make an input so that the user inputs as many tasks as they want until they want to stop? when they want to stop then enter a key
but probably not
Yeah, that kind of thing. I def want to bookmark the post-redirect "real" URL.
I mean I guess it starts from the core
I just HATE html and css
it's painful π
I see, point taken. (I don't remember ever having that scenario, I use Firefox's tab syncing thing.)
then find a way to do it without them, or use this as a chance to embrace them. If you are drawn to web apps, you need to solve that problem somehow
also the official tutorial of curses on docs.python.org recommend unicurses
I typically use a loop where I prompt for lines until they enter a line which is a dot on its own. Easy to type, not as prone to error as "end on a blank line" would be.
I mean if people are willing to help me solve that problem, it would be nice
If you do decide to leave stdlib and you want something more complex, there are urwid and textual libraries
(or if you want e.g. 24-bit color)
So the user experience is like this:
CSS[~]fleet2*> para=`readdottext`
Enter short update description. Terminate with lone dot.
> line 1
> line 2
>
> line 4
> .
CSS[~]fleet2*> echo "$para"
line 1
line 2
line 4
CSS[~]fleet2*>
yeah I would use textual but I am not leaving stdlib
and I am even fine with no color(just black and white)
Wiring in your own colours is pretty easy, you just need a table of the ANSI escapes (assuming that's enough - the point of termcap/terminfo on UNIX is to accomodate different escapes).
my recommendation would be to find a CSS library/framework, and keep the design simple
windows doesn't support ansi nicely
that uses windows virtual term sequences api
requires enabling explictly though thats 2 lines if you are already using kernel32.dll from ctypes and msvcrt
and in fact it only started supporting some parts of posix api via a native translation since 2014 release of windows 10 and that behaviour is also inconsistent across versions, newer ones support more but older ones will still struggle
and its still incomplete
Hello
they have a milestone for having complete support somewhere in future enough that they will natively port and develop ncurses for windows
Oh, I've got milestones. But not living in the US or UK, I work in kilometres and fall short.
meterstones for us(I also use metric)
π
living in Boston, I pass a few literal milestones on walks
https://maps.app.goo.gl/4HmidypFxwnssmko7 (good thing they have a shortener.....)
CSS is solved with tailwind
HTML is fine if you have copilot or something
@zealous edge might like the advice.
aka css without syntax highlighting, more fragile and making your html attributes 1000 chars long
I'm pretty sure @apply is supposed to solve that last one.
css works best when scoped
vue SFCs
I didn't know you were in Boston. I lived there for years. If you haven't walked it yet the minuteman bike trail that goes from arlington out to lexington is really pretty. (and used to be my daily commute)
like how svelte and next uses scoped/modular css
that is a good route, though far from me for a walk.
that really eliminates the main downside of css in large codebases
I like it
π
Guys how do i acc make something runnable?
Like how can i make the python code work in an app that a person can download lets say
and how can i make it so i know what those people in my app are doing
python is designed to be shipped as code, if they have python installed they can just run your code.
You can bundle python.exe with your code and distribute that, but it's more a pita.
You might be better off making a webservice that you run on your end, and they just connect to with any web browser.
Look i am trying to make a Todolist app for myself and some other people how do i make it that the code works and would i need to use html?
If they're running it locally, you don't need HTML. Just a file to store things in.
how do I build Kivy apps for android?
yeah, if you want an html based todolist that certainly sounds like a web app.
Ok so on my end just a file but what is needed for me to be able to access things on their end also?
no need for caution, this phone has been thru hell and beyond
I meant a file on their end.
I am so confused
it's not hard, but not trivial either, you'll want to look up the steps to push your kivy app to android.
as for developing it, you just write it and run it locally until you're ready to move it to android.
Well a TODO list is just a list of things to do, maybe with frills like due dates or repeats etc.
A user might run your app locally, and store the list locally, in a file.
i see that theres a kivy launcher thing but its not on the play store and there are no releases either
you don't need a kivy launcher. (that I know of) just write your kivy app locally, build and run that, just like you would any other python app with a ui. And then when you're ready follow a guide to copy it to your phone/device.
okay then, they recommend using buildozer which simplifies the apk build so i'll just use that
I had fun with kivy, really enjoyed it, but there were things I wanted that it could not do so I switched my interface to web based before I actually got to the "move it to my phone" stage. Yeah bulldozer sounds right.
there are a number of ways to build your application, and people are describing different aspects of different choices.
Would Windows Subsystem for Linux be useful to learn for python?
yes, but windows alone is fine too
ah ok
@simple willow WSL is useful if you have things you want to run in Python that are Linux-only (certain modules only work on Linux), but for most "vanilla" applications Windows is fine
Because wsl let's you continue to use windows at the same time
Switching back and forth is pretty tedious. With WSL you can use windows or use linux at the same time.
dual booting is deeply inconvenient
Some people also just prefer a Linux environment for development, stuff like bash or nix or whatever while wanting their main window manager and os to be windows (for some reason)
my parents don't really want me to dual boot or install linux on this laptop
Odd.
But just use WSL; you don't need to tell them it's a Linux VM.
nope, it's a real Linux
And you now have quite a breadth of choices for which Linux to use, too
WSL runs a full Linux (usually an Ubuntu) in a VM.
(why are your parents opposed to Linux?)
With dual booting you have to take care to partition to make space for the linux or windows, and not have one tromp on the other.
They don't hate it, they are very strong believers on keeping a device the same and not installing or upgrading operating systems
Ok. Well WSL is just an "app" from the windows point of view. An app running a Linux VM.
And there's also cygwin, which gets you a UNIX nvironment in windows (so not a VM).
They don't update the os?
They don't mind VMs, but installing other Operating Systems directly on the computer is a no go
If they're running windows 11 I suspect they don't get a choice about that these days π
they do update, just not upgrade to the newest version, like Win 10 to 11 or iOS 18 to 26
Well it is intrusive and risky (easy to damage the main OS by accident).
I guess screw security patches
Oh it sounds like they do security updates.
what do patches know about security anyways
they will if they are forced, like security stuff, it is just the big OSes they don't like to update
Right but they only do those for older "editions" for so long
Yes.
N-1 stays decently supported for a while
We're a mix.
Windows 
Well WSL should be jst fine then.
Freedom isn't free.
If anything if they don't like forced changes to the os etc etc Linux is much much much better, windows loves forcing bs updates on people
leaving windows was a good decision
So does discord and notion.
some people use Windows because they actually want to, or because they have no choice.
Why would anyone care what you use?
Ignore the haters. There's a big mix of desktops in use here.
I only have a windows install because of some windows only software
most of the insults seem directed at Windows users, tbh
i don't think it's worth spending time with people who insult you because you use the wrong operating system
I use Windows on my own systems, and my remote hosts are all Linux; the difference has never been a problem
People online with with strong absolutist statements are people to be ignored.
Well people on UNIXlike systems tend to not like Windows. Certainly, on a personal basis, I want to throw a windows machine across the room in rage after I've been failing to use it for a few minutes. But for people comfortable there, there's no general reason to try to change their choice. Python certainly works on Windows.
pretty much. I've been using Windows for a long time, I'm familiar and comfortable with it.
My desktop is windows, laptop MacBook, and I use Linux (wsl or on aws) daily
it's useful.
it does help. my own familiarity with Linux is limited but I can get Python stuff done with it
Meanwhile one of my main reasons for switching to Linux were tilling window managers, and my reason for staying has been windows 11
Yeah. I don't use tiling window managers (they tend to autoplace things) but I certainly tile my windows, just with key bindings for "full screen", "left half", "right half" and so on.
I am making a WhatsApp AI chatbot via code, I am stuck
Can anyone please help? The message sent by user is not detected and showed in my backend via the web book.
I have been using niri the last few months and I really like it, tilling but without the usually issue of running out of space on a workplace
What's the most interesting thing y'all have ever worked on?
I had added the Ngrok call back, URL. But it was still not working.
I use many wokrplaces. ("spaces" in macOSX speak, desktops in the X11/Linux/UNIX world).
I usually have around 3-4
I mean using python π
I dual boot and itβs the opposite for me
Windows breaks half the time and Linux always works π
What are you doing to it lol
Generally when I see someone say there windows constantly breaks the have tried "debloating" it
1: home/hosuehold/family, 2: work1, 3: persoanl code, 4: general web browsing, 7: reading, 8: work2, 9: work3
Or variations on that, if I'm using "numeric" desktops. Used to use named desktops when Linux was my desktop.
I generally have:
- Programming (terminals, editor, browsers)
- Discord
- Games
And then on a second monitor I often have YouTube open
Discord/slack/teams/signal are all "all desktops" apps for me.
6 was games for me, but I don't really do that much.
I guess with niri it would make more sense to keep games and discord on the same workspace, but this layout is a bit of a muscle memory from using non-scrolling wms
I'm a huge fan of MacOS' Cmd-H "hide" keystroke. Just withdraws all the windows for an app. Great for discord etc.
One thing I should get better at is using different browser windows for different groups of stuff
Having 50+ tabs in one window always hoping back and forth isn't exactly efficient
Aye. I've got browser windows on the various desktops, with desktop relevant stuff in them. Mostly.
And as of a year or so ago, firefox started remembering what desktop a window was on on restart. So useful.
Guys I've come to a realization that I haven't made anything that I could actually show off π
Just some python scripts that do what I need + some 2d games back in day
I feel so bad
A lot of what I do is scripts. Nothing wrong with that.
Scripts are great for consistency
It took years before I made something that got "popular" a like a year after that for me to start work on a project I actually fully felt proud off and felt is useful.
Being good at programming and being good at ideas is two very different things
guys i've come to a realization that i haven't made anything
What was that project if you don't mind me asking?
You're still young I'm in my 3rd year of university
I've wasted so much time..
It's pinned dude...
https://github.com/vivax3794/ComfyUI-Sub-Nodes were the thing that got popular, the stuff in https://github.com/Serpent-Tools is the stuff I'm proud off and currently working on
I didn't start until the last 6 months of the university, it's not that difficult honestly to get to a decent understanding of things
pinned where
This ot and I absolutely don't mean to be rude but what does "script kiddie" mean
Their GitHub
Programming?
It's a derogatory term for a wanna be black hat hacker
Oh I see
the type of people who download random shit to ddos some random website
Yeah, did I misread the context? Is programming not what we're talking about ?
I just joined
you could've meant python
Wouldn't have made much difference ?
Why cant i write in my gui? i want to make it like a note if you get what i mean but it doesnt let me write in it
You know how people call other people "kid"/"kiddie" when they wanna call them dumb?
The "script" is like "you're so dumb you can only write scripts and not "real" programs"
Or that you only know how to run scripts someone else wrote but not write your own
So its "dumb kid that can't code"
TL;DR: its me
you could've done programming before but not python :p
What lvl you on now, like a project you made
I think it's more nuanced than that, it specifically refers to people that don't know how to hack and are just using someone else's hacking tools.
Got into a startup recently, our main focus are api standards and specifications, lots to learn we work on openapi i.e. html APIs, grpc, graphql, workflows like arazzo and other stuff
Can someone answer me
Those do look cool! Rust frontend taking over the web next π
Respect
Oh hey you've got a whole org now
Getting all official
Yeah felt like it was org time
that one (taylor swift i think? i dont know pop artists) is playing in my head
Finally got two whole good ideas, got to keep it separate from my dumpster fire of normal repos
Nice, how many hours/day did you do to reach that
a lot
Real
I haven't really tracked my progress, i spent time learning python and frontend with react, and postgres is all, probably 1 month
The only reason I got into python and webdev was the requirement by the university to build a final year project, I come from an electronics background, so I had to learn this to stream record and showcase the data the electronics were collecting
Impressive man, I also am learning python's fastapi and postgres, I know javascript too but still haven't learnt a js framework ngl
