#voice-chat-text-0

1 messages ¡ Page 32 of 1

whole bear
#

Imma need yalls help later

#

Not now tho

gentle flint
#

and just what do you expect anyone to do with that information

#

"yes sir, we are sitting eagerly on the edges of our chairs until you do indeed require our humble assistance"

lethal thunder
#

import tensorflow as tf

#

tensorflow.python.framework.errors_impl.NotFoundError: D:\real_Python\projects\test\lib\site-packages\tensorflow-plugins\tfdml_plugin.dll not found

karmic elk
#

The Feynman Technique

warm vapor
#

What are the best projects you guys made so far

whole bear
#

okayy so how do i divide 24 to get 4?

#

sorry lets try 16/4 equals 4

#

sorry divided by 2 which gives you 8

#

nvm found a way

gentle flint
#

excellent

shadow sable
#

Yo

uncut meteor
#

!e

x = [1,3,54,7,1,3]
y = [3,6,2,54]

z = set(x) ^ set(y)
print(z)
wise cargoBOT
#

@uncut meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

{1, 2, 6, 7}
rugged root
#

It's what I'm most proud of

#
x = [1, 2, 3, 3, 3]
y = [2, 1, 3]
uncut meteor
#

!e

x = [1,3,54,7,1,3]
y = [3,6,2,54]

z = set(x) & set(y)
print(z)
wise cargoBOT
#

@uncut meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

{3, 54}
rugged root
#

!d set

wise cargoBOT
#
set

class set([iterable])``````py

class frozenset([iterable])```
Return a new set or frozenset object whose elements are taken from *iterable*. The elements of a set must be [hashable](https://docs.python.org/3/glossary.html#term-hashable). To represent sets of sets, the inner sets must be [`frozenset`](https://docs.python.org/3/library/stdtypes.html#frozenset "frozenset") objects. If *iterable* is not specified, a new empty set is returned.

Sets can be created by several means:

• Use a comma-separated list of elements within braces: `{'jack', 'sjoerd'}`

• Use a set comprehension: `{c for c in 'abracadabra' if c not in 'abc'}`

• Use the type constructor: `set()`, `set('foobar')`, `set(['a', 'b', 'foo'])`...
rugged root
#

!e

x = [1, 2, 3, 3, 3]
y = [2, 1, 3]

print(set(x) == set(y))
wise cargoBOT
#

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

True
uncut meteor
#

!e

x = [1, 2, 3, 3, 3, 4]
y = [2, 1, 3]

print(set(x) == set(y))
wise cargoBOT
#

@uncut meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

False
warm vapor
uncut meteor
#

!e

list_user1 = ["Dave", "Jermirah", "Kelli"]
list_user2 = ["Kelli", "Simon", "Jeff"]


z = set(list_user1) & set(list_user2)
print(z)
wise cargoBOT
#

@uncut meteor :white_check_mark: Your 3.11 eval job has completed with return code 0.

{'Kelli'}
rugged root
#

Yep, as part of that you add in your own bot token. Whole process is you make a bot, give the auto_guild script a template of what you want the guild to look like and the bot token, it then has the bot create the server, get the id's for all the categories and channels, gives you a link to invite you to the server, then transfers ownership to you

#

So it's meant to be a quick way to make a testing server

warm vapor
#

I was trying to make a terminal version of discord but i got scared they will ban me if i use discord api because discord dont allow third party

#

electric cars are evil

whole bear
#

print(4+4)
print(4*2)
print(14-6)
print(16//2)

#

which all gives you 8

#

how come i dont get a border around my code?

warm vapor
#

!code

uncut meteor
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

whole bear
#

!code

#

huh?

warm vapor
#

it has a cooldown

rugged root
#

You use the backticks like it says in the message embed

#

Not the code command itself

#

That's just to explain how to use the built in highlighting

whole bear
#

!code

rugged root
#

Back in a sec

uncut meteor
#

!poll "So you have a CS or Engineering degree, you have a degree for which you passed some programming courses and when you are interviewing for a job you are asked to complete some tests, to check you aren't a liar. A lot of the questions look the same, discuss if this is good or bad." "Sit in silence"

wise cargoBOT
#
Bad argument

The title cannot be longer than 256 characters.

#
Command Help

!vote <title> [options...]
Can also use: poll

Build a quick voting poll with matching reactions with the provided options.

A maximum of 20 options can be provided, as Discord supports a max of 20 reactions on a single message.

molten pewter
#

GTG cy a later 👋

golden hazel
#

Can someone help me fix the "name not defined problem"...its clearly defined and the program works in Pycharm but its not working in VSCode

rugged root
#

When you get into the Python REPL (shell, whatever you want to call it), you're not loading any other files

#

So it's just acting as if it's a blank page to work from. To the shell, there really isn't a function named that

golden hazel
#

wut? How do i fix that

rugged root
#

I'll answer in a moment, sorry.

#

Trying to investigate something for work

golden hazel
#

no problem

warm moth
#

just run python nameOfFile.py

rugged root
#

That lets you run it, but not play around with it in the repl after

warm moth
#

the function is not defined in the repl enviorment

#

if you want to play around with the code then you will have to wite the code again in the repl enviorment

#

and then play with or you can use jupyter notebook

golden hazel
#

wait...so if i make a new project in Pycharm...write my code...bla bla..and then i open the file in VSC...it wont work?

rugged root
#

It will

#

A .py file is a .py file wherever

#

But one editor may offer perks that others don't

#

I'm trying to remember, I know there's a way to do this, but my attention is split right now

golden hazel
#

im lost....lemme join the voice chat..maybe its easier to explain it by saying it and not typing it

rugged root
#

So between where you have the path to the python.exe and the file, add -i. So it'd be like python -i file.py

south torrent
#

hey guys someone can give me some python project for beginner?

#

ideas

rugged root
#

!kindling

wise cargoBOT
#

Kindling Projects

The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

rugged root
#

This is a great place to poke around for ideas

south torrent
#

thk

whole bear
#

how do i get borders around my code in chat?

rugged root
#

So for single lines, you use a single set of backticks. On US keyboards, it shares a key with the tilde ~ key, next to 1 on the number row

#

For larger blocks, you use three backticks

whole bear
#

have a problem here

gentle flint
#

how about py -m venv env

rugged root
#

Yeah, use py instead if you're on windows

subtle stone
#

Hello hemlock , hope you are well

#

Haha , I’ve been good

#

If I was rich I’d bribe you to name your son Cleveland

#

Eh I’m not rich so I was out of luck anyway

peak lily
#

@rugged root @midnight agate why "the system" you use in office should matter when choosing a cloud provider, seems unrelated, or am i missing something

#

are you "HARDCORE"?

gentle flint
#
let parser = (preprocessedScannedText, symboltable) => {
    let p1 = 0;
    let p2 = 0;
    let p3 = 0;
    let p4 = 0;
    let p5 = 0;
    
    while (true) {
        if (preprocessedScannedText[p1] === "if") {
            //base case
            if (p2 < p1) p2 = p1 + 1; //used to find (, has to be 1 symbol next to if
            if (preprocessedScannedText[p2] === "(") {
                if (p3 < p2) p3 = p2 + 1; //used to find )
                if (preprocessedScannedText[p3] === ")") {
                    if (p4 < p3) p4 = p3 + 1; //used to find {, optional
                    if (preprocessedScannedText[p4] === "{") {
                        if (p5 < p4) p5 = p4 + 1; //used to find }, mandatory again
                        if (preprocessedScannedText[p5] === "}") {
                            console.log("valid if");
                            p1 = p5 + 1;
                            continue;
                        } else if (p5 === preprocessedScannedText.length - 1) {
                            console.error("error, expected '}' at line X");
                        } else {
                            p5++;
                            continue;
                        }
                    } else {
                        console.log("valid if"); //because no { is found
                        p1 = p3 + 1;
                        continue;
                    }
                } else if (p3 === preprocessedScannedText.length - 1 && p3 !== ")") {
                    console.error("error, expected ')' at line X");
                } else {
                    p3++; //increment p3
                    continue;
                }

            } else if (p2 === preprocessedScannedText.length - 1 && p2 !== "(") {
                console.error("error, expected '(' at line X")
            }
        } else if(p1 === preprocessedScannedText.length - 1) {
            break;
        } else {
            p1++;
            continue;
        }
    }

}
peak lily
#

what does this do

trail mural
#

everything

gentle flint
#

an awful thing

peak lily
gentle flint
#
export function scan(source, parent, namespace) {
  if (typeof source == "string")
    return (
      parent.appendChild(
        window.document.createRange().createContextualFragment(source)
      ) && parent
    );
  if (source)
    Object.entries(source).forEach(function ([key, value]) {
      if (!value) return;
      if (key == "#text" || value.nodeName)
        return parent &&
          (value = value.nodeName
            ? value
            : window.document.createRange().createContextualFragment(value))
          ? parent.appendChild(value)
          : value instanceof window.DocumentFragment
          ? value
          : value[0];
      if (["string", "number", "boolean"].includes(typeof value))
        return parent.setAttribute(key, value.toString());
      if (key == "svg") namespace = svgns;
      Object.entries(
        {
          a: { target: "_blank" },
          svg: { viewBox: "0 0 1 1", xmlns: "http://www.w3.org/2000/svg" },
        }[key] || {}
      ).forEach(([key, attribute]) => (value[key] = value[key] || attribute));
      if (!parent || !parent.appendChild) parent = undefined;
      parent = [parent, ...(Array.isArray(value) ? value : [value])].reduce(
        function (parent, source) {
          let child = [...(namespace ? [namespace] : []), key];
          try {
            child = window.document["createElement" + (namespace ? "NS" : "")](
              ...child
            );
          } catch (fail) {
            return parent;
          }
          if (!parent) return scan(source, child, namespace);
          if (value) scan(source, parent.appendChild(child), namespace);
          return parent;
        }
      );
    });
  return parent;
}
gentle flint
trail mural
#

Hi there

golden hazel
#

anyone willing to help me write this code in Python?

#
function getDominator(n) {
    const mapa = {};

    for (let val of n) {
        if (mapa[val] == undefined) {
            mapa[val] = 0;
        }

        mapa[val] += 1;

        if (mapa[val] / n.length >= 0.5) {
            return val;
        }
    }

    return null;
}

const niz1 = [ 1, -2, 0, 1, -2, 1, 1, 7, -2, 1, 1, -2 ];
console.log( getDominator(niz1) );

const niz2 = [ -2, 1, -2, 7, -2, 1, -2 ];
console.log( getDominator(niz2) );
rugged root
#

@midnight agate Did you die?

willow light
#

capybara - the BROdent

gentle flint
willow light
gentle flint
gentle flint
willow light
#

Flying squirrels are really cool. I do wish we had more of those. I've only seen a dozen in the wild so far this year.

#

I've seen far more moose.

#

I brake for moose. It's why I'm still alive today.

rugged root
#

A bird that gives itself bunny ears in pictures

#

"Harpy Eagle"

gentle flint
rugged root
gentle flint
#

@frigid panther this was the disgusting piece of code which I was using locks in

golden hazel
#

what is "undefined" from JS in Python?

rugged root
#

There is no equivalent

#

If it's undefined, it's a name error

golden hazel
#

what about Null?

gentle flint
#

None

#

js doesn't have Null though

#

it has null

golden hazel
#

so if i wanted to see if the list is empty, how would my "if" statement look like

rugged root
#

You can just do if not my_list:

#

Empty lists will evaluate as falsey

golden hazel
#
if (mapa[val] == undefined) {
            mapa[val] = 0;
        }```
