#off-topic-lounge-text
1 messages · Page 30 of 1
:incoming_envelope: :ok_hand: applied mute to @dense thistle until 2021-06-11 07:54 (9 minutes and 59 seconds) (reason: newlines rule: sent 115 newlines in 10s).
!unmute 545278622915624970
:incoming_envelope: :ok_hand: pardoned infraction mute for @dense thistle.
!paste please use a pastebin
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.pydis.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.
TypeError: widp() missing 1 required positional argument: 'w'
UnboundLocalError: local variable 'w' referenced before assignment
hello, someone could help me on a voice and explain to me how to call class from main and create 20 members?
anyone able to help me a sec ?
What's up?
It'd probably be better if you tossed it either in here or to our hastebin
!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.
!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.pydis.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.
import time
class Timer:
def __init__(self,time_m,time_s):
self.time_m = m
self.time_s = s
def timing_mechanism(self):
print("Timer is set for ", m(int) , "and ", s(int), "seconds")
CookingTimer = Timer(time_m,time_s)
Timer(5,2)
#CookingTimer()
NameError: name 'time_m' is not defined
did i do the constructor fine ?
we can jump on voicechat 1 if you're fine w that
The issue is the CookingTimer = Timer(time_m, time_s) line. Neither time_m nor time_s have been defined anywhere, so Python doesn't know what value to pass to the class.
Also just a quick thing, the def timing... block needs to be on the same indent line as the def __init__... line
oh
TypeError: init() missing 2 required positional arguments: 'time_m' and 'time_s'
import time
class Timer:
def __init__(self,time_m,time_s):
self.time_m = m
self.time_s = s
def timing_mechanism(self):
print("Timer is set for ", m(int) ,"minutes ", "and ", s(int), "seconds")
where did i go wrong ?
@buoyant kestrel
can anyone teach me python
what you wanna learn ?
if you are beginner watch YouTube Tutorials
!play
hey
we dont have a music bot here sadly
Yeah
@graceful elk
I'm a software engineer who is familiar with Python and its library
@graceful elk and you?
a high school boi lol
if anyone good with pandas , can i call him here ?
Hey! Can anyone assists? I can do VC and ScreenShare
hi im unable to unmute(np)
i have a question
whats the power shell u are using is it / git ?
@gleaming shadow
@hot remnant
im a starter
@cold lintel help pls
Hello @tropic hedge. We're currently in #voice-chat-text-0. You need to have a certain amount of activity in the server before you can un-mute.
@tropic hedge See #voice-verification
ok i doo but @cold lintel
Erm, I believe he's using Bash on a Linux machine.
I'm not a Windows user so I don't know, sorry. When I used Windows in the past, I think Cygwin (?) was recommended.
It emulates a Linux/Unix shell in Windows.
But that was a long time ago 😅
import math
import statistics
f = open("C:\\Users\\burka\\OneDrive\\Desktop\\New folder\\demofile.txt", "r+")
numbers = sorted(list(map(int, f.readlines())))
print(numbers[:8000])
average = statistics.mean(numbers)
print("the average score: " + str(round(average, 2)))
!e
x = int('5\n')
print(x)
@undone yoke :white_check_mark: Your eval job has completed with return code 0.
5
hello
!voiceverify
why are the text help channels all food related?
!e
!e print("Hello")
!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
!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 print("")
hello
1923 The Intoxicating Liquor (Sale to Persons under 18) Act 1923 prohibited the sale or purchase of alcohol to or by any person under the age of 18 years
there you go
not margaret
hey guys I have a quick question on regex
do any of you have a sec lol
#algos-and-data-structs would know better than I would
if you have any knowledge , may i ask few things , are you down for that
i try knocking the mentioned channel , no response
Just gotta have patience
The topical channels typically have less foot traffic
But the folks who frequent there know their stuff
i cant talk her
can anyone help me parity and palindrome coding in python
in understanding with some examples
in live stream
?
Can someone help me install something on kali???
wat heappened
Hi guys, I have a little question. Why my function doesn't return enything ?
I will show you my code
If you are returning a value from a function instead of directly printing it, you need to either wrap the function call in a print statement like python print(pagocomputado(20, 2000)) or you can assign the return value to a variable using ```python
a = pagocomputado(20, 2000)
print(a)
Sure
Thanks ArynR
Np
!voiceverify
Shazaam!
anything good happening
ok bye
can some one help me? With .py to .exe
#bot-commands
We don't allow asking for paid help
@client.group()
async def __bank(ctx):
if ctx.invoked_subcommand is None:
await ctx.send('Invalid sub command passed'
'')
Dude please write and do not say. I need that if I send .bank, he sends me a message from the config, and if I also added a space separated by a space, let's say pay, he would execute def_pay for me.
You understood me?
If you have a ready-made solution, write do not tell me, and so I will not understand if you tell me👌
sorry
have very big problem with internet
what i need for it?
how i can fix it
help
i wanna ask input("whats ur name:") and then put print i like the name and put whatever was put in the input
can anyone help?
For in case your question wasn’t answered: the input() function returns what the user typed as a string, so you would just need to store that return in a variable
Ex:
myInput = input(“Enter input: ”)
print(myInput)
Output:
Enter input: Test
Test
Ayone can help me for this error?
1. Follow the Python Discord Code of Conduct.
d=-4.9t^2
Calculate displacement as a function of initial velocity, acceleration and time using the equation s = ut + (1/2)at^2. Solve for s, u, a or t; displacement, initial velocity, acceleration or time. Free online physics calculators and velocity equations in terms of constant acceleration, time and displacement.
Yo
Can't speak yet, not verified
#PyNoob Question lets say I want to create a virtual environment for a project, id like to isolate it from the rest of the system. I have been doing some googling and there is just an overwhelming amount of options. What would be best practice at the moment to use ?
Introduction Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
System requirements Poetry requires Python 2.7 or 3.5+. It is multi-platform and the goal is to make it work equally well on Windows, Linux and OSX.
Note...
!stream 461579135769116672
@sick pagoda
✅ @sick pagoda can now stream.
get rid of the try except and let the error bubble up perhaps
@buoyant kestrel huh, sounds like either my mic is broken or something. there's a bare except there, it's swallowing the error. also, hi! get them to remove the try except
been good 🙂
and i think now it might have been the fact that i didnt have voice verified role. haha
@hazy gate Staff are immune
Hello does anybody know what is wrong in my code? If you know please help me.

what do you want the output to be ?
what is your output
and what input are you giving
what is the problem you are facing
For example when I input "sad" the output is also "sad"
can you send the output
sad isnt the output ...its the input you giving to the a = input line
But why output isnt "what has happened?"? I don't understand : (
Now, it works
Ahhh
but that works
@primal bison "if a == ["sad","whatever"]" you cant do checks like this ...it will check if a is same as the list you provided which isnt
what you want to do is ..."if a in ["sad","im sad","Im sad"]"
😊
Another time THANK YOU A LOT!!!
well that was nice
does anyone know how to update messageboxes with tkinter?
Ayone can solve this?
Can anyone help me with my rock paper scissors game using tkinter?
i cant get the game to function at all and been stuck for 2 days now
def UserRock():
#Initialising variables
Rounds = 1
Wins = 0
ComputerScore = 0
ties = 0
RockPaperScissors = ["rock", "paper", "scissors"]
ComputerChoice = randint(0,2)
if ComputerChoice == RockPaperScissors[0]:
MessageBox['text'] = f"You Choose Rock, Computer chooses {RockPaperScissors}. You Both Tie!\n Wins:{Wins}\n Losses: {ComputerScore}\n , Ties:{ties}"
Rounds += 1
ties += 1
elif ComputerChoice == RockPaperScissors[1]:
MessageBox['text'] = f"You Choose Rock, Computer chooses {RockPaperScissors}. You Lose! \n Wins:{Wins}\n Losses: {ComputerScore}\n , Ties:{ties}"
Rounds += 1
ComputerScore += 1
elif ComputerChoice == RockPaperScissors[2]:
MessageBox['text'] = f"You Choose Rock, Computer chooses {RockPaperScissors}. You Win!\n Wins:{Wins}\n Losses: {ComputerScore}\n , Ties:{ties}"
Rounds += 1
Wins += 1```
this is one button for when the player chooses rock but i know this whole subroutine is wrong
whats happening where you stuck ?
@slate flame what you can do is make use of switch case ...and also proper a architechture for what you game does ..you could proper functions
What do you mean? @sick pagoda . I'm kinda new to tkinter and not very experienced in coding
The button doesn't do anything when i put the command to equal that function
you might have to share the code as in screenshare for someone to see whats happening
@sick pagoda https://paste.pythondiscord.com/uhowewefuf.apache
ill also join the voice chat
you dont use pack and place both together
what do you mean?
you either use pack or place
label1 = tk.Label(root,text="Welcome to Rock, Paper, Scissors!", font = Font_tuple1)
label2 = tk.Label(root, text="Do you want to play Rock, Paper Scissors?")
label1.pack()
label2.pack()
here you have used pac
pack*
thats for my first window
the issue is my second window
the buttons just doesnt work and i think its because of the subroutines for the rock, paper and scissors buttons
ok wait let me check the logic
ok
these buttons dont work
RockButton = tk.Button(frame1, text = "Rock", width = 10, height = 10, padx = 40, pady = 5, command = UserRock)
PaperButton = tk.Button(frame1, text = "Paper", width = 10, height = 10, padx = 40, pady = 5, command = UserPaper)
ScissorsButton = tk.Button(frame1, text = "Scissors", width = 10, height = 10, padx = 40, pady = 5, command = UserScissors)
?
what's wrong with it?
no i am saying which buttons dont work
all of them
i think this is the issue
def UserScissors():
#Initialising variables
Rounds = 1
Wins = 0
ComputerScore = 0
ties = 0
RockPaperScissors = ["rock", "paper", "scissors"]
ComputerChoice = randint(0,2)
if ComputerChoice == RockPaperScissors[0]:
MessageBox['text'] = f"You Choose Rock, Computer chooses {RockPaperScissors}. You Both Tie!\n Wins:{Wins}, Losses: {ComputerScore}\n, Ties:{ties}"
Rounds += 1
ties += 1
elif ComputerChoice == RockPaperScissors[1]:
MessageBox['text'] = f"You Choose Rock, Computer chooses {RockPaperScissors}. You Lose!\n Wins:{Wins}\n Losses: {ComputerScore}\n, Ties:{ties}"
Rounds += 1
ComputerScore += 1
elif ComputerChoice == RockPaperScissors[2]:
MessageBox['text'] = f"You Choose Rock, Computer chooses {RockPaperScissors}. You Win! Wins:{Wins}\n Losses: {ComputerScore}\n, Ties:{ties}"
Rounds += 1
Wins += 1```
i dont think this is right
okay
because im trying to display messages after every round
i just dont know how i would code for it to do that using tkinter since im really new to it
ok thanks
yea
it doesnt run
messagebox = [tk.Label(RockPaperScissorsWindow, text = f"This is Round {Rounds}", padx = 250, pady = 150, fg = "black")]
this is the issue code
its saying the 'RockPaperScissorsWindow' is not defined
and same with 'Rounds'
the buttons still doesnt work
oh ok
nothing works apparently
when you click on the button, there's nothing that happens
yea
no messages appear
no errors
just the buttons dont work
can we go in a private call so i can show my screen?
ohhh ok
so i use int()
ComputerChoice = random.choice(['rock', 'paper', 'scissors'])
where do i put that code?
ok wait
run this and press
rock button
see if something is sent in the terminal
@slate flame did it send something
nothing is sent to the terminal but nothing works
ok then remove the functions from b1 click
oh ok
so like remove indentation
cause i added a print statement in the function
and it didnt send anything
like you said
i gtg now
i deleted the whole functions and might do it from scratch again
i dont know how to do the functions for the buttons
ok no problem, thanks for the help
and if i will be online i will tell you the explanation
okay
It's coding the buttons to update the messages is the problem and absolutely have no idea, if you do manage to fix it I'll check it asap
can you hear me @primal bison
@hybrid gust eh?
i was helping someone and they left to eat dinner
they said they will be back
silent hi
ok ok
I think I have a network issue
!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.pydis.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.
@slate flame
copy what i have done for scissors to rock and paper
i have tested everything on my local machine so it will work fine
@sand gulch I cant run it rn since I'm still out, but I looked at it on my phone and why is 'window' in the parenthesis of the functions?
line number?
Like in line 58 and 75
i passed it as a argument because it would
give local variable refrenced before assignment
error
window = RockPaperScissorWindow
So you don't have to write 'window = RockPaperScissorsWindow' as it means the same thing?
yes
Oh ok
What if I have a second window for example, then what would I put in the parenthesis?
you change this line
RockButton = tk.Button(frame1, text = "Rock", width = 10, height = 10, padx = 40, pady = 5, command = functools.partial(UserRock, RockPaperScissorsWindow))
PaperButton = tk.Button(frame1, text = "Paper", width = 10, height = 10, padx = 40, pady = 5, command = functools.partial(UserPaper, RockPaperScissorsWindow))
ScissorsButton = tk.Button(frame1, text = "Scissors", width = 10, height = 10, padx = 40, pady = 5, command = functools.partial(UserScissors, RockPaperScissorsWindow))
to this
RockButton = tk.Button(frame1, text = "Rock", width = 10, height = 10, padx = 40, pady = 5, command = functools.partial(UserRock, Window_name))
PaperButton = tk.Button(frame1, text = "Paper", width = 10, height = 10, padx = 40, pady = 5, command = functools.partial(UserPaper, Window_name))
ScissorsButton = tk.Button(frame1, text = "Scissors", width = 10, height = 10, padx = 40, pady = 5, command = functools.partial(UserScissors, Window_name))
if you do this then window will be = Window_name
@slate flame
What's "window_name"?
"What if I have a second window" second window
So can I call that window anything I want?
yea
!e
import functools
def foo(a, b):
print(a+b)
bar = functools.partial(foo, 3) # it intialises a as 3
bar(9) # b =9 a =3
@sand gulch :white_check_mark: Your eval job has completed with return code 0.
12
@slate flame
Ok cool
:incoming_envelope: :ok_hand: applied mute to @burnt halo until 2021-07-09 20:12 (9 minutes and 58 seconds) (reason: burst rule: sent 8 messages in 10s).
hi
how can i access the voicechat
hello all, is anyone familiar with Django ?

anyone here very knowledgeable about "Pyenv" ?
@edgy shoal What would you like to know?
hi, redirect of the main page is not working, urls.py, I followed both these directions, Cant seem to figure out what i'm doing wrong: https://docs.djangoproject.com/en/3.2/ref/contrib/redirects/
here is my github repo, https://github.com/clouddevea/django_bookstore_app if you can figure out how to redirect the main page to either store.html or template.html
THANK YOU!!!
Okay. @edgy shoal , You do not have a proper url conf. See the examples here: https://docs.djangoproject.com/en/3.2/topics/http/urls/#example
If you are completely new to django. I suggest you follow this tutorial: https://docs.djangoproject.com/en/3.2/intro/tutorial01/
I have tried to follow that numerous times: getting errors. also upon adding this info to the app/middleware it tends to break as well INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.redirects',
'store',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
]
it's not a problem with your INSTALLED_APPS or MIDDLEWARE, you need to have url_patterns to intercept the requests after when the pass through the MIDDLEWAREs.
I see, & I also tried to intercept using the urlpatterns path('store/', include('store.urls')), but i guess you cant have 2 paths correct?
\urls.py", line 21
path('admin/', admin.site.urls),
^
SyntaxError: invalid syntax
it's list object, separate the paths by commas and the last on should not have a comma at the end
Yes but that goes back to
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in bookstore.urls, Django tried these URL patterns, in this order:
store/
The empty path didn’t match any of these.
I'm almost wondering if i should restart fresh and go with Django=1.9, I might still face the same issue because of the redirect.
http://127.0.0.1:8000/ is a request to the path "" (an empty string).
Make sure you have path in your urlpatterns like: Path("", some_view)
and it's not a version problem, older versions use different syntax and you might get into more trouble
Your right!, I'm getting some where, My issue i believe was in urls.py < intercepting from store store app folder. I changed it to from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]
now both the endpoints work , http://127.0.0.1:8000/admin and http://127.0.0.1:8000//store
but now http://127.0.0.1:8000/ is giving me :
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in bookstore.urls, Django tried these URL patterns, in this order:
store/
admin/
The empty path didn’t match any of these.
@ember orbit Pop down into this voice channel.
can we show me all of your urls.py files?
p.glob('**/*')```
Corey Schafer
@ember orbit I'll leave you to your watching. 🙂
I just want to mix Python with Arduino
So that i do programming on Python
and i can control some sensors
through that
book_store/urls.py is your main entry for django to your urlpatterns, and when the request is to "" (http://127.0.0.1:8000/) then django does not find that in your book_store/urls.py, it will only look at the store/urls.py when the request is to the path "store/" (http://127.0.0.1:8000/store).
path('admin/', admin.site.urls),
path('', include('store.urls')),
]```
This will find your index view
hey
hi
ovo very nice screenshare @wide aurora 


@silver solar you here?
lol
haha
to help with what
your in code help 1 so i asumed you needed help
well im sorry if i made you mad, you were in the code help vc so i asumed you needed help as that is the purpose of these channels
im banned
@lunar skiff im here
im vc banned
oh um i was just about to leave because the other guy was in here and didnt want heklp
and they didnt "ask" for help
they were in this channel so i thought they needed help
bye
hi
Hey @limber owl!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
If anyone could give me tips on how to condense this and make this neater it would be aperciated.
oh no - that sounds horrible
hi
can anyone help me solve 4 queen using pysat gulucose3 ? thanks very much
#bot-commands
hi i would like to make a quiz program and i also want to display the players total time to solve it
hey can someone help me make a discord bot
blah blah blah
e
Hey @short turret!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Learn how to code a Discord bot using Python and host it for free in the cloud using Repl.it. Along the way, you will learn to use Repl.it's built-in database and create a Discord bot that uses webhooks to connect with GitHub.
Need help with this tutorial? You can ask questions here: https://forum.freecodecamp.org/
This course was developed by...
.
.
.

@elfin blade Thanks for you help with pymongo, sorry i didn't see the message til now.
ok ill stop sry
i ll just talk here dont want to annoy you guys
ok
if i make the text to speech
i will be back
will stop
@slow plank Please don't try to ping @everyone or @here. Your message has been removed. If you believe this was a mistake, please let staff know!
vscode vs sublime text, which is better?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
Rigidbody rb;
int numberOfJumps;
bool isGrounded;
public LayerMask groundMask;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
var horiz = Input.GetAxis("Horizontal");
var vert = Input.GetAxis("Vertical");
transform.Translate(new Vector3(horiz, 0, vert) * (10f * Time.deltaTime));
if (Input.GetKeyDown(KeyCode.F) && numberOfJumps < 2)
{
rb.velocity = Vector3.up * 5f;
numberOfJumps++;
}
RaycastHit hitpoint;
if (Physics.Raycast(transform.position, Vector3.down, out hitpoint, 0.5f, groundMask))
{
isGrounded = true;
}
else
{
isGrounded = false;
}
if (isGrounded)
{
numberOfJumps = 0;
}
}
}
!stream @shadow mauve
✅ @shadow mauve can now stream until <t:1628534725:f>.
void Update()
{
//Get input from controls
float horizontal = Input.GetAxisRaw("Horizontal");
float vertical = Input.GetAxisRaw("Vertical");
float speed = 5f;
// Gravity
if (_characterController.isGrounded)
{
_currentJumps = 0;
_verticalVelocity = -gravity * Time.deltaTime;
}
else
{
_verticalVelocity -= gravity * Time.deltaTime;
}
// Jump
if (Input.GetKeyDown(KeyCode.Space) && (_currentJumps < amountOfJumps))
{
_currentJumps++;
_verticalVelocity = jumpForce;
}
// flat movement - left right forward backwards
var moveVector = (transform.right * (horizontal * speed) + transform.forward * (vertical * speed));
// Add vertical movement
moveVector.y = _verticalVelocity;
// Move player
_characterController.Move(moveVector * Time.deltaTime);
}
[Range(0, 20)] public float gravity = 14f;
private float _verticalVelocity;
[Header("Jumping")]
[Range(0,50)] public float jumpForce = 10f;
can someone teach me on how to use the queue functions in python
i want to learn it for my music player but im stuck
okay thanks
Hello @worldly reef
I don't have a microphone sorry!
I can hear you though.
Oh nice
Nice, Nedbat is kind of a legend here 😄
Erm, sure. I typically don't add people unless I know them personally though sorry.
You can ping me if you like 👍 . DMs are off as I'm a mod.
Ah right, like a matchmaking service 😄
Although there may be a bit of an imbalance of potential mentors and mentees.
Yeah, I know what you mean!
Ah right
👋
@primal bison imy
@primal bison hlo
hi i have a q
what is code for save something
like
when i press a my clipboard save hi im parsisor and when i press ctrl and v past that
pls help
Hello
Hola
hello
hii
ValueError: in user code: /usr/local/lib/python3.7/dist-packages/keras/engine/training.py:830 train_function * return step_function(self, iterator) /usr/local/lib/python3.7/dist-packages/keras/engine/training.py:813 run_step * outputs = model.train_step(data) /usr/local/lib/python3.7/dist-packages/keras/engine/training.py:771 train_step * loss = self.compiled_loss( /usr/local/lib/python3.7/dist-packages/keras/engine/compile_utils.py:201 __call__ * loss_value = loss_obj(y_t, y_p, sample_weight=sw) /usr/local/lib/python3.7/dist-packages/keras/losses.py:142 __call__ * losses = call_fn(y_true, y_pred) /usr/local/lib/python3.7/dist-packages/keras/losses.py:246 call * return ag_fn(y_true, y_pred, **self._fn_kwargs) /usr/local/lib/python3.7/dist-packages/tensorflow/python/util/dispatch.py:206 wrapper ** return target(*args, **kwargs) /usr/local/lib/python3.7/dist-packages/keras/losses.py:1631 categorical_crossentropy y_true, y_pred, from_logits=from_logits) /usr/local/lib/python3.7/dist-packages/tensorflow/python/util/dispatch.py:206 wrapper return target(*args, **kwargs) /usr/local/lib/python3.7/dist-packages/keras/backend.py:4827 categorical_crossentropy target.shape.assert_is_compatible_with(output.shape) /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/tensor_shape.py:1161 assert_is_compatible_with raise ValueError("Shapes %s and %s are incompatible" % (self, other)) ValueError: Shapes (None, 6) and (None, 4) are incompatible site:stackoverflow.com
I am getting such an error in colab, what is the reason? pls help 🙂
👀
I don't use a terminal as well.
Does anyone know bash or a discord that could get me help with a bash script?
why
What do you want to know exactly
j
@primal bison whys that
hey
Anyone who knws c programming?
hi can someone help me
Can someone help me create a histogram via Pandas and seaborn
cool
@drifting spruce we have had a pretty long convo about this iirc 😄 haha
so it is ordered in hashmap according to the hashmap in ascending order?
yeah
ohhh since hashes for objects arent constant
ahh right
so if i start interpreter again i might get different order for {"chara", "fallin", "eivl"}
@drifting spruce drag me please in voicechat
@rare garden this
ahh okay seems right
yeah its -5 to 256
to this channel?
yes
so uhm hash map of set it pretty similar to what you showed right?
and everytime we add an object it recreates it?
can you tell how hashmaps are useful in coding interviews 👀 , like i have heard a lot , are they used for code optimizations
yea
yeah
👌
bubble sort i see
O(n^2)
i see
Hash tables almost seem too good to be true.
yeah
also sorry to drag to a previous topic but
is {1,2,3,5,4} a possible pseudo order / hashmap ( using the 2/3rd thing)
ohhh okay
ah okay
also i would like to know/read a bit more about hashmaps
they seem quite interesting
ah lol but i like to do it more for the fun of it
could u link something to read over it 😅
sure
that would be sooo cool man
!e
print([x for x in list(range(6)) if x % 2 == 0])
@hoary cloud :white_check_mark: Your eval job has completed with return code 0.
[0, 2, 4]
sorry ^
ill try to find out myself too.. thanks!
also about that question
oreo asked
what would be the most optimal way to sort... like the algorithm
thats what hashmap is for
i have one but it seems like somewhere O(n) and O(n^2)
filename=pass_gen.py
from string import ascii_lowercase,ascii_uppercase,punctuation
import random
length=int(input("tell me the lenght of password "))
def password_creator(lg):
copy=lg
numbers=[i for i in range(10)]
chars=[ascii_lowercase,ascii_uppercase,punctuation,numbers]
password=''
while copy>0:
random.shuffle(chars)
password+=str(random.choice(random.choice(chars)))
copy-=1
return password
from pass_gen import password_creator,length
length
def pass_check(lg):
pct,upper,lower,number,symbol=0,0,0,0,0
a=password_creator(lg)
for i in a:
if i.islower():
pct+=1
lower+=1
elif i.isupper():
pct+=1
upper+=1
elif i.isdigit():
pct+=1
number+=1
else:
pct+=1
symbol+=1
if lower<1:
print('password require at least 1 lowercase char')
print('generating new password...................')
pass_check(lg)
if upper<1:
print('password require at least 1 upercase char')
print('generating new password.................')
pass_check(lg)
if number<1:
print('password require at least 1 number')
print('generating new password.....................')
pass_check(lg)
if symbol<1:
print('password require at least 1 special symbol')
print('generating new password.............')
pass_check(lg)
print(f'Your newly created password is {a}')
pass_check(length)
ascii_digits
you might like to try regex for this
i might even wanna try to use the match cases for this.. seems lovely way to try it
loop will not break tho @drifting spruce 👀
@drifting spruce so just curious continue vs pass... cause we were just taught that it skips the execution.. but well my mind got baffled here 👀
ah okay
ahh okayy yeah
finally got it cleared man thanks a lot
also if you might have a lil time 👀
ahh lol nice a happy weekend
make a rep?
rep means a reputation.. a slang i read somewhere idr 👀
ohh so it chooses different algorithms for different data structures to sort
that be cool
really nice way to go lol
yeah similar
i think that its targeted at me xD
anyway yeah i need to go to bed.. its my bed time!
it was a real fun session @drifting spruce if you would have some free time.. i would really love have some guidance on python and life too 😄 ✌️
good night @rare garden
good night eivl
Leste den i sommer, fantastisk bok! Ble et par naps mellom kapitlene for å si det sånn 😛 Utrolig interessant lesning da! Og nyttefull
cannot unmute
hu
❌
can someone help me with prime numbers from a list
list=[]
n=int(input())
for i in range(0,n):
ele=int(input())
list.append(ele)
print(list)
x=0
for i in range(2, list[x]):
if (list[x]%i)!=0 and i==list[x]:
print(list[x])
x=x+1
else:
break
x=x+1
didn t print anything
I will talk here if it doesn't bother you
I see
I will have to go on deafen as mom is sleeping next to md
Me
@drifting spruce
And as a stupid person as I am I forgot my head phones
no worries
Alright, I will continue to watch the stream
you can also watch at twich. probablty houndres of people streaming this came
Ye, I prefer you
but im not going to stream more, just to show you a few moments of the game
I understand
ill stream more this weekend if you want 😄
Even those were good
Sure
I will try to see more game plays of it
its a great game, loads of fun
i just got a house in the game, and ill probably have to spend houndreds of hours decorating it 😄
When you see this, just wanna tell you have a nice day and a great time spending, you an amazing person!
{
"tab-size": 4,
"translate_tabs_to_spaces": true,
"ensure_newline_at_eof_on_save": true,
"rulers": [72, 79],
"word_wrap": true,
"wrap_width": 80,
}
{
"ignored_packages":
[
"Vintage",
],
"font_size": 19,
"rulers": [72, 79],
"caret_style": "solid",
"wide_caret": true,
"highlight_line": true,
"draw_white_space": "all",
"indent_guide_options": ["draw_active"],
"line_padding_top": 0,
"line_padding_bottom": 0,
"fold_buttons": false,
"scroll_past_end": true,
"shift_tab_unindent": true,
"tab-size": 4,
"translate_tabs_to_spaces": true,
"ensure_newline_at_eof_on_save": true,
/*"rulers": [72, 79],*/
"word_wrap": true,
"wrap_width": 80,
"theme": "auto",
"color_scheme": "Packages/Theme - Gravity/Monokai Gravity.sublime-color-scheme",
}
"font_face": "Ubuntu Mono Nerd Font Complete Mono Windows Compatible",
"font_options":
[
"directwrite",
"subpixel_antialiasing",
"no_bold",
"no_italic"
//"no_antialias"
],
"file_exclude_patterns": [
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db",
"*.sublime-workspace"
],
"folder_exclude_patterns":[
".svn",
".git",
".hg",
"CVS",
"__pycache__"
],
When is the get_user function (implemented in django.contrib.auth) called? I am using a custom authentication backend and I keep getting anon users for request.user. I followed this post but it didn't help me: https://stackoverflow.com/a/5377282/11573842
class EmailCustomAuthentication(authentication.BasicAuthentication):
def authenticate(self, request):
data = json.loads(request.body)
email = data.get('email')
password = data.get('password')
if not email:
raise exceptions.AuthenticationFailed('No email provided.')
if not password:
raise exceptions.AuthenticationFailed('No password provided.')
try:
user = User.objects.get(email=email)
except User.DoesNotExist:
raise exceptions.AuthenticationFailed(
"Incorrect email provided. No such user exists for this email.")
credentials = {'username': email, 'password': password}
if not user.is_active:
raise exceptions.AuthenticationFailed(
'The user account has not been active. Check your mailbox for activation mail & click on the activation url to activate your account.')
user = authenticate(**credentials)
if not user:
raise exceptions.AuthenticationFailed(
"Incorrect password provided.")
request.session['user_id'] = user.pk
return (user, None)
# https://stackoverflow.com/a/5377282/11573842
def get_user(request):
print('get_user called!')
from django.contrib.auth.models import AnonymousUser
try:
user_id = request.session[SESSION_KEY]
backend_path = request.session[BACKEND_SESSION_KEY]
backend = load_backend(backend_path)
user = backend.get_user(user_id) or AnonymousUser()
print(user, user_id)
except KeyError:
user = AnonymousUser()
return user
I am using session authentication btw... Not JWT. I never get get_user called! when I send a request to the backend
The doc string says
Return the user model instance associated with the given request session. If no user is retrieved, return an instance of `AnonymousUser`.
So do I need to clear the session table in the db to get this to work?
I tried this too:
class MessageViewSet(viewsets.ModelViewSet):
serializer_class = MessageSerializer
permission_classes = (permissions.AllowAny,)
def get_queryset(self):
from django.contrib.auth import get_user
user = get_user(self.request)
print(user)
queryset = Message.objects.all()
chat_id = self.request.query_params.get('chat_id')
if chat_id:
queryset = Message.objects.filter(chat_room_id=chat_id)
return queryset
but I still get AnonymousUser in the terminal even though I am sending my requests from postman, which does have the session cookie...
Oops the channel is full
{
"target": "run_existing_window_command",
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
I am in :)
var canvas;
var backgroundImage, bgImg, car1_img, car2_img, track;
var database, gameState;
var form, player, playerCount;
var allPlayers, car1, car2;
var cars = [];
function preload() {
backgroundImage = loadImage("assets/background.png");
car1_img = loadImage("assets/car1.png");
car2_img = loadImage("assets/car2.png");
track = loadImage("assets/track.jpg");
}
function setup() {
canvas = createCanvas(windowWidth, windowHeight);
database = firebase.database();
game = new Game();
game.getState();
game.start();
}
function draw() {
background(backgroundImage);
if (playerCount === 2) {
game.update(1);
}
if (gameState === 1) {
game.play();
}
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
@thorn grove are you a secret agent and can i join your agentcie pls
@green ruin This is the chat channel btw
I'll hop back .... I'm likely not going to be of any help anymore
Jetzt verfügbar
LEGO® Powered Up (88009)
LEGO® Powered Up 88009 Hub
hi
im having trouble writing a language
help?
@shut marlin ?
@astral sable
I cant stream
yes
stream pycharm
write programming language in python
how do i stream
you cant steam here
then?
to stream
what are you trying to do?
Hey @tall badge!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
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.pydis.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.
how do i do it
paste int this website
oh the admins will give you the role
rip
you need to be trusted here
are you trying to create your own langugae?
yes
so what can I add?
what can i add?
yes
what kwds or cmds
ok
ill try
ok
sry
trying to save space
brain||fuck|| sharp
ok
ty
hi
@client.command(aliases=['b'])
@commands.has_permissions(ban_members = True)
async def ban(ctx,member :discord.Member,*,reason= "No reason provided"):
await member.send("you have been banned from Aurora | Astronomy • Social • Icons, Because:" +reason)
await member.ban(reason = reason)
this is what i have to ban members but i cans figure out how to unban members
hi guys
its something like check discord ban list for the given argument (the banned member youre trying to unban) and remove it from there. also instead of hardcoding the server name i recommend using ctx.guild.name just so that it can work on other servers too
Ahhh i see. Thank you
I get this error when trying to use dictionary.get for indices in sql
@jovial arrow When you pull an element from hashtags, it's returning a string. Strings don't have a .get method
is there another method to call 'indices' ?
it's wrapped like this
i need to call (211) and (234) separately
from json
What're you running the regex on? It looks like a JSON
yes JSON
It'd be wiser if you use the json library and load it that way. That'll give you a lot more control
https://docs.python.org/3/library/json.html So depending on how you're getting the JSON, you'll either .load() it from a file or you'll .loads() it from a string
Happy to help
What would u guys suggest? Cause currently I'm using pycharm code but should I buy the all products pack because I want to learn C++ or should I just use Visual Studio Code?
Also what advantages do I have using Jetbrains IDE's?
@inland basin are you looking for code help?
Hi!
Its je - ku @cunning maple
Naaah men
Im not allowed to speak daw
ohh i see
Im new here
yuuuh HAHAHHA
can we chat?
AHHAHAHAHAHA
okay, Whats up man?
Hi!! @novel shard
HAHAHAHA
OHhh!!
Ohhh!!!
I played CSGO
@novel shard
@gritty grove good to know
!voiceverify
!voiceverify
!voiceverify
Can anyone help me out with pytest fixtures and alembic?
Im trying to set up a test database and apply alembic migrations on it while testing
you need help yes? @unreal gale
Can anyone help me with my tkinter music player in vc? i cant get it to work properly
What kind of function this got to be?
Damn I think just sent this too in voice 0
Pardon, but I still don't know how though
Im having a hard time understanding how to retrieve dictionary values to print or return. I've tried a few different methods akin to print(dict_name["Key"]) but Im stumped
:/
I can't connect my github desktop with web through authorization. Anyone please help
What steps have you tried?
This might be a better fit for another channel btw.
fine
hello, can you help me: The code has bugs. Can you find them, correct them and pass the tests?
HELP BUGS
def fix_me(my_list):
if len(my_list) % 2: # imperative code
new_list = []
for item in my_list:
for element in item:
new_list = new_list.append(element)
else: # functional code
new_list = [element for element in my_list for element in item]
return new_list.sort(reverse=True, key=lambda x: -x)
Arguments: [[3, 4], [2, 6]]
Departure:
Error Message: free variable 'item' referenced before assignment in enclosing scope, Error Type: NameError, Stack Trace: ['File "/var/task/879430_9203_fix_me.py", line 15, in lambda_handler \ n return fix_me ([[3 , 4], [2, 6]]) \ n ',' File "/var/task/879430_9203_fix_me.py", line 11, in fix_me \ n new_list = [element for element in my_list for element in item] \ n ',' File "/var/task/879430_9203_fix_me.py", line 11, in <listcomp> \ n new_list = [element for element in my_list for element in item] \ n ']
Expected output:
[6, 4, 3, 2]
!d os.getcwd
os.getcwd()```
Return a string representing the current working directory.
!d print
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)```
Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments.
All non-keyword arguments are converted to strings like [`str()`](https://docs.python.org/3.10/library/stdtypes.html#str "str") does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be `None`, which means to use the default values. If no *objects* are given, [`print()`](https://docs.python.org/3.10/library/functions.html#print "print") will just write *end*.
The *file* argument must be an object with a `write(string)` method; if it is not present or `None`, [`sys.stdout`](https://docs.python.org/3.10/library/sys.html#sys.stdout "sys.stdout") will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3.10/library/functions.html#print "print") cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
!d print
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)```
Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments.
All non-keyword arguments are converted to strings like [`str()`](https://docs.python.org/3.10/library/stdtypes.html#str "str") does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be `None`, which means to use the default values. If no *objects* are given, [`print()`](https://docs.python.org/3.10/library/functions.html#print "print") will just write *end*.
The *file* argument must be an object with a `write(string)` method; if it is not present or `None`, [`sys.stdout`](https://docs.python.org/3.10/library/sys.html#sys.stdout "sys.stdout") will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3.10/library/functions.html#print "print") cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
hi everyone , can someone tell me , how can i split this with keep wihtespaces
my
str
be
like
And i want split it like this -> ['my','str','\n','be','like']

Hlo
hlo
How do I download the module Bigfloat? I tryed but it gave a long error. https://paste.pythondiscord.com/ofikajitob.sql
Heyya!
There's no easy way to learn any language!
But there's a way, you can do stuff like hands on practice!
Make something in python, work on different frameworks as flask/django web app
definitely help you more! : )
In the given code, the program will check if the given user_num is greater than or equal to 2, if it is then it will print "Num is not two" but in the case where the given input is less than 2, for example: user_num is 1 then it will check if it is greater than 2 or equal to 2 which it is not, So it will print "Num is equal to two" which is incorrect since 1 is not equal to 2. And also in the case where user_num is 2 itself which is equal to 2 it will print the same, thus making the program incorrect.
Correct Code:
user_num = int(input())
if user_num != 2:
print("Num is not two")
else:
print("Num is equal to two")
PS: sorry for the late answer
watch YT tutorial , get a hang on some websites and practice Python(HackerRank Leetcode Hackerearth Geeksforgeek) and practice daily ...
Do you know a good source for python?
Mean to
To learn python?
!resources @karmic jackal We've got a whole bunch of resources on our site. For just starting, we typically recommend "Automate the Boring Stuff" and "A Byte of Python"
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
you should use != condition while checking
Yes
u can learn from
1. YouTube
2. Udemy
3. Freecodecham
4. Cs50 edx
5. W3school
6. Geeksforgeeks
7. automatetheboringstuffwithpython
8. codewar
automatetheboringstuffwithpython is my fav book
any reccomendations about moveis
hii
i need help
plz
plz
plz
help me
help!
@buoyant kestrel
plz help me
With?
can u come on another vc channel plz
i dont have the permission to speak on this vc
@buoyant kestrel
You don't in the others either. What do you need
i am doing a project of li-fi and i need help in putting the comaands in my aurdiuno and i dont know how to do it
no i dont
plz
i need it tommorow
i am sry
and its night here
dude can u help me plz!?
is there anyone u know?
who knows ardiuno who said that?
@agile portal hii
can u help me
in ardiuno
ok
do u know anybody with info of that
Erm, ask your question and someone might know.
ok
i did but no is responding
i need it tomorrow itself
i am doing a project of li-fi and i need help in putting the comaands in my aurdiuno and i dont know how to do it
phone = input ("phone:")
numbers= {
"1": "one",
"2": "two",
"3":"three",
"4": "four"
}
output = ""
for ch in phone:
output +=numbers.get(ch)
print (output)
Thanks
hello
I dont understand import code in python
someone pls help
@wintry kernel If you need some help you can ask me. i will try to help.
i made
Ooo, that's pretty cool
No , ITS REALLY COOL
hi there @buoyant kestrel
It's really awesome
wait why cant i talk in voice chat
i need help
hi
i m creating a discord i need help if u want to help me dm me i will be in call
pls
is this place for getting help via voice?
can anyone help me with my tkinter music player? im stuck and im not very experienced
anyone knows how to install pandas in a docker using python alpine image?
cool!
pip install pandas doesn't work?
no... because of the image. Alpine doesn't have some C stuffs that numpy needs to install...
I want to build a chatbot using python .. can someone guide me please
thank you
For this problem: it's better don't try to use alpine image with pandas xD
https://pythonspeed.com/articles/alpine-docker-python/
When you’re choosing a base image for your Docker image, Alpine Linux is often recommended. Using Alpine, you’re told, will make your images smaller and speed up your builds. And if you’re using Go that’s reasonable advice. But if you’re using Python, Alpine Linux will quite often: Make your builds much slower. Make your images bigger. Waste you...
Hey @primal bison!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
@agile portal I have a quick question
can I tell u speaking
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
however is c related
c language
but it's something like tooling
i try to explain
i installed ming and visual studio code on pc. Now I would like to compile from visual studio but when I press run with debug I open a json setting on which I don't know what to do
we can goto a private call if you want
ok
will be easier to see with screenshare
hello, i need help with a simple pythone turtle exercise. i need to make a star, any help?
Follow me https://github.com/MaximeGuinard
i need help
ngrok secure introspectable tunnels to localhost webhook development tool and debugging tool
`help
How do I remove duplicates from a list like [3, 7, 10, 8, 18, 3, 10, 27, 7, 8] without using the not in [] or set or dictionary?
any1 know anything about automation with selenium?v
arr=[3, 7, 10, 8, 18, 3, 10, 27, 7, 8]
ar=[]
for num in arr:
i=num in ar
if(not i):
ar.append(num)
arr=ar
print(arr)
@primal bison is this what you are looking for?
No, I am not allowed to use list comprehension. I need to do this without using that or set or dict
hey @primal bison
i don't know if this helps, i didn't really look into corner cases
arr=[3, 7, 10, 8, 18, 3, 10, 27, 7, 8]
i=0
while i<len(arr)-1:
while arr[i] in arr[i+1:]:
index=arr[i+1:].index(arr[i])
del arr[index+i+1]
i+=1
print(arr)
I know a thing or two, I made a script to automate my nursing documentation. What can I help with?
I have an error called selenium exception,I really need a way to fix it,and btw I'm working on a script to automate daily check website
Invalid selector
Can I see the source code?
hello
i need help
i'm trying to make a program that allows you to convert a relative integer using the add in method to 2
import time
for i in range(100):
time.sleep(1)
print(f"■■■■ {i} ■■■■")
At 30-39
The square block only prints one, is there any reason for this ?
I don't understand why that happens.
!e
for i in range(100):
print(f"---- {i} ----")
@primal bison :white_check_mark: Your eval job has completed with return code 0.
001 | ---- 0 ----
002 | ---- 1 ----
003 | ---- 2 ----
004 | ---- 3 ----
005 | ---- 4 ----
006 | ---- 5 ----
007 | ---- 6 ----
008 | ---- 7 ----
009 | ---- 8 ----
010 | ---- 9 ----
011 | ---- 10 ----
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/amakipesuf.txt?noredirect
Why does that happen? @owengitt
I cannot understand why that happens, @cerulean barn
Please try running the code to see if you see the same problem
Or could it be from my compiler ?
Hi, if anyone can help me I am stuck on a homework assignment and my prof is really particular about spaces and parenthesis
result_list = []
def dining_hall_menus(ovt_menu, pines_menu):
for x in ovt_menu:
if x not in pines_menu:
difference_1 = set(ovt_menu).difference(set(pines_menu))
for y in pines_menu:
if y not in ovt_menu:
difference_2 = set(pines_menu).difference(set(ovt_menu))
result_list = list(difference_2.union(difference_1))
print(result_list)
this is the code I tried to do, but it was wrong
@primal bison We don't allow recruitment for paid jobs. We're more than happy to assist people when they get stuck, but we're not a jobs board
#python 3.7.1
##Object oriented python
class bank:
value=1000
star=50*"*"
def addMoney(self):##Withdraw money function
amount=input("how much do you want to deposite?")
amount=int(amount)
self.value+=amount
print(f"""
{self.star}
New deposited on your account
Amount: ${amount}
Your new account balance is ${self.value}
{self.star}
""")
def removeMoney(self):#Remove money function
amount =input ("how much do you want to withdraw? ")
amount =int(amount )
if amount>self.value:
print(f"sorry, You don't have up to ${amount} in your account ")
else:
self.value+=amount
print(f"""
{self.star}
You just withdraw ${amount} from your account .
Your new account balance is {self.value}
{self.star}
""")
def accountBalance(self):##show account balance function
print(f"your account balance is: ${self.value}")
transact=bank()
print( f"your account balance is ${transact. value}")
print(f"""
{transact.star}
Welcome to WORLD BANK 🏦
What do you want to do?
Type 1 to Deposit
Type 2 to Withdraw
{transact.star}
""")
n=input("")
a=0
while a==0:
n=int(n)
if n==1:
transact.addMoney()
elif n==2:
transact.removeMoney()
elif n==3:
a+=1
else:
print("invalid input, try again")
n=input(f"""
{transact.star}
is there anything else you want to do?
1 deposit
2 withdraw
3 leave the bank
{transact.star}
""")
if n==3:
a+=1
print("have a nice day dear")
print ("give me a star 🌟")
print("""Learn python and become a pro in less than
2 month.
copy the link and paste in your browser :
https://getmimo.com/invite/u02xr5
""")
#i am not sure why the leave bank has to run two times
Why does the leave bank run two times?
That is kind of strange though...
Okay, I figured it out
I used the
break``` statement instead of the counter
Hello, tell me how to add a background for a window written in the wxpython library? here is the code:
import wx
class MyFrame(wx.Frame):
def init(self, parent):
supper().init(parent, size=(600, 300))
panel = wx.Panel(self)
grid_bag = wx.GridBagSize(10, 10)
text = wx.StaticText(panel, label="Exempla")
scroll_bar = wx.Gauge(panel, wx.ID_ANY, 100, wx.Point(0, 100), wx.Size(-1, 10), wx.GA_HORIZONTAL)
grid_box.Add(text, pos=(0, 0), flag=wx.TOP, border=10)
grid_box.Add(scroll_bar, pos=(2, 0), flag=wx.EXPAND | wx.BOTTOM, border=50)
grid_box.AddGrowableCol(0)
grid_box.AddGrowableRow(1)
panel.SetSizer(grid_box)
app = wx.App()
frame = MyFrame(None)
frame.Show()
app.MainLoop()
https://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/
how is the time complexity of this is O(n!*n)
i feel it shud be O(N!)
can anyone explaim
are any helpers available @scenic tulips
pyautogui" is not accessedPylance
pip install pyautogui
I installed it
that just means you imported it but didn't use
nya
hii
Hello, does anyone here speak serbian?
where do i have to start to have a good base of Python and my objectif is to make a web site that can be hook to API for pushing method that give location and i need Python to resolve my client problem .Where can i go to find a good learning python web base for free.
Hi everyone, excuse me for this ask but i´m really struggled in this issue
work on a Glue Job ETL with pyspark
I need to loop a column that has xml texts, very veryyy long texts, to struct them un another dataframe
i used collect to encapsule the rows and iterate, but this action took more than 4 min to execute just for one register
other option was to convert to pandas and iterate but, the dataset has 500k registers and it causes problems. Can someone has any advice for this problem?
obs. the library to struct xml texts is xmltree
elon musk
Hey @primal bison!
It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
press the trash can on the terminal pane thing, also make sure it saved the file (try opening it in Notepad to see if it did)
@lean hull that sounds familier
I have a question how do you write a code where the user puts a number and python takes that number and shuffles it with other number
Anyone have a thought on how to move a file to s3 on the closing/cleanup of a class?
Hi anyone know why my dcf function is not printing anything, `import pandas as pd
import matplotlib.pyplot as plt#imported pyplot to plot graphs
import datetime as dt#date time to read first column of csv file
import numpy as np
from datetime import datetime
df = pd.read_csv('FREY.csv')
df2 = pd.read_csv('SLI.csv')
pd.to_datetime(df["Date"]).dt.strftime("%d%m%Y")#reads the date time objects
pd.to_datetime(df2["Date"]).dt.strftime("%d%m%Y")
df['Date'] = pd.to_datetime(df['Date'])
df2['Date'] = pd.to_datetime(df2['Date'])
x1=(df['Date'] - dt.datetime(1970,1,1)).dt.total_seconds()/86400
x2=(df2['Date'] - dt.datetime(1970,1,1)).dt.total_seconds()/86400 def dcf(x1, x2):
x1_n = len(x1)
x2_n = len(x2)
x1_mean = np.mean(x1)
x2_mean = np.mean(x2)
x1_stdv = np.std(x1)
x2_stdv = np.std(x2)
dcf = np.zeros((x1_n, x2_n))
for i, x1 in enumerate(x1):
for j, x2 in enumerate(x2):
#x2_val=[t+x2[j]]
d = (x1 - x1_mean) * (x2 - x2_mean) / (x1_stdv*x2_stdv)
dcf[i, j] = d
return dcf
print(dcf)`
@brazen crown if you use that language in our server you will be banned
damn
huh?
Write a function:
class Solution { public int solution(int[] A); }
that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
Given A = [1, 2, 3], the function should return 4.
Given A = [−1, −3], the function should return 1.
Write an efficient algorithm for the following assumptions:
N is an integer within the range [1..100,000];
each element of array A is an integer within the range [−1,000,000..1,000,000].
// import java.util.*;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public int solution(int[] A) {
// write your code in Java SE 8
}
}
what is the solution?
!ban 642455022852112384 Racist language is not allowed
:x: User is already permanently banned (#53496).
Ninjas
🥷 
@buoyant kestrel check this https://youtu.be/nc-6G9R2APE
We can now Install Windows 11 or Windows 10 on the Raspberry Pi 4 without using a PC! We can do it all from the Raspberry Pi running a Debian-based OS like Raspberry Pi OS thanks to the all-new WoR Flasher from Botspot This will Word with a Micro SD Card, USB Drive M.2 SSD or a 2.5" SSD and in this video, I show you how to get this up and runnin...
yo this my first time using discord.
Idfk python I'm just here to shitpost






