#off-topic-lounge-text

1 messages ยท Page 37 of 1

rustic crown
#

No problem. Good luck.

agile portal
#
with open('a', 'w') as a, open('b', 'w') as b:
    do_something()
rustic crown
#

but also checkout Django

void torrent
timid fjordBOT
#

Lib/shutil.py line 406

def copy(src, dst, *, follow_symlinks=True):```
`Lib/shutil.py` lines 418 to 422
```py
if os.path.isdir(dst):
    dst = os.path.join(dst, os.path.basename(src))
copyfile(src, dst, follow_symlinks=follow_symlinks)
copymode(src, dst, follow_symlinks=follow_symlinks)
return dst```
jagged granite
#

It can return multiple types because it can accept multiple types

agile portal
#

@rich moss how is your nurses thing going? ๐Ÿ˜ฎ

#

made anything more interesting?

#

like the solvable rubiks cube in terminal

rich moss
#

i don't know if anything is more interesting, i've been working on it sporadically though

#

been working on docs for nurses and i added a way to subscribe to widget properties -- so widgets far separated in the widget tree could still observe each other

odd cove
#

hey guys who knows class type moduls and functions?

rich moss
agile portal
#

for linux users mkdir has an option -p which creates all needed folders to reach a path you want
and for windows New-Item has a -Force flag which does the same

#

if you do the same from shell

rich moss
#

windows has robocopy

agile portal
#

robocopy ๐Ÿ˜ฎ

rich moss
#

short for robust copy

agile portal
#

ah but its old cmd crap with weird flags and no good docs off their website

#

:/

jagged granite
#

Python has pathlib.Path.mkdir(parents=True)

rich moss
#

i used shutils recently to help automate my doc generation

jagged granite
#

How?

agile portal
#

shutils and pydoc? ๐Ÿ˜ฎ

#

nvm

rich moss
#

because github needs the index to be in project root or in docs root

#

so i generate docs in docsrc and copy them over

jagged granite
#

Yeah, that's why you use GitHub Actions to push to gh-pages

odd cove
#

bro can i ask a question ?

#

owner of meet

jagged granite
rich moss
#

i'm very new to sphinx and doc generation and was half tempted to write my own doc generation

jagged granite
#

Go for it

#

I'd like a cleaner alternative

odd cove
#

and class

jagged granite
odd cove
#

im going to send

jagged granite
#

@buoyant kestrel

#

pypa/pip#3164

vivid terraceBOT
jagged granite
#

There we go

buoyant kestrel
#

Huh

jagged granite
#

Apparently they've been saying "Use python -m pip dammit" since 2015

buoyant kestrel
#

As opposed to py?

#

Or just in general

jagged granite
# buoyant kestrel As opposed to `py`?

py is just a selector for which python you're going to use
Soo.... Example:
Issue recommends python -m pip - py would be py -m pip
Issue recommends python3.8 -m pip - py would be py -3.8 -m pip

buoyant kestrel
#

Right

jagged granite
#

I don't like py

buoyant kestrel
#

Which is what I try to educate folks on

#

Then you'd have to tell Windows to stop aliasing python to their specific microsoft store one

jagged granite
#

I'll just provide a script that removes the alias

buoyant kestrel
#

Which is more annoying than just telling people to use py which is part of the windows installer

#

Like

#

It's no different than having to remember any other quirks when working on different OSs

agile portal
#

cuz python3 just works 99% of the time for linux / mac (if they have python 3 installed)

rustic crown
#

I got to go, see you all soon

fresh sail
#

@primal bison over here...

primal bison
fresh sail
#

@primal bison keep typing here

primal bison
#

I wanted to know what curses is in python?

keen rain
#

the library

#

windows has one to

#

but not build in

grim wind
#

@agile portal Could you share your Github so we can look at these projects?

primal bison
hollow dew
#

hi

#

what are u coding?

buoyant yoke
#

what you doing @primal bison

primal bison
#

Trying to get some help with this script to separate 12000 clusters

#

wbu?

timid fjordBOT
#

Hey @west sun!

It looks like you tried to attach file type(s) that we do not allow (.webarchive). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

agile portal
#

i just made a small thing with it to try it out

#

except for the thing i made all the other examples are in the repo

vernal canyon
#

someone can help me to transform this vector(1,2,3,4,5,6) in this(1-4-2-5-3-6)?

#

is a code on a transposed vector

cold lintel
#

@dreamy basin Erm, do you want to share your screen?

dreamy basin
#

yesss

#

please

cold lintel
#

Mods can grant temporary permissions

#

!stream 537578374152060928 "30 mins"

timid fjordBOT
#
Bad argument

Could not convert "duration" into Duration or ISODateTime.
30 mins is not a valid ISO-8601 datetime string

cold lintel
#

Er

#

!stream 537578374152060928 30M

timid fjordBOT
#

โœ… @dreamy basin can now stream until <t:1654288688:f>.

cold lintel
#

NP ๐Ÿ‘

#

Pro tip: use pathlib.Path to make your paths cross-platform

#

@tawdry mist jam_cuneiform_this

#

Er, people streaming bad things ๐Ÿ˜‘

#

So we had to lock it down, as we're quite a large server

#

๐Ÿ‘

#

!stream 952414808920162324 30M

timid fjordBOT
#

โœ… @tawdry mist can now stream until <t:1654289387:f>.

cold lintel
#

fastAPI is pretty good

#

Have you tried using any APIs?

#

Ah right. If you put those functions in another module, then import that module, you'll need to qualify the names of the functions when you use them.

#

For example mymodule.myfunction() instead of myfunction().

#
import mymodule
mymodule.myfunction()
#

Yeah, you should try to avoid sharing global state between modules.

#

You'll need to find a way to structure your program so that functions in separate modules don't need to access the same global variables.

#

Ideally, you want to pass any information a function needs in through its arguments.

#

Silly example, but e.g. ```py
def add(x, y):
return x + y

print(add(1, 2))
instead of:py
def add():
return x + y

x = 1
y = 2
print(add())

wary lance
#

That's new... partially intialized module.

wary lance
cold lintel
#

Ah yeah

#

Mhm

#

Alright

rich ginkgo
#

damn, that keyboard is loud

cold lintel
#

If you type the command clr in the windows command line, it will clear the screen. You're essentially just calling that function from python using the os.system function.

rich ginkgo
#

i personally don't mind it though

cold lintel
#

Try it out in CMD

#

Oh right yeah.

#

Sorry I don't really use Windows much lemon_sweat

#

Erm, Linux currently yeah.

#

Or MacOS

#

Erm

#

I'm not sure there's any great advantage.

#

A lot of servers run on Linux, so it's useful to get used to that environment.

#

If you're regularly configuring servers and so on.

#

Tbh, I don't know the reason.

#

Yeah, your keyboard is kind of loud btw lemon_sweat

#

Not sure what you can do about that.

#

I think there's a noise suppression setting on Discord on Windows?

#

It depends on the context really. Do you know about for loops?

#

You can also use the break statement to break out of a while loop.

#

That just immediately takes you out of the loop.

#

Right yes

#

I might be a good thing to look for opportunities to put the code into a function.

#

If you have a really long function with lots of loops, you can often find a way to break that function down into smaller functions logically.

#

Yeah, although it can save you time in the long run.

#

Sorry I didn't understand that?

tawdry mist
#

Imagine Cup

cold lintel
#

Oh right, nah I've not heard of it.

#

Erm, I wouldn't say I'm an expert in multithreading.

#

Not sure what you mean sorry

#

Yep

#

Although if it's, e.g., a web server, usually the web framework you use will take care of threading.

#

E.g. Flask.

#

If will just create a new thread for each request that comes in.

#

I've got to go in a min

#

Ah right

tawdry mist
#

Bye!

cold lintel
#

Cya ๐Ÿ‘‹

tawdry mist
#

Have a nice day/ good night!

cold lintel
quaint sinew
#

Hi

#

I want some help related to python course

#

Plz help me??

empty scarab
#

what do you need

inland wedge
#

hello can someone help me

timid fjordBOT
#

Hey @inland wedge!

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

inland wedge
#

