#voice-chat-text-0

1 messages ยท Page 198 of 1

gritty wyvern
#

this is a little complex lol

#

ill work upon it tho appreciate it

candid juniper
#

hi

gritty wyvern
#

wanna look at my code?

somber heath
#
with open('text.txt', 'w') as file:
    file.write('Hello, world.')
# File has now been created, opened in write mode, written to and closed
with open('text.txt', 'r') as file:
    text = file.read()
# File subsequently has been opened in read mode, read from, and closed.
print(text)  # File contents displayed.```
gritty wyvern
#

ohhhhhh

#

i was gonna find a way to save it into the lists

#

and put the lists into a dif file

vocal basin
#

!d csv

wise cargoBOT
#
csv

Source code: Lib/csv.py

The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in RFC 4180. The lack of a well-defined standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer.

vocal basin
#

sounds more fit for tracking something

somber heath
#
import json
my_dictionary = {'apples': 5, 'pears': 6, 'oranges': 0}
with open('data.json', 'w') as file:
    json.dump(my_dictionary, file)
# File created, written to

with open('data.json', 'r') as file:
    my_dictionary = json.load(file)
# my_dictionary reassigned, now points at information read from file
print(my_dictionary)```
#

(Data need not be a dict)

gritty wyvern
#

wow

#

this is great

vocal basin
#

only appending

gritty wyvern
#

i see

somber heath
#

There's a file mode for that.

#

But...

#

You want to be careful, there.

vocal basin
#

JSON can be streamed too, but it's way harder than both regular JSON or CSV

gritty wyvern
cerulean ridge
#

takes @somber heath

somber heath
gritty wyvern
#

i see

vocal basin
#

surprising that ```csv isn't a thing

day;value1;value2
2023-10-10;1500;300
2023-10-10;1620;250
...
#

