135201
You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython
chose an aspect of the language.
read up - write code - run tests - fix issues - understand the code - rinse and repeat
Code isn’t given like candy here . Write your own and if youre stuck, then ask for help here.
Читать полностью…
I have multiple ip & port in excel & want to telnet multiple ip & port
How can I do it
Not very helpful. Maybe a bit, considering the context.
Читать полностью…
Why this happens
- Something defines its own init(self, age: int)
- Data is a @dataclass and does not declare age as a field
- Dataclasses generate their own init and do NOT automatically include parameters from the parent init
If age is part of Data, declare it in the dataclass and let it handle everything.
from dataclass import dataclassЧитать полностью…
@dataclass
class Something:
age: int
@dataclass
class Data(Something):
name: str
d = Data(name="John", age=30)
print(d)
In [20]: im=Image.open("/home/user/Imágenes/mantra-machine-heliosphere.jpg")
In [26]: im.size
Out[26]: (1200, 1200)
Читать полностью…
yeah Image.ImageFile.ImageFile should has the size property
Читать полностью…
So... having this, yeah, i have questions, doesn't ImageFile.ImageFile have the size?
Читать полностью…
Check out @PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.
Читать полностью…
No, because what you described is too broad. What have you tried where are you stuck?
Читать полностью…
Check out @PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.
Читать полностью…
Hello , what editors do you use in Python programming, which one is the best
Читать полностью…
This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.
Читать полностью…
Please don't ask meta questions like:
- Any user of $x here?
- Anyone used technology $y?
- Hello, I need help on $z!
Just ask about your problem directly! If you don't know what to ask, please read: http://catb.org/~esr/faqs/smart-questions.html
Perhaps depends on how it's being used
from dataclasses import dataclassЧитать полностью…
class Something:
def __init__(self, age: int):
self.age = age
@dataclass
class Data(Something):
name: str
d = Data(name="John", age=30)
print(d)
# Traceback (most recent call last):
# File "/home/user/test.py", line 14, in <module>
# d = Data(name="John", age=30)
# ^^^^^^^^^^^^^^^^^^^^^^^^^
# TypeError: Data.__init__() got an unexpected keyword argument 'age'
i made the dataclass for organization, is not all the code, there are some other parameters inside that dataclass
Читать полностью…
So why do you need a dataclass for something that is already supported on the library?
Читать полностью…
File <string>:4Читать полностью…
product_size: tuple[int, int]
^
IndentationError: unindent does not match any outer indentation level