rugged root
#

Same with empty strings, dictionaries, tuples, etc

#

Ah, that'd be a dictionary in that case

golden hazel
#
        if map[arr[i]] is None:
            map[arr[i]] = 0```i
rugged root
#

And in that case you'd do either of these:

golden hazel
#

i did something like this and its not working

rugged root
#
ham = "pork"
spam = {}

if ham not in spam:
  ...

# or alternatively

if spam.get(ham) is None:
  ...
golden hazel
#

thanks mate

gentle flint
#

how about spham

#

then you have ham in spham

rugged root
#

The former would be preferred in this case

golden hazel
#
function getDominator(n) {
    const mapa = {};

    for (let val of n) {
        if (mapa[val] == undefined) {
            mapa[val] = 0;
        }

        mapa[val] += 1;

        if (mapa[val] / n.length >= 0.5) {
            return val;
        }
    }

    return null;
}

const niz1 = [ 1, -2, 0, 1, -2, 1, 1, 7, -2, 1, 1, -2 ];
console.log( getDominator(niz1) );

const niz2 = [ -2, 1, -2, 7, -2, 1, -2 ];
console.log( getDominator(niz2) );```
#
def dominator(arr):
    map = []
    for i in arr:
        if map[arr[i]] not in map:
            map[arr[i]] = 0

        map[arr[i]] += 1

        if map[arr[i]] / len(arr) >= 0.5:
            return arr[i]

    return None

