#off-topic-lounge-text
1 messages ยท Page 31 of 1
$ docker-compose up --build
Pulling pgdb (postgres:)...
Docker Compose is now in the Docker CLI, try `docker compose up`
latest: Pulling from library/postgres
error pulling image configuration: Get https://registry-1.docker.io/v2/library/postgres/blobs/sha256:3d8d979945851f52a66f04e92cfc9d5d08f71bb5166e5292978162764a053b2c: unknown: unable to scan account service account row from query: context deadline exceeded
Show your docker-compose.yml?
version: "3.8"
services:
django:
build: .
container_name: django
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/usr/src/app/
ports:
- "8000:8000"
networks:
- pg_database
environment:
- DEBUG=1
- DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
depends_on:
- pgdb
- redis
celery:
build: .
command: celery -A core worker -l INFO
volumes:
- .:/usr/src/app
networks:
- pg_database
environment:
- DEBUG=1
- DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
depends_on:
- django
- redis
pgdb:
image: postgres
container_name: pgdb
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- pgdata:/var/lib/postgresql/data/
networks:
- pg_database
redis:
image: "redis:alpine"
networks:
- pg_database
volumes:
pgdata:
networks:
pg_database:
driver: bridge
I guess, no
alright so i coded an app on python, compiled it with pyinstaller i tested it on my pc and it works fine but i tested it in another pc and it doesn't work properly, why?
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.")```
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 problems when the code cant find the string the programs breaks and does not trigger the else statement.
result_code will be used before defining in the case len(code)==0
can anyone help me?
i have this 3 codes i want to connect them together
ill have to explain later i just gotta take a bathroom break
u still there ?
@cursive grove see #โ๏ฝhow-to-get-help
yea i think itll be better if you use a help channel
I hope I can use my voice here
hello guys, i need help please... does anyone of you know appium? appium is perfectly installed in my machine (raspi) but I still kept getting this error: /bin/sh: 1: appium: not found any help would be so much appreciated. Thank you.
NC
???
still
Hi! Can someone help with Django?
I have some issue with database.
yes
I want to do this in regex ...cant figure this out can anyone help me ?
hey
(:
Hey guys! Do any of you have the time to help me with a school project?
I am working on a neural network
how do you import .xlsx file in jupyter notebook for R??
hi
i need help please on a python script, it's urgent
can i get help with a tensorflow code?
can u guys hear me
nooooo
Can anyone help me with exceptions ?
I need to run through my program printing only the first error that occurs then exiting the program. Currently my program prints all errors.
hi
Hellooo , anyone here know hoy pass the python to HTML? im so loose
can someone give me any link for practicing python questions for beginer level please?
can someone help me with this code in visual studio?
from discord.ext.commands import Bot
import random
import pickle
import os
client = Bot(command_prefix=",")
data_filename = "data.pickle"
class Data:
def __init__(self, wallet, bank):
self.wallet = wallet
self.bank = bank
@client.event
async def on_ready():
print(f"Logged in as {client.user}")
@client.command()
async def work(message):
member_data = load_member_data(message.author.id)
member_data.wallet += 1
await message.channel.send("You earned 1 coin!")
save_member_data(message.author.id, member_data)
@client.command()
async def bal(message):
member_data = load_member_data(message.author.id)
embed = discord.Embed(title=f"{message.author.display_name}'s Balance")
embed.add_field(name="Wallet", value=str(member_data.wallet))
embed.add_field(name="bank", value=str(member_data.bank))
await message.channel.send(embed=embed)
#Functions
def load_data():
if os.path.isfile(data_filename):
with open(data_filename, "rb") as file:
return pickle.load(file)
else:
return dict()
def load_member_data(member_ID):
data = load_data()
if member_ID not in data:
return Data(0, 0)
return data[member_ID]
def save_member_data(member_ID, member_data):
data = load_data()
data[member_ID] = member_data
with open(data_filename, "wb") as file:
pickle.dump(data, file)```
it says its not working
!paste
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.
so
it just said incorrect
and
let me see what the console log said
alr
problem:
cannot run discord
print("\n")
x = len(Atm)
y = 0
z = 0
go = 0
while z <= x-1:
go = 20 - len(Atm[z])
while y <= x-1:
print(str(y+1) + ". " + Atm[y] + " -> " + Atm_symbols[y] + " -> " + Atm_mass[y])
y += 1
z += 1
go = 0```
plzzz help
need help in the voice code/help1
Creating a window screen
wn = turtle.Screen()
wn.title("Snake Game")
wn.bgcolor("blue")
the width and height can be put as user's choice
wn.setup(width=600, height=600)
wn.tracer(0)
head of the snake
head = turtle.Turtle()
head.shape("square")
head.color("white")
head.penup()
head.goto(0, 0)
head.direction = "Stop"
food in the game
food = turtle.Turtle()
colors = random.choice(['red', 'green', 'black'])
shapes = random.choice(['square', 'triangle', 'circle'])
food.speed(0)
food.shape(shapes)
food.color(colors)
food.penup()
food.goto(0, 100)
pen = turtle.Turtle()
pen.speed(0)
pen.shape("square")
pen.color("white")
pen.penup()
pen.hideturtle()
pen.goto(0, 250)
pen.write("Score : 0 High Score : 0", align="center",
font=("candara", 24, "bold"))
It dosent create the window
.
explain numpy
:incoming_envelope: :ok_hand: applied mute to @wicked pawn until <t:1639900690:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
hi
def staircase(n):
for i in range(1, n+1):
stars = "#" * i
space = (n-i-1)*' '
print(space, stars)
staircase(6)
When i run this code everthing is goind well untill the last line
i tried to solve, but as you can understand i couldn't. Anyone with diffrent perspeftive?
def staircase(n):
for i in range(1, n+1):
stars = "#"i
space = " "(n-1)
n-=1
print(space+stars)
i solved thanks folksss
๐
it does not allow me
yeah :/
you guys are doing good gossip
most of talks are non tech ๐
True
moreover its helping me to free of code stuck
nice nice
ok
you got experience in pyqt5 btw
nope
or some gui development in general
i am django developer
damn nice
who is talking now?
Oasis and Gi
both are
okay see you buddies
@primal bison do you play
PUBG?
@primal bison ask her
my question
๐ finger crossed!
afk give me sec yall
Online multiplayer puzzle game
I am friendly about this. I know how it feels.
@golden kindle thank you
@primal bison no. I am not Indian. Guess my country
hahah
it means Cuty instead of PyQT
i can understand the exam in India
@primal bison
@primal bison
oi
@primal bison Actually, its hard to live in 3rd world country. Students are like a pressure cooker
hi
hi
There seems to be a lot of people saying 'hi' here.
I'll step up and also say hi
So umm...
Anyone else working on anything cool with python?
So on this discord is django preferred over flask?
Or how about bottle? Bottle is supposed to be tiny.
And good for small implementations of microservices.
Or personal projects.
@primal bison here
nice channel
Using this function to parse a xml string from a inputbox...
How do I only continue the processing of the input of there are no errors:
def parseString(content):
try:
tree = ET.fromstring(content)
except ET.ParseError as err:
lineno, column = err.position
line = next(IT.islice(StringIO(content), lineno))
caret = '{:=>{}}'.format('^', column)
err.msg = '{}\n{}\n{}'.format(err, line, caret)
print(err.msg)
raise
return tree
How do I only continue if root is created with no error??
root = parseString(string_data)
I need some help for opening a text file on phyton but im not understanding by chat, can someone voice chat me
:incoming_envelope: :ok_hand: applied mute to @primal bison until <t:1640645100:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
Hey can you help me with some code in discord.py?
can someone help me? i have problem with pyaudio i can't install this
and i have error: pipwin : The term 'pipwin' is not recognized as the name of a cmdlet, function
when: pipwin install pyaudio
:incoming_envelope: :ok_hand: applied mute to @primal bison until <t:1640865612:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
:incoming_envelope: :ok_hand: applied mute to @candid lodge until <t:1640865624:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
:incoming_envelope: :ok_hand: applied mute to @primal bison until <t:1641320375:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
hello, is there any one good at html css who can help me, i have a small problem on my code, and i have no idea on how to do it
a?
talk with us ! i can help you if i know ๐
Are we allow to request help in the voice chats?
Also how can we tell if we are voice verified
:incoming_envelope: :ok_hand: applied mute to @primal bison until <t:1641680132:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
Hi! Just a beginner who wants help setting up a venv
Open VS Code in the project folder.
Open terminal.
Type "python -m venv <name of the venv here>"
Activate it by typing ".<name of the venv>\Scripts\Activate.ps1" in the terminal.
Install the packages.
If you get a suggestion to update python, do so.
If you don't update, venv will not work the next time you activate it.
Hope it helps!
can someone help me deploy my django project please
THANK YOU SO MUCH
I WAS USING python3 -m venv .venv WHICH IS WHY IT DIDN
WORK
it says why
you wrote prin ("HELLO") instead of print("HELLO")
see where it says:
?
@burnt bloom
Hello everyone, who can help me with a small programming in python/ jupyter
flaskkk
lol
no problem mate!
im new to this and need help
grade = input ("grade")
if grade >= 50
print ("pass"):
else print ("fail"))
whats wrong with the above code
@west sun
1st line since its input it shld be int(input("grade"))
2nd semicolon missing at end
3rd line intendation not proper with if same with else
Chk these and get back and post your query in the right channel pls...
I have an issue
Hello guys can i get some help?
hi i am new to pythone
same
Can anybody help me with this??
I am new to python
This is quite confusing because i think this is right?
indeed
ok soooo is this right
import turtle
tom = turtle.turtles()
tom.left(45)
turtle.done()
j
hello can anyone help me
I might be able to @modest coral... What do you need help with?
mmoooothhherrrr
ffffuuuucckkkkkkkeeerrrrr
bbbbbeeeeeaaaacccchhhhhh
mmmmmmeeeeennnnnn
iiiinnnnn
yyyyyoooouuuurrrrr
eeeeeaaaaaaasssseeellllll
Hello, I am trying to make a toggle for when someone holds left click, it will draw a pattern by following coordinates, I think I've done it, but now when I move my mouse, it draws a pattern by following coordinates, but I want it to draw the pattern when I click not when I move my mouse.
Here is the code:
from pynput.mouse import Listener, Button, Controller
import pyautogui
import mouse
mouse = Controller()
press = False
def on_move(x, y):
if press:
pyautogui.moveTo(960, 540, duration=0, tween=pyautogui.easeInOutQuad)
pyautogui.moveTo(960, 800, duration=2, tween=pyautogui.easeInOutQuad)
else:
return False
def on_click(x, y, button, pressed):
global press
press = pressed
while True:
with Listener(on_move = on_move, on_click=on_click) as listen:
listen.join()
Could someone help me
sory it is not for you ๐
def on_click():
pyautogui.dragTo(960, 540, button='left')
pyautogui.dragTo(960, 800, button='left')
Hey @manic linden!
It looks like you tried to attach file type(s) that we do not allow (.pdf). 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.
Hello there
I need a quick help
Just a little thing
Ping me if som1 is ready to help me
why does my mouse keep freezing in my program
i am trying to detect a mouse click
and when it detects a mouse click i want it to search for an image
hi
U missed a closing bracket
:incoming_envelope: :ok_hand: applied mute to @chrome crane until <t:1643788629:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
Perhaps capitalise the "y"?
i need help from homeworks, can somebody help me?
yeah sure you can share your code
!voiceverif
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
def print_nums(x):
for i in range(x):
print(i)
return
print_nums(10)
can somebody explain to me why is the output of this code 0?
you are returning nothing
remove return
I want to do pd.concat multiple time through all my dataframes
I did merge 2 dataframes with simple pd.concat, but I don't know how to iterate through all my dataframes
can someone help me in vc?
my attempt
!voiceverify
you should be able to make a list of dataframes and then pass that list to pd.concat()
!d pandas.concat
pandas.concat(objs, axis=0, join='outer', ignore_index=False, keys=None, levels=None, names=None, verify_integrity=False, sort=False, copy=True)```
Concatenate pandas objects along a particular axis with optional set logic along the other axes.
Can also add a layer of hierarchical indexing on the concatenation axis, which may be useful if the labels are the same (or overlapping) on the passed axis number.
def wait_for(by, element, timeout):
if not isinstance(by, By.XPATH):
raise ValueError("Invalid parameter!")
What I'm trying to achieve is my function only allowing the parameter being By.XPATH and looks like I'm getting that traceback on the image
!voice -- See the bot message below as to why you are muted.
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
could you tell me what is wrong with this code?
why can't I get the expected output?
Most of them look like they are one more than they should be.
len(line.strip()) ?
from playsound import playsound
playsound("A:/Alve/Hottiti/Documents/try.py/Sounds/wi.mp3")
whats wrong in this code
tell me someone
@hallow jasper
what error are u getting
Traceback (most recent call last):
File "a:\Alve\Hottiti\Documents\First file\test.py", line 2, in <module>
playsound("A://Alve//Hottiti//Documents//try.py//Sounds//Thanos.mp4")
File "C:\Python10\lib\site-packages\playsound.py", line 34, in _playsoundWin
winCommand('open "' + sound + '" alias', alias)
File "C:\Python10\lib\site-packages\playsound.py", line 27, in winCommand
exceptionMessage = ('\n Error ' + str(errorCode) + ' for command:'
TypeError: can only concatenate str (not "bytes") to str
i need help
Sum( f, n) which takes as argument a function f and an integer n and
emitted โ f(k)
any idea ?
!!
u need to download the song first
and add it as a packgae to ur interprreter
package*
noo
I was using transformer with tensorflow to generate sentence but the code closes without an output,
from transformers import pipeline
generator = pipeline(task= 'text-generation', model= 'gpt2')
generator("I am now testing..", max_length=300, num_return_sequences=3)
hi
Is anyone available to help me with some homework?
!voiceverif
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
is this channel available
!voiceverif
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voiceverif
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voiceverif
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voiceverify
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
myName = input("Hello. What is your name?: ")
print() #easy way to add space between output lines
myQuestion = input("Thank you " + myName + ". "+ "What is your question?: a=() b=()")
#print output
print( "Nice to meet you", myName + ".", "okay so ", myQuestion + " is,")
print( "Good bye.")
Could someone help me figure out what's wrong with this code?
You cant put space in between variable names in python
And also on line 15, ".." remove that dots
On line 23, there should be '.' between string and format
last line should be like this
print("The discount in $ {0:.2f}".format(discount))
Help in the corn section plz
Anyone willing to chat with me about decorators in CodeHelp1?
!voiceverif
Hello!
!voiceverif
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Hi
I have some problems
Im trying to import functions from one file to another
this is the error
this is how i imported the funtions
this is how I imported some data from the main file to the funtions file
any idea why this error occurs
Hey guys,
I am trying to write a recursive function that takes a list of integers as parameter and returns True if sum of 2 numbers from that list is 0 else returns False. So far I've tried:
L = [12,5,10,-5,8]
def inverse_pair(L):
if not L:
return False
else:
if inverse_pair(L[1:])+inverse_pair(L[1:]) == 0:
return True
return False
having trouble getting started here
i know that i need to use some form of indexes but im honestly lost
im pretty sure it requires for and in as well
!e py text = "apples pear grapes" result = text.split(" ") print(result)
@night lily :white_check_mark: Your eval job has completed with return code 0.
['apples', 'pear', 'grapes']
!e py text = "apples pears grapes bananas" result = text.split(" ", maxsplit=1) print(result)
@night lily :white_check_mark: Your eval job has completed with return code 0.
['apples', 'pears grapes bananas']
!e py text = "apples pears grapes bananas oranges" result = text.split(" ", maxsplit=2) print(result)โ
@night lily :white_check_mark: Your eval job has completed with return code 0.
['apples', 'pears', 'grapes bananas oranges']
!e py url = "http://blahblahblah://byadda" a, b = url.split("://", maxsplit=1) print(a) print(b)
@night lily :white_check_mark: Your eval job has completed with return code 0.
001 | http
002 | blahblahblah://byadda
!e py nums = [1,2] a, b = nums #variable unpacking print(a) print(b)
@night lily :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 2
!e py b = "www.blah.com/blah" c, d = b.split("/", maxsplit=1) print(c)
@night lily :white_check_mark: Your eval job has completed with return code 0.
www.blah.com
!e b = "www.blah.com/blah" c = b.split("/", maxsplit=1)[0] print(c)โ
@night lily :white_check_mark: Your eval job has completed with return code 0.
www.blah.com
!e py b = "www.blah.com/blah" c = b.split("/", maxsplit=1) print(c)โ
@night lily :white_check_mark: Your eval job has completed with return code 0.
['www.blah.com', 'blah']
!e py my_list = ["apples", "pears", "grapes"] print(my_list[0]) print(my_list[1])
@night lily :white_check_mark: Your eval job has completed with return code 0.
001 | apples
002 | pears
!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 py text = "yaddayadda" result = text.split("$") print(result)
@night lily :white_check_mark: Your eval job has completed with return code 0.
['yaddayadda']
!e py www.discord.com
@night lily :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 'www' is not defined
if component == 'protocol':
url = url.split('://', maxsplit = 1)[0]
elif component == 'domain':
url = url.split('/', maxsplit = 1)[0]
else:
print('Error')
return url
# Remember: end all of your functions with a return statement, not a print statement!
# Test cases
print(decompose_url('protocol', 'https://stonybrook.edu/')) ```
str.split/cut cake in half on :// The first half of the cake is the protocol.
Cut the second half in half on /, the first quarter is your domain.
maxsplit=1 for at least the second split
url = 'http://discord.com/'
protocol = url.split('://', maxsplit = 1)
domain = url.split('/', maxsplit = 1)
print(print)
print(domain)
def func(url):
...
return protocol, domain
url = "http://www.blah.com/yadda/yaddaboo"
result = func(url)
print(result)```Write for ... just for now.
!e ```
url = 'http://discord.com/'
protocol = url.split('://', maxsplit = 1)
domain = url.split('/', maxsplit = 1)
print(print)
print(domain) ```
@languid crystal :white_check_mark: Your eval job has completed with return code 0.
001 | <built-in function print>
002 | ['http:', '/discord.com/']
@night lily :white_check_mark: Your eval job has completed with return code 0.
['http', 'discord.com/']
!e ```py
url = 'http://discord.com/'
protocol, not_protocol = url.split('://', maxsplit = 1)
print(protocol)
print(not_protocol)```
@night lily :white_check_mark: Your eval job has completed with return code 0.
001 | http
002 | discord.com/
domain, not_domain = not_protocol.split(...)```
!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!*
domain, not_domain = not_protocol.split('/', maxsplit = 1)
!e ```
url = 'http://youtube.com/'
protocol, domain = url.split("://", maxsplit = 1)
print(protocol)
print(domain)
@languid crystal :white_check_mark: Your eval job has completed with return code 0.
001 | http
002 | youtube.com/
!e ```
url = 'http://youtube.com/mrbeast'
protocol, domain = url.split("://", maxsplit = 1)
print(protocol)
print(domain)
@languid crystal :white_check_mark: Your eval job has completed with return code 0.
001 | http
002 | youtube.com/mrbeast
!e ```
url = 'http://youtube.com/mrbeast'
protocol, domain = url.split("://")
domain, domain_misc = domain.split("/", maxsplit = 1)
print(protocol)
print(domain)
print(domain_misc)
@languid crystal :white_check_mark: Your eval job has completed with return code 0.
001 | http
002 | youtube.com
003 | mrbeast
!e ```
url = 'http://youtube.com/mrbeast/squidgames/video'
protocol, domain = url.split("://")
domain, domain_misc = domain.split("/", maxsplit = 1)
print(protocol)
print(domain)
print(domain_misc)
@languid crystal :white_check_mark: Your eval job has completed with return code 0.
001 | http
002 | youtube.com
003 | mrbeast/squidgames/video
!e ```
url = 'http://youtube.com/mrbeast/squidgames/video'
protocol, domain = url.split("://")
domain, domain_misc = domain.split("/")
print(protocol)
print(domain)
print(domain_misc)
@languid crystal :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 4, in <module>
003 | ValueError: too many values to unpack (expected 2)
!e ```
url = 'http://youtube.com'
protocol, domain = url.split("://")
domain, domain_misc = domain.split("/", maxsplit = 1)
print(protocol)
print(domain)
print(domain_misc)
@languid crystal :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 4, in <module>
003 | ValueError: not enough values to unpack (expected 2, got 1)
protocol = url.split('://')[0]
def decompose_url(component, url):
if component == 'protocol':
url = url.split('://')[0]
elif component == 'domain':
url = url.split('/')[0]
else:
print('Error')
return url
# Test cases
print(decompose_url('protocol', 'https://stonybrook.edu/'))
print(decompose_url('protocol', 'ftp://amazon.com/'))
print(decompose_url('domain', 'https://stonybrook.edu/sbengaged'))
print(decompose_url('hello', 'https://stonybrook.edu/sbengaged'))
print(decompose_url('domain', 'https://en.wikipedia.org/wiki/Alan_Turing#Awards,_honours,_and_tributes'))
print(decompose_url('protocol', 'smtp://mail.notahacker.org/steal_your_info'))
print(decompose_url('files', 'smtp://mail.notahacker.org/steal_your_info'))```
url = url.split('://')[1].split('/')[0]
it looks like this?
def decompose_url(component, url):
if component == 'protocol':
url = url.split('://')[0]
elif component == 'domain':
url = url.split('://')[1].split('/')[0]
else:
print('Error')
return url
if component == 'protocol':
url = url.split('://')[0]
elif component == 'domain':
url = url.split('://')[1].split('/')[0]
else:
print('Error')
return url ```
def func(url):
...
return protocol, domain
url = "http://www.blah.com/yadda/yaddaboo"
result = func(url)
print(result)```
Solve for ...
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@primal bison
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@primal bison, if you want to speak you need get the voice-verified role
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
!e
ham = ""
for i in range(5):
ham += str(i)
print(ham)
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
01234
!e
for i in range(5):
ham += str(i)
print(ham)
@buoyant kestrel :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | NameError: name 'ham' is not defined
ham += str(i)
# is the same as
ham = ham + str(i)
!e
for i in range(5):
print(i)
print("Done!")
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | Done!
0
1
10
11
1 1 0
(1 * 2^2) + (1 * 2^1) + (0 * 2^0)
!e
reverse_binary = ""
integer_value = 6
while integer_value > 0:
print(f"{integer_value=}")
reverse_binary += str(integer_value % 2)
integer_value = integer_value // 2
print(f"{reverse_binary=}")
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
001 | integer_value=6
002 | reverse_binary='0'
003 | integer_value=3
004 | reverse_binary='01'
005 | integer_value=1
006 | reverse_binary='011'
!e
ham = "Boy, Python is dope"
print(ham[3:9])
print(ham[::2])
print(ham[::-1])
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
001 | , Pyth
002 | By yhni oe
003 | epod si nohtyP ,yoB
!e
print(.1 + .2)
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
0.30000000000000004
!e
print(6/2)
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
3.0
!e
print(3.5 // 1.2)
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
2.0
!e
print(3.5 / 1.2)
@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.
2.916666666666667
I can explain here in a sec. Have to feed the cat monster and then I'll type out on the laptop. What part has you stumped
no dark mode?
!e print("hello")
@young cedar :white_check_mark: Your eval job has completed with return code 0.
hello
I can't talk ๐
!e
Answer = "Alright bet"
question = input("Do you like to say alright bet?")
if question == ("no"):
print("good I like you")
else:
print(Answer)
@eager citrus :x: Your eval job has completed with return code 1.
001 | Do you like to say alright bet?Traceback (most recent call last):
002 | File "<string>", line 3, in <module>
003 | EOFError: EOF when reading a line
!e print(โthis is a cool botโ)
@shell ermine :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print(โthis is a cool botโ)
003 | ^
004 | SyntaxError: invalid character 'โ' (U+201C)
!e print(โhelloโ)
@shell ermine :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print(โhelloโ)
003 | ^
004 | SyntaxError: invalid character 'โ' (U+201C)
!e print("hello")
@shell ermine :white_check_mark: Your eval job has completed with return code 0.
hello
!e input("test")
@tiny socket :x: Your eval job has completed with return code 1.
001 | testTraceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
@tiny socket :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 'b' is not defined
!e print(print)
@wary flame :white_check_mark: Your eval job has completed with return code 0.
<built-in function print>
!e print("hi there!")
@young garnet :white_check_mark: Your eval job has completed with return code 0.
hi there!
!e print("Hello .Nabil!")
@bold prairie :white_check_mark: Your eval job has completed with return code 0.
Hello .Nabil!
@primal bison :white_check_mark: Your eval job has completed with return code 0.
Test
@merry ocean :warning: Your eval job has completed with return code 0.
[No output]
!e
test_list = [9,8,7,6,5,4,3,2,1,0]
print({k:v for k, v in enumerate(test_list)})```
@merry ocean :white_check_mark: Your eval job has completed with return code 0.
{0: 9, 1: 8, 2: 7, 3: 6, 4: 5, 5: 4, 6: 3, 7: 2, 8: 1, 9: 0}
!e
@commands.command(name="embed")
async def embed(ctx):
embed = discord.Embed(title="embed")
return await ctx.send(embed=embed)```
@primal bison :warning: Your eval job has completed with return code 0.
[No output]
!e
@commands.command(name="embed")
async def embed(ctx):
embed = discord.Embed(title="embed")
return await ctx.send(embed=embed)
@primal bison :x: Your eval job has completed with return code 1.
001 | File "<string>", line 3
002 | embed = discord.Embed(title="embed")
003 | ^
004 | IndentationError: expected an indented block after function definition on line 2
!eval embed=discord.Embed(title='All Systems Operational', description=f'
Antinuke Systems\n!online Anti Bots Systems', color=255)
await ctx.send(embed=embed)
any chance you guys are talking about maths here, too?
what you using to build REST api?
the reason i was recommending emmet <-
@gloomy lily ```python
from pydantic import BaseModel
router = APIRouter()
class Calc(BaseModel):
op: str
number1: int
number2: int
@router.post("/calc")
def calc(body: Calc):```
FastAPI framework, high performance, easy to learn, fast to code, ready for production
import os
from fastapi import APIRouter, FastAPI
from pydantic import main
from .routers import name_main_router
app = FastAPI()
@app.get("/ping")
def ping():
return 'pong'```
FastAPI framework, high performance, easy to learn, fast to code, ready for production
"Yak Shaving Day" from Ren & Stimpy's "Crock 'o' Christmas" album ... Captioned ... never saw a video of it but lots of shaving yaks in the "Fleck the Walls" video. Took the audio track and pieced together clips and stills and added captions to enhance your enjoyment of the celebration of Yaksmas.
const htmlString = `<div class="media-left">
<figure class="image">
<img src="${therapistProfile.img_uri}"
alt="${therapistProfile.name}">
</figure>
</div>
</div>`
var wrapper = document.createElement('div');
wrapper.innerHTML = htmlString;
return wrapper.firstChild;
@oak shard @umbral thunder you can write here
1?
@median mantle ฤฑ need help for something
What is FastAPI
Dont know Xd
isnt it like vss
Its like asking data?
I have develop some with flask
Ok
Ok
Kind of
No I am not new
yes
@fresh sail something came up - I can work on data website in ~4/5 hours
So it is build on top of anyother framwork or it's totally another framwork?
continue
ฤฑ wasnt on my pc what is fast apฤฑ
some one left
ฤฑ tried to learn python from a youtube video witch is around 12 hours
ฤฑ am still in the first 2 hours of the video
and ฤฑ have a problem with my code
can you help me about that a little bit
ฤฑ have a question that ฤฑ should ansver with y or n
ฤฑ get the part that if ฤฑ answer with y or n
idk how to get vscode html auto complete working hm
it always auto complete a wrong tag
@atomic phoenix i left that rust server dude๐คฃ
i did leave
why would i lie about that๐คฃ
those moderators are bozos
they are weak
they stand for nothing
they went with the majority
because nobody wants to be productive
and talk about languages and do nothing for hours...and anything apart from rust
That server is dry anyway
Python is alot better
@atomic phoenix you ready to begin?
i just cant stand weak people
these people lowered their standards to Fit In
I never cared
Stack Overflow has been steadily declining over the past decade. It serves as one of the greatest resources for programmers all over the world. However fails to accomplish the one purpose it was created for, Q&A. People are becoming more and more hesitant to ask questions on Stack Overflow because of the hostile moderators, and this will eventua...
@atomic phoenix
@atomic phoenix are we ever going to begin?
@atomic phoenix thats ok man
Ill just do something else i guess๐คฃ
thanks for looking out thoughโค๏ธ
Dont worry man, ill be fine
Have fun
what's going on in here
๐ @vernal snow
lolll
We going to bully jake?
@atomic phoenix plz share screen , i wont to see ๐ฅบ ?
@atomic phoenix you have a really nice voice
i really loved
I'm going to sleep, have a nice day
and besafe
Hey where should I ask a coding question?
Hello! You can claim your own help channel (#โ๏ฝhow-to-get-help ), ask in one of the topical channels, or ask in #python-discussion
Hello everyone
:incoming_envelope: :ok_hand: applied mute to @topaz wing until <t:1646762931:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
is there a way to get all 50 messages sent to the server to be able to enter the voice chat
I guess I'll browse for awhile longer!
They have to be sent over a certain period of time, otherwise it doesn't count :P
!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 ```python
def Hello():
return "Hello World!"
print(Hello())
@echo bobcat :white_check_mark: Your eval job has completed with return code 0.
Hello World!
!e
print("Lets do this!")
@pastel quail :white_check_mark: Your eval job has completed with return code 0.
Lets do this!
So i cant use a python bot to send 50 random messages?
!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!*
!eval
os.system("stop")
@kind dagger :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 'os' is not defined
:incoming_envelope: :ok_hand: applied mute to @topaz wing until <t:1646822823:f> (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).
@topaz wing Do not spam messages to reach the minimum required for voice
someone could fix my good code
I was like here for 3 blocks x 1 hour
but since this is my first day
I might need like 48 hours before I can continue my code
god save me, no one is helping me, they're all helping otherds
i dont know much but send it here maybe i can help
i dont think it counts
because i guess you have to send the messages in certain period of time
"Spamming to meet any criteria will get you temporarily or permanently banned from voice, and potentially the community"
it says on the voice verification channel
thats sad am i right:(
You are not allowed to use that command.
you need to write that command in voice verification channel
you made it
hahahaha
i still needto send
need to* send more messages
i dunno
maybe i didnt send 50 messages so far
im not counting
:)
oh
i get this:
โข You have sent less than 50 messages.
no thanks
i think it will be over soon
but thanks so much for your offer
byee
It doesn't count unless it's over a certain timespan
i was talking with someone i know that
i guess they deleted the messages between mines
thanks anyway:)
!e
@buoyant kestrel can Fury have streaming permissions so we can make some pretty charts?
@honest pasture C:\Program Files\Git\usr\bin\grep.exe
@fresh sail yea but ive got to go. Ill see you guys later, have fun
@honest pasture how do we pattern match in python?
without match statement
@fresh sail
That's not pattern matching...
Yeah.. if statements are equivalent... but it is just sweeter syntax...
btw, I don't how they implemented in python, I've not used match yet...
But haskell pattern matching is "sweet" ..
Pattern matching is much nicer in languages with more advanced type systems than Python - it's great in Scala/Kotlin/probably-every-other-similar-language
Yeah.. That make sense..
Hey @fresh sail!
It looks like you tried to attach file type(s) that we do not allow (.xlsx). 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.
Why wouldn't they allow xlsx
@honest pasture stream at 5fps.. I can't see text properly
I'm talking about this...
@fresh sail @honest pasture what are you guys searching for?
@honest pasture add spaces @fresh sail
make a list of cols and add there
yaxis = []
for i in d[field]:
yaxis.append(i + " ")
# when you ploting, send yaxis
@honest pasture
@fresh sail
No, it is general
Whatever you want to plot... you do it everytime... and we are not changing data
x, y are same @honest pasture @fresh sail
d[field]
What lib are you guys using...
๐ got it
@honest pasture hi sorry donโt want to interrupt also have no mic
Maggy
I do have a mic
No nice privilege
Mic

@honest pasture sometimes not relying on lib features and writing code will be faster...
Okay
Probably even better... if you write your own plotly....
@fresh sail what's the website...
No..
Pls no
Treating girls differently
It's negative...
Pink for girls...
Pink for girls... find complementary for that.... I was saying...
and also add references...
No kids it is ๐ค
is it causation or correlation... "further research is needed"
Keep track of references. When it gets serious, it is important...
https://www.youtube.com/watch?v=2sjqTHE0zok&t=1387s
@fresh sail @honest pasture this is quite helpful
You can find the lecture notes and exercises for this lecture at https://missing.csail.mit.edu/2020/version-control/
Help us caption & translate this video!
contrl L
it clears
haha, we are taking "delete git" route..
"./" ?
@fresh sail @honest pasture
@fresh sail it is in styles folder not pages
@fresh sail See the full error
iframe in react isn't the problem, the problem is figuring out how to get Gatsby to dump the html file somewhere that we can find it when it's running on the server
Okay
I think this is how to do it
/ is root folder
root is site i guess
move it site/public/static...
Static is in root in that doc
@honest pasture
. is current folder...
don't use .
@fresh sail
This maybe?
I'm feeling like it is react... "it is expecting .js"
I don't know JS.. is it {}
@fresh sail
not ..
{} @fresh sail
public won't work because it doesn't have that file
oh..
but we don't have static
in root now
let's try all at once...
static in root
{}
@fresh sail
@buoyant kestrel @fresh sail can I get streaming perms
ah - yeah - thanks
@fresh sail making charts?
me too...
if you really want some serious table,use sql... or use google sheets
there is no place for excel..
@fresh sail @honest pasture
where can I get that excel
@fresh sail
Charlie, can you send that cleaned one...
why JS ๐
@honest pasture
I don't know... It is bad language for manipulating data...
You could write python for manipulating data... dump it into json or something...
@honest pasture what is the return type of map
There is something with that lamda function i think
test it out
@honest pasture
better way would be, write a loop that goes through entire csv( every col, row) and removes ","... @honest pasture
@fresh sail does this lib give interactive plots...
https://github.com/gatsbyjs/gatsby/issues/17761
@honest pasture
Easier, Even for google @fresh sail
@agile portal @fresh sail This looks like a solution...
@agile portal can you please help me to understand this code
import re
import string
separators = string.punctuation+string.digits+string.whitespace
excluded = string.ascii_letters
word = "badword"
formatted_word = f"[{separators}]*".join(list(word))
regex_true = re.compile(fr"{formatted_word}", re.IGNORECASE)
regex_false = re.compile(fr"([{excluded}]+{word})|({word}[{excluded}]+)", re.IGNORECASE)
profane = False
if regex_true.search(message.content) is not None\
and regex_false.search(message.content) is None:
profane = True
It was a moderation cmd for discord bot
I have no error but i am not able to understand code
๐
Ok
@agile portal Hindi me bol lo ge kya bhiya๐คฃ
!e
import string; print(string.punctuation)
@agile portal :white_check_mark: Your eval job has completed with return code 0.
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Ohh
Ohk
Ohk i understood till this
Aah i didn't get this ascii_letters
Ohk ohk thanks
And about that I mean how I put this in my previous code i am not able to fix it
@fresh sail just class
Okay react...
make sense... it conflicts with js lang class
@fresh sail probably better to use just some dummy iframe like wiki and then sytle it there..
Use a dummy iframe @fresh sail
put some wiki link or something...
Or just link the html
not iframe...
@fresh sail do we have to have it in iframe?
then just link it as external url
<a herf = " ">
@fresh sail
Then you can just load whole html
@agile portal problem with js is, it is not great for data manipulation...
when this 1 + "1".. happens... it will annoying...
@agile portal
yeah that will usually happen...
it is easy to forget and add a number and string ...
because our data will be in strings...
We already talked about this...
jsfuck and all...
that's why it is bad for manipulating data...
And we shouldn't
That's what I'm saying... do it in python.. and plot in js
Sometime, I want to write a graphic library..
Sure...
Maybe in 2 months... right now I have internship
Cool...
@agile portal change email in steam
@agile portal what you doing...?
ah i'm trying to reply to every message i get
haha
and i'm getting alooot of messages
๐ or i'm horrible at noticing dms in middle of conversations so i have to bulk answer them at the end
i have some issue in vs code for c can anyone help in fixing it
what issues?
its showing gcc is not recognized and even i have tried the path setting in pc also
can someone help me please
@limpid coral i think you're looking for django
i learned sql python and excel in 3 months
practicing sql for interview
@fresh sail whats the pronounciation of ur name
i cant speak for now just making quick conversation for the role.
furio shonen deren?
why cant i stram in the cannel? @fresh sail
stream?
probably need voice permission first, then you need to ask the Admins politely .
ok sir
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for i, num in enumerate(nums):
for j in range(i+1, len(nums)):
if num+nums[j]==target:
return [i,j]
i gues
you have to paste ur logic inside the class function
@fresh sail paste the code and u will understand
above code
how to join?
Trying to make a lobby ;c
I guess I'll wait until Furyo's done with the leetcode thing
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
for i, element in enumerate(nums):
try: return i, nums[i::].index(target - element)
except ValueError:...
@agile portal my money is on you, dont let me down...
f
you want to make a bet?
shh step bro
i got 10k on davinder
codingame is the most intense game ever
i believe in you reaper
print(pow(sum(int(input()) for _ in range(input(i))), 2))
print(sum(int(input())for _ in range(int(input())))**2)
!e print(len(r"print(sum(int(input())for _ in range(int(input())))**2)"))
@honest pasture :white_check_mark: Your eval job has completed with return code 0.
55
u lost :X
i didnt
davinder submitted like 10 minutes ago
guys their needs to be a clock
Griff is winning so far
its only the beginning....relax
this a tourney
its not how you start, its how you finish...
damn bro
give davinder a level playing field
you guys sneaked that win on him, by having extra minutes
now he knows the rules
are we missing someone?
@opal gate he defeaned. You know its on ๐ฟ
yes, playing for ๐ฅ
intense
davinder i put my life savings on you, dont let me down man
SUBSCRIBE
Credits @Isyan Tetick Official
lmfao
is it legal to use other langs other than python
when you're ready for the technical interviews
could you use splicing for this question?
i dont know, you talked about it with chris ๐คฃ
did you mean slicing?
yes
yes
there is also vim mode
any esoteric way could work
if a % 2 == 0:
x += a
else x -= a
pls dont spoiler ๐ฅบ
OwO
my code:
print(sum(map(lambda n:[1,-1][n%2]*n,map(int,open(0)))))
bruh
fastest not shortest ๐
@agile portal come on man, this is my reputation on the line here
``import sys
import math
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
a = int(input())
b = int(input())
c = int(input())
x = 0
for a % 2 == 0:
x += a
else x -= a
for b % 2 == 0:
x += b
else x -= b
for c % 2 == 0:
x += c
else x -= c
Write an answer using print
To debug: print("Debug messages...", file=sys.stderr, flush=True)
print(x)
``
@atomic phoenix
``import sys
import math
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
a = int(input())
b = int(input())
c = int(input())
x = 0
if a % 2 == 0:
x += a
else x = x - a
if b % 2 == 0:
x += b
else x = x - b
if c % 2 == 0:
x += c
else x= x - c
Write an answer using print
To debug: print("Debug messages...", file=sys.stderr, flush=True)
print(x)``
on ur elses
what am i doing wrong
:
else:
@atomic phoenix marco antonio playing mind games with competitors
would a lowercase one word thing be camelCase ?
yep
imagine @gloomy lily and @atomic phoenix in the same Agile team as Programmers.
informal talk
ok ima just change this
Agile is commonly used in the industry man
oh this one is actually quite ez
hmm no criteria kinda boring
can't believe end='' actually works
share code ๐ฅบ
its visible on the page i believe
Like what charlie says, its a way to organize teams to make software
o
while not sacrificing on quality