Part A: Dropping a Ball!
We all drop the ball occasionally (pun intended)J Let us study how it bounces back though.
The process: Assume that the ball is dropped from a certain height (h) with an initial speed of u m/s. The
ball travels down and as it is acted upon by the gravitational force (g ~ 10m/s2), it hits the ground with a
higher final speed v. This final speed is calculated using the relation v = u+gt. Upon hitting the ground the
ball rebounds. Let us assume that it rebounds without any loss of energy, i.e., it rebounds with the same
speed v. As the ball moves up, it decelerates at the rate of -g (i.e. g ~ -10m/s2) and eventually when it get
back to the original height of h, it stops. It then starts falling back to the ground, emulating the initial fall.
The distance that the ball rises/falls is d = ut + 0.5gt2. (Note: If the initial dropping velocity is 0 m/s then
the ball must rise to the exact same initial height. If the ball it thrown with a certain downward speed,
then it rebounds to a greater height than the initial height.)

#

Now, write a python program that simulates this process by doing the following: Using the getInput()
function obtain the following values from the user: initial height and initial speed. (Both will be a
positive number). Use the motionSimulator() function to simulate the falling and rising of the ball. In
this you will have to increment time by small steps of 0.04s and determine the precise position of the
ball for these timesteps, plotting it as a function of time. You must print the following data onto the
screen each time the ball reaches the extremum:

  1. Position (Top or Bottom indicated by T and B, respectively).
  2. The speed at that position
  3. Total number of timesteps to be simulated (use 401 timesteps)
  4. The time interval needed to make that motion from the previous extremum.
  5. The total time that the ball has been bouncing for since the beginning of the simulation.
  6. The cumulative number of 0.04s timesteps that have been simulated.
  7. A graph showing the bouncing of the ball through the entire duration
    Hint: You will need the pyplot library to plot graphs. While a detailed introduction to pyplot is in
    https://matplotlib.org/stable/tutorials/introductory/pyplot.html, a relevant code that you need
    for this exercise is:
    import matplotlib.pyplot as plt
    plt.plot(time,current_height,'bo')
    plt.xlabel('Time [s]')
    plt.ylabel('Height [m]')
    Use floats for all your variables except the number of timesteps. The output should be printed only
    from the main program. Your program output should be in the following format:
    Test Case 1: (h=20, u=0)
    S. Srinivasan
    Copyright ยฉ๏ธ ssriniv@mcmaster.ca
    B: 20.00 2.00 2.00 50
    T: 0.00 2.00 4.00 100
    B: 20.00 2.00 6.00 150
    T: 0.00 2.00 8.00 200
    B: 20.00 2.00 10.00 250
    T: 0.00 2.00 12.00 300
    B: 20.00 2.00 14.00 350
    T: 0.00 2.00 16.00 400
#

what is wrong in this code for time_s in range(0,401,50):
final_speed = initial_speed + g * time_interval
current_height = h - (initial_speed + 0.5 * g * time_interval)
time_interval += 2.0
initial_speed = final_speed
if current_height == 0:
final_speed = initial_speed - g * time_interval
current_height = (initial_speed - 0.5 * g * time_interval)
initial_speed = final_speed
time_interval += 2.0
t.append(time_interval)
h_a.append(current_height)

rancid patrol
#

@cold lintel Hey LX, I was reading through chat and the link you sent "composingprogramming.com" or somthing along that url. Out of curiosity i started reading it and it's actually really benefical!

#

My question is that, can you explain to me;

>>> def sum_naturals(n):
        total, k = 0, 1
        while k <= n:
            total, k = total + k, k + 1
        return total
>>> sum_naturals(100)
5050
#

I dont understand it for a couple of reasons, is total, k = 0,1 does that mean its assigning two variables to 2 values? like total = 0 and k = 1 or is it total and k are both = (0,1)

#

then i also dont understand the total, k = total + k, k + 1 since im not sure what they're doing originally.

#

So if you'd be so kind and help me understand this. I'd appreciate it ๐Ÿ™‚

rancid patrol
#

What are you saying yes to my boy

royal trout
deft sky
#

Hey anyone down for a basic revision

fresh sail
#

@pure tapir over here

jagged granite
#

I have a question

#

What time is this scheduled for?

#

Yep
Am CST

#

boys and non boys

#

In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compression reduces bits by identifying and eliminating statistical redundancy. No information is lost in lossless...

jagged granite
proper cobalt
#

We enhance auto-regressive language models by conditioning on document chunks retrieved from a large corpus, based on local similarity with preceding tokens. With a 2 trillion token database, our Retrieval-Enhanced Transformer (RETRO) obtains comparable performance to GPT-3 and Jurassic-1 on the Pile, despite using 25ร— fewer parameters. Afte...

proper cobalt
#

gtg ttyl

agile portal
#

it lets you do anything from just a mass rename to a mass rename with regex with even preview of the result

fresh sail
#

@stiff sand @shrewd wren @cobalt helm OVer here!

rancid patrol
agile portal
#

@fresh sail https://git-lfs.github.com/ maybe?

Git Large File Storage

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

fresh sail
#

# backupToZip.py - Copies an entire folder and its contents into
# a ZIP file whose filename increments.

import zipfile, os

def backupToZip(folder):
    # Back up the entire contents of "folder" into a ZIP file.

    folder = os.path.abspath(folder)   # make sure folder is absolute

    # Figure out the filename this code should use based on
    # what files already exist.
    number = 1
    while True:
        zipFilename = os.path.basename(folder) + '_' + str(number) + '.zip'
        if not os.path.exists(zipFilename):
            break
        number = number + 1

    # TODO: Create the ZIP file.

    print(f'Creating {zipFilename}...')
    backupZip = zipfile.ZipFile(zipFilename, 'w')

    # TODO: Walk the entire folder tree and compress the files in each folder.
    for foldername, subfolders, filenames in os.walk(folder):
        print(f'Adding files in {foldername}...')
        # Add the current folder to the ZIP file.
        backupZip.write(foldername)
        print(foldername)

        # Add all the files in this folder to the ZIP file.
        for filename in filenames:
            newBase = os.path.basename(folder) + '_'
            if filename.startswith(newBase) and filename.endswith('.zip'):
                continue   # don't back up the backup ZIP files
            backupZip.write(os.path.join(foldername, filename))
    backupZip.close()
    print('Done.')

backupToZip('./delicious')
#

@agile portal here

stray mist
#

@fresh sail Is there sound on the stream? [If so, I have a local problem. If not, great.]

fresh sail
#

no music or anything, but we are talking

stray mist
#

Cool. Figured it out.

shrewd wren
#

Does it work ?

#

Already ?

#

How does the code navegates thru the os ?

#

Is it fixed to the py repo ?

fresh sail
#

we fixit it!

shrewd wren
#

Can you write the sorce

#

The updated one

tepid fox
#

strftime("%m/%d/%Y, %H:%M:%S")

fresh sail
#
#! python3

# backupToZip.py - Copies an entire folder and its contents into
# a ZIP file whose filename increments.

import zipfile, os

from datetime import datetime

def backupToZip(folder):
    # Back up the entire contents of "folder" into a ZIP file.

    folder = os.path.relpath(folder)   # make sure folder is absolute

    # Figure out the filename this code should use based on
    # what files already exist.
    date_time = str(datetime.now()).strip(' ')
    while True:
        zipFilename = os.path.basename(folder) + '_' + str(date_time) + '.zip'
        if not os.path.exists(zipFilename):
            break
        

    # TODO: Create the ZIP file.

    print(f'Creating {zipFilename}...')
    backupZip = zipfile.ZipFile(zipFilename, 'w')

    # TODO: Walk the entire folder tree and compress the files in each folder.
    for foldername, subfolders, filenames in os.walk(folder):
        print(f'Adding files in {foldername}...')
        # Add the current folder to the ZIP file.
        backupZip.write(foldername)
        print(foldername)

        # Add all the files in this folder to the ZIP file.
        for filename in filenames:
            newBase = os.path.basename(folder) + '_'
            if filename.startswith(newBase) and filename.endswith('.zip'):
                continue   # don't back up the backup ZIP files
            backupZip.write(os.path.join(foldername, filename))
    backupZip.close()
    print('Done.')

backupToZip('./delicious')
limpid coral
#
s_r = repr(s)
print(s_r)
# 'a\tb\nA\tB'
agile portal
#