array = [ 1, -2, 0, 1, -2, 1, 1, 7, -2, 1, 1, -2 ]
print(dominator(array))```
rugged root
#

!e

from collections import defaultdict

def denominator(numbers):
  number_dict = defaultdict(int)
  for number in numbers:
    number_dict[number] += 1
    if (number_dict[number] / len(numbers)) >= 0.5:
      return number
  return None

ham = [ 1, -2, 0, 1, -2, 1, 1, 7, -2, 1, 1, -2 ]
print(denominator(ham))
wise cargoBOT
#

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

1
rugged root
#

@golden hazel This work for you?

lethal thunder
#

tensorflow.python.framework.errors_impl.NotFoundError: D:\real_Python\projects\test\lib\site-packages\tensorflow-plugins\tfdml_plugin.dll not found

rugged root
lethal thunder
real solstice
#
print(tf.__file__)
with open(r'D:\real_Python\projects\test\lib\site-packages\tensorflow-plugins\tfdml_plugin.dll', 'rb') as f:
    data = f.read(4)
    print(int.from_bytes(data, "big"))
#

I can't talk in vc since I don't have enough messages yet

tidal shard
#

hahahaha

rugged root
#

He has the time, not the messages

tidal shard
#

ah

lethal thunder
#

<_io.TextIOWrapper name='D:\\real_Python\\projects\\test\\lib\\site-packages\\tensorflow-plugins\\tfdml_plugin.dll' mode='r' encoding='cp1252'>

real solstice
#

I've been here for 4+ years LUL

rugged root
#

You're like..... 5 messages away

real solstice
#

4 now [inb4 banned for spamming]

rugged root
#

I'm not that much of a hard ass

#

And you've been having genuine conversations with us

lethal thunder
tidal shard
lethal thunder
real solstice
#

"I aM dOinG mY hOmeWoRk!!!"

real solstice
#

I wish I had python homework in hs, I was stuck using QBASIC

lethal thunder
real solstice
#

it wasn't actually homework, I finished all the labs in shop class [lathe, mechanical drawing, cnc] and used the computer for programming

rugged root
#
py -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
lethal thunder
rugged root
#

py -m pip list

lethal thunder
#

tensorflow 2.11.0

real solstice
rugged root
#

!e print(len('D:\real_Python\projects\test\lib\site-packages\tensorflow-plugins\tfdml_plugin.dll'))

wise cargoBOT
#

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

78
#

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

82
rugged root
#
py -m pip install tensorflow-cpu
lethal thunder
rugged root
#

py -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

gentle flint
#

solution: use linux

lethal thunder
#

tf.Tensor(962.38074, shape=(), dtype=float32)

gentle flint
#

exactly

#

linux

#

they know where it's at

rugged root
#

py -3.9

lethal thunder
rugged root
lethal thunder
#

virtualenv --python=<python_version> <path/to/new/virtualenv/>

rugged root
#

That was the last version of Python 2

#

`

whole bear
#
f = open('Race_results.txt', 'r')
content = f.read()
list_break = content.split("\n")
for i in list_break:
  content = i.split()
  namn = content[0:2]
  nummer=(content[2:])
  string=" ".join(nummer)
  minvärde=min(string)
  maxvärde=max(string)
  print(type(string))
  medelvärdet=sum(string)/len(string)

  print(namn[0],namn[1])
  print(sorted(nummer))
  print("bästa tid: ",minvärde)
  print("sämsta tid:",(maxvärde))
  print( )
#

Erik Eriksson 11.47 12.7 10.98 12.04 12.0 12.43 10.47 11.82 10.91 10.37

rugged root
#

string = "".join(number)

#

Can you give the full error and traceback?

#

I legit forgot there was a statistics built in

wise cargoBOT
#

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

1.5
rugged root
#

That'll tell you what you need to know about the voice gate

languid cargo
#

if there is anyone is availbe now i've simple problem in coding

rugged root
#

What's the question?

languid cargo
#

can you join room to share my screen

#

same

#

error

#

how can i fixe it

#

another problem

whole bear
#
f = open('Race_results.txt', 'r')
content = f.read()
list_break = content.split("\n")
for i in list_break:
  content = i.split()
  namn = content[0:2]
  nummer=(content[2:])
  minvärde=min(nummer)
  maxvärde=max(nummer)
  
  print(type(nummer))


  
  print(namn[0],namn[1])
  print(sorted(nummer))
  print("bästa tid: ",minvärde)
  print("sämsta tid:",(maxvärde))
  print( )

here is my code for now.

#

here is the text sample from the text file

#

Erik Eriksson 11.47 12.7 10.98 12.04 12.0 12.43 10.47 11.82 10.91 10.37

#

Anna Andersson 10.02 11.23 13.79 12.44 12.56 11.12 12.68 10.53 13.82 10.26

#

here is my output

languid cargo
#

no i'dont need to rename text file

#

i need to rename old name of files to new name without deleting all the name of old name just the first 14 characters

whole bear
#

namn is list, so is nummer

languid cargo
#

i don't understand

#

can you make it easier

#

by coding

#

so do you have some ideas to everyone how can i make code python to deleting the first 14 characters of files names

#

using python

whole bear
#

lets try

languid cargo
#

basically i dont really understand what is that but try to make simple like give some contex to copy it

rugged root
sweet lodge
rugged root
#

pathlib is just nicer to deal with in general

whole bear
#

ill get back to you in 5 mins take a break

rugged root
#

@languid cargo This is just doing changes in a given folder, right?

rugged root
#

No no, I'm asking

languid cargo
#

aah okay no i mean like i would like to create progaram to simply deleting the first 14 chacters from the file name using python

#

but idk from what begin

rugged root
#

I'm just making sure I'm understanding, sorry. Would the user give it the file they want to trim the file name of, or are they doing this on a folder of files?

whole bear
#

IT WORKSSSSSSSSSSSSS

#

IT FINALLY WORKSSSSSSSSSSSSSS

sweet lodge
#

🎉

whole bear
#
f = open('Race_results.txt', 'r')
content = f.read()
list_break = content.split("\n")
for i in list_break:
  content = i.split()
  namn = content[0:2]
  nummer=list(map(float, content[2:]))
  minvärde=min(nummer)
  maxvärde=max(nummer)
  medelvärde=sum(nummer)/len(nummer)
   
  print(namn[0],namn[1],sorted(nummer))
  print("bästa tid: ",minvärde,"sämsta tid:",maxvärde)
  print("medelvärde_av_tiderna:",medelvärde)
  print( )
languid cargo
whole bear
#

can you explain to me nummer=list(map(float, content[2:])) ?

languid cargo
#

from file

sweet lodge
languid cargo
sweet lodge
rugged root
languid cargo
sweet lodge
#

wat

languid cargo
#

('*'):

#

what mean

sweet lodge
#

All files in the directory

languid cargo
#

okay i will try it and come back

sweet lodge
#

Off by one, aren't you?

#

Starting index is inclusive

#

wait

warm jackal
#

Yeah, but you miss out on all the .net interfaces/tools depending on .net (not core)

sweet lodge
#

No, no, you're right

languid cargo
sweet lodge
#

I have the dumb today

languid cargo
#

@sweet lodge

sweet lodge
#

Yes?

rugged root
#

Possibly permissions error

languid cargo
rugged root
#

Oh no file exists

languid cargo
#

there is problem

sweet lodge
#

So you can either delete your file
Or.... I think you can pass a overwrite=True

