#code-help-voice-text
5 messages · Page 5 of 1
and you can do seq on any number
e.g. echo "enter a number :"; read number; seq $number
dude what the hell
ok so do i need to make a file
and "this is a test" is not valid
no
look at my example
what you wanted is probably echo "this is a test"
then a pipe (the | ) can be used
this allows you to take the output of a command and to put it in the input of another
and enter?
?? you indeed need to press enter to execute a command
ok it dropped don with a new arrow pointer
i think it took me out of my root access, not sure whats going on
because you did not closed the quote
just press ^C to stop
and restart
echo "this is a test"
then echo "this is a test" | tr "i" "1" here each "i" is TRansformed in a "1"
so try it to see what you get
also, try cat hello_world , that prints the file contents.
it says -comes back...test 1s a test
then, cat hello_world | tr "l" "L"
🤣
problem is, i dont know how we just did that
and im doing this for my own learning
yes
so if i cant talk about it, its worthless
so the idea is that tr takes to arguments and one input
why is echo this is a test and tr, what does tr actually do in this?
and it replaces every [1st argument] with [2nd] argument, and pushed this as an output
so this was all done when doing this before, or did we put this here before when we typed it in previously
so tr "i" "1" replaces each "i" with a "1"
how does it know what a second and first argument is
so tr kind of replaces?
why is this useful?
in a terminal, the general syntax is command --parameter --other_parameter argument other_argument file_or_input
yes
eg if you want to iterate over the words of a sentence
ok i have two now, grep and tr , actually three (seq) but sequence didnt feel that complex
you think you can get 2 more out of me before you go
what next?
for a in $(echo "this is a test" | tr " " "\n")
do
echo $a
done
that shows the use of a for loop
here you are looping in the worlds of "this is a test"
and tr helps converting spaces into newlines
so the for can go word by word. if you don't do that, it will just read the whole "this is a test"
while it knows how to split
this
is
a
test
because there are multiple lines
but you really just should read a tutorial
just google for one, there are several good ones
also, bye, i'm gonna eat !
see you !
Thanks man
how is it called to change your own custom voice in speech recognition @faint hinge
using wav file
@echo urchin can you help pls
How to fix this
Defining it as a variable
Or function
Function
How to fix this?
!e
"hello" = "..."
@sly merlin :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | "hello" = "..."
003 | ^^^^^^^
004 | SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
Ooh
Thx
It worked
!close
!close
Why can’t close
!clpse
Yes
!close
!close
?
ModMail
Here pls help
<@&831776746206265384>
I can’t close
!close
this is a permanent channel, these dont get closed.
need help with a bot
im creating a twitter bot in which i have to scrape latest tweets of a user
i use a function which extracts top latest 15 tweets
but i want the tweets that are new that ive not scrapped till now
i get a list of tweets , how can i check which tweets i have scraped
so i can scrape only those tweets which i didnt scraped
@vocal mica
@main solar
anybody can help on displaying overlay text vewrbose for a bot script im running
will pay 5$ if it works
seconds = int(input("Enter the number of seconds: "))
i have it
and i need this
days 6 hours 51 minutes 20 seconds 0
!e
import datetime
ourseconds = 69696969
time_converted = datetime.timedelta(seconds=ourseconds)
print(time_converted)
@vital sinew :white_check_mark: Your eval job has completed with return code 0.
806 days, 16:16:09
!e
from datetime import timedelta
td = timedelta(seconds=256852)
print(td)
print(td.days)
@fringe flax :white_check_mark: Your eval job has completed with return code 0.
001 | 15:45:15
002 | 0
What did I break?
Oh
Whoops
!e
from datetime import timedelta
td = timedelta(seconds=256852)
print(td)
print(td.days)
@fringe flax :white_check_mark: Your eval job has completed with return code 0.
001 | 2 days, 23:20:52
002 | 2
How do i run a python file?
hey
im sure that this address is valid as a socket
wss://streamer.cryptocompare.com/v2
import socket
# Standard loopback interface address (localhost)
HOST = 'wss://streamer.cryptocompare.com/v2'
PORT = 80 # Port to listen on (non-privileged ports are > 1023)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
with conn:
print('Connected by', addr)
while True:
data = conn.recv(1024)
if not data:
break
conn.sendall(data)
but this code says: socket.gaierror: [Errno 11001] getaddrinfo failed
how can i download file via url using cmd
@glossy salmon we can type here
@faint hinge
we're building screen share n video share part of an web-app but it seems django wont handle these me n @glossy salmon r trying from last 3-4 hours + we have used WebRTC also but seems it wont help
@faint hinge
we somehow done the screen share n video for public but we cant do that for dm/pvt
@hazy lantern your input is a bit too low
Hey @faint hinge , got some issues with the microphone today
f = open ('C:/Users/PC/Downloads/17.txt')
a = [int (i) for i in f]
f.close ()
max = -100000
k = 0
for i in range (len(a)-1):
if (a[i]*a[i+1]) % 3 == 0:
k+=1
if a[i] + a[i+1] > max:
max = a[i] + a[i + 1]
print(k, max)
#HELP PLS
Excuse me ?
guys i need to check if in a list between 2 place there is at least one "1" how do i get it
@vale dagger @solemn talon @hidden mountain @faint hinge
You can use a slice to get the specific portion you need, if you know the two places
yes i know the the place for example
a=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
b=[1, 0, 0, 0, 1, 0, 1, 0, 1, 0]
have to check if in position 5 in b list there is a "1" than if it is true, have to do that position - tau and check if there is at least a "1" between 5 and 5 - tau in list a (tau is a given namber, ex 2) @faint hinge
@faint hinge
Sorry, bouncing around
Could do something like.....
a = [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
b = [1, 0, 0, 0, 1, 0, 1, 0, 1, 0]
tau = 2
if b[5]: # If the value is 1 (which evaluates to True, it'll continue into the if
print(1 in a[5-tau:6]) # We do 6 so that it will include index 5. The end is not inclusive, so it goes up to but not including that number
Stephen Wolfram is the creator of Mathematica, Wolfram|Alpha and the Wolfram Language; the author of A New Kind of Science and other books; the originator of the Wolfram Physics Project; and the founder and CEO of Wolfram Research.
def clear_mat(list_of_lists): # clears everything
list_prepared = []
for i, li in enumerate(list_of_lists):
if li:
temp = list()
for j, word in enumerate(li):
word_prepared = word.translate(word.maketrans({",":"",".": "", "(":"",")": "", "!":"","?": "",":":"",";": "", "[": "","]":"", "\"":"", "\"":""}))
if "'" in word_prepared:
word_list = word_prepared.split("'")
temp.extend(word_list.copy())
if "'" in word_prepared[:1]:
word_prepared = word_prepared[1:]
if "'" in word_prepared[-1]:
word_prepared = word_prepared[:-1]
elif "—" in word_prepared: # doesn't divide the words properly here
word_list = word_prepared.split("—")
temp.extend(word_list.copy())
elif "-" in word_prepared:
word_list = word_prepared.split("-")
temp.extend(word_list.copy())
else:
temp.append(word_prepared)
list_prepared.append(temp)
return list_prepared
print(clear_mat([['Are', 'these,', 'by', 'the', 'black', 'air', 'so', 'scourg\'d?"—"The', 'first']]))
is there anyone who can help me, im trying to remove all non letters from the words and when i meet ' and - and — i should split them, this code seems right but it doesn't work only with — character :/
try to learn regex and apply it in your code. It's hard (harder than js), but it's worth it.
Do we have any helpers available right now?
For discord bot
@slash.slash(name="archive-channel",
description="Allows moving interactions channels in to the archive category",
guild_ids=[GUILD_ID])
async def _archive_channel(ctx: SlashContext):
archive_category = discord.utils.get(ctx.guild.channels, name="Archive")
channel_name = str(ctx.channel.name)
await ctx.channel.edit(category=archive_category, name=channel_name)```
Does what I want but says interaction failed
What would I do here?
Is anyone available to help me with some coding?
why is it in yellow
heres the doc
grep "$1" meresek.txt | cut -c 27-36 | sort -u | wc -l
(47.6498634, 19.1404118), 2021.09.10, 12:35, 26
(47.6498634, 19.1404118), 2021.09.12, 15:55, 24
(47.6498634, 19.1404118), 2021.09.14, 18:05, 20
(57.6498634, 29.1404118), 2021.09.06, 11:05, 31
(47.6498634, 19.1404118), 2021.09.12, 14:00, 30
(17.6498634, 15.1404118), 2021.09.25, 09:05, 24
(47.6498634, 19.1404118), 2021.09.30, 20:05, 21
.sh
declare -A dataHashMap
dataHashMap=( ["47.6498634, 19.1404118"]=( [1]="2021.09.10" [2]="12:35" [3]="26") )
echo ${dataHashMap[$1, $2][3]}
$ cat test.sh
function kill(){
echo $2
}
ibrahim@ibrahim-desktop:~$ kill hi hi2
hi2
ibrahim@ibrahim-desktop:~$
Sure!
Other than the other stuff I said it says that for the sorting a-z part I just need to use dunder lt and dunder st
Sure
Okay and yes I can see
Can we use as much of the current as possible?
What stuff would you get rid of?
Oh that makes sense
Did you learn python in school or for fun? I'm in college but I'm finding it difficult!
That's cool! I just started in Sept and I like it but it's the most challenging stuff I've ever learned
Yeah the trouble I'm having is working with the list
Its weird because appending was easy but trying to find and delete isn't working the same
hmmm
omg i think i have supers = [] in there twice too 😩
i didnt code line 112 yet lol
Nope if its blank its like they changed their mind
so they choose not to delete anything and continue
yeah exactly
oh yeah i always forget f string
so much easier
haha wow!
i understand everything except enumerate - we havent used that yet
Ever find yourself in need of the current iteration number of your for loop? You should use enumerate! Using enumerate, you can turn code that looks like this:
index = 0
for item in my_list:
print(f"{index}: {item}")
index += 1
into beautiful, pythonic code:
for index, item in enumerate(my_list):
print(f"{index}: {item}")
For more information, check out the official docs, or PEP 279.
ohhh i get it
thank you so much!!
In this beginner object oriented programming tutorial I will be covering everything you need to know about classes, objects and OOP in python. This tutorial is designed for beginner python programmers and will give you a strong foundation in object oriented principles.
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
https://tech-wi...
In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.
Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...
oh okay sure! i'll watch both just in case
that's okay haha
i'll check out his channel
In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.
Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...
oh perfect
definitely
sounds great
i haven't even looked at the lt part yet haha
less than
i havent used it yet i was going to start googling it
yeah i threw return in there as a placeholder lol
yeah the teacher wants me to use lt to alphabetize the records
only because i entered them in that way lol
XD
i am tempted
tbh i feel these assignments are trickier than they need to be
exactly
we learned all these oop examples and then i had to do this but this is nothing like the examples we went over lol
XD i wouldnt stop you because id learn the "right" way LOL
already it makes way more sense
haha
sorry my connection is acting up one sec
back
haha my dog does the same
all the time
always when im on the phone and its important too
whoops sorry!
i am just watching you type haha
yeah i understand most of it and i think it looks great!
if i "drop out" a few times its because my internet is weak af
oh thats fine! we're having outages the past month while they work on the lines so it just gets twitchy
lol
"where does the superhero live: lol"
i thought it was funny
i will never get the 1.5 seconds back XD
i think it looks really cool
yeah it works really well!
oh yea
niiiice
ohhh okay
i know a little but i think we're learning that in class in a few weeks actually
on the syllabus theres like sorting methods and stuff
that makes sense
🙌
oh yeah it looks amazing! i honestly learned a lot from the example
oh yeah haha they always want to find a way to break out of it
haha if you cant find one then i definitely wouldnt be able to, i didnt even think of keyboard interrupt and youre advanced compared to me haha
hahaha
noidea lmao
the teacher chose the letters i prefer numbers
you will run out of letters eventually!
oh yeah
ahhhh i have to go and make dinner, i didnt realize it was so late here : X thank you so much for the homework help i feel like i understand way better now!
hahahaha yes
i think hes showing us like the tiniest basics before hes letting us learn the real stuf??? i think??
thank you again!!
bye!
i need help. Can anyone give me a hand about this code i can access the "mycodes.db" and verify the variable code is equal to result_code. The problem is when the code cant find the string , the program breaks and does not trigger the else statement.
def gotoreg(self):
code = self.regcode.text()
if len(code) == 0:
self.error.setText("The field is empty.")
else:
conn = sqlite3.connect("mycodes.db")
cur = conn.cursor()
query = 'SELECT Codes FROM pass_codes WHERE Codes = \''+code+"\'"
cur.execute(query)
result_code = cur.fetchone()[0]
if code == result_code:
reg = RegScreen()
widget.addWidget(reg)
widget.setCurrentIndex(widget.currentIndex() +1)
else:
print("false")
self.error.setText("Invalid code.")```
cant talk im muted
is anyone around to offer me some help ❤️
yuup
PocketSphinx for SpeechRecognition Module
@amber epoch this one. I want to use it instead of Google Speech recognition because it works offline.
!pypi PocketSphinx
I am trying it install it. But it says disutils are missing. But, I don't understand how to install disutils on a Windows PC. It is simple on Linux but not on windows
*distutils
Okay Opal. Thanks for your time.
Hm. Python module. Should be pip installable, but setuptools seems to supersede it.
So pip install setuptools maybe.
could csomeone please help me I have 1 hour left
it is with AI
lol pleaseee i will literarly do naything for it
pleassseeee
why can't I watch the live?
it doesn't open for me
!code
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.
Last updated: January 10, 2021 Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the https://telegram-channel.net/ website (the "Service") operated by "Telegram Channels" ("us", "we", or "our"). Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms. These ...
Traceback (most recent call last):
File "C:\Users\USER\PycharmProjects\FaceRecog\faces-train.py", line 46, in <module>
recognizer.train(x_train, np.array(y_labels))
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
i have this error
Any god tier bot devs that can help me figure out something will be highgly apreciated
What's your question
Any help from gods ??
guys , do you know how i can disconnect from wifi in python3 for linux ? i am making a small script to use it on my laptop
fileExists = os.path.exists('images/folder1')
yes
i have no idea about time stamps
infinite
or something like that
new create folders can be named in unique folders by the persons name
im gonna put this in a gui
filename = input("Enter a folder name: ")
We have a system for getting help - such that you have the best possibility of getting help.
But you're not using this system..........
@main solar send screenshot here
@age.error
async def age_error(self, ctx, error):
if isinstance(error, nextcord.ext.commands.errors.CommandInvokeError):
await ctx.reply("Please type numbers only.")
!e
foo = "1234 "
print(foo.strip().isdigit())
@sly merlin :white_check_mark: Your eval job has completed with return code 0.
True
anyone here ?
Uu
have you read #voice-verification ? any more non-meaningful messages will result in a 2 week temporary voice ban.
:incoming_envelope: :ok_hand: applied mute to @undone plinth until <t:1637828642:f> (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).
idk if this is gonna help but you should probably put ctx parameter before the error parameter.
oh lo
use datetime module, read python docs on datetime module
ill simplify this
i dont support spoonfeeding
but ill simplify this
get the time in utc
;-;
wdym specify
elaborate what you are trying to make me help you
typing animation?
oh you wanna know how to make the bot type for a few seconds
then send the message
here
that's called the datetime modul
it's in a spoiler
so
theres no thing
such as
"hovering over and showing"
no
can you show me
like
a screenshot
oh
well
that confuses me
hey can you help me plz
we have a django based telegram bot which send messages to given group after some intervals
so i want to schedule the function but to the time given
but also don't want my django server to sleep
because i am using sleep to sleep the code for the given time
@shy matrix
@tender hill
use asyncio.sleep
ya but async function require a event loop
guys
how do i make the bot check
if the person whos trying to use the command
has a specific
perm
they are allowed to use
the command
and people who don't have it can't run the command
hey
i want to connect to this wss://streamer.cryptocompare.com/v2 in python
and it connects in postman
but when i write my code it says getaddrinfo failed
HOST = 'wss://streamer.cryptocompare.com/v2
socket_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_client.connect((HOST, 80))
;
guys i need in a help a little
do you know how to once get roles, like on_ready, and save them somewhere to use from different cogs
how do I declare a variable?
any gods here?
Traceback (most recent call last):
File "C:/Users/USER/PycharmProjects/FaceRecog/train-scan.py", line 40, in <module>
recognize.train(x_train, np.array(y_labels))
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
i keep getting this error
this is the code
Hi, can someone help me with importing from a sibling package?
Its been driving me crazy since yesterday
send a pic
Here is my relative import in FeedCreateTable:
from ..constants import dynamodb
And here is the error:
ImportError: attempted relative import with no known parent package
hey
I have a syntax error I cannot figure out, any help would be greatly appreciated.
Can you provide a screenshot of what error you're facing exactly?
Lil Uzi Vert - LUV is Rage 2 (Deluxe) - OUT NOW
Download/Stream - https://Atlantic.lnk.to/LIR2deluxe
Connect with Lil Uzi Vert:
https://twitter.com/LILUZIVERT
https://www.instagram.com/liluzivert/
https://www.facebook.com/LilUziVert/
https://soundcloud.com/liluzivert
http://liluziofficial.com/
Illustrations by - https://www.instagram.com/amth...
I actually got it figured out, turns out it was vsc sometimes putting in a tab as 2 spaces.. i guess when I noticed it I built a habit of hitting backspace then tab again.. but actually started from a hidden 2 space from beginning of line now.. but put the tab in the right place.. what a nightmare.
@twilit sage can u help me
?
in what?
in a code
apparantley im having problems in training the code it seems it only detects one person instead of multiple
its a facial recognition thin
no I didn't learn facial recognition yet
but how about this? :
a= person1
if b != person1 :
recognize_new
oh sory
Hey guys! Do any of you have the time to help me with a school project?
I am working on a neural network
The conversations in this voice channel are so interesting
hey
is anyone willing to help
hello
i dont have perms anymore
no, i got voice banned
bc i wasn't actually talking
more like, streaming unnecessary audio
You wouldn't say that if you read any of my prose. 😛
if n[0]!='.' ]+[0])[-1] + 1``` can anyone explain this to me?
bruh in the philippines emulating an accent is some kind of a joke
|| @humble yacht ||
run = True
while run:
if event.type == pygame.QUIT:
run = False
pygame.quit()
why does it say name event was not defined?
PS: pygame has been imported
if not antiCollision.collidepoint(pygame.mouse.get_pos()):
mouse_pos = pygame.mouse.get_pos()
x, y = mouse_pos
antiCollision = pygame.Rect(x, y, 128, 128)
platform = pygame.Rect(x, y, 64, 64)
platform.center = (x, y)
antiCollision.center = (x, y)
pygame.draw.rect(screen, (255, 255, 255), (platform))
pygame.draw.rect(screen, (255, 111, 111, 255), (antiCollision), 5)
else: return print('e')```
antiCollision isnt defined
i know i should define it
but if i define it it just prints e when i do that and doesnt work even when its not touching that
since it spawns on x or y
@restive tapir r u here to help or for help
Hi people. I need help. I have a dataframe with several attributes and some of them are combined keys. I need to created a histogram chart based on number of countries in 'production_countries' attribute.
and this is my table
as you can see most of rows have more than one name
and cell structure is dict-like
import http.server
import socketserver
class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.path = '/html and css/gui.html'
return http.server.SimpleHTTPRequestHandler.do_GET(self)
# Create an object of the above class
handler_object = MyHttpRequestHandler
PORT = 8000
my_server = socketserver.TCPServer(("", PORT), handler_object)
# Star the server
my_server.serve_forever()```
python3 -m http.server 8000
python3 -m http.server --directory web 8000
@main solar can you type here for now?
since your audio iss having issues
this is my html with css
so try this
i'm here
cd to where your file is
python3 -m http.server 8000
^ run this
rename your html file to index.html
and goto localhost:8000 in your browser
and it should serve that file + your css and javascript on the homoe page
WOW
MR NOODLE YOU ARE THE TOP
be rght back!
i bought phone on black friday, it comes today if i'm lucky
i'll use it for comm
but
i said
i like those beans too, and pizza is good, i get the cups of precooked rice, and then sometimes i eat ramen
but the prepackaged ramen is pure sodiums and makes me sick
so im learning to make my own noodles
but cooking is hard and my food taste bad
after i run the python3 -m http.server
it does not allow me to type in the same terminal
or do commands there
there's 2 ways to deal with that
1 open another terminal / split
or 2
run it asynchronously by adding a & at the end
and then later use kill -SIGTERM <pid> to kill it with its process id (it tells you it when ran with &)
measurements = open('input.txt', 'r')
depth_measurement = measurements.read().splitlines()
first_measurement = depth_measurement[0]
for i, item in enumerate(depth_measurement):
f"index, {i}, item: {item}"
if first_measurement < depth_measurement[first_measurement]:
Count = Count + 1
print(Count)
example of how you c an run and stop it in async
i changed the file to index.html and now it loads my html file straight to the page when I access localhost:8000
it does not load the css and it produces this server
error
i solved it
i fixed it
ill tell u solution
- You can see in my terminal, I am typing this command from that directory
so from my cd, I launch the server
no let me tell you
- so I rename my html file to index.html. it works. It did not load the css file, but I look in the error and it mentions "server.py" but I ask myself why is it even bringing that up ? i found that I had a custom server.py file in one directory down, so when http.server went up the directory, it tried to use the content of the server.py file because my file is overwriting the actual server.py file the module is using
i deleted the server.py file and now everything works perfectly.
YES
YES
yes
but i look at beginning of error
and it says
f=open server.py
i think, why is it doing that?
so i delete
now it's perfect
together, we reached the solution
mr noodle I dont know how to thank you
i wish I had smething to give you
please if you ever need anything just ask me
i am not that good at python yet
but i just want you to know anything i can help with i will try
thank you
thank you thank you thank you
this has been stressing me for so many days
!code
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.
PEMDAS
^
hey do python errors count as a false statement
there are many classifications of errors
run time error, logical error, syntax error
false statement is syntax error
this means the syntax (the way you wrote it) is incorrect
What do you mean with "false statement"?
li = ["hello" , "there"]
if int(li(0)) == False
return "uwu"
I think he means "incorrect syntax"
When an error occurs, Python raises the exception, which means that you won't be able to compare it like that
jpiz
Basically, if you don't handle the exception, the execution of the application will stop
and Python will print a traceback
first of all, you are doing a return, except when you return, it must assign to a variable
!e
li = ["hello" , "there"]
if int(li[0]) == False:
print("uwu")
you cannot do return if there is not a variable or function to which the equation is returning to
@rustic stream :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | ValueError: invalid literal for int() with base 10: 'hello'
As you can see, you get a ValueError exception, and it will interrupt the normal flow of the application
@wind stag your getting the error because you must assign your return value to a function or a variable
If you're looking to handle the exception, you can use a try-except block
this python error is a syntax error
okay, let me explain what I'm trying to do
!e
try:
int("foo")
except ValueError:
print("Not a number!")
@rustic stream :white_check_mark: Your eval job has completed with return code 0.
Not a number!
aaaaahhhh
nvm I think you got it
so what if we put in something valid
li = ["1","2","3"]
try:
int(li(0))
except ValueError:
print("Not a number!")
would that just continue the program?
okay so it's saying list item not callable?
I'm dumb I got my syntax messed up
!e
!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!*
!e
li = ["1","2","3"]
try:
int(li[1])
except ValueError:
print("Not a number!")
@wind stag :warning: Your eval job has completed with return code 0.
[No output]
okay I get it now
Hi
oh right
yep
sorry i cant talk rn
yes
from sklearn.linear_model import LinearRegression
Splitting dataset
X1_train, X1_test, X2_train, X2_test, X3_train, X3_test, X4_train, X4_test,
this is what i did so far
from sklearn.linear_model import LinearRegression
yepp
yes like this?
Ohhh
yes
yep
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y)
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
model = LinearRegression()
model.fit(X_train, y_train)
prediction = model.predict(X_test)
okk
I'm sorry, there's some noise in the background.
A constant?
X = sm.add_constant(X)
like this?
constant for the intercept 😬
sorry i dont know much 💀
Not really aware of it. It's probably in statsmodel, yeah?
ahh yes
Are you looking to program a Linear Regression from scratch?
so then for this i can just do
print (prediction) ?
Oh i can use models and libraries
like i need to fit linear regression to the data and then i need to print the R^2
You can. Or you can compare the models accuracy with something like
from sklearn.metrics import r2_score
print(r2_score(prediction, y_test))
Cool then
.
I don't really follow the question here
hmmm i think liek first i need to fit it to linear regresssion
which youve already showed me
I've typed out the code on how to do that. But if you need to use statsmodels or something, I can't help with that
yes i just printed our the r2 and i think ill be able to do the rest
Thank you soooo much for your help.
Cool, no problem.
You dont know how much it means to me :salute:
Glad I could help
👍 thank you
hi
def create_world():
def create_map():
return {
'house': {
'car': ['garage, outside'],
'about': "All the stuff you'll need is in the garage. Your car is itching to get cleaned.",
'stuff': [],
},
'start the car': {
'car': ['house'],
'about': "Hmm you shouln't leave yet you still got a car to finish.",
'stuff': ['key']
},
'garage': {
'car': ['exterior', 'interior','house'],
'about': "Now we are in the garage, what should we work on first?",
'stuff': []
},
'exterior': {
'car': ['garage'],
'about': "The body of your car is very dirty, lets wash it up.",
'stuff': ['hose', 'soap', 'sponge']
},
'interior': {
'car': ['garage'],
'about': "The inside of your car is in need of a good touch up. Get to cleaning.",
'stuff': ['vaccum','all_purpose_cleaner']
},
}
def create_player():
return {
'location': 'house',
'inventory': [],
}
return {
'map': create_map(),
'player': create_player(),
'status': 'playing'
}
def create_world():
world_map = {
'house': {
'car': ['garage, outside'],
'about': "All the stuff you'll need is in the garage. Your car is itching to get cleaned.",
'stuff': [],
},
'start the car': {
'car': ['house'],
'about': "Hmm you shouln't leave yet you still got a car to finish.",
'stuff': ['key']
},
'garage': {
'car': ['exterior', 'interior','house'],
'about': "Now we are in the garage, what should we work on first?",
'stuff': []
},
'exterior': {
'car': ['garage'],
'about': "The body of your car is very dirty, lets wash it up.",
'stuff': ['hose', 'soap', 'sponge']
},
'interior': {
'car': ['garage'],
'about': "The inside of your car is in need of a good touch up. Get to cleaning.",
'stuff': ['vaccum','all_purpose_cleaner']
},
}
world_player = {
'location': 'house',
'inventory': [],
}
return {
'map': world_map,
'player': world_player,
'status': 'playing'
}
def checklist():
vaccum = 'use vaccum and cleaner'
if vaccum is True:
return 'exterior'
is is like comparing identity.
is there anyone here who knows pgzero?
3 days before i can talk
a would be 1
Example
inp_list = ['t','u','t','o','r','i','a','l']
result = list(filter(lambda x: x!='t' , inp_list))
print(result)
Output
['u', 'o', 'r', 'i', 'a', 'l']
Is it a bad idea to start learning coding with Python, when you literally know nothing about it?
I don't even know a lot of the basic terminology related to computers and coding.
Which is gonna make learning a bit more complicated perhaps.
No, infact I was in the same condition... But I just started learning python.... Now it's really benificial to me because I can relate those concepts to any other new language that I am learning, just begin with a language and continue it for atleast 2 months or so... That way you will learn the programming concepts
And with python it's really easy to learn programming as u can find a ton lot of resources and documentation online for the same 🙂
@tranquil fulcrum helo again
seriously what are you typing?
i can just hear your keyboard
what stuff exactly?
yes
coding?
sorry no idea
new concept for me
in what lang you're doing it?
ok then idk
Could I get some help with something? I'm trying to convert integers to string in a list and have it display the letters numbers instead of numbers. https://paste.pythondiscord.com/xaluvamaki.py
But I'm getting an error if the right number is guessed
anyone wanna help me make the main of my function... I am quite confused on how to call the previous functions made into the main
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@main solar see the embed
i need help in something selenium related , so i am trying to go a website and upload a photo and keep doing that in a while loop but every iteration its focused on the running window , i need to prevent the running chrome from receiving the focus
cuz i need to run the bot and leave it running for hours and work on something else+(i cant use headless mode)
/home/farzan/Desktop/ai/spammer.py:16: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Chrome(executable_path = driver_address)
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
File "/home/farzan/Desktop/ai/spammer.py", line 16, in <module>
driver = webdriver.Chrome(executable_path = driver_address)
File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 93, in __init__
RemoteWebDriver.__init__(
File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 268, in __init__
self.start_session(capabilities, browser_profile)
File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 359, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute
self.error_handler.check_response(response)
File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
Stacktrace:
#0 0x5613b126bee3 <unknown>
import os
import time
from selenium import webdriver
from colorama import init
init()
from selenium.webdriver.common.keys import Keys
import colorama
from colorama import Fore
#...chromedriver path
file_path = os.path.abspath(__file__)
directory = os.path.dirname(file_path)
driver_address = os.path.join(directory , "chromedriver.deb")
driver = webdriver.Chrome(executable_path = driver_address)
#...code meli
message = input("enter message")
number = int(input("enter number you wanna text"))
name = input("enter a name").split('-')
driver.get("https://web.whatsapp.com/")
time.sleep(25)
#...site address
for i in name:
koskhol1 = driver.find_element_by_xpath(f'//span[@title="{i}"]').click()
koskhol = driver.find_element_by_xpath(f'//span[@title="{i}"]')
time.sleep(2)
k = driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div/div/div[2]/div[1]/div/div[2]')
for j in range(number):
k.send_keys(message + Keys.ENTER)
# goh = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[4]/div[1]/footer/div[1]/div/div/div[2]/div[1]/div/div[2]')
# goh.send_keys('kos kesh kos amat . ba god kal nakon .i am the king')```
@faint hinge
what happened to the stream
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
colors.append(image[row+row_delta][col+col_delta])
final=[]
for values in zip(*colors):
final.append(sum(values)/len(colors))
final=tuple(final)
return final
image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
[(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
[(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
[(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]
!e py my_list = [1, 2, 3] my_tuple = tuple(my_list) print(my_tuple)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
(1, 2, 3)
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
colors.append(image[row+row_delta][col+col_delta])
final=[]
for values in zip(*colors):
final.append(sum(values)/len(colors))
final=final.tuple(final)
for row_delta in range(square_size):
for col_delta in range(square_size):
return final
!e py for i in range(5): ... ... # This dedent from the above signals that for loop codeblock is done. for i in range(5): #Indent without preceding/above colon : signifying an indent/codeblock to follow ...
@amber epoch :x: Your eval job has completed with return code 1.
001 | File "<string>", line 4
002 | for i in range(5):
003 | IndentationError: unexpected indent
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
[0, 5, 86]
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
colors.append(image[row+row_delta][col+col_delta])
final=[]
for values in zip(*colors):
final.append(sum(values)/len(colors))
final=final.tuple(final)
for row_delta in range(square_size):
for col_delta in range(square_size):
image[row+row_delta][col+col_delta]=final
!e py a = [10, 20, 30] print(a[2]) print(a[3])
@amber epoch :x: Your eval job has completed with return code 1.
001 | 30
002 | Traceback (most recent call last):
003 | File "<string>", line 3, in <module>
004 | IndexError: list index out of range
!e py a = [10, 20, 30] try: a[3] except IndexError: print("Ta-da!") print("Fin.")
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | Ta-da!
002 | Fin.
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
colors.append(image[row+row_delta][col+col_delta])
except IndexError:
pass
final=[]
for values in zip(*colors):
final.append(sum(values)/len(colors))
final=final.tuple(final)
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
image[row+row_delta][col+col_delta]=final
except IndexError:
pass
import matplotlib.pyplot as plt
image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
[(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
[(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
[(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
colors.append(image[row+row_delta][col+col_delta])
except IndexError:
pass
final=[]
for values in zip(*colors):
final.append(sum(values)/len(colors))
final=tuple(final)
print(final)
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
image[row+row_delta][col+col_delta]=final
except IndexError:
pass
pixelization(image, 2)
plt.imshow(image)
plt.show()
(40.0, 40.0, 125.0)
(40.0, 200.0, 105.0)
(200.0, 40.0, 45.0)
(200.0, 200.0, 25.0)
!e py a = [v for v in range(5)] print(a)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
[0, 1, 2, 3, 4]
for v in range(5): #<- Right of the leftmost
v #<-- Leftmost v in the conprehension```
!e py m = [(a,b) for a in range(3) for b in "abc"] print(m)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
[(0, 'a'), (0, 'b'), (0, 'c'), (1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b'), (2, 'c')]
for a in range(3):
for b in "abc":
(a,b)```
A new thing for me
Familiar
!e py m = [1.0, 4.5, 2] k = [int(v) for v in m] print(k)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
[1, 4, 2]
import matplotlib.pyplot as plt
image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
[(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
[(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
[(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
colors.append(image[row+row_delta][col+col_delta])
final=[]
for values in zip(*colors):
final.append(sum(values)/len(colors))
final=tuple(int(v) for v in final)
print(final)
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
image[row+row_delta][col+col_delta]=final
except IndexError:
pass
pixelization(image, 2)
plt.imshow(image)
plt.show()
!e py a = (v for v in range(5)) b = tuple(v for v in range(5)) c = [v for v in range(5)] print(a) print(b) print(c)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | <generator object <genexpr> at 0x7fbffe1e7df0>
002 | (0, 1, 2, 3, 4)
003 | [0, 1, 2, 3, 4]
!e py print([*zip( [1,2,3], "abc" )])
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
[(1, 'a'), (2, 'b'), (3, 'c')]
!e py for v in [(1, 'a'), (2, 'b'), (3, 'c')]: print(v)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | (1, 'a')
002 | (2, 'b')
003 | (3, 'c')
!e py for v in zip([1, 2, 3], "abc"): print(v)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | (1, 'a')
002 | (2, 'b')
003 | (3, 'c')
Okay I am back
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
2
!e print(5/2)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
2.5
import matplotlib.pyplot as plt
image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
[(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
[(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
[(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
colors=[]
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
colors.append(image[row+row_delta][col+col_delta])
except IndexError:
pass
final=[]
for values in zip(*colors):
final.append(sum(values)//len(colors))
final=tuple(final)
for row_delta in range(square_size):
for col_delta in range(square_size):
try:
image[row+row_delta][col+col_delta]=final
except IndexError:
pass
pixelization(image, 2)
plt.imshow(image)
plt.show()
!e py a = [(1, 2, 3), (4,5,6)] print((1, 2, 3), (4, 5, 6)) print(*a)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | (1, 2, 3) (4, 5, 6)
002 | (1, 2, 3) (4, 5, 6)
!e py print(*"abc")
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
a b c
print("a", "b", "c")```
def pixelization(image, square_size, column_percentage)
import matplotlib.pyplot as plt
image=load_img('sample.png')
def pixelization(image, column_percentage):
for row in range(0,len(image)):
for col in reversed(range(len(image[0])-int((column_percentage/100)*len(image[0])), len(image[0]))):
image[row][col]=(0,0,0)
return image
pixelization(image, 60)
plt.imshow(image)
plt.show()
from CSE8AImage import *
import matplotlib.pyplot as plt
image=load_img('sample.png')
def pixelization(image, column_percentage):
for row in range(0,len(image)):
for col in range(int((1-column_percentage/100)*len(image[0])), len(image[0])):
image[row][col]=(0,0,0)
return image
pixelization(image, 60)
plt.imshow(image)
plt.show()
for col in reversed(range(len(image[0])-int((column_percentage/100)*len(image[0]))
for col in range(int((1-column_percentage/100)*len(image[0])), len(image[0]))
v = 3 // 6 * 3 // 8 % 2
for i in range(v, 32, 2):
...```
vs
```py
for i in range(3 // 6 * 3 // 8 % 2, 32, 2):
...```
from CSE8AImage import *
import matplotlib.pyplot as plt
image=load_img('sample.png')
def pixelization(image, column_percentage):
starting_col=int((1-column_percentage/100)*len(image[0]))
for row in range(0,len(image)):
for col in range(starting_col, len(image[0])):
image[row][col]=(0,0,0)
return image
pixelization(image, 60)
plt.imshow(image)
plt.show()
def thing(image):
height = len(image)
width = len(image[0])
...```
def pixelization(image, square_size):
for row in range(0, len(image), square_size):
for col in range(0,len(image[0]), square_size):
def pixelization(image, column_percentage):
starting_col=int((1-column_percentage/100)*len(image[0]))
for row in range(0,len(image)):
for col in range(starting_col, len(image[0])):
def pixelization(image, square_size, column_percentage):
starting_col=int((1-column_percentage/100)*len(image[0]))
for row in range(0,len(image), square_size):
for col in range(starting_col, len(image[0]), square_size):
@main solar 👋
🤝
hi
what do u wanna get help with
@main solar are you still available
i do not yet have permission
oh
i am cleaning up a csv file
!yt-dl Unfortunately, that library isn't really one we can assist with
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
Sorry I only just saw this
I am trying to make a list of dates from this dataframe
and date=df['Date'] returns key error
Can you inspect the df object to see what keys are in it? I'm not a Pandas person.
dir(df) if you're in interactive mode. print(dir(df)) if you're not.
There might be a keys method or something you can call.
Yeah, try looking at df.keys()
thank you for the advice!
that returns
Index(['Open', 'High', 'Low', 'Close', 'Adj Close', 'Volume'], dtype='object')
it seems like this date is a datetimeobject I managed to in another thread get where I wanted in regards to the script output but I would be interested in seeing how to get the list
hey guys could one of yall help me on this lab
i need to find the amount of occurrences of each number in a list using ifs and loops
hm what editor is this?
ah thanks. and did you figure out your issue?
I'm not familiar with that UI but it perhaps looks like Date was your dataframe's index
or maybe the color coding is just based on data type..
@little badger sorry I missed this, I ended up finding a work around overall. I still dont know how to yank this index out as when you do something like list=df.index(0) you get a datetimeobject error. I think the API I used to get this df has the index as a datetimeobject which I have zero familiarity working with
!d pandas.Index.tolist I would think that this works
Index.tolist()```
Return a list of the values.
These are each a scalar type, which is a Python scalar (for str, int, float) or a pandas scalar (for Timestamp/Timedelta/Interval/Period)
if you want I can try helping sometime tmrw
@little badger sure thing thank you vm
!remind 12h ^
Your reminder will arrive on <t:1639243324:F>!
Here's your reminder: ^
[Jump back to when you created the reminder](#code-help-voice-text message)
do you have a csv file that you're reading in?
@little badger I make a call to the yfinance API to get that df
`import yfinance as yf
import matplotlib.pyplot as plt
df = yf.download('VOO')
ar= df['Close'].to_numpy()`
so I would have liked to have done something like ar2= df['Date'] but that doesn't work, neither does ar2=df.key('Date') or ar2=df.index('Date')
so its an interesting problem that highlights my limited knowledge on dfs
mk let me try
you're trying to get a list of all the date values?
that's what you want ar2 to be?
df = yf.download('VOO')
dates = df.index.tolist()```
<class 'pandas._libs.tslibs.timestamps.Timestamp'> this is the type
>>> dates
[Timestamp('2010-09-07 00:00:00'), Timestamp('2010-09-08 00:00:00'), ...]```
if you need a regular python datetime object i can help with that too. not sure what the end goal is
@lusty anchor
@little badger The original end goal was to simply get a timeplot out of the df which was achieved in avacado chat with a friend telling me to df.plot(y="Close")
Now in terms of the way I originally was going to get my plot, it would have been plt.plot(ar2,ar) so it leaves me curious how to get ar2 out of the df
let me see
hm i've not explored any plotting yet but if you just need a list of the dates then what i wrote above should work. let me know!

Thank you very much
i really need to explore graphs
I am slowly transitioning from VB for my graphs, and in the corporate world I think half of my work is making visualizations and half is actual data analysis haha
cool! i kind of do that at work but on a very small scale. check out #data-science-and-ml if you haven't already
Hey guys I am not able to load my image in html file
@full lodgear i am hear now
i join the call for fun
now i need no help sorry for disturbing :((((
i am sorry :(( @twilit sage
how do i chage my name here
to real name
ok thanks
now i know how to change name :))
i am python beginner
i know a bit of html
anyone willing to help by voice??
Anyone able to help via voice?
from PySide6 import QtWidgets, QtCore, QtGui
class Settings(QtWidgets.QWidget):
def __init__(self):
super(Settings, self).__init__()
class WindowWhichWillContainTheProgram(QtWidgets.Qwidget):
def __init__(self):
super(WindowWhichWillContainTheProgram, self).__init__()
self.setStyleSheet('background-color:black;')
class Main(QtWidgets.QMainWindow):
def __init__(self):
super(Main, self).__init__()
self.central_widget = QtGui.QStackedWidget()
self.setCentralWidget(self.central_widget)
self.settings = None
self.main_window = None
self.initialise()
self.central_widget.addWidget(self.settings)
self.central_widget.addWidget(self.main_window)
current = 1
self.central_widget.setCurrentWidget(self.settings)
timer = QtCore.QTimer(1000)
timer.start()
def initialise():
self.settings = Settings()
self.main_window = WindowWhichWillContainTheProgram()
def timerEvent(event):
if current == 1:
self.central_widget.setCurrentWidget(self.main_window)
current = 0
else:
self.central_widget.setCurrentWidget(self.settings)
current = 1
if __name__ == "__main__":
app = QtWidgets.QApplication([])
app.setApplicationName("Test")
window = Main()
window.show()
app.exec()
from PySide6 import QtWidgets, QtCore, QtGui
class Settings(QtWidgets.QWidget):
def __init__(self, central_widget, main_window):
super(Settings, self).__init__()
self.central_widget = central_widget
self.main_window = main_window
button = QtWidgets.QPushButton("Confirm")
button.clicked.connect(self.on_click)
self.layout = QtWidgets.QVBoxLayout()
self.setLayout(self.layout)
self.layout.addWidget(button)
def on_click(self):
self.central_widget.setCurrentWidget(self.main_window)
class WindowWhichWillContainTheProgram(QtWidgets.QWidget):
def __init__(self):
super(WindowWhichWillContainTheProgram, self).__init__()
self.setStyleSheet('background-color:black;')
class Main(QtWidgets.QMainWindow):
def __init__(self):
super(Main, self).__init__()
self.central_widget = QtWidgets.QStackedWidget()
self.setCentralWidget(self.central_widget)
self.settings = None
self.main_window = None
self.initialise()
self.central_widget.addWidget(self.settings)
self.central_widget.addWidget(self.main_window)
current = 1
self.central_widget.setCurrentWidget(self.settings)
def initialise(self):
self.main_window = WindowWhichWillContainTheProgram()
self.settings = Settings(self.central_widget, self.main_window)
if __name__ == "__main__":
app = QtWidgets.QApplication([])
app.setApplicationName("Test")
window = Main()
window.show()
app.exec()
i don't have permission to speak ;3
i need help
With what?
Hello all, anyone available to help me ?
I want to couple 2 task for example If i press my key to go left, it's shoot to the left
If i press my right key It's shoot to the right
!stream 717983911824588862 10M
✅ @fair niche can now stream until <t:1639758635:f>.
bot#2015
I may have already implemented it
....................................................................................................................
write a new function called
“generate output(path to python program, path to input file)”. This function
takes a path to a python program as an input, runs it based off the input file,
and redirects the output to a new file called actual output file.txt, and returns
the path to this file. You can assume this program reads from standard input
and writes to standard output.
.............................................................................
i did not understand this question
yeah
hii?
oh! I'm not sure I caught that bug
m new...
yeah
bot#2017
yo
ah, I have a polls command for the gurkult in my assigned
can someone please tell what i have to do here
also github command enhancements but I can't work on them until sir-lancebot#778 is merged 😭
bot#2017 ready for review arl?
can do one quick
the config which may require the change would be in config-default.yaml
so the filters work differently, I haven't looked too much into how they work 😅
filters will be going through a big rewrite sometime soon, atleast zig has a issue specifying that
nope, its a extension iirc
bot/exts/filters/antispam.py line 186
rule_function = RULE_FUNCTION_MAPPING[rule_name]```
its an extension, yeah
it doesn't copy it from the repo as far as I know, uses hacks\™️
uses the current head, and the remote configuration, to make one, but doesn't actually check if its been pushed which is annoying
although that'd be a lot of work to implement so i'm fine with it
I think its this extension
github pull requests and issues
syntax and intellisense for .github/workflows/*
Name: GitHub Pull Requests and Issues
Id: github.vscode-pull-request-github
Description: Pull Request and Issue Provider for GitHub
Version: 0.34.1
Publisher: GitHub
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
installed ty~
ah, doesn't the default yaml already add syntax checking?
so for the new lines, it seems possible that the config could just be boosted, or we could also calculate a percentage of whitespace/newlines for a message
here's I'll show you
oh nice
trying lol, thanks, gonna add it
wait wrong config
you missed something
ayo what's poppin
442
config-default.yml line 439
newlines:```
hello joe
sup
config-default.yml lines 439 to 442
newlines:
interval: 10
max: 100
max_consecutive: 10```
okay finally
god those pings lol
we could probably add a new way to configure it, with newlines.max_percentage
they don't discard it after testing negative?
@coarse yew my hospital has my dna and samples from some testing 10 years ago lmfao
they kept a blood sample frozen
👀
@little badger I didn't check the tests on that last mention pr so I have to go back to it ;-;
change the yaml & add some more logic to the filter
my ideas are percentage of a message, threshold of a certain number of characters in the message, etc
arl, you are using get_partial_messageable cuz the msg isn't resolved right? or there is some other reason
2017 pr
I could use get_channel, but I don't need the full channel object, I only need to be able to fetch the message
and since that can be done with get_partial_messageable, I don't need to use get_channel and rely on the cache
what different does it actually do under the hood
(yeah my computer is running slow, need to kill a process)
doesn't rely on the cache, basically
well no
under the hood it just constructs the api routes
since all i need are the api routes, which partialmessageable implements
ah ok much clear by looking into the source, cool thanks
... why are these tests passing strings to where a Member object should be
how does that test even pass
grim
aren't all pancakes like that
class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
hash(x) Returns the member’s hash.
str(x) Returns the member’s name with the discriminator.
x == y Checks if two members are equal. Note that this works with User instances too
why is this test failing ;-;
yeah
oh
bot/rules/mentions.py line 26
total_recent_mentions = 0```
deleted that line, and tests succeed
since that line was invalidating all of the logic above, as it was setting the variable to 0
tests should pass now too
cool cool
shall we take a look at the newlines filter too?
i'm not sure i understand your idea/proposal though
I'm proposing a few changes to add a bit more configuration options (and code them, as well) to have minimum threshold for character count and a percentage of the message being newlines
(definitely able to tinker this, but here's an example)
user sends a message with 20 newlines as the entire message, but since its 99% percent of the message, the filter triggers
user sends a message with 50 new lines, but there's a bunch of code, so it ends up being around 30 of the message, so the filter doesn't trigger
@still turtle accused
i'm 5'2 😔
5'4~
i'm 4'2
could someone maybe approve bot#1924?
@still turtle Joe is calling you out saying you're like 5'10 or 5'11
#dev-contrib message @main solar you gotta join a channel so you can
I'm about ~182 cm
@little badger does this make sense?
sry reading
smh y'all distracted by joe
lolol i read it but i'm parsing it
but since its 99% percent of the message
what is 99% of the message?
20 newlines with a start and end character in the message would be >=99%
although that may be a bad example given that duplicates exists
arl but we do want to delete even if it's 100 lines of pure code
also blank line != new line.. no? 
see my screen
yeh yeh i'm looking
well nvm I guess it would rely on the filter rewrite then
mm yeah
i just made the issue bc zig said to do it so that Eventually™️ it would be looked at
at that point we would be able to hook into the code detection
arl thoughts on meta#155 ?
if we hook into the already pretty well filtered codeblock cog, we would be able to better determine if the user sends code, and not warn them in that case, but if code is not detected, perhaps we'd be able to warn them
well actually
nah
The danger of assuming general artificial intelligence will be the same as human intelligence. Rob Miles explains with a simple example: The deadly stamp collector.
The Problem with JPEG: https://youtu.be/yBX8GFqt6GA
Apple's $200,000 Computer: https://youtu.be/PccvZRTUhbI
Rabbits, Faces & Hyperspaces: https://youtu.be/q6iqI2GIllI
Thanks to N...
i've never seen a false positive from codeblock but i've seen places where there should be a positive and there isn't i think
looking
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
i fairly frequently toggle my DMs on and off for this server. was it an intentional decision for !helpdm on to have to be re-run every time i turn my DMs back on?
👀
yeah
We put some of your questions to Dr Mike Pound.
Stolen Bitcoing Tracing - Ross Anderson: https://youtu.be/UlLN0QERWBs
Feistel Cipher: https://youtu.be/FGhj3CGxl8I
AES Explained: https://youtu.be/O4xNJsjtN6E
Elliptic Curve Back Door: https://youtu.be/nybVFJVXbww
Parsing Explained: https://youtu.be/bxpc9Pp5pZM
Data Analysis Learning Playlist...
i'll be honest i'm not really a fan with how fast some of the bot commands delete themselves
.help
For Mathematics, trees are more useful than strings. Professor Thorsten Altenkirch takes us through a functional approach to coding them in Python.
Thorsten's Python programming book: https://bit.ly/2p3r5IT
https://www.facebook.com/computerphile
https://twitter.com/computer_phile
This video was filmed and edited by Sean Riley.
Compute...
or how inconsistently they delete
especially if it's.. not enough time for me to notice & navigate to the channel to see why i was pung
ikr
is using !e in pygen similar?
lance deletes all of its errors basically
after like 7 seconds
(not what is set but what it feels like)
but not the invokes
then some of the trashcans delete the user's message and the reply, some just the reply, some only delete the reply on timeout, some don't delete the reply on timeout, some delete the user message on timeout, etc etc
something like !d i think it deletes your message if it can't be found
it deleted my invoke and the resp in #python-discussion but not the eval resp
#bot-commands
yeah, and the error itself
feel like it's fine to leave it
i've actually reimplemented the frontend of the docs command on my own bot
slash commands
was fun to implement too lol
Neat
what do you have it do if it's not found?
ephermals.
aha very nice!!
huh... i left an alias of the previous command, so now i wonder what happens
oh it doesn't say anything, very nice! /s
I can't really think of a great way to implement this without making a 403 on every request while the user has dms closed.
mm
the other way is to just change that delete after period i guess
yeah i'd be down for extending it
but if i choose not to turn dms back on for some reason, would also be annoying to get pings in bot-commands for every help channel i participate in
so my non-solution solution for now is to just keep DMs open
because like... if you're helping in help channels, you tend to be in several, which would be a good amount of direct messages, aka guaranteed 403s
especially now that i'm moderating more in help channels than helping
aaa
maybe i should just run helpdms off lol
given you're a mod, I think you can get around it in a way
iirc there's a test server and/or an emoji server for the bots here
so you can join that and turn on dms for that server
oh wait
which would allow @keen onyx to be able to dm you but not members
i don't see the bot on the test server..
that would be a good idea hmm
yeah it's not on the test server
lol what a guy
There are some emoji servers that it's on I can add you to
i got in, thank you!
`def get_content(file):
f = open('lyrics.txt', 'r')
lines = f.read()
f.close()
return lines
lyrics = get_content('lyrics.txt')
print(lyrics)
` This is a challenge that I have in my class and the only thing I am getting wrong that my hint says is "Does the function get_content work correctly? Does it open a file, read its contents and then close the file? Does it use the return keyword" can someone help?
hey guys, I've been trying to learn how to do matrix-vector multiplication (both row-variant and column-variant methods) when given a Matrix and a vector, WITHOUT using the numpy methods (dot method and the matmul method), can anyone help me out?
.
@foggy mica I said "ciao ciao"
Oh ciao