@fresh sail"%Y%m%d-%H%M%S"

tepid fox
#

or
datetime.now().strftime("%m-%d-%Y_%H-%M-%S")

#

i just sent for an example ๐Ÿ˜„

graceful elk
#

ig yea

unborn sorrel
tired sluice
#

howd you save this

#

ah alright, makes sense

#

copyright

graceful elk
#

uhm, what was the discord api url?

#

Nvm

tired sluice
#

I gave an AI 13,000 songs and 38,000 video clips and told it to create a motivational YouTube video about water and this is what it made!

Song:
Single Moment - RomanBelov

Video clips:
Thoxuan99
eisenkern1982
macstevens
astrofreq
notperfectpic
taorbu
Vimeo-Free-Videos
vrogov
Relaxing_Guru
RSK-Nature
krzys16
MixailMixail
Engin_Akyurt
Ambient_Nat...

โ–ถ Play video
unborn sorrel
#

Yeah ๐Ÿ™‚

tired sluice
#

was that intentional?

unborn sorrel
#

It's supposed to try to change on beat

#

Sometimes it gets the wrong beat

tired sluice
#

holy man, thats rlly cool

shrewd wren
#

How did you do it ?

tired sluice
#

"pay me bitch" ๐Ÿ˜ญ

shrewd wren
#

Wow , that was intense

fresh sail
primal bison
#

@agile portal what IDE are you using?

unreal otter
#

what is -> None ?

pulsar sun
#

ฤฑ cant speak

#

why?

#

Also, there is no sharing on the screen.

#

@fresh sail

#

@limpid coral

#

time break?

calm bay
#

!voice

timid fjordBOT
#

Voice verification

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

tired sluice
shrewd wren
#

How does gravity work @agile portal

#

How did you defined it @agile portal

#

How does it work

#

But how do you make the variable or function gravity work as gravity ?

#

Hey

#

@all

#

One question

#

How do you create the base for the game

#

Lets say the background its a square of x.height and y.width

#

|------------------|

#

!e
top="|"+("-"*10)+"|"
side="|"+(""*10)+"|"
bottom="|"+("_"*10)+"|"

print(top)
print(side)
print(side)
print(side)
print(bottom)

timid fjordBOT
#

@shrewd wren :white_check_mark: Your eval job has completed with return code 0.

001 | |----------|
002 | ||
003 | ||
004 | ||
005 | |__________|
shrewd wren
#

!e
top="|"+("-"10)+"|"
side="|"+(" "10)+"|"
bottom="|"+("_"*10)+"|"

print(top)
print(side)
print(side)
print(side)
print(bottom)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     top="|"+("-"10)+"|"
003 |              ^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
shrewd wren
#

!e
top="|"+("-"10)+"|"
side="|"+(" "10)+"|"
bottom="|"+("_"*10)+"|"

print(top)
print(side)
print(side)
print(side)
print(bottom)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     top="|"+("-"10)+"|"
003 |              ^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
shrewd wren
#

!e
top="|"+("-"10)+"|"
side="|"+(""*10)+"|"
bottom="|"+("_"*10)+"|"

print(top)
print(side)
print(side)
print(side)
print(bottom)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     top="|"+("-"10)+"|"
003 |              ^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

print(top)
print(side)
print(side)
print(side)
print(bottom)

timid fjordBOT
#

@shrewd wren :white_check_mark: Your eval job has completed with return code 0.

001 | |----------|
002 | |          |
003 | |          |
004 | |          |
005 | |__________|
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

print(top)
print(side)
print(side)
print(side)
print(bottom)

timid fjordBOT
#

@shrewd wren :white_check_mark: Your eval job has completed with return code 0.

001 | |----------|
002 | |          |
003 | |          |
004 | |          |
005 | |__________|
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

def cube:
print(top)
print(side)
print(side)
print(side)
print(bottom)