amber raptor
#
Get-ChildItem | %{Rename-Item $_.Name -NewName $_.Name.Substring(14)}``` Use real scripting language
sweet lodge
rugged root
#

100%

sweet lodge
amber raptor
#

and no one would understand it

warm jackal
# languid cargo

I guess I need glasses, can barely make out the error text anything when reading the error message... x)

sweet lodge
amber raptor
#

I foreach stuff out of habit

sweet lodge
#

I do

warm jackal
#

Why not lisp?

rugged root
#

OH OH OH

languid cargo
#

same problem

rugged root
#

Speaking of Excel

sweet lodge
amber raptor
#

because not everything takes pipes, I'm also bad with Powershell and file manipulation because:

warm jackal
# languid cargo same problem

Your problem is that there already exists a file with the new (shortened) name. Open the target folder in explorer and see/delete as needed.

amber raptor
#

oh yea, Powershell would let you test it

sweet lodge
#

-WhatIf?

amber raptor
#
Get-ChildItem | %{Rename-Item $_.Name -NewName $_.Name.Substring(14) -WhatIf}```
rugged root
sweet lodge
sweet lodge
warm jackal
rugged root
warm jackal
#

Well, ignore them and take over the world? (Read: accounting dept.)

rugged root
#

It's an accounting firm. Without them I haz no monies

warm jackal
#

@zenith radish That depends on not only the compiler, but also the kernel of whatever run-space

#

So yeah, gl; hf unifying that =P

sweet lodge
# sweet lodge I do

I mean, can you even really call yourself a developer if you've never done a =XLOOKUP(XLOOKUP(MID(LEFT(A5,FIND(",",A5)-1),FIND("#",A5)+1,LEN(A5)),tracking[rno],tracking[reference]),tracking[reference],tracking[tracking])?

warm jackal
#

You also depend on the kernel, nt, linux, bsd, mac-whatever. It's not guaranteed to even have a stdout/stderr assigned. This also goes for Linux, for say kernel-space executables.

gentle flint
warm jackal
#

Anyone here tried coconut?

faint ermine
warm jackal
zenith radish
languid cargo
#

so guys can you try to fixe it urg

#

this problem

gentle flint
warm jackal
#

@languid cargo

gentle flint
#

urg?

languid cargo
#

urgent

languid cargo
gentle flint
#

hmmm

warm jackal
faint ermine
languid cargo
#

😢

sweet lodge
#

welp

warm jackal
#

@zenith radish What platforms are you targeting?

warm jackal
#

Ahh, okay @faint ermine =)

#

@zenith radish Just trying to wrap my head around your end-goal y'see =) All fair that this is temporary/proof-of-concept.

A Readme could help ;)

languid cargo
#

is working in thoney but it didn't make any changes

#

stilll same

#

634eac7b9bdf4_

#

wait

warm jackal
#

@zenith radish Fair

languid cargo
sweet lodge
languid cargo
#

i ve run it for 2 times

sweet lodge
#

Doesn't that mean you've now lost 28 characters?

warm jackal
# sweet lodge And if you run it again?

If they run it again, and it runs successfully, I'd start double-checking the paths set/given. Make triply sure (literally talking to a rubber-duck style sure), that the paths are true.

languid cargo
#

same

#

is to small the pic

warm jackal
#

@zenith radish What benefit was it you felt you got by bypassing all compiler guarantees with unsafe? Genuinely curious

languid cargo
#

no because i dindnt chane the 'example '

#

yeah but when i changed it simply say

#

👨

warm jackal
#

@zenith radish It's just the new() call that's unsafe, no? The rest can be typed? I'm not criticizing here, I'm genuinely curious - never understood how it could help.

Ignore the "best practices" and "error handling", I just assumed you'd do this for a concrete benefit (that I don't get, I know you need unsafe for bindgens, but that's why it's best practice to isolate them with an unsafe block, which contains only the unsafe invocation and nothing else)

faint ermine
#

1sec

languid cargo
warm jackal
#

@zenith radish Do you know if the nvidia modules are foss? Or just oss with closed source blobs?

echo glade
#

got im

rugged root
#

I think something is wrong with me. I was standing for like.... 5 minutes and now I'm light headed and my bpm is like 120

#

Wheeeeeeeee

languid cargo
#

is that work

warm jackal
#

find . -name "*.pdf" | xargs sha256sum | cut -d 14 (I forget the correct cut invocation, but you get the point of my guess)

warm jackal
#

Welcome to the fragility of the human condition!

echo glade
rugged root
#

My wife has been having the same issues. We also both got sick from the Epstein-Barr virus and I wonder if that's a possible lingering effect

warm jackal
#

@zenith radish Including in FF?

rugged root
#

Many people become infected with EBV in childhood. EBV infections in children usually do not cause symptoms, or the symptoms are not distinguishable from other mild, brief childhood illnesses. People who get symptoms from EBV infection, usually teenagers or adults, get better in two to four weeks. However, some people may feel fatigued for several weeks or even months.
Well..... shit

warm jackal
rugged root
#

This is going to be fun for an indeterminant amount of time.

sweet lodge
warm jackal
gentle flint
#

all labelled

echo glade
#

USA are winning

warm jackal
gentle flint
#

soccer

echo glade
#

Sports update

gentle flint
#

usa vs iran

#

1:0 for usa

#

so far

#

whichever side loses this game is out of the championship iirc

warm jackal
#

@echo glade The latter. But maybe group them - like "for each open/draw/read", and then close the block and handle again. OR use some caching within the unsafe block

echo glade
#

@warm jackal ty

warm jackal
#

Ooops, as you understood, wrong @

echo glade
#

XD

warm jackal
zenith radish
#

Yeah but there's so many unsafe calls

languid cargo
#

@sweet lodge thank you man it workes but idk why is working only for 1 time then i should reopenning the file location

warm jackal
#

I'd imagine an implementation wouldn't be "that bad"

zenith radish
#

I'll come back to this after I finish this example

#

I'll figure out the proper way to handle this

warm jackal
#

Fair enough

#

@mild quartz So the "recipe" for a non-contiguous matrix?

zenith radish
#

&mut a as *mut _ as *mut type

potent carbonBOT
#
Command not found

Command "mut" is not found

faint ermine
#
    let val: u32 = 31;
    let ptr = val as *mut usize;
    dbg!(ptr);
zenith radish
#

&mut usize

#

&mut val as &mut usize

zenith radish
#

yee that's it

#

that works

rugged root
#

But does it twerk

#

Twork?

#

Yeah if it's for work then it's a twork

#

I know this is true, because I just made it up

faint ermine
#
let val: u32 = 31;
let mut val = val as usize;
let rf = &mut val; 
zenith radish
#

&mut buffer as *mut _ as *mut std::ffi::c_void;

#

*mut Type

#

a: Type

#

fun(&mut a);

elder canopy
#

Hi guys

#

I'm not able to join the vc yet

echo glade
#