(using ```txt instead)

#

I don't remember exactly why I'm used to ; instead of .

#

likely correlates to that avoiding conflict with , in numbers

gritty wyvern
#

wait i found a way

somber heath
#

The Australien Government just released this ad about the Marriage Equality Plebiscite and it's surprisingly honest and informative. ๐Ÿ‘‰ Enrol for Equality: http://aec.gov.au/enrol

__Ways you can keep us going:
โ˜› Become a Patron: https://www.patreon.com/TheJuiceMedia
โ˜› Tip us on PayPal: https://www.paypal.me/thejuicemedia
โ˜› Bitcoin: 1HMPK1zFCLopA...

โ–ถ Play video
vocal basin
#

"whereas here, we just don't vote for anything and don't recognise any rights"

#

I actually don't remember a single voted-on change since 2020 here

#

"voted"

#

it's still funny to me that that change was in large part pushed by the first woman to be in space
truly shows how selection procedures worked back then

candid juniper
#

i lob tasmania

vocal basin
#

problem with stuff like climate change is that it's portrayed as only an existential threat
instead of "it already harms, not somewhere in the future"

somber heath
#

@keen tendon ๐Ÿ‘‹

thin fox
#

any headphone suggestions? from indian market, budget 3k to 6k rupees

candid juniper
#

do you know what does it means when a person say "a bilingual dict is good for 1 thing- put coffee on your cup so it doesnt leave rings on the table"

warped raft
#

hello @rugged root

#

how are you doing

#

what are you up to

#

just trying to trying to torrent some udemy courses

#

can you help me

#

oh yeah we are in python server

#

nice ethics

#

i appreciate it

#

so how do you recommend to learn courses

#

so how do you recommend learning a new language

#

i paticularily need js

karmic obsidian
#

hey chat

#

what y'll talking about?

rugged root
#

The various injuries BlueRaven has incurred and walked away from

waxen barn
craggy forge
#

hello

#

ive got no clue how to work with python guys

rugged root
#

!resources We've got tons of different resources. I typically recommend "A Byte of Python", which is free on its respecitve site.

wise cargoBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

rugged root
#

"Automate the Boring Stuff" is also great

craggy forge
#

well i think i know what i want but i dont know how to put it together so python understands

rugged root
#

What's tripping you up?

craggy forge
#

i dont think ive got enough braincells to put the problem into understandable sentence

rugged root
#

What's the end goal

#

What're you trying to make, we can work from there

craggy forge
#

so i just started with python and ive got to do a simple task a week

#

the task is

#

to make program that after inputing code of a part and ammount needed it says if there is enough of those parts or not

coarse rock
craggy forge
#

yes

#

i think ive got the thing right but i just dont know how the specific lines should look like so python gets thro it

coarse rock
#

you will need "if statement" for that.

craggy forge
#

yes ive done that

halcyon blaze
#

hi

#

!voiceverify

coarse rock
#

for example
a = int(input("enter value")
if a >= 10
print("you have enough material")

halcyon blaze
#

what

coarse rock
#

else
print("you dont have enought material")

serene inlet
coarse rock
craggy forge
#

ive maybe found the mistake

coarse rock
#

what is the mistake?

#

don't forget to indent in python by using tab

craggy forge
coarse rock
#
a = int(input("enter value")

#

you mean like that??

craggy forge
# coarse rock ```py a = int(input("enter value") ```

you know i started out with pascal and that silly thing needs to know litteraly everything about the value like if its a number or letter code so i wonder if it takes both a number combination and letter combinations with the same line of code

coarse rock
#

oh not really

#

a is already int

craggy forge
#

so what about if the code looked something like N21KL4

coarse rock
#

the print you mean?

craggy forge
#

oh ye i forgot you need to enter a code of the material before you ask for the ammount

coarse rock
#

you should add another input for string.

#

there are many ways to do that though

wise cargoBOT
#

rest_framework/viewsets.py line 238

class ModelViewSet(mixins.CreateModelMixin,```
somber heath
#

@whole bear๐Ÿ‘‹

serene inlet
#

what is his problem?

rugged root
wise cargoBOT
#

rest_framework/serializers.py line 1064

def get_fields(self):```
rugged root
#

That's the closest it might be?

#

I'm really unsure

serene inlet
#

I found a video about printing "Hello world!" is so boring
and he uses random letter and joins them together one by one
I think that was ....
FUN

wise cargoBOT
#

rest_framework/serializers.py line 242

def data(self):```
serene inlet
#

about 2 min

#

because he prints them all and delays them by 0.2 sec

rugged root
serene inlet
#

have nice day guys

rugged root
#

@plain salmon Yo

plain salmon
#

pretty good hbu @rugged root

#

nicee

rugged root
#

@fathom laurel Yo

fathom laurel
#

hey

#

@rugged root hey

rugged root
#

How's it going

fathom laurel
#

good wau?

rugged root
#

Fighting Excel. Excel is currently winning

fathom laurel
#

FN

somber heath
#

!e py import numpy as np arr = np.arange(81).reshape(9, 9) print(arr) result = [] for y in range(0, 9, 3): for x in range(0, 9, 3): result.append(arr[y:y+3, x:x+3]) print(*result, sep='\n')

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | [[ 0  1  2  3  4  5  6  7  8]
002 |  [ 9 10 11 12 13 14 15 16 17]
003 |  [18 19 20 21 22 23 24 25 26]
004 |  [27 28 29 30 31 32 33 34 35]
005 |  [36 37 38 39 40 41 42 43 44]
006 |  [45 46 47 48 49 50 51 52 53]
007 |  [54 55 56 57 58 59 60 61 62]
008 |  [63 64 65 66 67 68 69 70 71]
009 |  [72 73 74 75 76 77 78 79 80]]
010 | [[ 0  1  2]
011 |  [ 9 10 11]
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/MAD6T5QPHFNC3YQKXOP7Z6UVOI

swift valley
#

evening

rugged root
#

I'll be honest Opal, I'm looking at Chat-GPT responses

#

Because I was already dealing with Excel stuff

candid juniper
#

hi

somber heath
#

Critical infrastructure: When you cross a bridge and it starts criticising your life choices.

rugged root
swift valley
#

We just released our first audio plugin at work

#

So very busy past couple of months

#

We used to do game dev in the first year but we pivoted to AI (which was the original market of the company) when it didn't work out

rugged root
#

Nice

#

@somber heath Do you need me to tuck you in? Tell you a story?

molten pewter
#

I was not aware I had this power, sleep well.

somber heath
#

I'm just surprised it decided to pick anything up.

molten pewter
#

It was just slight each time, it was more that I am now yawning in the middle of the day.

rugged root
#

What're you looking for?

#

The precommit package?

daring swift
#

yes

rugged root
#

!pypi pre-commit

wise cargoBOT
#

A framework for managing and maintaining multi-language pre-commit hooks.

obsidian dragon
rugged root
#

!e

class Student:
  def __init__(self, name: str, age: int, favorite_subject: str):
    self.name = name
    self.age = age
    self.favorite_subject = favorite_subject

  def introduce(self):
    print(f"Hello, my name is {self.name}")

  def how_old_in(self, years):
    print(f"In {years} years, I will be {self.age + years} years old!")


sally = Student("Sally", 10, "Science")
billy = Student("Billy", 9, "Math")

sally.introduce()
billy.introduce()

sally.how_old_in(3)
billy.how_old_in(3)
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | Hello, my name is Sally
002 | Hello, my name is Billy
003 | In 3 years, I will be 13 years old!
004 | In 3 years, I will be 12 years old!
obsidian dragon
#

@swift valley very log of you

#

what is it learning

novel wagon
#

What data type is picked_piece? a list?

rugged root
#

I'm going to assume that trainer/global_step means how many steps a Pokemon trainer takes while wander Kanto

swift valley
molten pewter
#

๐Ÿš… +๐Ÿ–ฅ๏ธ

swift valley
#

I should try out the newer Pokemon games

#

But I'm too busy with my backlog of games

rugged root
#

Started playing Lies of P

#

It is scratching the Bloodborne game itch

molten pewter
#

Also Love is Magic

swift valley
#

Since when did JetBrains change their UI design?

#

Feels very macOS-ey to me

rugged root
#

Huh, yeah I hadn't noticed that

molten pewter
#

2022 apparently is when JetBrain overhauled their UI

swift valley
#

@ebon mist The list you're passing to print_in_piece(?) is empty

#

Around line 140-ish

lucid forge
#

does anyone here know much about simpy?

#

......

swift valley
#

@ebon mist Line 152

lucid forge
#

no simulation the python module

#

is there anychance someone who knows simpy can review my code im slamming my head against the wall since its not outputing any values

swift valley
#

@rugged root I was about to say that lol

#

iirc it's a clean room effort

#

actually, not that specifically

undone idol
#

@ebon mist

#

!global

wise cargoBOT
#
Globals

When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.

Instead of writing

def update_score():
    global score, roll
    score = score + roll
update_score()

do this instead

def update_score(score, roll):
    return score + roll
score = update_score(score, roll)

For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.

undone idol
#

your previous issue deals with this this

empty leaf
#

hello

#

hello everyone

wind raptor
#
function drawTree(x, y, len, angle) {
  if (len > 2) {
    let x1 = x + len * cos(angle);
    let y1 = y - len * sin(angle);
    line(x, y, x1, y1);
    drawTree(x1, y1, len * 0.75, angle + PI / 6);
    drawTree(x1, y1, len * 0.75, angle - PI / 6);
  }
}

function setup() {
  createCanvas(500, 500);
  background(220);
  translate(width / 2, height);
  drawTree(0, 0, 100, PI / 2);
}
fleet marlin
#

hey does anyone have an exif extracter script?

#

for pictures

peak junco
#

sup

rugged root
#

Not a lot, you?

peak junco
#

i'm crazy or I heard Java Script?

#

There's something in particular you guys would recommend to study in python?

broken ether
#

Hi, if someone could help me with a twitter bot i would really appreciate that

short owl
#

has anyone tried , mojo-python yet ?

wind raptor
short owl
#

claim is its faster , made for AI research , using advanced python stuff which i dont know .. cant form opinion on it

vocal basin
#

is it available yet?

short owl
#

last i heard its BETA , but you can ask to be on list to test it , i want advanced programmers to offer ideas to be incorporated into it - i cant offer to many ideas for it

#

its like asking me to tune up a ferrari , i have no idea how , but maybe the advanced programmers do

vocal basin
#

curl ... | sh -
ffs

#

this is so, like, bad

#

well, at least there is less cringe option

#

The SDK is currently provided free of charge. Licensee acknowledges that Modular may at any time discontinue its provision of the SDK for free or generally. In the event Modular does the foregoing, it will make commercially reasonable efforts to provide Licensee of advanced notice of its plans to either discontinue its provision of the SDK or offer the SDK for a fee to the contact information provided by Licensee to Modular.

#

These Terms may be terminated by Modular immediately for any reason or no reason. Modular will attempt to provide written notice of termination to Licensee either through a posting on its website, or via the contact method for Licensee it has available. Upon termination, Licensee shall immediately cease all use of the SDK.

short owl
#

so.... temporarily open with option to make it private , hmmm locked doors in future ??

short owl
#

do you think the reasons in article are true , open source is NOT good ? @vocal basin

vocal basin
#

many reason listed are just open lies

#

not even close to true

short owl
#

doesnt a closed source , stagnate with ideas ?

#

buggy whips are cool - kinda thinking

vocal basin
#

@rugged root
one thing is defending closed-source; it's completely different to try to justify it by saying "open source bad, dumb and useless"

rugged root
#

Which I'm for sure not saying

vocal basin
short owl
#

listened to the Lex Fridman interviews , with python inventor and scipi inventor , they feel open source allows experts to contribute amazing ideas and makes python grow and become better tools

vocal basin
#

reworded and shortened:
"we want to move the project in a specific direction, we don't want any interference in that"
"we need money"
"we don't need to take responsibility for someone else's contributions"

#

latter being rather against open-contribution

#

but, like, many projects are already open-source closed-contribution

short owl
#

i have a dreaded feeling , mojo may die on the vine ,

vocal basin
#

it might even become open-source at some point, who knows

short owl
#

its the dream of multicore ( no GIL lock ) , massive speed ups , C underneath ... bla bla ... santa clause dreams

vocal basin
#

well, Zig works already

wet stream
#

these are all different languages?

short owl
vocal basin
# vocal basin someone from Wolfram being wrong lmao https://blog.wolfram.com/2019/04/02/why-wo...

1 -- not related to open-source
2 -- not related to open-source
3 -- not related to open-source
4 -- not related to open-source
5 -- yes, correct
6 -- not related to open-source
7 -- not related to open-source
8 -- not related to open-source
9 -- lie
10 -- header tells nothing; what's written inside the section is partially true, but exaggerated
11 -- yes, correct
12 -- not related to open-source

vocal basin
rugged root
#

But will it ever hit a major version

vocal basin
#

it might be weird versioning

#

like, 0.X -> 1.0 would imply breaking backwards compatibility

peak junco
#

lmao

rugged root
#

Right

vocal basin
#

Rust's base library for everything async has been at 0.3 for 4 years

rugged root
#

Weird

vocal basin
#

Rust uses slightly altered semver

#

@whole bear yes, implemented it once

#

@whole bear what block mode are you using?

vocal basin
#

use existing implementations

#

always

rugged root
#

100%

vocal basin
#

if you're ever using ECB for files that aren't already encrypted, you've failed

rugged root
#

Yeah but like

#

Effort

short owl
#

ftp not sftp ?

vocal basin
#

it's not that hard to make a secure encryption using C/Rust/etc.

#

salt needs not be protected

#

use argon or something

#

@whole bear find libsodium bindings for the language you're using

#

then it's trivial

#

password hashes it uses:
argon2i
argon2id
scrypt

#

they're implemented in libsodium

whole bear
#

javascript on top

vocal basin
#

PyNaCl package provides bindings

whole bear
#

javascript on top

vocal basin
#

password hashing would happen where it's stored

whole bear
#

if anybody knows python can you reply back to this message to help me witht his error

rugged root
whole bear
#

if anybody knows python can you reply back to this message to help me witht his error

vocal basin
#

which error

#

15 years

#

NaCl (pronounced "salt") is an abbreviation for Networking and Cryptography Library, a public domain, high-speed software library for network communication, encryption, decryption, signatures, etc.NaCl was created by the mathematician and programmer Daniel J. Bernstein, who is best known for the creation of qmail and Curve25519. The core team al...

#

their signature algorithm, iirc, is very easy to implement
(and it's easier to verify for correctness)

rugged root
vocal basin
#
space space
tab
tab space space
tab tab
tab tab space space
#

opening a multiline comment

space
tab space

closing a multiline comment

space space space
tab space space space
#

if I correctly remember the BS spec

rugged root
#

The bullshit specs?

vocal basin
#

There's something good you can say about every programming language. But that's no fun. Instead, let's take the worst features of all the languages we know, and put them together to create an abomination with the worst syntax, the worst semantics, the worst foot-guns and the worst runtime behaviour in recorded history. Let's make a language so b...

โ–ถ Play video
vocal basin
# rugged root The bullshit specs?

"So we need a name for our language, and nice short names, that are easily googleable, are key thing when you're creating a programming language.
So I'm going to call it BS"

#

pain

bash: curl: command not found
#

I'm still halfway through trying to install mojo
(or rather, forgetting I'm doing that)

pine dune
#

Can someone explain me how to calculate:
w * = + + z โ€“ ( โ€“ โ€“ y ) + 2 * โ€“ z โ€“ โ€“ ;
It's c, I'm new to it but needs to learn cause University

peak junco
vocal basin
#

libcurl likely isn't installed either

pine dune
#

ints

vocal basin
#

values not types

pine dune
vocal basin
#

is this an exam? or homework?

short owl
#

test question ?

vocal basin
#

you know what *= does, right?

pine dune
#

This is from presentation

vocal basin
#
// x = 5
x *= 3;
// x = 15
#
// x = 5
y = x++;
// x = 6
// y = 5
#
// x = 5
y = ++x;
// x = 6
// y = 6
#

same applies for --

#

this, I think, is implementation-defined

#

does C actually specify order of evaluation?

vocal basin
# pine dune

parentheses seem to just be placed based on operator precedence

#

(i.e. just clarifying how it's evaluated)

#

(-(y--))%(++z) is simpler to understand than first part because it doesn't rely on ordering

pine dune
#

How to search it on internet so I can see someone solve similar example? I don't know how to call it

vocal basin
#

I don't know if there's a name for this type of exercise

#

seems like it's just about stepping through the structure, evaluating one expression at a time

#

this can be represented as a tree

wise loom
#

And specifically the grammar of the language where the precedence of operators is defined

vocal basin
#

because that is already solved

vocal basin
#

ah

#

yeah, with two x it's difficult

#

(++x)*(x--) is either x*x or (x+1)*(x+1)

#

I'd pick latter because it comes from left-to-right evaluation of *

#
w*=((-(++x))*(x--))+((-(y--))%(++z)) x=1 y=2 z=3 w=4
w*=((-2)    *(x--))+((-(y--))%(++z)) x=2 y=2 z=3 w=4
w*=((-2)    *    2)+((-(y--))%(++z)) x=1 y=2 z=3 w=4
w*=(-4)            +((-2)    %(++z)) x=1 y=1 z=3 w=4
w*=(-4)            +((-2)    %    4) x=1 y=1 z=4 w=4
w*=(-4)            +            (-2) x=1 y=1 z=4 w=4
w*=-6                                x=1 y=1 z=4 w=4
-24                                  x=1 y=1 z=4 w=-24
wise loom
#

does it make sense to fry pasta a bit after boiling in order to dry them up a bit. i have tortellini

pine dune
vocal basin
#

it assumes that, in p*q, p is evaluated before q

#

this is guaranteed in Python and many other languages
but, iirc, not in C

#

i.e. (-(++x))*(x--) is actually not defined, but I doubt it matters much here

vocal basin
#

idk

#

it might be defined in some compilers

pine dune
#

w += (-(++x))+(x--)+(-(y--))%(++z) x=1 y=2 z=3 w=4
w += -(2) +(1) -(1)%(4) x=1, y=1, z=4, w=4
w += 1-1%4 x=1, y=1, z=4, w=4
w += 0
x=1, y=1, z=4, w=4

#

Right?

vocal basin
#

y-- becomes 2 not 1

#

because -- is after y

#

also it should be *= not +=

pine dune
#

so --y is permament and y-- is temporary?

vocal basin
vocal basin
#

after decrementing y

#
// y = 5
y-- // = 5
// y = 4
#
// y = 5
--y // = 4
// y = 4
pine dune
#

Ok, will try again

#

w += (-(++x))+(x--)+(-(y--))%(++z) x=1 y=2 z=3 w=4
w += -(2) +(2) -(2)%(4) x=1, y=1, z=4, w=4
w += -2%4 x=1, y=1, z=4, w=4
w += -2
x=1, y=1, z=4, w=2

#

Small corection
w+= 2
w=6

vocal basin
#

(-2)%4==-2 in C because it's remainded not modulo

#

for original task, it would be this (just switched + to * accordingly)

w *= -(2)*(2) (-2)%(4)

which would give the expect result (w=-24)

steep juniper
#

anyone willing to review 420 lines of code i wrote for school

pine dune
wise cargoBOT
#
Pasting large amounts of code

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.

steep juniper
#

true but what about pastebin or github

#

@vocal basin

#

how does this work

#

do i paste the link

vocal basin
#

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.

steep juniper
#

my bad

vocal basin
#

!pep8

wise cargoBOT
#
PEP 8

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:
โ€ข PEP 8 document
โ€ข Our PEP 8 song! :notes:

vocal basin
vocal basin
vocal basin
#

is None is preferred over == None

steep juniper
#

ok

vocal basin
#

and is not None over != None

#

!e

print(None is None)
print(5 is not None)
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | /home/main.py:2: SyntaxWarning: "is not" with 'int' literal. Did you mean "!="?
002 |   print(5 is not None)
003 | True
004 | True
vocal basin
#

(don't do this for literals)

#

!e

print(None is None)
x = 5
print(x is not None)
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | True
002 | True
steep juniper
#

i see

vocal basin
steep juniper
#

how is that

vocal basin
#

reason for using is with None is that

  1. there's only one None in existence
  2. ==None can be overloaded by a custom type, in which case comparison may be inaccurate
vocal basin
#

!e

print((100**100) is (100**100))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.

False
steep juniper
#

i see

#

ohhh

#

its comparing the objects

#

not the actual values

vocal basin
#

yes

steep juniper
#

and then != is for evaluating values

#

use is not on strings

#

only

#

and operators on ints

#

unless your concatinating strings

#
string1 = 'hi'
string2 = 'how are you'
string3 = string1 + string2
print(string3)
#

how did you run the code

#

in here

#

with the bot

vocal basin
#

!e
```py
print(5)
```

steep juniper
#

ok

#

!e

string1 = 'hi'
string2 = 'how are you'
string3 = string1 + string2
print(string3)
wise cargoBOT
#

@steep juniper :white_check_mark: Your 3.12 eval job has completed with return code 0.

hihow are you
steep juniper
#

lolol

#

any other general pointers

vocal basin
steep juniper
#

i see

vocal basin
steep juniper
#

i think i have done something simaler when i was iterating through object lists

#

ok

#

overall its just a basic game

#

but i think i did good on the logical parts

vocal basin
#

just so it doesn't get created/deleted each iteration

steep juniper
#

it should just live outside of the while loop then

vocal basin
#

moving it to before while starts should be good enough

steep juniper
#

ok

vocal basin
steep juniper
#

ok im still unsure about about exceptions work

vocal basin
steep juniper
#

and how try except actually works

vocal basin
#

!e

{}[2]
wise cargoBOT
#

@vocal basin :x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     {}[2]
004 |     ~~^^^
005 | KeyError: 2
steep juniper
#

oh no because im calling a function, the function is just stored in the dict relative to the key

#

if the key is invalid it errors out and prints invalid choice

#

then reloops

#
choices[choice[0][0]](choice[1][0])
#

the () on the right of the dictionary call are the function areguments

vocal basin
#
try:
    action = actions[choice]
except KeyError:
    clear()
    print('Invalid choice.')
    time.sleep(1)
    continue
try:
    action()
except Exception:
    traceback.print_exc()
    input("an internal error occured. continue?")
steep juniper
#

that is longer tho

#

its faster to just call it from the dict than to store it in another place first

#

i do like that decision branching though where you can choose to continue.

#

one thing I'm unsure about is if its ok to put all of the functions with he player object

#

the

wise loom
#

is there a professional channel somewhere?

vocal basin
urban hamlet
#

amongus

vocal basin
#

the choice often is between controlled and uncontrolled modification

#

law can only ban the former

tight pivot
#

hello

#

uhm

#

i have a question

#

is it okay

#

uhm this is not the question

#

but

#

can i have permission to open my mic?

#

okay okay

#

uhm

#

i have this problem

vocal basin
tight pivot
#

how do i get it to print their bmi status and not just the numbers

vocal basin
#

function isn't being called

tight pivot
#

how do i fix that

vocal basin
#
print(bmi)
#     ^^^ this should be different
tight pivot
#

its my first time working with the else if thing

#

i see

#

i seee

#

wait a sec

#

ill check

#

im trying to learn python

#

yes

#

thats what i need hahaha

#

no unfortunately

vocal basin
#

print is a function too

tight pivot
#

i see

#

i missed () at the end

#

haha i put (categorize_bmi)

#

and didnt put

#

(categorize_bmi(bmi))

#

yes yes

#

yes

#

thanks mannn

#

it worked as i wanted

#

this month

vocal basin
# tight pivot

iirc, Ctrl+Alt+L in PyCharm reformats the code to make it easier to read
(will be very useful later on for larger projects)

tight pivot
#

i want to pursue it

#

IT

#

yes

#

college is next month

#

just getting a headstart

vocal basin
#

I think PyCharm embedded this style lint into my brain

tight pivot
#

also new skill

vocal basin
#

missing newline

#

at the end

#

I don't remember what extension that was (maybe misconfigured prettier),
it automatically removed the trailing newline

#

horrible

#

(in VS Code)

#

rustfmt is slightly weird with newlines in one specific case

#

it changes an empty file to be a single newline

vocal basin
#

I still haven't found a way to show Python/Rust style issues in VSC
but that's kind of not as important to me now as it used to be
(because now I myself see if something is off + everything gets auto-reformatted anyway)

shy raft
#

the pun programming language is coming together

haughty fog
#

yea

shy raft
#

spider!

cosmic bison
#

hi

cosmic bison
shy raft
#

yeah

#

more like idioms

#

but yeah

cosmic bison
#

close enough

shy raft
#

any features you want?

haughty fog
shy raft
#

ah yes

vocal basin
#

you can checkout other repositories in actions

#

even private, but that's difficult

#

GitHub use either VM or Container

#

there likely exist prepared actions to install stuff

vocal basin
somber heath
#

@kindred blade @dreamy shore ๐Ÿ‘‹

vocal basin
#

yaml moment

haughty fog
vocal basin
#

I still have only, like, cargo-cult-ish understanding of how yaml is structured

cosmic bison
haughty fog
#

reads your mind

vocal basin
#

it just outputs "you already know what the problem is"

cosmic bison
cosmic bison
haughty fog
#

something like that

#

what's the iq of a snake?

vocal basin
#

"my react project isn't working"
the "react project":

cosmic bison
vocal basin
#

how many snakes are there?

haughty fog
shy raft
#

what

#

fine

haughty fog
#

you heard me

untold hemlock
#

hi

#

anyone here good with selenium

shy raft
#

sssss
ss
ssssss

vocal basin
untold hemlock
#

does anyone know how to incorperate a captcha solver into a selenium script?

haughty fog
#

happy?

vocal basin
# cosmic bison at least 7

for any snake to have an iq of below 10, there needs to be at least a billion snakes
so, likely, correct

untold hemlock
#

o

wind raptor
#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

vocal basin
#

mostly because getting funding to develop that is problematic,
unless you either are running a captcha company yourself or are funded by government

#

another reason why saying "AI is dumber than humans because it can't solve captchas" is quite incorrect

haughty fog
#

do fish ever get thirsty?

cosmic bison
#

not sure why you would want netflix and the GIL

vocal basin
shy raft
haughty fog
#

why's it called a "pair of pants" when there's only one?

shy raft
#

um

haughty fog
shy raft
#

no

#

idiomic

haughty fog
#

why

shy raft
#

@wind raptor ur mic is low

#

I DIED

vocal basin
shy raft
#

?

cosmic bison
haughty fog
# shy raft idiomic
  'ssss',
  'ssss',
  'ssssss',
  'ssssss',
  'ss',
  'sssss',
  'sssss',
  'sssss',
  'ss',
  'ssss',
];

sssss sssss = sssss[Ssss.sssss(ssss.ssssss() * sssss.ssssss)];

ssssssss.sss(`ssssssss sssss sssssss: ${ssss}`);
#

snake

cosmic bison
#

all non-s characters (other than symbols) are ignored as comments

haughty fog
#

indeed

vocal basin
shy raft
haughty fog
cosmic bison
shy raft
#

so...

cosmic bison
#

so...

shy raft
#

quick
72/8 + 32

haughty fog
#

5

cosmic bison
#

41

shy raft
haughty fog
#

thank u

cosmic bison
#

you accidentally replied to me. You should have replied to aim

vocal basin
#

I can't count

shy raft
haughty fog
#

i already know

vocal basin
cosmic bison
#

lol

shy raft
#

why is no one talking in the vc

haughty fog
shy raft
#

tf

haughty fog
#

very wise

#

i broke it

shy raft
#

im making it rn

haughty fog
#

very productive

shy raft
#

ah yes

#

so how would you make an S-Lang program where you print numbers 0 to 10

vocal basin
#

you can just use s and S to represent this
https://en.wikipedia.org/wiki/Iota_and_Jot

In formal language theory and computer science, Iota and Jot (from Greek iota ฮน, Hebrew yodh ื™, the smallest letters in those two alphabets) are languages, extremely minimalist formal systems, designed to be even simpler than other more popular alternatives, such as the lambda calculus and SKI combinator calculus. Thus, they can also be consider...

shy raft
#

i see

vocal basin
#

(Sss)(a)=a
(SsSsSss)(a)(b)=b
(SsSsSsSss)(a)(b)(c)=(a(b))(a(c))
in that notation

shy raft
#

how will the snakes pronounce parantheses

vocal basin
#

without parentheses

#

SsSsSsSss is a complete program

shy raft
#

okie

vocal basin
haughty fog
#

innovation

shy raft
#

sSSSSSSSSSSSs

vocal basin
#

I have meaningful code that can be relatively easily transpiled into this

shy raft
#

great

#

but how do you do anything useful in it lmao

shy raft
#

how are the symbols pronounced

#

what should i add

vocal basin
haughty fog
whole bear
#

Hi

#

Alisa Hi

#

Hi @somber heath

shy raft
#

thx

vocal basin
shy raft
whole bear
#

Anyways

whole bear
#

can anyone teach me powershell?

#

@somber heath

vocal basin
#

almost always if I need something powershell-related, I just look up specific questions

whole bear
#

Thanks alisa

vocal basin
#

something terrible happened to this SVG

whole bear
#

What is that

haughty fog
haughty fog
whole bear
#

omg

somber heath
#

That startling, are they?

whole bear
#

Anyways how to get a virtual machine working?

haughty fog
#

snakelanguage.iso

whole bear
#

What is Ubuntu?

somber heath
#

I usually install virtualbox and its gui and go from there.

somber heath
#

Linux flavour.

#

Popular operating system. A lot of other distributions are based on it.

whole bear
#

How long do I left to talk in VC?

haughty fog
vocal basin
haughty fog
#

i wish

somber heath
#

You've been eligible for some time.

shy raft
vocal basin
#

okay, so the code compiled and synced, that's already quite impressive

#

now I need 3 numbers between 1 and 1000

#

!e

from random import randrange
x = randrange(1000)
y = randrange(1000)
z = randrange(1000)
print(x, y, z)
print(pow(x, y, z))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | 927 611 957
002 | 927
shy raft
#

erm

vocal basin
#

wha

shy raft
#

uhh

vocal basin
#

wait, why is it same

#

!e

from random import randrange
x = randrange(1000)
y = randrange(1000)
z = randrange(1000)
print(x, y, z)
print(pow(x, y, z))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | 154 218 158
002 | 128
haughty fog
#

!e

wise cargoBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

Run Python code and get the results.

This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.

Currently only 3.12 version is supported.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!

vocal basin
haughty fog
#

!e
print('bob')

wise cargoBOT
#

@haughty fog :white_check_mark: Your 3.12 eval job has completed with return code 0.

bob
vocal basin
#

unsurprising given the compiled artifact is 5MB

vocal basin
#

I don't think I have hyper-V enabled

#

VirtualBox itself is relatively easy to use, afaik

#

haven't changed much since it was Sunโ„ข๏ธ VirtualBox

vocal basin
shy raft
#

holy

#

the vc isnt working for me

vocal basin
#

rtc hell moment

#

a common failure mode

haughty fog
#

brave

#

snake browser

#

yea

vocal basin
#

Chrome/Firefox/Edge depending on situation

haughty fog
#

opera is a virus itself

vocal basin
#

Edge is chrome anyway

#

and so is Opera

shy raft
#

edge has more precise search results while google has more

vocal basin
#

edge isn't a search engine

#

Brave is chromium-based too

#

everything is Chrome nowadays

#

except for Firefox and Safari

haughty fog
#

doesn't edge use google?

#

nah

vocal basin
#

edge uses whatever you configure it to use

haughty fog
#

im using duckduck ngl

vocal basin
#

Tor defaults to duckduckgo

somber heath
#

@prime bobcat ๐Ÿ‘‹

shy raft
vocal basin
#

duckduckgo turned out not as independent and no-tracking as they claimed

prime bobcat
#

hello guys

haughty fog
#

2

vocal basin
prime bobcat
#

chatgpt is awesome lol

shy raft
#

bing ai better

#

it doesnt have a knowledge cutoff

haughty fog
haughty fog
prime bobcat
#

is teaching me how to code python so i like gepeto

haughty fog
#

hacking browser?

somber heath
#

Please don't rely by on chatgpt to teach you Python.

vocal basin
haughty fog
prime bobcat
#

i mean i read the documentation but i ask gepeto to solve stuff or make my code better

vocal basin
#

@whole bear participate in CTFs

haughty fog
#

you capture the flag

#

capture a flag

vocal basin
#

metaphorical flag being a secret key

somber heath
#

@ashen hollow @spice wave ๐Ÿ‘‹

prime bobcat
#

print("{player['Hp']}/{player['MaxHp']}")

haughty fog
prime bobcat
#

i was having issues with that

vocal basin
#
print(f"{player['Hp']/player['MaxHp']}")
prime bobcat
#

but using gpt for info instead of just asking him to code

vocal basin
#

this?

prime bobcat
#

is pretty damn good

ashen hollow
#

why?

prime bobcat
#

oh okay charizard

#

ty

haughty fog
ashen hollow
#

omg using markdown please xD

prime bobcat
#

yeah alisa, i didnt know i should use f before

haughty fog
#

format

somber heath
#

@unreal otter ๐Ÿ‘‹

prime bobcat
#

shes an unicorn

haughty fog
ashen hollow
#
This is an example markdown
pr1nt("{play3r['Hp']}/{pl@y3r['M@xH?']")
haughty fog
prime bobcat
#

how do i paste my code as that Cloud?

vocal basin
#

players are breaking into target computer

#

competing for who gets first

haughty fog
ashen hollow
#
pr1nt("{play3r['Hp']}/{pl@y3r['M@xH?']")
haughty fog
vocal basin
shy raft
#

what``is``happening``oh no

ashen hollow
#

lol xD

prime bobcat
#

hi

#

oh ty

haughty fog
#

p#in\t("{pl&y^r['H,p'],b*(^y}['M}xH?']")

ashen hollow
#

aim has a low voice!

prime bobcat
#

i cant speak yet lol

#

aim you dont want to play that game

vocal basin
# vocal basin this code works, confirmed

how to get it to work:

  1. parse it as a syntax tree this way: s is jot combinator, S<p><q> is "call <q> with argument <p>"
  2. evaluate it (the result is a function)
  3. call it with arguments: 0, 1, a => b => a + b, n => x => y => x if n == 0 else y, n => x => y => x if n & 1 else y, n => n >> 1, a, b, m
  4. result is pow(b, a, m)
haughty fog
ashen hollow
shy raft
whole bear
#

My broken laptop

ashen hollow
#

Emotional Damage

haughty fog
#

download ram

prime bobcat
#

no

ashen hollow
shy raft
prime bobcat
#

turn off the modem, wait 10 seconds and power on again

#

that will fix the problem

haughty fog
ashen hollow
vocal basin
#

the art of suggesting solutions to non-existent problems

ashen hollow
#

xD

#

lol

haughty fog
#

is he really installing more ram?

shy raft
#

||how do we tell him...||

haughty fog
haughty fog
#

๐Ÿ˜‚

ashen hollow
#

lol

#

oh bro wtf

haughty fog
#

its fine, it's godaddy

ashen hollow
#

oh nice

#

why the sky is blue?

haughty fog
ashen hollow
#

Install a new video card

#

install a new keyboard more retro!

haughty fog
#

download nvidia4090free100percent.exe

ashen hollow
#

I need a photo from your keyboard right now who has the best keyboard for programming ?

haughty fog
#

corsair k100

prime bobcat
#

hey aim

#

'hi'

#

hi

#

`import randomshit
xd = randomshit.data

print(f"{xd['1']}{xd['2']}{xd['3']}{xd['4']}{xd['5']}{xd['6']}{xd['7']}{xd['8']}{xd['9']}{xd['10']}{xd['11']}{xd['12']}{xd['13']}{xd['14']}{xd['15']}{xd['16']}{xd['17']}{xd['18']}{xd['19']}{xd['20']}{xd['21']}{xd['22']}{xd['23']}{xd['24']}{xd['25']}{xd['26']}{xd['27']}{xd['28']}{xd['29']}{xd['30']}{xd['31']}{xd['32']}{xd['33']}{xd['34']}{xd['35']}{xd['36']}{xd['37']}{xd['38']}{xd['39']}{xd['40']}{xd['41']}")`

data = { "1" : "p", "2" : "r", "3" : "i", "4" : "n", "5" : "t", "6" : "(", "7" : '"', "8" : "{", "9" : "p", "10" : "l", "11" : "a", "12" : "y", "13" : "e", "14" : "r", "15" : "[", "16" : "'", "17" : "H", "18" : "p", "19" : "'", "20" : "]", "21" : "}", "22" : "/", "23" : "{", "24" : "p", "25" : "l", "26" : "a", "27" : "y", "28" : "e", "29" : "r", "30" : "[", "31" : "'", "32" : "M", "33" : "a", "34" : "x", "35" : "H", "36" : "p", "37" : "'", "38" : "]", "39" : "}", "40" : '"', "41" : ")", }

#

i win

#

dont mind my dirty desk

haughty fog
#

clean

somber heath
#

@tranquil jasper ๐Ÿ‘‹

tranquil jasper
#

didnt realize it wouldnt let me talk lmao

somber heath
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

tranquil jasper
#

is there anyway to see how many messages ive sent

#

it says i need 50

haughty fog
#

22-23?

tranquil jasper
#

i have 22?

shy raft
#

yes

tranquil jasper
#

sweet almost halfway

shy raft
#

you need to be in the server for 3 days

#

youve been here for 2

tranquil jasper
#

oh gotchu

#

microsoft edge is terrible

haughty fog
#

nothing better

tranquil jasper
#

aim what you like to do in python

prime bobcat
#

!voiceverify

shy raft
#

straightedge

prime bobcat
#

!voice

wise cargoBOT
#
Voice verification

Canโ€™t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

tranquil jasper
#

can i not react?

shy raft
tranquil jasper
#

monke what do you like to do in python

haughty fog
#

i use snake not python

tranquil jasper
#

you deleted that message fast

shy raft
prime bobcat
#

monke, what do you use for map generators?

tranquil jasper
haughty fog
shy raft
#

S-lang for short

tranquil jasper
#

i like that

vocal basin
shy raft
prime bobcat
#

but how do you display as graphic output?

shy raft
#

pygame

prime bobcat
#

oh, i was looking at that recently

#

im using terminal only

#

whats the difference between pygame and pygame zero?

shy raft
#

idk what pygame zero is

vocal basin
#

pygame zero has extra stuff already implmented so you don't have to

#

allegedly

prime bobcat
#

like what?

vocal basin
#

most of PyGame stuff is already imported

#

event loop is built-in

prime bobcat
#

i havent used any, someone told me to stick with raw python

#

but i saw the documentation a bit

vocal basin
#

default Pygame is better for understanding what's actually happening

haughty fog
#

documentation for S-lang will be out shortly

shy raft
#

wow

vocal basin
prime bobcat
#

so, basically if you want to learn properly is better to start with pygame instead?

vocal basin
vocal basin
#

there might be things similar to Pygame Zero but less framework-ish

prime bobcat
#

they were right, you know a lot Alisa

vocal basin
#

IDK if Pygame Zero is even properly integrated with IDEs

#

this is valid pgz script but every IDE will say it has issues

WIDTH = 300
HEIGHT = 300

def draw():
    screen.fill((128, 0, 0))
#

specifically lack of imports

shy raft
#

mate

prime bobcat
#

what do you think about this libraries?
pyqt
django
mysql

vocal basin
prime bobcat
#

someone told me to start with those

shy raft
#

my maps are ๐Ÿ”ฅ

vocal basin
#

mysql isn't a library, it's a database

prime bobcat
#

oh yeah sorry

#

i asked for database too

vocal basin
shy raft
vocal basin
#

worst part about MySQL is its current owner, otherwise it's a good choice

tranquil jasper
#

wdym

vocal basin
#

Oracle

tranquil jasper
#

oh didnt realize they were the owner

#

i tried getting their like cloud free tier and literally just kept getting stuck when i tried to validate payment and i looked up like if other people where having this problem and every one was bad mouthing them pretty much

vocal basin
#

MariaDB, as a MySQL fork, was started due to Oracle takeover

tranquil jasper
#
#this is so cool i didnt realize you could put the language in the top
def send(msg):
    message = msg.encode(FORMAT)
    msg_length = len(message)
    send_length = str(msg_length).encode(FORMAT)
    send_length += b' ' * (HEADER - len(send_length))
    client.send(send_length)
    client.send(message)
    print(client.recv(2048).decode(FORMAT))

send(DISCONNECT_MESSAGE)
shy raft
#
print('ikr')
tranquil jasper
#
cout << "omg this is so litty" << endl;
#
class Me:
  def __init__(self, smort):
    self.smort = smort
  def let_people_know_how_smort(self):
    print('smortness level:', self.smort)

me = Me(10000000000)
me.let_people_know_how_smort()
#

anyone a tkinter fanatic?

vocal basin
#

I've helped with tkinter more than I've done anything myself, I think

tranquil jasper
#

i have a database and i need to make an app for me and my buddies to use and i was gonna make it via tkinter but ive just been kinda delaying for a week

vocal basin
#

the app only interacts with the DB, right?

tranquil jasper
#

ive made like small tkinter stuff but this would probably be like 2k lines of code

#

yeah

#

well wdym like what else would it do?

vocal basin
#

web UI might be another option instead of a tkinter app
with web server running on the same host as the DB

tranquil jasper
#

how much would i have to learn to host website?

vocal basin
#

depends

#

is the DB centralised?

#

if yes, how is it accessed normally? over the network?

tranquil jasper
#

accessed over network

#

its on a linux server through linode

#

and i use just mysql.connector to connect to it

candid juniper
#

im very greedy imo

vocal basin
#

(async is better for multiple concurrent requests)

haughty fog
#

guess what

vocal basin
tranquil jasper
#

it has documentation now?

vocal basin
#

FastAPI's sql tutorials are based on SQLAlchemy (ORM for Python)

#

so most of the documentation will be there

tranquil jasper
#

gotchu

tranquil jasper
#

aim you keeping me in suspense

#

i think the goals really fit it well

#

also i think the only way to speed up my current project is divy it up across multiple machines but i have to use requests.get for like 52 thousand links every day and it takes like 4 hours to run with threading, any thoughts to speed it up?

vocal basin
#

aiohttp

#

or httpx

#

instead of requests

vocal basin
tranquil jasper
#

kinda new to this not sure exactly what that means i dont think its cpu bound i think its just whenever it makes the requests and its waiting it fires off the next request in the list

haughty fog
vocal basin
tranquil jasper
#

can i combine threading and asyncio or just one or other

vocal basin
#

asyncio is faster without threading

#

combining them requires extra synchronisation overhead

vocal basin
#

if it does get stuck because of CPU, then multiprocessing

tranquil jasper
#

any idea what syntax would look like

#

with futures.ThreadPoolExecutor(max_workers=40) as p:
p.map(get_html_of_card, sub_links)

shy raft
#

im pretty sure map doesn't work like that

tranquil jasper
#

i mean its worked so far

vocal basin
tranquil jasper
#

its from threadpoolexecutor

#

so something like

for link in sub_links:
  asyncio.create_task(get_html_of_Card(link))
vocal basin
#

that would a little bit too much tasks, if there's 50K total

tranquil jasper
#

well i split it up into groups of 1k

#
for x in range(54):
        a = x*1000
        b = x*1000+1000

        sub_links = card_links[a:b]

        with futures.ThreadPoolExecutor(max_workers=40) as p:
            p.map(get_html_of_card, sub_links)
vocal basin
#

then it's fine, though not perfectly efficient

tranquil jasper
#

the threads would crash if i didnt them all at once

vocal basin
#

singular slow requests will slow down everything when batch-processing

tranquil jasper
#

ill try asyncio and see how fast it goes

#

oh my god im so stupid

#

is there anyway to revert back to a previous instance of mysql

#

i just deleted like my entire history table

#

from mysql connector and committed because i forgot i put it main

vocal basin
#

normally only before it's committed

vocal basin
#

(if the server takes 1 second to respond)

tranquil jasper
#

it throws all the tasks in the loop but its freezing after that

prime bobcat
#

Alisa, are u the thing that we as humans consider as god?

#

or just very close to it?

vocal basin
# vocal basin CPU I'm using is able to process 100 requests

the setup I used

total = 0

def increment():
    global total
    total += 1

async def worker(client: httpx.AsyncClient):
    while True:
        _ = await client.get("http://localhost:7780")
        increment()

async def tracker():
    while True:
        print(total)
        await asyncio.sleep(1)

async def main():
    async with httpx.AsyncClient(limits=httpx.Limits(max_connections=10000, max_keepalive_connections=10000)) as client:
        async with asyncio.TaskGroup() as tg:
            tg.create_task(tracker())
            for _ in range(100):
                tg.create_task(worker(client))
#

"http://localhost:7780" would be replaced by await queue.get()
and main would also store all tasks that were created, cancelling them once await queue.join() is done

#

and worker would also queue.task_done on each element it pulls

#

!d asyncio.Queue

wise cargoBOT
#

class asyncio.Queue(maxsize=0)```
A first in, first out (FIFO) queue.

If *maxsize* is less than or equal to zero, the queue size is infinite. If it is an integer greater than `0`, then `await put()` blocks when the queue reaches *maxsize* until an item is removed by [`get()`](https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.get).

Unlike the standard library threading [`queue`](https://docs.python.org/3/library/queue.html#module-queue), the size of the queue is always known and can be returned by calling the [`qsize()`](https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.qsize) method.

Changed in version 3.10: Removed the *loop* parameter.

This class is [not thread safe](https://docs.python.org/3/library/asyncio-dev.html#asyncio-multithreading).
tranquil jasper
#

this is current code

def get_tasks(session):
        tasks = []
        for card_link in card_links:
            tasks.append([card_link, session.get(card_link, ssl=False)])
            print(len(tasks))
        print('returning tasks')
        return tasks
    
    async def get_htmls():
        async with aiohttp.ClientSession() as session:
            tasks = get_tasks(session)
            responses = await asyncio.gather(*tasks)

            for response in responses:
                p_dict[response[0]] = await response[1].text()
                print("HTML:", len(p_dict.keys()))


    asyncio.run(get_htmls())
#

getting an error currently though

vocal basin
#

elements of tasks aren't awaitable

tranquil jasper
#

aight lemme try that

vocal basin
#

also, isn't get a context manager?

#

aiohttp works very differently from requests

#

unlike httpx

tranquil jasper
#

idk i was follwing youtube tutorial

vocal basin
tranquil jasper
#
Traceback (most recent call last):
  File "C:\Users\Aidan\p_chart_server.py", line 533, in <module>
    main()
  File "C:\Users\Aidan\p_chart_server.py", line 464, in main
    asyncio.run(get_htmls())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Aidan\p_chart_server.py", line 457, in get_htmls
    responses = await asyncio.gather(*tasks)
                      ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 827, in gather
    fut = _ensure_future(arg, loop=loop)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 674, in _ensure_future
    raise TypeError('An asyncio.Future, a coroutine or an awaitable '
TypeError: An asyncio.Future, a coroutine or an awaitable is required
sys:1: RuntimeWarning: coroutine 'ClientSession._request' was never awaited
#

currently getting this

vocal basin
#
tasks.append(session.get(card_link, ssl=False))
#

(list isn't awaitable)

tranquil jasper
#

but i need the card link

#

do i need to like make another dictionary and just input the response to get the link

vocal basin
#

you can return that separately, then zip together

tranquil jasper
#

oh you right lmao

#

im losingit

vocal basin
#

or create a coroutine that both does session.get and returns card_link

#

and may even do await response.text() inside that coroutine

#

so that it's all concurrent

tranquil jasper
#

i realized i could just do it by index since its already sending them in order

#

and we back to freezing again

prime bobcat
#

I love listening this guys

#

sad

tranquil jasper
#

oh its probably not freezing its just actually making the requests

#

i wish there was a way to tell

#

yup thats what its doing!

tranquil jasper
#

yeah its just struggling with larger amounts at a time

prime bobcat
#

yeah men, shes a god helping everyone here

#

someone taught me how to use dictionary variable values into print

#

but i cant get it

#

i mean i understand the For loop

tranquil jasper
#

wdym?

#

show code

prime bobcat
#

`import randomshit
xd = randomshit.data

output = ''
for x in xd:
output += xd[x]

print(output)`

#

he explain something like this right?

tranquil jasper
#

do you want output to be a list?

prime bobcat
#

because he saw my code, sorry for the lenght

#

data = { "1" : "p", "2" : "r", "3" : "i", "4" : "n", "5" : "t", "6" : "(", "7" : '"', "8" : "{", "9" : "p", "10" : "l", "11" : "a", "12" : "y", "13" : "e", "14" : "r", "15" : "[", "16" : "'", "17" : "H", "18" : "p", "19" : "'", "20" : "]", "21" : "}", "22" : "/", "23" : "{", "24" : "p", "25" : "l", "26" : "a", "27" : "y", "28" : "e", "29" : "r", "30" : "[", "31" : "'", "32" : "M", "33" : "a", "34" : "x", "35" : "H", "36" : "p", "37" : "'", "38" : "]", "39" : "}", "40" : '"', "41" : ")", }

tranquil jasper
#
import randomshit
xd = randomshit.data

output = ''
for x in xd.keys():
 output += xd[x]

print(output)
#

try that

prime bobcat
#

and i printed like this because aim was trolling me with some code i send

tranquil jasper
#

im not sure if that will output in order or not

prime bobcat
#

`import randomshit
xd = randomshit.data

print(f"{xd['1']}{xd['2']}{xd['3']}{xd['4']}{xd['5']}{xd['6']}{xd['7']}{xd['8']}{xd['9']}{xd['10']}{xd['11']}{xd['12']}{xd['13']}{xd['14']}{xd['15']}{xd['16']}{xd['17']}{xd['18']}{xd['19']}{xd['20']}{xd['21']}{xd['22']}{xd['23']}{xd['24']}{xd['25']}{xd['26']}{xd['27']}{xd['28']}{xd['29']}{xd['30']}{xd['31']}{xd['32']}{xd['33']}{xd['34']}{xd['35']}{xd['36']}{xd['37']}{xd['38']}{xd['39']}{xd['40']}{xd['41']}")
`

#

manually

#

so he told me to use for loop to make it, it works with any of the 2 methods for output the text right?

tranquil jasper
#

!e

data = {
    "1" : "p",
    "2" : "r",
    "3" : "i",
    "4" : "n",
    "5" : "t",
    "6" : "(",
    "7" : '"',
    "8" : "{",
    "9" : "p",
    "10" : "l",
    "11" : "a",
    "12" : "y",
    "13" : "e",
    "14" : "r",
    "15" : "[",
    "16" : "'",
    "17" : "H",
    "18" : "p",
    "19" : "'",
    "20" : "]",
    "21" : "}",
    "22" : "/",
    "23" : "{",
    "24" : "p",
    "25" : "l",
    "26" : "a",
    "27" : "y",
    "28" : "e",
    "29" : "r",
    "30" : "[",
    "31" : "'",
    "32" : "M",
    "33" : "a",
    "34" : "x",
    "35" : "H",
    "36" : "p",
    "37" : "'",
    "38" : "]",
    "39" : "}",
    "40" : '"',
    "41" : ")",
}

output = ''
for x in data.keys():
 output += data[x]

print(output)
wise cargoBOT
#

@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.

print("{player['Hp']}/{player['MaxHp']}")
tranquil jasper
#

yeah so you for loop through the keys of the dictionary which i think it does in the order that you add them in

prime bobcat
#

`import randomshit
xd = randomshit.data

for x in xd:
print(x)`

#

and here it prints the name of the variable right?

#

wtf this does output = ''

#

" "

#

this

tranquil jasper
#

it would have to be xd.keys() so like

for x in xd.keys()
prime bobcat
#

''