print(cube*2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     def cube:
003 |             ^
004 | SyntaxError: invalid syntax
shrewd wren
#

Oh

#

!e
top="|"+("-"10)+"|"
side="|"+(" "10)+"|"
bottom="|"+("_"10)+"|"
cube= (print(top),
print(side),
print(side),
print(side),
print(bottom))

print(cube2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     top="|"+("-"10)+"|"
003 |              ^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

def cube:
print(top)
print(side)
print(side)
print(side)
print(bottom)

print(cube*2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     def cube:
003 |             ^
004 | SyntaxError: invalid syntax
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

  cube={ print(top)
   print(side)
   print(side)
   print(side)
   print(bottom)}

print(cube*2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     cube={ print(top)
003 | IndentationError: unexpected indent
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

  cube={ print(top);
   print(side);
   print(side);
   print(side);
   print(bottom)}

print(cube2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     cube={ print(top);
003 | IndentationError: unexpected indent
shrewd wren
#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

  cube={ print(top);
             print(side);
             print(side);
             print(side);
             print(bottom)}

print(cube2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     cube={ print(top);
003 | IndentationError: unexpected indent
shrewd wren
#

Im trying to create an object

#

Name cube , the object is the one above and print it 2 times

#

!e
top="|"+("-"*10)+"|"
side="|"+(" "*10)+"|"
bottom="|"+("_"*10)+"|"

  cube={ print(top);
             print(side);
             print(side);
             print(side);
             print(bottom)}

print(cube*2)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     cube={ print(top);
003 | IndentationError: unexpected indent
shrewd wren
#

@agile portal

#

Whats the bug here ?

#

!e
"""Create object cube
Cube ==[]
"""

timid fjordBOT
#

@shrewd wren :warning: Your eval job has completed with return code 0.

[No output]
shrewd wren
#

cube="["+i+"]"
for i in range(20)
print(cube)

upbeat mirage
#

!code

timid fjordBOT
#

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.

shrewd wren
#

!e
cube="["+i+"]"
for i in range(20)
print(cube)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     for i in range(20)
003 |                       ^
004 | SyntaxError: expected ':'
shrewd wren
#

!e
cube="["+i+"]"
for i in range(20):
print(cube)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'i' is not defined. Did you mean: 'id'?
shrewd wren
#

!e
cube=(f"["+i+"]")
i=0
for i in range(20):
print(cube)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'i' is not defined. Did you mean: 'id'?
shrewd wren
#

!e
cube="["+i+"]"
i=0
for i in range(20):
print(cube)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'i' is not defined. Did you mean: 'id'?
shrewd wren
#

!e
cube=(f"["+0+"]")
for 0 in range(20):
print(cube)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     for 0 in range(20):
003 |         ^
004 | SyntaxError: cannot assign to literal
shrewd wren
#

!e
cube=(f"["+num+"]")
num=0
for num in range(20):
print(cube)

timid fjordBOT
#

@shrewd wren :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'num' is not defined. Did you mean: 'sum'?
tired sluice
#

!e
priceTax = * 12%

timid fjordBOT
#

@tired sluice :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     priceTax = * 12%
003 |                     ^
004 | SyntaxError: invalid syntax
tired sluice
#

!e
priceTax = * 12 %

timid fjordBOT
#

@tired sluice :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     priceTax = * 12 %
003 |                      ^
004 | SyntaxError: invalid syntax
tired sluice
#

!e
priceTax = + 12 %

timid fjordBOT
#

@tired sluice :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     priceTax = + 12 %
003 |                      ^
004 | SyntaxError: invalid syntax
tired sluice
#

how do I add a percentage

#

!e
priceTax = 1 / 10 * 100

timid fjordBOT
#

@tired sluice :warning: Your eval job has completed with return code 0.

[No output]
tired sluice
#

yay

pulsar sun
#

def list_sum(num_List):
if len(num_List) == 1:
return num_List[0]
else:
return num_List[0] + list_sum(num_List[1:])
print(list_sum([3, 5, 8, 9, 9]))

agile portal
#

i managed to fix all the bugs in the code now that i'm not streaming (it was just 2 simple things that i'm too sleepy to quickly notice) T-T anyways gonna go sleep now

#

gnight

tired sluice
#

sick

sullen chasm
#

!e
price_tax = 1 / 10 * 100
print(price_tax)

timid fjordBOT
#

@sullen chasm :white_check_mark: Your eval job has completed with return code 0.

10.0
fresh sail
#

ู…ุตุทูู‰

shrewd wren
#

Hey

#

@all how does that one goes

#

!e
def cl(pr):
return pr/10*100
pr=9

timid fjordBOT
#

@shrewd wren :warning: Your eval job has completed with return code 0.

[No output]
#
Missing required argument

code

#
Command Help

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

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

#

@primal bison :white_check_mark: Your eval job has completed with return code 0.

hiii
sullen chasm
#

!e
def cl(pr):
return pr/10*100
print(cl(100))

timid fjordBOT
#

@sullen chasm :white_check_mark: Your eval job has completed with return code 0.

1000.0
royal trout
#

!e
Number=int(input("What is the cube u want"))
print(NumberNumberNumber)

#

?

#

!e
Number=int(input("What is the cube u want"))
print(Number* Number *Number)

timid fjordBOT
#

@royal trout :x: Your eval job has completed with return code 1.

001 | What is the cube u wantTraceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
royal trout
#

bruh dicord ownt let me do it

#

!e
Number=int(input("What is the cube u want"))
print(NumberNumberNumber)

timid fjordBOT
#

@royal trout :x: Your eval job has completed with return code 1.

001 | What is the cube u wantTraceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
royal trout
#

e

fresh sail
#

@keen mirage over here

keen mirage
keen mirage
#

bro ur afk

#

yes

finite ferry
#

ah there it is

#

nope

#

complete beginner

fresh sail
#

!voice

timid fjordBOT
#

Voice verification

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

fresh sail
#

@keen mirage

earnest nymph
#

yeah following

agile portal
#

D: unfortunately i can't join today

#

had plan with friends to play

earnest nymph
#

That would do๐Ÿ˜‚

#

Maybe from the exception message?

#

27

fresh sail
#

@high cosmos Over here!

high cosmos
#

@fresh sail Got it

#

@fresh sail Thanks very much

fresh sail
#

!voice

timid fjordBOT
#

Voice verification

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

high cosmos
#

@fresh sail How to start? Just follow this book from the beginning?

earnest nymph
#

Put the statement on same line as the assertion

#

Assert before the statement

sinful pond
#

hi

earnest nymph
#

Itโ€™s easier to put print statements everywhere

#

Wellโ€ฆ Iโ€™ll use both, then gradually phase out the prints

fresh sail
#

@primal bison over here

#

@alpine parcel OVer here!

hollow spade
#

Hi, how can I stream?

quaint oyster
#

does anyone know why my python cant run mySQLdb?

shrewd wren
#

How can i lonk a program to an messaging app to create like a fake person

#

@all

shrewd wren
#

@agile portal what are you doing , hello ?

#

Hello

#

Not ment to be unpolite

#

Dou you know about bf

#

Brain fuck

#

The language

#

It was hilarious

#

How can that work

#

In a computer ?

gloomy lily
#

CLOJURE IS GOOD

#

Just like haskell and job

#

imma dip for now

#

@calm bay I'll hit u up when I get back my perms

pine hill
#

hi

#

hi @agile portal

#

h r u

agile portal
robust osprey
#

where should I start here ?

silver aurora
#

@robust osprey whats goin on?

fresh sail
#

@unique meteor over here

unique meteor
#

hello!

#

:)

fresh sail
#

@runic jewel Over here

unique meteor
#

don't have much to say. just dropping by to see what's up

runic jewel
#

@fresh sail keep up the good work.

unique meteor
#

niice

fresh sail
#

@glad stratus

unique meteor
#

what if you change htts to https

#

lmao

polar dew
#

I can help you

rapid rover
unique meteor
#

maybe make it python map_it.py

fresh sail
#

I think it is good can you suggest something better?

unique meteor
#

hmm

rapid rover
#

depends on what you want to learn step by step or specific

unique meteor
#

I think tokens are the keywords in programming. Like 'for' in for loop could be a token. I'm not sure though. Let me google it

#

I'm on windows 11 rn. I never noticed it, but the search bar is indeed huge

#

i gtg too. later!

light lichen
#

how is this guy talking from other channel

#

๐Ÿคฃ

fresh sail
leaden shoal
#

top 10 reasons to switch to linux

fresh sail
limpid coral
rocky charm
agile portal
#
import requests

def get_stream(url):
    s = requests.Session()
    headers = {
        "User-Agent": "curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8h zlib/1.2.3 libssh2/0.15-CVS"
    }


    with s.get(url, headers=headers, stream=True) as resp:
        for line in resp.iter_lines():
            if line:
                print(line.decode())


url = "http://parrot.live"
get_stream(url)
rocky charm
fresh sail
#

welcome back

fresh sail
#

!Dad

timid fjordBOT
#

Mutable Default Arguments

Default arguments in python are evaluated once when the function is
defined, not each time the function is called. This means that if
you have a mutable default argument and mutate it, you will have
mutated that object for all future calls to the function as well.

For example, the following append_one function appends 1 to a list
and returns it. foo is set to an empty list by default.

>>> def append_one(foo=[]):
...     foo.append(1)
...     return foo
...

See what happens when we call it a few times:

>>> append_one()
[1]
>>> append_one()
[1, 1]
>>> append_one()
[1, 1, 1]

Each call appends an additional 1 to our list foo. It does not
receive a new empty list on each call, it is the same list everytime.

To avoid this problem, you have to create a new object every time the
function is called:

>>> def append_one(foo=None):
...     if foo is None:
...         foo = []
...     foo.append(1)
...     return foo
...
>>> append_one()
[1]
>>> append_one()
[1]

Note:

โ€ข This behavior can be used intentionally to maintain state between
calls of a function (eg. when writing a caching function).
โ€ข This behavior is not unique to mutable objects, all default
arguments are evaulated only once when the function is defined.

humble hinge
#

lel

primal bison
#

@agile portaltook me forever to @ you lmao bc of your non -ascii name

#

but anyways- bye!

topaz creek
#

hello guys ๐Ÿ™‚

plush widget
#

Hello guy's

#

I'm building a discord robot now, does anyone have any theoretical ideas? I mean, what options should I put on the robot?

fresh sail
#

pip install --user requests

fickle abyss
#

what is going on in live coding?

wraith eagle
#

pip install --user requests

limpid coral
#

py -m pip intsall --user requests try this

buoyant kestrel
#

On Tuesdays and Thursdays, Magical Girl (Fury) goes through a section of the text Automate the Boring Stuff, and does a kind of work along/read along workshop

fickle abyss
#

That's very nice

wary lance
#

Are you typing the command in like cmd or powershell?

#

And not the Python interpreter

fresh sail
#

winget install pip

wary lance
#

I thought pip gets bundled with Python nowadays.

buoyant kestrel
#

It does

rapid rover
#

on windows it's python instead of py

buoyant kestrel
#

And if it isn't, you should do py -m ensurepip

rapid rover
#

python app.py

#

maybe the env isn't activated

limpid coral
rapid rover
#

why you don't use anaconda that have installed lots of package, isntead of pure python interpter

wary lance
#

Are you getting these errors?

fresh sail
#

quit()

rapid rover
buoyant kestrel
#

40 more pages of this legal document left to read.

rapid rover
#

I saw some url or command to download it

dense galleon
#

hello guys can i pls ask u something?

buoyant kestrel
#

py -m ensurepip should be the modern way to get or make sure you have pip properly installed

dense galleon
#

what type are the operation signs? @buoyant kestrel

buoyant kestrel
#

Fury spelled python incorrectly

rapid rover
#

set PATH=%PATH%; C:\Python3\Scripts

rapid rover
wraith eagle
#

C:\Users\megatronic>pip install --user requests
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
Requirement already satisfied: requests in c:\users\megatronic.local\lib\python3.9\site-packages (2.28.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\megatronic.local\lib\python3.9\site-packages (from requests) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in c:\users\megatronic.local\lib\python3.9\site-packages (from requests) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\megatronic.local\lib\python3.9\site-packages (from requests) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\megatronic.local\lib\python3.9\site-packages (from requests) (2022.6.15)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)

buoyant kestrel
fresh sail
#

import requests

wraith eagle
#

import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'

fresh sail
#

python -m ensurepip --default-pip

buoyant kestrel
#

After what he put, do python -m pip list

wraith eagle
#

C:\Users\megatronic>python -m ensurepip --default-pip
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
Looking in links: c:\Users\MEGATR~1\AppData\Local\Temp\tmpzhmc_xcl
Requirement already satisfied: setuptools in c:\msys64\mingw64\lib\python3.9\site-packages (62.4.0)
Requirement already satisfied: pip in c:\msys64\mingw64\lib\python3.9\site-packages (22.1.2)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)

buoyant kestrel
#

See if requests even shows up there

versed schooner
#

why is this happening?

Empty DataFrame
Columns: []
Index: []

buoyant kestrel
#

And honestly, you may just have to uninstall/reinstall Python

rapid rover
#

i have never installed packages using --user

buoyant kestrel
#

For some reason the one from the MS Store always causes issues

tulip blaze
#

It's msys2, trying to find out what that is

dense galleon
#

@buoyant kestrel what type are operation signs?

wary lance
#

Can you list the package directory?

dir c:\msys64\mingw64\lib\python3.9\site-packages
buoyant kestrel
#

I'm not sure, Shaken

fresh sail
#

python -m pip list

buoyant kestrel
#

I don't know what type they'd be classified as

rapid rover
#

you forgot to check all the fields set path and etc during the installion i suppose

buoyant kestrel
#

Add to PATH isn't needed so long as you use py

dense galleon
#

@buoyant kestrel is that ur real face?

buoyant kestrel
#

It is

wraith eagle
#

C:\Users\megatronic>python -m pip list
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
Package Version


certifi 2022.6.15
charset-normalizer 2.0.12
idna 3.3
pip 22.1.2
requests 2.28.0
setuptools 62.4.0
urllib3 1.26.9
wheel 0.37.1
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\msys64\mingw64\lib\python3.9\site-packages)

buoyant kestrel
#

It shouldn't be using msys

rapid rover
#

the pip is installed, the system can't see it

buoyant kestrel
#

Like

#

At all

tulip blaze
#

Someone said that the tilde char '~' can cause this issue in site-packages folder

wary lance
#

Still need to manually remove MSYS2 from %PATH%, I think.

#

Open start menu. Typing "envir" should search for it.

primal bison
#

Rate my joke programm

wary lance
#

Might need to relog to use the new %PATH%.

fresh sail
#

@lunar delta @silent star @digital blade overt here

dense galleon
#

@buoyant kestrel so if till now we could use css+htm+javascript, now that we can write python tags in html, can we replace javascript with python?

#

@buoyant kestrel ?

tulip blaze
#

might have to restart the editor for bs4 import to be recognized? @fresh sail

buoyant kestrel
fiery mulch
#

Not sure but seems some dependency issue... @glass forum

sinful salmon
#

just made my own language whose syntax is like:

depression kill_yourself(a,b)
{
    if(!a)
        return "Dont Die!";
    else
        return "Die!";
}

cry kill_yourself(1,0);
#

basically u declare a function with depression

#

a variable with pain

#

cry is equivalent to print

#

anything else should i change?

#

opinion requested

glass forum
odd inlet
#
for i in range(10):
    time.sleep
    print(i)```
timid fjordBOT
#

Hey @crystal notch!

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

crystal notch
sweet wasp
#
func test() {
  val, err := BadFn1();
  if err != nil {
    return;
  }
  val, err = BadFn2();
  if err != nil {
    handle(err);
  }
  OofyFn3(val);
}
primal bison
#

In python you choose what error type to skip
Javascript just skips it

sweet wasp
stone gulch
#

Yup

#

WARNIG: im a newbie

#

In python and this channel too

sinful salmon
#

yikes

covert iris
#

could someone slide in code help D:

#

wait

#

nvm you cant screen share lmao

winged heart
#

cool

rose monolith
#

why lgbtq logo trash

latent dome
#

shut up

idle cove
#

@calm bay, what are you two working on?

calm bay
#

ps1 emulator

idle cove
#

ah, nice

honest pasture
pine linden
#

llo there

#

is there anyone ??

calm bay
#

@gloomy lily ping me when ur back, hope u didn't die

gloomy lily
#

@calm bay

#

I'm back

#

That was...a long laundry thing

lilac pond
#

Hey could I ask you guys a question?@gloomy lily

gloomy lily
#

SQUARE

hidden socket
#

Nice

warm beacon
hollow mesa
#

I need help

agile portal
#

@gentle dock you can type here

gentle dock
#

ozk

#

sure

#

i m installing vscode

#

@agile portal m i the only one here today? .o.

agile portal
#

@thorny yoke

#

here

thorny yoke
#

ah ok

gentle dock
#

i think so

thorny yoke
#

i have not, new windows installation, gimme a sec

gentle dock
#

with recommended python files

#

got the live server i think

thorny yoke
#

im still doing it, you can move ahead tho

gentle dock
#

was fine for me

thorny yoke
#

im good

rustic scarab
#

Hello @agile portal sir can i have permission to speak i have dought?

#

ok no worries can i ask my dought here?

#

Is doctype mandatory?

#

what will happen if i dont write <Doctype.html> ?error?

thorny yoke
#

sure

gentle dock
#

it was all basics for me ^^

thorny yoke
#

same

gentle dock
#

why do tags have overlapping functions tho?

#

like strong and bold or em and i

#

.o.

thorny yoke
#

yup

gentle dock
#

pretty much

#

it is audible

#

yes

thorny yoke
#

@agile portal i got a question

#

so you know how we made a form

#

what if i want the submit button to link to a new page

#

like websites usually do

unreal prairie
#

I guess you would usually redirect to that page

buoyant kestrel
#

We're in the middle of a workshop so in here isn't the best place to ask specific questions right now

gentle dock
#

@agile portal so wt was actually supposed to happen?

agile portal
gentle dock
#

lol

thorny yoke
#

@agile portal could you please quickly recap just a little bit, from when you opened the script tag

#

i dont get it tbh

gentle dock
#

@agile portal is this happening bcoz there is another event in the background?

thorny yoke
#

i think

thorny yoke
#

@agile portal think theres a typo in email-content, in your html file

agile portal
#

@primal bison

neat bluff
#

@agile portal thanks for the session, is this recorded?

agile portal
#

!paste

timid fjordBOT
#

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.

neat bluff
#

@agile portal is this recorded?

#

@agile portal all break point can be used

halcyon schooner
#

what

agile portal
#

though i'm probably gonna do one just for javascript the language itself tommorow (8 pm ist) if you wanna show up

calm bay
calm bay
vernal snow
#

dwm.c:742 just need to note something down before I restart xorg

calm bay
gloomy lily
gloomy lily
calm bay
honest pasture
#

JavaOS is an operating system based on a Java virtual machine and predominantly used on SIM cards to run applications on behalf of operators and security services. It was originally developed by Sun Microsystems. Unlike Windows, macOS, Unix, or Unix-like systems which are primarily written in the C programming language, JavaOS is primarily writt...

gloomy lily
obtuse nebula
#

Log4Shell (CVE-2021-44228) was a zero-day vulnerability in Log4j, a popular Java logging framework, involving arbitrary code execution. The vulnerability had existed unnoticed since 2013 and was privately disclosed to the Apache Software Foundation, of which Log4j is a project, by Chen Zhaojun of Alibaba Cloud's security team on 24 November 2021...

#

โ€œThere are only two kinds of languages: the ones people complain about and the ones nobody uses.โ€

gloomy lily
honest pasture
#
ADD 1 TO x
ADD 1, a, b TO x ROUNDED, y, z ROUNDED

ADD a, b TO c
    ON SIZE ERROR
        DISPLAY "Error"
END-ADD

ADD a TO b
    NOT SIZE ERROR
        DISPLAY "No error"
    ON SIZE ERROR
        DISPLAY "Error"
honest pasture
#
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.

DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 WS-STRING PIC X(15) VALUE 'ABCDACDADEAAAFF'.

PROCEDURE DIVISION.
   DISPLAY "OLD STRING : "WS-STRING.
   INSPECT WS-STRING REPLACING ALL 'A' BY 'X'.
   DISPLAY "NEW STRING : "WS-STRING.
   
STOP RUN.
frank minnow
#

!e print("\7")

timid fjordBOT
#

@frank minnow :white_check_mark: Your eval job has completed with return code 0.


frank minnow
#

!e print("\7")

timid fjordBOT
#

@frank minnow :white_check_mark: Your eval job has completed with return code 0.


grim wind
#

Do you think the corsair hs80 wireless are getting a reboot? I am considering getting them to improve my audio

#

especially for calls

#

Also do you all transnight when your projects are due?

gloomy lily
#

HE REPLIED

#

@calm bay @honest pasture

calm bay
#

no emotion

#

I'm disappointed

#

I expected better from Shaun

honest pasture
vapid anvil
#

never have i seen html code look so perfect :')

queen hatch
#

It says steam ended for me.

#

nevermind discord was glitching again.

halcyon schooner
#

ok

lunar shadow
#

!e

timid fjordBOT
#
Missing required argument

code

vapid anvil
#

nooo actually the code is so symmetrical

agile portal
primal bison
#

yess downloading it as we speak

wary lance
#

Would you mind using a lower fps?

#

Thank you

barren wigeon
#

ello

buoyant kestrel
#

Hello!

#

I thought the semi-colon thing was inconsistent

#

Whether it's needed or not

#

I'm trying to remember if there's a way to hot reload or auto reload whenever you save your code so that the browser shows changes as it goes

buoyant kestrel
#

Please Excuse My Dear Aunt Sally

primal bison
#

So far so good

primal bison
#

All good on my end

rustic scarab
#

I am consfused in pre increment and post increment/decrement๐Ÿ˜ตโ€๐Ÿ’ซ

#

Can you please re explain again in short way

#

Can i speak?

wary lance
#

It's like counting your piggy bank before putting money in it.

#

Haven't heard of it!

languid olive
#

i know

gentle dock
#

๐Ÿ˜ถ

languid olive
#

i've made it

thorny yoke
#

Same

languid olive
#

i know how to solve it

#

but not in js

#

i know for python

analog anchor
#

we could check if it's divisible by 15

thorny yoke
#

@agile portal if you could change your webpage bg to black that would be very nice cuz I keep getting flashbanged

#

Much better

analog anchor
#

nope

#

its good

wary lance
#

Gotta go, but I appreciate the lesson!

rustic scarab
#

does alert function can have buttons like Ok and cancel? @agile portal

#

sorry but I have heared API for the first time here...
i m in 10th standard

#

can you tell me what is API stands for?

#

point noted

#

what?

agile portal
#

i asked if everyone knows what return means

#

vs printing something for example

thorny yoke
#

@agile portal wanna stop here for today before canvas? It's been 2+ hours so

#

Ah ok

#

Aight imma head out

#

Thanks for the session

agile portal
gentle dock
#

ggs^^

balmy pasture
#

!e

list1 = [[8388902, 6], [8388901, 8], [8388922, 22]]
list2 = [[8388902, 6], [8388901, 10], [8388922, 22]]

for sublist1, sublist2 in zip(list1, list2):
  if sublist1 != sublist2:
    print(sublist1, sublist2)
timid fjordBOT
#

@balmy pasture :white_check_mark: Your eval job has completed with return code 0.

[8388901, 8] [8388901, 10]
calm bay
calm bay
night lily
#

๐Ÿœ <- An ant named Anthony.
๐Ÿœ <- The same ant, but named Bob.

Anty aliasing.

calm bay
#

it made me giggle

proper wyvern
calm bay
proper wyvern
nocturne jay
#

hee

#

h

#

e

#

h

#

e

#

hello

#

I want to share my project

calm bay
#

!kindling

timid fjordBOT
#

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.

odd hinge
#

Hello friends, I have been working on a cryptographic program for the last year. After many iterations I have concluded to a final program ,but there is a problem. The program is very slow (It would take my laptop 3 months running 24-7 to finish) but there is little to no optimization I can do to the code rather than changing the algorithm. The only solution I could think about is distributing the workload to other computers but I don't know where to find such source of cheap computing power. If you can help me with the problem I face ,please contact me : )

sullen garden
#

How's everyone today?

sullen garden
#

Yay for payday or Nay? ๐Ÿ˜„

timid fjordBOT
#

Hey @amber kettle!

It looks like you tried to attach file type(s) that we do not allow (.html). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

amber kettle
agile portal
#

@gentle dock

#

you can type here

hardy ferry
#

Did my first coding. I feel like I have ascended into a higher dimension.

wanton sapphire
halcyon schooner
#

;0

hybrid steeple
#

Hello everyone. I have been learning how to code in python from an online platform. I have an assignment which deals with text based files and string manipulation. I have been stuck with this assignment for 2 days, if anyone can help me out it would mean a lot. Please contact me if willing to help ๐Ÿ˜„

nocturne jay
#

@hybrid steeple yes How can i help you?

hybrid steeple
#

@nocturne jay I have been learning how to code in python from an online platform. I have an assignment which deals with text based files and string manipulation. I have been stuck with this assignment for 2 days, if you can help me out it would mean a lot.

nocturne jay
#

yes i understand the assignment target and code

#

like you want to search a particular string or something?

#

@hybrid steeple?

hybrid steeple
#

No. Basically i have a text file containing a set of dialogues from a script. I have to Find out the number of unique dialogue speakers in the sample conversation and Create a new text file by the name of the dialogue speaker and store the unique words
spoken by that character in the respective text file.

timid fjordBOT
#

Hey @hybrid steeple!

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

nocturne jay
#

!paste

timid fjordBOT
#

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.

nocturne jay
#

text file will work to...

timid fjordBOT
#

Hey @hybrid steeple!

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

nocturne jay
#

then just send me the url

#

do not forget to save

hybrid steeple
#

okay give me a sec

#

are you able to view it?

nocturne jay
#

yes

#

ok i understand

hybrid steeple
#

This is the problem statement

#

for better understanding

nocturne jay
#

ok so all the char left to the colon are the characters meaning you can just find the characters left of the colon.

hybrid steeple
#

i am pretty new to coding. Can you write the code if possible?

nocturne jay
#

yes sure

#

will take some time

hybrid steeple
#

No worries. Take your time.

#

Thanks for your help.

nocturne jay
#

ya but you iwll ned a module

#

numpy specifically

hybrid steeple
#

i can import that right?

nocturne jay
#

yes

hybrid steeple
#

okay, i know how to do that.

nocturne jay
#

as it will be long code, i i wil post updates

#

@hybrid steeple?

hybrid steeple
#

Okay

#

I will

ornate escarp
violet bridge
#

Hello friends

jovial willow
#

i have a probelm

#

problem

#

int Alter = 19; // andere datentypen funktionieren damit auch (switch case)

switch (Alter) {
case 17: System.out.println("17 Jahre alt"); break;
case 18: System.out.println("18 Jahre alt"); break;
case 19: System.out.println("19 Jahre alt"); break;     //break ist fรผr die reihenfolge wichtig, sonnst werden werte vertauscht
default: System.out.println("anderes alter"); break;
}


String Film = "StarWars";

switch (Film) {
case "HarryPotter": System.out.println("Falsches Buch"); break;
case "WarriorCats": System.out.println("Falsches Buch"); break;
case "Qualityland": System.out.println("Falsches Buch"); break;
case "StarWars": System.out.println("Richtiges Buch"); break;
default: System.out.println("Kein treffendes Buch erschienen"); break;
}

}

#

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error, insert "... VariableDeclaratorId" to complete FormalParameter

at Program.main(Program.java:4)
inland loom
#

CODEGINITY!

#

You have a syntax error maybe missing semicolon or whatever on that line

calm bay
#
import sys

def register(cls):
    def setup(bot):
        bot.add_cog(cls)
        print(f"Registered {cls.__name__}")
    mod = sys.modules[cls.__module__]
    mod.setup = setup
    return cls
alpine parcel
#
list_1 = []
m = 0
while m <= 21:  # where m is the length of the `output_id` series.
    list_1.append(m)
    m = m + 1
# print(list_1)

print('now, time to slice list_1 candy')
print(list_1[1:21:6])

####################
list_2 = []
n = 0
while n <= 21:
    list_2.append(n)
    n = n + 1

print('now, time to slice list_1 candy')
print(list_2[2:21:6])

# time to merge these lists together in the right order:
for i in list_1:
    list_1.insert(i + 1, list_2[i])
print(list_1)

####################
list_3 = list(sum(zip(list_1, list_2), ()))
print(list_3)
#

!e


a = [1, 3, 5, 7]
b = [2, 4, 6, 8]

print(list(sum(zip(a ,b) , ())))
timid fjordBOT
#

@alpine parcel :white_check_mark: Your eval job has completed with return code 0.

[1, 2, 3, 4, 5, 6, 7, 8]
alpine parcel
#

e!

list_1 = []
m = 0
while m <= 21:  # where m is the length of the `output_id` series.
    list_1.append(m)
    m = m + 1
# print(list_1)

print('now, time to slice list_1 candy')
print(list_1[1:21:6])

####################
list_2 = []
n = 0
while n <= 21:
    list_2.append(n)
    n = n + 1

print('now, time to slice list_1 candy')
print(list_2[2:21:6])


####################
list_3 = list(sum(zip(list_1, list_2), ()))
print(list_3)
#

!e

list_1 = []
m = 0
while m <= 21:  # where m is the length of the `output_id` series.
    list_1.append(m)
    m = m + 1
# print(list_1)

print('now, time to slice list_1 candy')
print(list_1[1:21:6])

####################
list_2 = []
n = 0
while n <= 21:
    list_2.append(n)
    n = n + 1

print('now, time to slice list_1 candy')
print(list_2[2:21:6])


####################
list_3 = list(sum(zip(list_1, list_2), ()))
print(list_3)
timid fjordBOT
#

@alpine parcel :white_check_mark: Your eval job has completed with return code 0.

001 | now, time to slice list_1 candy
002 | [1, 7, 13, 19]
003 | now, time to slice list_1 candy
004 | [2, 8, 14, 20]
005 | [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21]
alpine parcel
#

the desired output: [1,2, 7,8, 13,14 19,20]

alpine parcel
#

i figured it out btw

halcyon schooner
#

uwu

tepid jewel
#

@urban reef you can dc now if you want to.

leaden shoal
leaden shoal
#

maybe get some sleep @urban reef

trim pelican
leaden shoal
hallow anvil
#

print('hello')

astral prairie
#

e!

marble jolt
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

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

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

marble jolt
#

!eval print("Hello, World!")

timid fjordBOT
#

@marble jolt :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
marble jolt
#

!eval eval("print('Hello, World!')")

timid fjordBOT
#

@marble jolt :white_check_mark: Your eval job has completed with return code 0.

Hello, World!
brisk pawn
#

!hel0

robust mirage
#

!e print("hello")

#

!e i = 9
if i = 9:
print(i)

timid fjordBOT
#

@robust mirage :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     if i = 9:
003 | IndentationError: unexpected indent
carmine wasp
#

!eval eval print(โ€œHello worldโ€)

timid fjordBOT
#

@carmine wasp :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     eval print(โ€œHello worldโ€)
003 |                ^
004 | SyntaxError: invalid character 'โ€œ' (U+201C)
terse magnet
#

!eval print('Hi')

timid fjordBOT
#

@terse magnet :white_check_mark: Your eval job has completed with return code 0.

Hi
terse magnet
#

!eval a = []
b = input('How many cats do you have?')
a.append(b)
if len(a) > 2:
print('cool')

nocturne jay
#

!eval for x in range(1, 100): for y in range(1, 10): print(f"{x} * {y} = {x * y}")

timid fjordBOT
#
Missing required argument

code

nocturne jay
#

!eval for x in range(1, 100): for y in range(1, 10): print(f"{x} * {y} = {x * y}")

nocturne jay
#

8hello?

#

Can you tell me your problem?

warm dome
#

wait

#
class Hashtable:
    def __init__(self):
        self.max=10
        self.arr=[[] for i in range (self.max)]
        
    def get_hash(self,keys):
        sum=0
        for c in keys:
            sum=sum+ord(c)
        return (sum%self.max)
    def __setitem__(self,key,val):
        h=self.get_hash(key)
        found=False
        for index,element in enumerate self.arr[h]:
            if element[0]==key and len(element)==2:
                found=True
                self.arr[h][index]=(key,val)
        if not found:
            self.arr[h].append((key,val))
    def __getitem__(self,key):
        h=self.get_hash(key)
        for i in self.arr[h]:
            if i[0]==key:
                return i[1]
        return self.arr[h]
    ```
#

for index,element in enumerate self.arr[h]:
^
SyntaxError: expected ':'

#

this error

nocturne jay
#
enumerate(self.arr[h]):
#
class Hashtable:
    def __init__(self):
        self.max=10
        self.arr=[[] for i in range (self.max)]
        
    def get_hash(self,keys):
        sum=0
        for c in keys:
            sum=sum+ord(c)
        return (sum%self.max)
    def __setitem__(self,key,val):
        h=self.get_hash(key)
        found=False
        for index,element in enumerate(self.arr[h]):
            if element[0]==key and len(element)==2:
                found=True
                self.arr[h][index]=(key,val)
        if not found:
            self.arr[h].append((key,val))
    def __getitem__(self,key):
        h=self.get_hash(key)
        for i in self.arr[h]:
            if i[0]==key:
                return i[1]
        return self.arr[h]
#

try this

warm dome
#

thanks it worked

warm dome
nocturne jay
#

enumerte()

warm dome
#

didnt knew to use bracket

nocturne jay
#

it is function so it has parenthesis

nocturne jay
#

@solid arch Australia is in Australia

wary lance
#

May be they are makinig tea as well!

agile portal
#

possible

buoyant kestrel
random pecan
#

how dogs respond to "fetch": runs for some random object
how programmers respond to "fetch": PROCEED TO OPEN IDE AND TYPE A JS FETCH API CALL

wary lance
#

Makes me wonder if p1.eat.call(p2, "ice-cream") works.

#

Mm. Things to never do!

#

So defer alone is not enough?

nocturne jay
#

@agile portal what are you doing currently

#

oh great

timid fjordBOT
ember breach
#

if (mode ==='public') {
showDetails();

Call a function here to show the post details

showDetails();
} else{
#Call a function here to hide the post details
hideDetails();
}

#

my code is not running lol

#

doing this practice from codeacademy

wary lance
#

Pretty clear so far

ember breach
#

yeah

#

it is

#

i did everything clearly

#

but idk why its not executing

#

lemme try using replit

wary lance
#

Oh right. Can you use endPath please? Not having it matching bugs me a little!

#

I assume there is an endPath anyway.

ember breach
#

endpath for which one

#

if (endpath ==='public') {

#

like this?

wary lance
#

Not a channel for asking questions.

ember breach
#

oh

wary lance
#

Forgot to copy the "#", I think

waxen frigate
#

(Math.random() * 4 + 1 ) + (Math.random() * -4 -1);

#

will this work?

wary lance
#

Pretty neat

#

Thanks for the lesson! Making something graphical is always more interseting

#

Estimating pi in a browser...!

agile portal
#

@gentle dock @ember breach @buoyant kestrel this is the code we wrote today ๐Ÿ™‚

gentle dock
#

arigato^

wary lance
#

It's Friday!

warm dome
#
class Hashtable:
    def __init__(self):
        self.max = 10
        self.arr = [[] for i in range(self.max)]

    def get_hash(self, keys):
        sum = 0
        for c in keys:
            sum = sum + ord(c)
        return (sum % self.max)

    def __setitem__(self, key, val):
        h = self.get_hash(key)
        found = False
        for index, element in enumerate(self.arr[h]):
            if element[0] == key and len(element) == 2:
                found = True
                self.arr[h][index] = (key, val)
        if not found:
            self.arr[h].append((key, val))

    def __getitem__(self, key):
        h = self.get_hash(key)
        for i in self.arr[h]:
            if i[0] == key:
                return i[1]
        return self.arr[h]

    def __delitem__(self, key):
        h = self.get_hash(key)
        for index, element in enumerate(self.arr[h]):
            if element[0] == key:
                print(f"delete element in {index}")
                del self.arr[h][index]


filename='nyc_weather.csv'
f=Hashtable()
f.arr
with open(filename,'r') as fileobj:
    for line in fileobj:
        date,temp=line.split(',')
        temp = int(temp)
        f.arr[date]=temp
mighty compass
#

ngl, I'm kind of new to python...

#

Ik html tho

warm dome
#

@sinful salmon

#

are you online

#
class Hashtable:
    def __init__(self):
        self.max = 10
        self.arr = [[] for i in range(self.max)]

    def get_hash(self, keys):
        sum = 0
        for c in keys:
            sum = sum + ord(c)
        return (sum % self.max)

    def __setitem__(self, key, val):
        h = self.get_hash(key)
        found = False
        for index, element in enumerate(self.arr[h]):
            if element[0] == key and len(element) == 2:
                found = True
                self.arr[h][index] = (key, val)
        if not found:
            self.arr[h].append( (key, val))

    def __getitem__(self, key):
        h = self.get_hash(key)
        for i in self.arr[h]:
            if i[0] == key:
                return i[1]
        return self.arr[h]

    def __delitem__(self, key):
        h = self.get_hash(key)
        for index, element in enumerate(self.arr[h]):
            if element[0] == key:
                print(f"delete element in {index}")
                del self.arr[h][index]


filename='nyc_weather.csv'
f=Hashtable()
count=0
with open(filename,'r') as fileobj:
    for line in fileobj:
        try:
            date,temp=line.split(',')
            temp = int(temp)
        
        except ValueError:
            pass
        else:
            f.arr[count]=(date,temp)
            count+=1
print(f.arr)
#
class Hashtable:
    def __init__(self):
        self.max = 10
        self.arr = [[] for i in range(self.max)]

    def get_hash(self, keys):
        sum = 0
        for c in keys:
            sum = sum + ord(c)
        return (sum % self.max)

    def __setitem__(self, key, val):
        h = self.get_hash(key)
        found = False
        for index, element in enumerate(self.arr[h]):
            if element[0] == key and len(element) == 2:
                found = True
                self.arr[h][index] = (key, val)
        if not found:
            self.arr[h].append( (key, val))

    def __getitem__(self, key):
        h = self.get_hash(key)
        for i in self.arr[h]:
            if i[0] == key:
                return i[1]
        return self.arr[h]

    def __delitem__(self, key):
        h = self.get_hash(key)
        for index, element in enumerate(self.arr[h]):
            if element[0] == key:
                print(f"delete element in {index}")
                del self.arr[h][index]


filename='nyc_weather.csv'
f=Hashtable()
count=0
with open(filename,'r') as fileobj:
    for line in fileobj:
        try:
            date,temp=line.split(',')
            temp = int(temp)
        except TypeError:
            pass
        except ValueError:
            pass
        else:
            f.arr[count]=(date,temp)
            count+=1
print(f.arr)
#

[('Jan 1', 27), ('Jan 2', 31), ('Jan 3', 23), ('Jan 4', 34), ('Jan 5', 37), ('Jan 6', 38), ('Jan 7', 29), ('Jan 8', 30), ('Jan 9', 35), ('Jan 10', 30)]

agile portal
#

@warm dome can't replicate your issue

primal bison
#

grokking algorithms

agile portal
#

for me its working in both versions

#

with same output

warm dome
agile portal
#

nope

#

@warm dome

#

can't replicate

#

getting same input both times

#

same output*

#

with or without

#

@primal bison hello btw ๐Ÿ™‚

primal bison
#

hey :>

agile portal
#

wanna play 1 match of either coding game or bomb party before i go? xD

agile portal
#

;-; sure go ahead and beat me at your expert level questions man

agile portal
#

no you're not >w>

primal bison
wary lance
#

Gotta go. It was good to see you around again Maro!

gloomy lily
#

; true; <-ticker.C

agile portal
#

@calm bayhttps://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/

calm bay
#

i tried reading that at some point but I'm stupid

nocturne jay
#

@night lily are you online?

stable warren
#

Can anybody help me out? I am stuck at a problem?

wet minnow
timid fjordBOT
#

:incoming_envelope: :ok_hand: applied mute to @tropic imp until <t:1656827560:f> (9 minutes and 59 seconds) (reason: discord_emojis rule: sent 21 emojis in 10s).

astral loom
#

The solution is to learn how to use computer and send screenshots

drifting nest
#

hello

vapid anvil
#

what happens in the voice chat 0-0

primal bison
vapid anvil
#

thats very sus 0_0

open niche
#

really weird

jagged granite
#

!voice

timid fjordBOT
#

Voice verification

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

jagged granite
#

Thank you for flying @buoyant kestrel air

karmic sonnet
#

@white mica

white mica
#

yep

#

oh were you referring to the bot message

karmic sonnet
#

non

white mica
#

are you not able to be voice verified cause of the restrictions

calm bay
#
pool = Pool(processes=8)
tasks = len(tasks)
for _ in tqdm.tqdm(pool.imap_unordered(handle, tasks), total=len(tasks)):
    pass
#
if __name__ == '__main__':
karmic sonnet
#

bonjour comment รงa va

#

bonjour?

#

Please don't use transtale

fresh sail
#

รงa va

karmic sonnet
fresh sail
#

nope.

obtuse yarrow
#

made my first code with the help of copilot, adds a crosshair to the middle of the screen and the window showing it is fully passthrough with fullscreen game support, FPS too.

jagged lagoon
#

Noice

terse wedge
#

help

grand iris
#

!voice

timid fjordBOT
#

Voice verification

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

sonic gulch
#

hi i need some help with finding definite integral

#

im pretty new to python

#

i can explain my need, can someone with experience in finding definite integral over a range in a xarray help me

frank abyss
#

why am i not able to talk in channels

#

i did verify

#

but not talking now neither

daring kernel
#

Like i am trying to do

#

I only have 8 messages

#

i need to get 50

#

If i type 20 per day

#

in 3 days im verified

#

im not cleary clarified if its only to get 50 messages or you have to do all the tasks

#

to get the voice verification

#

well

#

you

#

hve

#

to

#

get

#

the

#

job

#

done

#

its simple as that

verbal escarp
#

Lol

#

What a way to get 50 messages

sturdy geyser
frank abyss
#

are you kidding without 50 messages per day it wont verify?

shadow ivy
#

no, 50 messages total outside of bot command channels. you also need a few days activity. read #voice-verification

gusty delta
#

hello there

#

it seems like i have to get the 50 messages so i can speak ๐Ÿฅฒ

#

wym

#

guess its so people can share their screen while coding

#

and voice chat

#

there's a voice channel next to this text channel

#

with the same name

#

but i can't unmute myself because i'm still not verified

frank abyss
#

me too i cant talk too

#

sadness

jagged flicker
#

learning to code and not having voice privilege's is kinda terrible but it is needed to keep people from spamming vc's like children.

#

like right now I'm new to coding completely and I chose python to start with and functions are giving me a bit of trouble figuring out all the proper ways to word and how to fix the errors in my practice however I have found that there are some members who are extremely helpful regardless if I can communicate through vc or not.

molten spindle
#

hi

#

yes

#

i don't have stupit role

#

yes

#

just send msg?

#

sure

#

like โ€‹โ€‹!voiceverify or โ€‹โ€‹!verify

#

it just says that i need to send more msg to verify

abstract oracle
#

!voice

timid fjordBOT
#

Voice verification

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

molten spindle
#

!voice

#

no

#

!voice

timid fjordBOT
#

Voice verification

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

molten spindle
#

Voice Gate failed
You are not currently eligible to use voice inside Python Discord for the following reasons:

โ€ข You have sent less than 50 messages.

#

bot says

#

stupit system

jolly radish
#
22
86
-1   -1   -1   -1   -1   -1   -1   -1
-1    0    0    0    7    0    0    0
-1    0   -1   -1   -1   -1   -1   -1
-1    0   -1   -1   107  -1   -1   -1
-1    0    0    0    0   -1   -1   -1
-1   -1   -1   -1   -1   -1   -1   -1
low patio
#

Ia

stable shell
#

di da

low patio
#

minions

short summit
#

pie thong

warm wren
#

Hi

pine lark
#

Pie Thong

ivory marten
#

hello @slim dust

#

@lunar skiff hello

#

i don't have a mic

#

how are you doing

#

i was making a password cracker for metamask

#

how about you

#

ok

#

but isn't it dangerous to link you account with a programming language

#

ok

#

ok

#

can you share your code

#

i wu=ould like to see it

#

would

#

ok

#

no problem

#

do you use arduino