it was fun. until next time

mortal sundial
#

gotcha

somber heath
paper dome
#

My mic is suppressed

somber heath
wise cargoBOT
#

Voice verification

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

paper dome
#

Thanks i will check it out

somber heath
#

@toxic jacinth 👋

lethal thunder
#

@gritty schooner talk here

#

@void quartz talk here

void quartz
#

okay

#

why doesn't it let me use voice?

lethal thunder
#

!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.

void quartz
#

okay

#

u there?

#

okay

#

u know how to use python to code?

#

nice

#

I started 3 days ago

#

I've only been following tutorials online

#

youtube

#

not much

#

just the basics

#

yes through the print function

#

yes I just learnt it today

#

if and elif statements

#

not yet

#

yes I will definitely learn it

#

I've been following this guy: programming with Mosh

#

on youtube

#

yes just following his tutorials

#

yes it is pretty interesting

#

yes python is my first programming language

#

pycharm

#

what do you use

#

oh ok

#

yeh i heard of it

#

the latest

#

version

#

3.11.0

#

oh nice

#

how long have you been programming for

#

nice

#

18

#

just finished high school

#

IT

#

how old r u?

#

woah that is impressive

#

at least you know more than me haha

#

oh ok

lethal thunder
#

Mr. Hemlock

void quartz
#

??

#

don't wanna say it sorry

#

ok i gtg

#

see ya

lethal thunder
#

@pearl mica talk here

pearl mica
#

HI

#

I can't say in the channel

lethal thunder
#

!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.

echo glade
#

hi hajaa

echo glade
#

hi @lethal thunder

#

still not allowed to talk here

#

Im working away

#

and you?

#

just gotta spam some text here i guess lol

#

more than 3 days - more than 30 mins of activity and 50 spams :p

#

im designing a ecommerce website on django

#

and you?

#

have you been able to seek some help from any of the helpers on this server?

#

im really new to python - wish i could help 😦

#

this is my first project. i started it around 2 months ago

#

i watched some videos on YT and decided to make a website

#

yup

#

never tried anything like this before

#

its been fun listenin to experts on here

#

brb - phone call

#

im back

#

my basics are really rusty - which makes it all the more embarrassing to ask for help because im basically just copyin what another youtuber is doing. and he hasnt explained ALL of his steps which means I'm basically stuck all the time lol

#

i hear you

#

that makes sense

#

hello

#

UK

#

and you?

#

are you keepin up to date with the football world cup?

#

soccer

#

yeh - theyre thru to the next round

#

Eng are doing amazing. i back them to win the tournament

#

Hey Mo

#

This course will give you a full introduction into all of the core concepts in python. Follow along with the videos and you'll be a python programmer in no time!
Want more from Mike? He's starting a coding RPG/Bootcamp - https://simulator.dev/

⭐️ Contents ⭐
⌨️ (0:00) Introduction
⌨️ (1:45) Installing Python & PyCharm
⌨️ (6:40) Setup & Hello Wor...

▶ Play video
lethal thunder
#

@prime forge talk here mo

echo glade
#

i watched this to learn the basics

prime forge
#

hi i have a question could u check my help thread 1 sec

echo glade
#

do you approve?

prime forge
#

i would be thankful

#

python-help

#

ye

#

no

#

im new to coding just my teacher wants alot

#

its in german

#

ill translate my assigment one sec

#

The assigment is to count the words on a specific website
We have to use Import requests and beautifulsoup4

lethal thunder
#

In this Python Programming Tutorial, we will be learning how to use the Requests library. The Requests library allows us to send HTTP requests and interact with web pages. We will be learning how to grab the source code of a site, download images, POST form data to routes, read JSON responses, perform authentication, and more. Let's get started....

▶ Play video
prime forge
#

thanks

#

i will look it up

echo glade
#

33

#

im old af

#

getting into programming to earn extra cash

#

Im a pharmacist

#

For a bigger car lol

#

vacay, homes

#

just financial independence generally

#

how old are you?

#

nice! you already know so much

#

keep it up

#

5

#

pharmacy school

heavy vale
#

what/

#

what
??

#

e

echo glade
#

hell yeh. Ive been pharmacy-ing for 13 years

#

i hear canada and the US are great for pharmacy. I would suggest paying attention at university and going into academic progression instead of chasing easy money in early years

heavy vale
#

@lethal thunder your voice is very low

#

yeah

#

better

echo glade
#

So you can find well paying jobs in dead end roles. but you should go for the lower paying jobs and gain knowledge. it puts you in good standing later on in your career. i guess im doing the opposite of that when it comes to programming lol

heavy vale
#

okay so what were u asking??

#

wait

#

its low again

#

ok

echo glade
#

@heavy vale you can right click their name and slide their vol up

#

exactly

#

exactly that

heavy vale
#

@echo glade i already did it

echo glade
#

yup, the idea is to design and sell websites

#

thats reassuring

#

@heavy vale is your PC master vol too low?

heavy vale
#

ik but using python its not possible

echo glade
#

uh oh

heavy vale
#

master volume is full

echo glade
#

does your headset have a separate vol control?

heavy vale
#

if u wanna build websites u need to use

#

like

echo glade
#

WORDPRESS

#

XD

heavy vale
#

c++

#

or html

echo glade
#

ive learnt html and css

heavy vale
#

or even games need java

echo glade
#

no lol

#

aint nobody got time fo dat

heavy vale
#

no i dont want to build games

#

im just

#

like'

echo glade
#

that would be so good

#

because you can earn from your bedroom

heavy vale
#

yeah

echo glade
#

nice

#

you should learn it. it's apparently good for data jobs too

#

This Django tutorial aims to teach everyone the Python Django web development framework.

🔗 Course Website: https://www.dj4e.com/
💻 Sample Code: https://github.com/csev/dj4e-samples/

✏️ This course was created by Dr. Charles Severance (a.k.a. Dr. Chuck). He is a Professor at the University of Michigan School of Information, where he teaches var...

▶ Play video
heavy vale
#

i do data science

echo glade
#

this is what i watched

#

@heavy vale would you say django is useful in your line of work?

#

love the name btw

heavy vale
#

kinda

heavy vale
echo glade
#

good bye @lethal thunder

heavy vale
#

see ya guys later

#

im goin to eat

echo glade
#

some gnochi

heavy vale
#

bruh

#

if i got it irl

#

i like mac n cheeeeeeeeeeeeeeeese

#

bye

echo glade
#

OOOOF! good shout

somber heath
#

@rugged root 👋

willow light
#

Finally figured out how to make soccer watchable:

  1. Shrink the field.
  2. Shrink the goals.
  3. Maximum of five people per team in play at a time.
  4. Don't stop the game to swap out players.
  5. Ice instead of a field.
  6. Replace the ball with a small flat disc, and have the players hit it with sticks
gentle flint
velvet urchin
gentle flint
zenith radish
zenith radish
rugged root
static pond
#

looks nice

#

Do you think that worth to me instal linux, i am jut learning python

zenith radish
#

WeaSeL

gentle flint
somber heath
#

"Life's less shitty when you see a kitty"

rugged root
#

Life is divine when you have a feline

willow light
#

Or a canine

#

depending on personal preference, of course

rugged root
somber heath
#

"Toot rooty toot. Toot rooty toot..."

willow light
#

will join vc later during lunch, currently trying to convince my team to actually label our docker images with human-readable version numbers

#

or at all, for that matter

gentle flint
#

oh

#

aaaa

gentle flint
#

that's actually not too bad

#

thought it was aaa

rugged root
#

I think I'd only ever seen AAAA like once

#

Just forgot they existed

gentle flint
#

I used the battery in the Microsoft surface pen. The batteries lasted a grand total of 4 days per battery. And that was with me using the pen for an average of 30 minutes per day. When I purchased different batteries, 1 battery lasts about 8 months.

#

lord be praised

#

the radiator is warm

#

draft is closed

#

adoption by european commission is upcoming

rugged root
#

@midnight agate 👋

amber raptor
weary sorrel
#

pls anyone help me in line 14

#

its showing error

wintry pier
#

@weary sorrel is this python 2 ,

weary sorrel
#

no its just a online python compiler

wintry pier
#

YOU CANT compare input with array

#

you need to access array

weary sorrel
#

oh

wintry pier
#

if it's python 3.11 will tell you where

#

your error

#

what is the error ?

weary sorrel
#

not working

#

i mean when i run it for a correct answer it shows wrong

wintry pier
#
if input in array:
 pass
#

use in condition

#

in

rugged root
#

in looks inside the list to see whether the thing is in there somewhere or not

#

It's pretty awesome

weary sorrel
#

actually i'm a begginer

wintry pier
#

edit names

#

variables

weary sorrel
#

answer to array

undone frost
#

Boys!!!

rugged root
#

Duuuuuude

#

How've you been!

undone frost
#

My old account was compromised!

#

This is a new one

#

this happened months ago though

rugged root
#

You've got the perms again now

undone frost
#

😄

#

I've moved up in the world!

#

Took a new job in march for a 13k raise!

rugged root
#

Oh yeah?

#

Niiiiiiiiiiiiice

#

What's the position?

undone frost
#

I'm a Tech Support Engineer at a company called Appsmith

rugged root
#

Ooo, fancy

undone frost
#

We're a low code platform, so they need software boys on support 😄

#

and girls!

wintry pier
#

tell me what to do

rugged root
#

Weird question. Would saying "boys and non-boys" be acceptable?

#

For some reason I just really like that one

undone frost
#

"Boys and those who don't identify as boys"

rugged root
#

I just... feel weird saying y'all

#

I mean I guess I use folks as well

#

That one feels fine

undone frost
#

y'all is underrated

rugged root
#

It just feels too hick, you know?

undone frost
#

I'm from Georgia, it's part of the regular vocabulary lol

rugged root
#

I'm from Ohio, maybe that's why

#

Just culture difference

undone frost
#

😄

#

The new company took us all to Thailand the other week!

weary sorrel
#

it says choice not defined

undone frost
#

I got this killer picture with a buddy at the company, I'll share it here

weary sorrel
#

omg

#

tysm

#

it works

#

thank you @vocal basin

rugged root
#

Is it a startup?

#

Random trip to Thailand feels like that

willow light
#

Oh lawdy, they’re really pushing the return to the office

#

In precisely the worst way

undone frost
amber raptor
rugged root
#

@willow light He's in the zone

undone frost
#

Here's that photo

#

😂😂

sweet lodge
rugged root
#

That's absolute gold

undone frost
#

We destroyed slack with that image lol

rugged root
#

I thought you were wearing Crocs for a second and I was going to give you so much crap

undone frost
#

No those are slippers from the resort lmao

#

My other shoes were too hot, it's summer in Thailand rn

rugged root
#

Were the other one Uggs?

#

Boots with the fur WITH THE FUR

undone frost
#

I had furry slippers and regular shoes with me

rugged root
#

Nice

undone frost
#

Yep 😂😂

peak lily
#

I would rather pay to youtube than twitter. Twitter blue doesn't make sense for 99% of twitter users.

#

With youtube, you atleast get ad free experience

weary sorrel
#

@vocal basin pls explain this line
sample_answer = answer[question.index(sample_question)]

rugged root
#

Although I've thought about this, I don't really mind the ads. Compared to ads back in the days of regular TV, it's nowhere near as bad

willow light
#

I started paying for YouTube premium in 2016 because of the political ads.

rugged root
#

They were sooooo bad this year

weary sorrel
#

oook

#

i got it now

#

thank you so much

undone frost
#

cough Ad block cough

rugged root
willow light
undone frost
#

I'm my experience this is not the case 99.99% of the time

peak lily
# undone frost *cough* Ad block *cough*

background play, picture in picture are pretty nice

my point is for most people, value proposition of Youtube is better than what's twitter is offering for most people

undone frost
#

True

rugged root
undone frost
#

You can always whitelist sites 🙂

rugged root
#

And I do

waxen zodiac
#

everything is going above my head

willow light
#

Adblock is iffy on mobile, especially the app

rugged root
#

And I'll turn it off on sites that I want to support

undone frost
#

I didn't know they had it on mobile

peak lily
rugged root
wintry pier
#

@willow light VPN

peak lily
#

simps that are willing to pay, maybe in thousands

rugged root
#

Are there more than one sub tier for Twitter?

willow light
rugged root
#

Yarr ducky_pirate

undone frost
#

I'll be back in a bit!

rugged root
#

Later, brother

undone frost
#

That's a cool duck!

rugged root
#

The server has tons

#

And lemoji

undone frost
#

OMG

rugged root
#

@gentle flint did a really good job on ducky_gopnik and ducky_beer

undone frost
#

Already lol

#

Nice!

peak lily
#

to get you hooked!

tidal shard
#

hahhahahahhaa

#

I've done just the right amount that I can say I've used it and am familiar with it lmao

rugged root
#

!stream 272071537475977217

wise cargoBOT
#

✅ @limpid sparrow can now stream until <t:1669829034:f>.

plucky delta
#

the p word sold you out lmao @limpid sparrow

rugged root
plucky delta
#

so a closure is an arrow function?

#
const something = () => {
    console.log("hello world")
}
#

eh i tried

#

bruh so its an arrow function

#

so its a variable thats in the scope of one function only?

limpid sparrow
plucky delta
#

7 mins is a lot

#

is there 1 min

wise cargoBOT
#

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

hellow world
peak lily
#

closure is like a factory, that creates functions based on parameter, maybe not general, atleast an usecase

plucky delta
#

def function1():
    def function2():
        pass
#

so this is a closure

limpid sparrow
#

JS Closure example


const sayHello = () => {
    return `Hello ${name}`
}

sayHello() // Hello Bob

name = "Kate"

SayHello() // Hello Kate
plucky delta
#

wtf is the point of it then why not just make it one function in the first place

limpid sparrow
#
    return `Hello ${name}`
}

sayHello("Bob") // Hello Bob
SayHello("Kate") // Hello Kate
plucky delta
#

it doesnt look like it has much uses

plucky delta
#

def greeter(*,name):
    print(f"hello {name}")

greeter(name="bob")
#

me when this

peak lily
#
const makeGreeter = (greeting) => {
  const greeter = (person) => {
    console.log(greeting + " " + person);
  };
  return greeter;
};

const greetHello = makeGreeter("hello");
greetHello("bob");
#

maybe this is a better example

plucky delta
peak lily
#

maybe not a good one

rose verge
#

hello can anyone please help i am in desperate need this is my ict homework ill get killed if i dont do it please help
Q.1 Write a python program to print following outputs using loops:
a) (999 -800) + ( 899 - 700 ) + ( 799 - 600 ) +....................................+ (199 – 0 )
b) # - # # # - # # # # # - # # # # # # # - # # # # # # # # #
c) x.0 // 1 - x.2 // 4 - x.4 // 16 - x.5 // 32 ..................................... - x. 10 // 1024

rose verge
plucky delta
#

detect language and print appropriately

peak lily
#
def compose(func1, func2):
    return lambda x: func1(func2(x))
#

this might be a good example

#

function composition

plucky delta
#

show me how

#

you make test cases for german

#

i show you

#

i dont understand bruh

#

what do you mean

#

yeah?

peak lily
#

Samsung also has something like findmyiphone

plucky delta
#



def greeter(*, lang="english", name):
    if lang == "german":
        print(f"hallo {name}")
    else:
        print(f"hello {name}")

assert greeter(name='bob') == 'hello bob'; assert greeter(lang='german',name='bob') == 'hallo bob'
#

@vocal basin

lethal thunder
plucky delta
#

bro

#

i show you

#

ok where do you want me to get the lang from

peak lily
rugged root
#
from time import perf_counter

def timer(func):
  def wrapper():
    start = perf_counter()
    func()
    print(f"The function took {perf_counter() - start} seconds to run"
  return wrapper

I just realized I never hit enter on this when we were talking about closures earlier

#

But here's a potentially useful usecase

plucky delta
#

bro what

#

get off my dick

lethal thunder
gentle flint
#

i found just the website for lp

plucky delta
gentle flint
#

there's a book about how to deal with your huge penis

lethal thunder
plucky delta
#

ok

#

sorry bruh

lethal thunder
gentle flint
rugged root
#

Really hem

#

!stream 762972477479059489

wise cargoBOT
#

✅ @safe pumice can now stream until <t:1669831759:f>.

waxen barn
#
n = 0

for i in range(100):
    n = n + 1
    print(n)

wise cargoBOT
#

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

001 | 1
002 | 2
003 | 3
004 | 4
lavish cipher
#

Range(start, stop, step)

rugged root
#

!e

for i in range(1, 11):
  print(f"Mod 2 of {i} is {i % 2}")
lavish cipher
#

Mind if I can get permission to voice chat?

rugged root
#

!e

for i in range(1, 11):
  print(f"Mod 2 of {i} is {i % 2}")
wise cargoBOT
#

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

001 | Mod 2 of 1 is 1
002 | Mod 2 of 2 is 0
003 | Mod 2 of 3 is 1
004 | Mod 2 of 4 is 0
005 | Mod 2 of 5 is 1
006 | Mod 2 of 6 is 0
007 | Mod 2 of 7 is 1
008 | Mod 2 of 8 is 0
009 | Mod 2 of 9 is 1
010 | Mod 2 of 10 is 0
rugged root
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

#

Hey @waxen barn!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

#

Hey @waxen barn!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

rugged root
#

!paste

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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

waxen barn
lavish cipher
#

There’s no final keyword in python so all caps gives devs the idea this variable is a final or non changeable

#

I don’t want to start lol

#

Grepper?

rugged root
lavish cipher
#

It is interesting

#

Co pilot is decent

#

It has sped up my coding but man I’m realizing I don’t have to think of the logic as much which I unno if that’s a good thing

#

It’s a good starter

rugged root
#

Probably the best site I've used to learn JS

lavish cipher
#

Oversleeping can cause exhaustion

#

Influctiation in moods

#

Drastic mood changes

#

Staying active and getting good sleep can be enough to help with depression

#

What would happen if you stopped taking the medication for you

rugged root
#

Massive depression, no focus, likely wouldn't be able to force myself to go to work

#

I would spiral

#

Never been suicidal, though

#

Weirdly enough

lavish cipher
#

Well it depends on a lot of factors

#

Or do you do it so the house doesn’t feel empty?

#

@waxen barn

rugged root
#

You might want to get noise cancelling headphones to save your ears

#

If it's literally just about filtering out other sounds

peak lily
rugged root
#

They work well?

peak lily
# rugged root They work well?

they do, obviously, i can see the difference if i have them v. not having them

i'm saying now, it feels like rest of the world got louder than before buying them

rugged root
#

Oh sure sure

peak lily
waxen barn
rugged root
#
for i in range(1, 101):
  if i % 2 != 0 and i % 7 != 0:
    print(i)
#

That's entirely up to you. I try to have open discussions about mental health stuff because it's still so stigmatized in places

lethal thunder
#

how you get the words blacked out>

#

||this||

#

||||

#

||||this||||

#

||get recked||

#

||butthole||<CLICK AT YOUR OWN PERIL

waxen barn
rugged root
#

Range is so weird

#
while x == 5 and y != 4:
  ...
waxen barn
#

while user_input != "H"

rugged root
#

Weeeiiiiirrrrddddddd

whole bear
#

guys can i get some help

waxen barn
rugged root
#

That's not a Chrome error is it?

worn lake
#

what r u doin?

rugged root
worn lake
#

no worries, i'm beginner so imma learn python in order to do scripts in bash

waxen barn
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

waxen barn
#
user_input = ""

while True:
    print("""Welcome to the Compliment Bot
Please choose from the following options:
A To hear a joke
B To receive a compliment
X To exit the program""")
    if user_input != "X" and user_input != "x":
        break
    if user_input == "A" and user_input == "a":
        print("Whats a ghosts favorite fruit? Blueberry!")
    if user_input == "B" and user_input == "b":
        print("your amazing!")
    else:
        print("please input something intelligent.")

print("good bye!")
rugged root
#
if user_input.lower() == 'a':
#

Noooooooo

sweet lodge
rugged root
#

Not like that

#

Weird

faint ermine
#

yikes

rugged root
#

From my experience it'll reserve memory until your total memory in use is around 50%. But it does a pretty decent job releasing that memory if other things demand it

faint ermine
amber raptor
rugged root
#

Damn

#

Okay that's kind of crazy

#

Weird

#

Happens a lot

faint ermine
waxen barn
faint ermine
rugged root
#

That fight was a bitch

#

Oh good, it's 4 C

#

I guess I'll grab my coat

waxen barn
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

waxen barn
#
print('Hello world!')
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

steel drift
#

Original ,Username 0,omid369639 1,elyasaz09Er 2,Shmim7 3,aminghasemi_79 4,xhszgazflhgeh 5,ART1A12 6,azadianshop 7,ArminSeep 8,Setare_pumkin 9,ho3ein_ojaghi 10,Arash710R 11,mmeelloodii 12,boom_boom_1998 13,masiiiiii0 14,ka2sii 15,m_hossaini1 16,rayann56 17,Life_is_good2017 18,mohmmahd 19,sami_9520 20,haAm888 21,Vahid00560056 22,Mahdiyeh6542 23,Aylin5528mo 24,hanane_amiri6 25,pone_arami 26,hami8d 27,mohsengharooni65 28,Hamed1377 29,Saleh_sport 30,Amehran_1 31,MIC3651 32,naadi_a 33,Nitro0027 34,siamak_sh74 35,David3ia 36,Auditory_hallucination 37,mahdi_rti0300 38,Amirhh916 39,azimi07 40,Abraham6364 41,dehghani_1234 42,ladyfatimaa 43,hajmosi1234 44,Alirezaaaaa1988 45,renerota 46,OM34ID 47,Mb_asakeri 48,Ali135548turk 49,mn_mahdi

#

User.textUsername omid369639 elyasaz09Er Shmim7 aminghasemi_79 xhszgazflhgeh ART1A12 azadianshop ArminSeep Setare_pumkin ho3ein_ojaghi

silver stratus
#

I can't talk

faint ermine
#

wait

#

!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.

faint ermine
#

!e ```py
s1 = set("abc")
s2 = set("bcd")
print(s1, s2)

diff = s1.symmetric_difference(s2)
print(diff)

wise cargoBOT
#

@faint ermine :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | {'a', 'b', 'c'} {'b', 'd', 'c'}
002 | {'d', 'a'}
faint ermine
#

!e ```py
s1 = set("abc")
s2 = set("bcd")
print(s1, s2)

diff = s1.symmetric_difference(s2)
print(s1.difference(s2))
print(s2.difference(s1))
print(diff)

wise cargoBOT
#

@faint ermine :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | {'b', 'c', 'a'} {'c', 'b', 'd'}
002 | {'a'}
003 | {'d'}
004 | {'a', 'd'}
#

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

{'d', 'a'}
waxen barn
faint ermine
#

(accepts two arguments) and returns the ((value of the first argument multiplied by 2) plus (4 times the second argument))

#
def func(a):
    return a*2
waxen barn
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

waxen barn
#
def func(a):
    a = 3
    return a*2
#
def func(a):
    return a*2

func()
faint ermine
wise cargoBOT
#
Missing required argument

code

faint ermine
#

!e ```py
def func(a):
return a*2

func()

wise cargoBOT
#

@faint ermine :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 | TypeError: func() missing 1 required positional argument: 'a'
waxen barn
#
def func(a):
    return a*2
    print(A)

func()
#

!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 code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

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

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

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

waxen barn
#
def func(a):
    return a*2
    print(A)

func()
#

!E

def func(a):
    return a*2
    print(A)

func()
wise cargoBOT
#

@waxen barn :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 5, in <module>
003 | TypeError: func() missing 1 required positional argument: 'a'
waxen barn
#

!E

a = 3

def func(a):
    return a*2
    print(a)

func()
wise cargoBOT
#

@waxen barn :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 7, in <module>
003 | TypeError: func() missing 1 required positional argument: 'a'
waxen barn
#

!E

a = 3

def func(a):
    return a*2
    print(a)

func(a)
wise cargoBOT
#

@waxen barn :warning: Your 3.11 eval job has completed with return code 0.

[No output]
faint ermine
#

!e

def func(a):
    return a*2

func(3)
wise cargoBOT
#

@faint ermine :warning: Your 3.11 eval job has completed with return code 0.

[No output]
faint ermine
#

!e

def func(a):
    return a*2

ret = func(3)
print(ret)
wise cargoBOT
#

@faint ermine :white_check_mark: Your 3.11 eval job has completed with return code 0.

6
faint ermine
#

!print-return

wise cargoBOT
#
Print and Return

Here's a handy animation demonstrating how print and return differ in behavior.

See also: !tags return

faint ermine
#

!e

def func(a):
    return a*2

ret = func(3)
print(ret)
ret = func(6)
print(ret)
ret = func(8)
print(ret)
wise cargoBOT
#

@faint ermine :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 6
002 | 12
003 | 16
waxen barn
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

waxen barn
#

!e

def calculate(a, b):
    return 2*a+4*b

answer = calculate(5, 6)
print(answer)

answer = calculate(8, 2)
print(answer)
wise cargoBOT
#

@waxen barn :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 34
002 | 24
waxen barn
#

😁

faint ermine
#

Rust is so much better for this

#

everything is a expression

#

yea, still far more consistent

#

eh, fair, but also i want something i can actually build things with

#

at that point why bother?

#

if you're limited to js/wasm capabilities

#

wat?

#

you're still limited to web capabilities

#

actually, my stance might make more sense knowing i mostly do gamedev in rust

#

ehhh

#

i doubt it

#

but its ahead of much else for now

#

i've been stuck on the build queue for 22h now

#

aight get it out

#

the strawman isn't gonna dissapear, but i dont really care

#

the one you seem to be going on against?

#

oh actually

#

theres a good tool for that

#

best used in moderation, as all things, but still pretty good to know the most important few

#

what stopped you?

#

you mean rustup?

#

or compile time?

#

ahhh docker

#

yea i recently ran into that myself

#

lemme share my solution

#
FROM rust:1.65 as rust-builder
WORKDIR /usr/src/gt_bot

# Copy cargo
COPY ./Cargo.toml .
COPY ./Cargo.lock .

# Create fake main.rs file in src and build for dependencies
RUN mkdir ./src && echo 'fn main() { println!("Dummy!"); }' >./src/main.rs
# Build dependencies first - without project
RUN cargo build --release

# Copy source files over
RUN rm -rf ./src
COPY . .

# Use SQLX offline mode to build without a DB connection.
ARG SQLX_OFFLINE=true

# The last modified attribute of main.rs needs to be updated manually,
# otherwise cargo won't rebuild it.
RUN touch -a -m ./src/main.rs
RUN cargo build --release

# Only keep binaries around for final container
FROM rust:1.65
COPY --from=rust-builder /usr/src/gt_bot/target/release/gt_bot /usr/local/bin/
WORKDIR /usr/local/bin
CMD ["gt_bot"]