Str error python

Every programming language has certain keywords with specific, prebuilt functionalities and meanings. Naming your variables or functions after these keywords is most likely going to raise an error. We'll discuss one of these cases in this article — the TypeError: 'str' object is not callable error in Python. The TypeError: 'str' object is not callable error mainly occurs when: * You pass a variable named str as a parameter to the str() function. * When you call a string like a function.

Typeerror: str object is not callable – How to Fix in Python

Every programming language has certain keywords with specific, prebuilt functionalities and meanings.

Naming your variables or functions after these keywords is most likely going to raise an error. We’ll discuss one of these cases in this article — the TypeError: 'str' object is not callable error in Python.

The TypeError: 'str' object is not callable error mainly occurs when:

  • You pass a variable named str as a parameter to the str() function.
  • When you call a string like a function.

In the sections that follow, you’ll see code examples that raise the TypeError: 'str' object is not callable error, and how to fix them.

Example #1 – What Will Happen If You Use str as a Variable Name in Python?

In this section, you’ll see what happens when you used a variable named str as the str() function’s parameter.

The str() function is used to convert certain values into a string. str(10) converts the integer 10 to a string.

Here’s the first code example:

str = "Hello World"

print(str(str))
# TypeError: 'str' object is not callable

In the code above, we created a variable str with a value of «Hello World». We passed the variable as a parameter to the str() function.

The result was the TypeError: 'str' object is not callable error. This is happening because we are using a variable name that the compiler already recognizes as something different.

To fix this, you can rename the variable to a something that isn’t a predefined keyword in Python.

Here’s a quick fix to the problem:

greetings = "Hello World"

print(str(greetings))
# Hello World

Now the code works perfectly.

Example #2 – What Will Happen If You Call a String Like a Function in Python?

Calling a string as though it is a function in Python will raise the TypeError: 'str' object is not callable error.

Here’s an example:

greetings = "Hello World"

print(greetings())
# TypeError: 'str' object is not callable

In the example above, we created a variable called greetings.

While printing it to the console, we used parentheses after the variable name – a syntax used when invoking a function: greetings().

This resulted in the compiler throwing the TypeError: 'str' object is not callable error.

You can easily fix this by removing the parentheses.

This is the same for every other data type that isn’t a function. Attaching parentheses to them will raise the same error.

So our code should work like this:

greetings = "Hello World"

print(greetings)
# Hello World

Summary

In this article, we talked about the TypeError: 'str' object is not callable error in Python.

We talked about why this error might occur and how to fix it.

To avoid getting this error in your code, you should:

  • Avoid naming your variables after keywords built into Python.
  • Never call your variables like functions by adding parentheses to them.

Happy coding!



Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

So you have encountered the exception, i.e., TypeError: ‘str’ object is not callable. In the following article, we will discuss type errors, how they occur and how to resolve them.

What is a TypeError?

The TypeError occurs when you try to operate on a value that does not support that operation. The most common reason for an error in a Python program is when a certain statement is not in accordance with the prescribed usage. The Python interpreter immediately raises a type error when it encounters an error, usually along with an explanation. For instance:

val1 = 100
val2 = "random text"

print(val1/val2)

When you try to divide an integer value with a string, it results in a type error.

TypeError Example

TypeError Example

Like any TypeError, the ‘str’ object is not callable occurs when we try to perform an operation not supported by that datatype. In our case, here it’s the ‘string’ datatype. Let’s see some examples of where it can occur and how we can resolve them.

Example 1:

str = "This is text number 1"
string2 = "This is text number 2"

print(str(str) + string2)

In the code above, we have deliberately defined the first variable name with a reserved keyword called str. Moreover, the second variable, string2, follows Python’s naming conventions. In the print statement, we use the str method on the str variable, this confuses the Python’s interpreter, and it raises a type error, as shown in the image below.

The output of example 1

The output of example 1

Example 2:

string1 = "This is text number 1"
string2 = "This is text number 2"

print("%s %s" (string1,string2))

Contrary to example 1, where we had defined a variable with the str reserved keyword, which raised an error. In the example 2 code, we are using the ‘ % ‘ operator to perform string formatting. However, there is a minor issue in the syntax. We have omitted the % before the tuple. Missing this symbol can raise a similar error.

The output of example 2

The output of example 2

How to resolve this error?

The solution to example 1:

In Python, the str() function converts values into a string. It takes an object as an argument and converts it into a string. The str is a pre-defined function and also a reserved keyword. Therefore, it can’t be used as a variable name as per Python’s naming conventions.

To resolve the error, use another variable name.

string1 = "This is text number 1"
string2 = "This is text number 2"

print(str(string1) + string2)

Using proper naming convention, error gets resolved.

Using proper naming convention, the error gets resolved.

The solution to example 2:

In example 2, we tried to use string formatting to display string1 and string2 together. However, not using the % operator before the tuples of values TypeError: ‘str’ object is not a callable error that gets thrown. To resolve it, use the % operator in its proper place.

string1 = "This is text number 1"
string2 = "This is text number 2"

print("%s %s" %(string1,string2))

Using the % operator at its right place resolves the error

Using the % operator in its right place resolves the error

TypeError: ‘str’ object is not callable Selenium

This error is likely due to accidentally invoking a function() which is actually a property. Please check your code for this.

TypeError ‘str’ object is not callable BeautifulSoup/Django/Collab

Irrespective of the library used, this error can creep in if you have used some reserved keyword as a variable or redefined some property or a function of the library. Please check your code for such things.

TypeError ‘str’ object is not callable matplotlib

Somewhere in the code, you might have used plt.xlabel = “Some Label”. This will change the import of matplotlib.pyplot. Try to close the Notebook and restart your Kernel. After the restart, rerun your code, and everything should be fine.

FAQs

How do I fix the str object that is not callable?

To fix this error, you need to ensure that no variable is named after the str reserved keyword. Change it if this is the case.

What does str object is not callable mean?

TypeError generally occurs if an improper naming convention has been used, in other words, if the str keyword is used as a variable name.

TypeError ‘str’ object is not callable pyspark

This error is likely due to accidentally overwriting one of the PySpark functions with a string. Please check your code for this.

Conclusion

In this article, we discussed where the ‘str’ object is not callable error can occur and how we can resolve it. This is an easy error to fix. We must ensure we don’t use the reserved keywords for naming variables. In addition, we also have to avoid redefining default methods.

Trending Python Articles

  • “Other Commands Don’t Work After on_message” in Discord Bots

    “Other Commands Don’t Work After on_message” in Discord Bots

    February 5, 2023

  • Botocore.Exceptions.NoCredentialsError: Unable to Locate Credentials

    Botocore.Exceptions.NoCredentialsError: Unable to Locate Credentials

    by Rahul Kumar YadavFebruary 5, 2023

  • [Resolved] NameError: Name _mysql is Not Defined

    [Resolved] NameError: Name _mysql is Not Defined

    by Rahul Kumar YadavFebruary 5, 2023

  • Best Ways to Implement Regex New Line in Python

    Best Ways to Implement Regex New Line in Python

    by Rahul Kumar YadavFebruary 5, 2023

Table of Contents
Hide
  1. What is typeerror: ‘str’ object is not callable in Python?
  2. Scenario 1 – Declaring a variable name called “str”
  3. Solving typeerror: ‘str’ object is not callable in Python.
  4. Scenario 2 – String Formatting Using %

One of the most common errors in Python programming is typeerror: ‘str’ object is not callable, and sometimes it will be painful to debug or find why this issue appeared in the first place.

Python has a built-in method str() which converts a specified value into a string. The str() method takes an object as an argument and converts it into a string.

Since str() is a predefined function and a built-in reserved keyword in Python, you cannot use it in declaring it as a variable name or a function name. If you do so, Python will throw a typeerror: ‘str‘ object is not callable.

Let us take a look at few scenarios where you could reproduce this error.

Scenario 1 – Declaring a variable name called “str”

The most common scenario and a mistake made by developers are declaring a variable named ‘str‘ and accessing it. Let’s look at a few examples of how to reproduce the ‘str’ object is not callable error.

str = "Hello, "
text = " Welcome to ItsMyCode"

print(str(str + text))

# Output
Traceback (most recent call last):
  File "c:ProjectsTryoutslistindexerror.py", line 4, in <module>
    print(str(str + text))
TypeError: 'str' object is not callable

In this example, we have declared ‘str‘ as a variable, and we are also using the predefined str() method to concatenate the string.

str = "The cost of apple is "
x = 200
price= str(x)
print((str + price))

# output
Traceback (most recent call last):
  File "c:ProjectsTryoutslistindexerror.py", line 3, in <module>
    price= str(x)
TypeError: 'str' object is not callable

The above code is similar to example 1, where we try to convert integer x into a string. Since str is declared as a variable and if you str() method to convert into a string, you will get object not callable error.

Solving typeerror: ‘str’ object is not callable in Python.

Now the solution for both the above examples is straightforward; instead of declaring a variable name like “str” and using it as a function, declare a more meaningful name as shown below and make sure that you don’t have “str” as a variable name in your code.

text1 = "Hello, "
text2 = " Welcome to ItsMyCode"

print(str(text1 + text2))

# Output
Hello,  Welcome to ItsMyCode
text = "The cost of apple is "
x = 200
price= str(x)
print((text + price))

# Output
The cost of apple is 200

Scenario 2 – String Formatting Using %

Another hard-to-spot error that you can come across is missing the % character in an attempt to append values during string formatting.

If you look at the below code, we have forgotten the string formatting % to separate our string and the values we want to concatenate into our final string. 

print("Hello %s its %s day"("World","a beautiful"))

# Output 
Traceback (most recent call last):
  File "c:ProjectsTryoutslistindexerror.py", line 1, in <module>
    print("Hello %s its %s day"("World","a beautiful"))
TypeError: 'str' object is not callable

print("Hello %s its %s day"%("World","a beautiful"))

# Output
Hello World its a beautiful day

In order to resolve the issue, add the % operator before replacing the values ("World","a beautiful") as shown above.

Avatar Of Srinivas Ramakrishna

Srinivas Ramakrishna is a Solution Architect and has 14+ Years of Experience in the Software Industry. He has published many articles on Medium, Hackernoon, dev.to and solved many problems in StackOverflow. He has core expertise in various technologies such as Microsoft .NET Core, Python, Node.JS, JavaScript, Cloud (Azure), RDBMS (MSSQL), React, Powershell, etc.

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

By checking this box, you confirm that you have read and are agreeing to our terms of use regarding the storage of the data submitted through this form.

Strings are immutable objects, which means you cannot change them once created. If you try to change a string in place using the indexing operator [], you will raise the TypeError: ‘str’ object does not support item assignment.

To solve this error, you can use += to add characters to a string.

a += b is the same as a = a + b

Generally, you should check if there are any string methods that can create a modified copy of the string for your needs.

This tutorial will go through how to solve this error and solve it with the help of code examples.


Table of contents

  • Python TypeError: ‘str’ object does not support item assignment
  • Example
    • Solution #1: Create New String Using += Operator
    • Solution #2: Create New String Using str.join() and list comprehension
  • Summary

Python TypeError: ‘str’ object does not support item assignment

Let’s break up the error message to understand what the error means. TypeError occurs whenever you attempt to use an illegal operation for a specific data type.

The part 'str' object tells us that the error concerns an illegal operation for strings.

The part does not support item assignment tells us that item assignment is the illegal operation we are attempting.

Strings are immutable objects which means we cannot change them once created. We have to create a new string object and add the elements we want to that new object. Item assignment changes an object in place, which is only suitable for mutable objects like lists. Item assignment is suitable for lists because they are mutable.

Let’s look at an example of assigning items to a list. We will iterate over a list and check if each item is even. If the number is even, we will assign the square of that number in place at that index position.

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

for n in range(len(numbers)):
    if numbers[n] % 2 == 0:
        numbers[n] = numbers[n] ** 2
print(numbers)

Let’s run the code to see the result:

[1, 4, 3, 16, 5, 36, 7, 64, 9, 100]

We can successfully do item assignment on a list.

Let’s see what happens when we try to change a string using item assignment:

string = "Research"
string[-1] = "H"
print(string)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-e8e5f13bba7f> in <module>
      1 string = "Research"
----> 2 string[-1] = "H"
      3 print(string)

TypeError: 'str' object does not support item assignment

We cannot change the character at position -1 (last character) because strings are immutable. We need to create a modified copy of a string, for example using replace():

string = "Research"
new_string = string.replace("h", "H")
print(new_string)

In the above code, we create a copy of the string using = and call the replace function to replace the lower case h with an upper case H.

ResearcH

Let’s look at another example.

Example

In this example, we will write a program that takes a string input from the user, checks if there are vowels in the string, and removes them if present. First, let’s define the vowel remover function.

def vowel_remover(string):

    vowels = ["a", "e", "i" , "o", "u"] 

    for ch in range(len(string)):

        if string[ch] in vowels:

            string[ch] = ""

    return string

We check if each character in a provided string is a member of the vowels list in the above code. If the character is a vowel, we attempt to replace that character with an empty string. Next, we will use the input() method to get the input string from the user.

string = input("Enter a string: ")

Altogether, the program looks like this:

def vowel_remover(string):

    vowels = ["a", "e", "i", "o", "u"] 

    for ch in range(len(string)):

        if string[ch] in vowels:

            string[ch] = ""

    return string

string = input("Enter a string: ")

new_string = vowel_remover(string)

print(f'String with all vowels removed: {new_string}')

Let’s run the code to see the result:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-7bd0a563e08b> in <module>
      8 string = input("Enter a string: ")
      9 
---> 10 new_string = vowel_remover(string)
     11 
     12 print(f'String with all vowels removed: {new_string}')

<ipython-input-6-7bd0a563e08b> in vowel_remover(string)
      3     for ch in range(len(string)):
      4         if string[ch] in vowels:
----> 5             string[ch] = ""
      6     return string
      7 

TypeError: 'str' object does not support item assignment

The error occurs because of the line: string[ch] = "". We cannot change a string in place because strings are immutable.

Solution #1: Create New String Using += Operator

We can solve this error by creating a modified copy of the string using the += operator. We have to change the logic of our if statement to the condition not in vowels. Let’s look at the revised code:

def vowel_remover(string):

    new_string = ""

    vowels = ["a", "e", "i", "o", "u"] 

    for ch in range(len(string)):

        if string[ch] not in vowels:

            new_string += string[ch]

    return new_string

string = input("Enter a string: ")

new_string = vowel_remover(string)

print(f'String with all vowels removed: {new_string}')

Note that in the vowel_remover function, we define a separate variable called new_string, which is initially empty. If the for loop finds a character that is not a vowel, we add that character to the end of the new_string string using +=. We check if the character is not a vowel with the if statement: if string[ch] not in vowels.

Let’s run the code to see the result:

Enter a string: research
String with all vowels removed: rsrch

We successfully removed all vowels from the string.

Solution #2: Create New String Using str.join() and list comprehension

We can solve this error by creating a modified copy of the string using list comprehension. List comprehension provides a shorter syntax for creating a new list based on the values of an existing list.

Let’s look at the revised code:

def vowel_remover(string):

    vowels = ["a", "e", "i", "o", "u"] 

    result = ''.join([string[i] for i in range(len(string)) if string[i] not in vowels])

    return result

string = input("Enter a string: ")

new_string = vowel_remover(string)

print(f'String with all vowels removed: {new_string}')

In the above code, the list comprehension creates a new list of characters from the string if the characters are not in the list of vowels. We then use the join() method to convert the list to a string. Let’s run the code to get the result:

Enter a string: research
String with all vowels removed: rsrch

We successfully removed all vowels from the input string.

Summary

Congratulations on reading to the end of this tutorial. The TypeError: ‘str’ object does not support item assignment occurs when you try to change a string in-place using the indexing operator []. You cannot modify a string once you create it. To solve this error, you need to create a new string based on the contents of the existing string. The common ways to change a string are:

  • List comprehension
  • The String replace() method
  • += Operator

For further reading on TypeErrors, go to the articles:

  • How to Solve Python TypeError: object of type ‘NoneType’ has no len()
  • How to Solve Python TypeError: ‘>’ not supported between instances of ‘str’ and ‘int’
  • How to Solve Python TypeError: ‘tuple’ object does not support item assignment
  • How to Solve Python TypeError: ‘set’ object does not support item assignment

To learn more about Python for data science and machine learning, go to the online courses page on Python for the most comprehensive courses available.

Have fun and happy researching!

Представим такое: студент только что окончил школу, где изучал Паскаль. В универе на лабораторной по Python ему дали такое задание: заменить в строке все точки на восклицательные знаки.

Студент помнит, что можно обращаться к отдельным элементам строки, поэтому сразу пишет очевидный цикл:

# исходная строка, где нужно заменить точки
s = 'Привет. Это журнал «Код».'
# делаем цикл, который переберёт все порядковые номера символов в строке
for i in range(len(s)):
    # если текущий символ — точка
    if s[i] == '.':
        # то меняем её на восклицательный знак    
        s[i] = '!'

Но после запуска компьютер выдаёт ошибку:

❌  TypeError: ‘str’ object does not support item assignment

Казалось бы, почему? Есть строка, можно обратиться к отдельным символам, цикл в порядке — что не так-то?

Что это значит: интерпретатор сообщает нам, что не может поменять символ в строке один на другой.

Когда встречается: когда в Python мы пытаемся напрямую заменить символ в строке, как это делали в Паскале или некоторых других языках, которые это умеют. В Python строки хоть и состоят из символов, которые можно прочитать по отдельности, но управлять этими символами он не даёт. 

Что делать с ошибкой TypeError: ‘str’ object does not support item assignment

Решение простое: нужно не работать с символами в строке напрямую, а собирать новую строку из исходной. А всё потому, что Python разрешает прибавлять символы к строке, считая их маленькими строками. Этим и нужно воспользоваться:

# исходная строка, где нужно заменить точки
s = 'Привет. Это журнал «Код».'
# строка с результатом
r = ''
# делаем цикл, который переберёт все порядковые номера символов в исходной строке
for i in range(len(s)):
    # если текущий символ — точка
    if s[i] == '.':
        # то в новой строке ставим на её место восклицательный знак    
        r = r + '!'
    else:
        # иначе просто переносим символ из старой строки в новую
        r = r + s[i]
# выводим результат
print(r)

Но проще всего, конечно, использовать встроенную функцию replace():

# исходная строка, где нужно заменить точки
s = 'Привет. Это журнал «Код».'
# встроенной функцией меняем точки на восклицательные знаки
s = s.replace('.','!')
# выводим результат
print(s)

Вёрстка:

Кирилл Климентьев

This article summarizes several cases that will throw Python TypeError: ‘str’ object is not callable or TypeError: ‘module’ object is not callable, it will also tell you how to fix the error in each case.

1. Case1: Define str As A Python Variable.

1.1 How To ReProduce Python Error TypeError: ‘str’ Object Is Not Callable.

  1. When I develop a python program, I want to use the Python built-in function str() to convert a number variable to a string type. But I meet the below error Typeerror: ‘str’ Object Is Not Callable. 
    >>> x = 1.99
    >>>
    >>> str(x)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: 'str' object is not callable
  2. This error confused me a lot for some time. But I finally fix it after googling it. The reason for this error is that I use the global variable name str in the same python interpreter, and I had assigned a string value to that variable str.
  3. So the python interpreter treats str as a variable name other than the built-in function name str(). So it throws out TypeError: ‘str’ object is not callable. Below is the full python source code.
    >>> global str
    >>>
    # some times ago, I assign string 'hello' to str variable, so python interpreter think str is a string variable.
    >>> str = 'hello'
    >>>
    ......
    ......
    ......
    >>> x= 1.99
    # so when I invoke str() function, the interpreter think str is a string variable then below error is thrown.
    >>> str(x)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: 'str' object is not callable

1.2 How To Fix Python Error TypeError: ‘str’ Object Is Not Callable.

  1. It is very easy to fix this error.
  2. Run del str command to delete the variable.
  3. After that, you can call the function str() without error.
    >>> global str
    >>> 
    >>> str = 'hello'
    >>> 
    >>> x = 1.99
    >>> 
    >>> str(x)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: 'str' object is not callable
    >>> 
    >>> del str
    >>> 
    >>> str(x)
    '1.99'

1.3 Conclusion.

  1. Do not declare the python variable name as the same as the python built-in function name or keyword.

2. Case2: Use A Python String As A Function Name.

2.1 Reproduce.

  1. In this case, it uses the python easygui module to get an integer number from user input, and then calculate the number as a percentage number. Please see below source code.
    # Import all functions from easygui module.
    from easygui import *
    
    
    def easygui_str_type_error():
        
        # Prompt a GUI dialog to gather user input integer number.
        number_str = enterbox("Please input an integer number as percentage.")
        
        # Convert the string number to integer value.
        number_int = int(number_str)
        
        if number_int > 100:
            
            msgbox("The input number is bigger than 100, it is invalid.")
        
        else:
            # Display a GUI dialog to show the percentage.
            msgbox("The percentage is "(number_int * 0.01))
            
    
    
    if __name__ == '__main__':
        
        easygui_str_type_error()
  2. When you run the above python code, it will throw the below error message.
    Traceback (most recent call last):
      File "/string/PythonStrTypeError.py", line 31, in <module>
        easygui_str_type_error()
      File "/string/PythonStrTypeError.py", line 23, in easygui_str_type_error
        msgbox("The percentage is "(number_int * 0.01))
    TypeError: 'str' object is not callable
    

2.2 How To Fix.

  1. The error occurs at the code line msgbox("The percentage is "(number_int * 0.01)).
  2. This is because there is nothing between the string literal (“The percentage is “) and the (number_int * 0.01) parenthesis.
  3. So Python interpreter treats the string “The percentage is ” as an invokable object ( a function name ), but the code’s real purpose is to splice two strings.
  4. So we can change the code to msgbox("The percentage is " + str(number_int * 0.01)) to fix the error.
  5. We can also use string formatting in a more regular way.
    msgbox("The percentage is {} ".format(number_int * 0.01))

3. Case3: Call The Module Name Like A Function.

3.1 Reproduce The TypeError: ‘module’ object is not callable.

  1. When I use the python builtwith module to detect the technology used by the target website, it throws the error message TypeError: ‘module’ object is not callable.
  2. The reason for this error is that you call the module object like a function.
  3. In my example, after I install the builtwith module, I run the python code like below, and the code throws the error.
    # Import the builtwith module
    >>> import builtwith
    
    # Call the builtwith module like a function as below, and this line of code will throw the TypeError.
    >>> builtwith('http://www.dev2qa.com')
    Traceback (most recent call last):
      File "", line 1, in 
    TypeError: 'module' object is not callable

3.2 How To Fix The Python TypeError: ‘module’ object is not callable.

  1. To fix this error, you should call a function in the module such as builtwith.parse(‘http://www.dev2qa.com’) like below.
    >>> builtwith.parse('http://www.dev2qa.com')
    {'cdn': ['CloudFlare'], 'analytics': ['Clicky'], 'advertising-networks': ['Google AdSense'], 'javascript-frameworks': ['Prototype', 'React', 'RequireJS', 'jQuery'], 'web-frameworks': ['Twitter Bootstrap'], 'ecommerce': ['WooCommerce'], 'cms': ['WordPress'], 'programming-languages': ['PHP'], 'blogs': ['PHP', 'WordPress']}
    
  2. Then you can find the error is fixed.
  3. So you should remember that you can not call the module name like a function, you should call a function in the module, then the error will be fixed.
  4. There are also other cases that throw this error, such as the python socket module has a socket class.
  5. If you want to create a python socket object, you need to call the code socket.socket(……), if you call the socket class directly, it will throw the TypeError: ‘module’ object is not callable also.
  6. From the below source code, we can see the difference between the python socket module and socket class.
    >>> import socket # import the python socket module.
    >>> socket # print out the socket module description text, we can see that it is a module.
    <module 'socket' from 'C:Python37libsocket.pyc'>
    >>> socket.socket # call the socket class in the socket module, you can see it is a socket class.
    <class 'socket._socketobject'>
  7. If you import the socket class from the socket module first ( from socket import socket ), then you can call the socket class constructor to create the socket object directly without error.
    >>> from socket import socket # import the socket class from the socket module.
    >>> socket # then the call to the socket will reference to the socket class, you can call socket(...) directly to create the socket object.
    <class 'socket.socket'>

Понравилась статья? Поделить с друзьями:
  • Storwize v3700 error 578
  • Storwize error 724
  • Storsec mbn error redmi note 6 pro
  • Storport sys windows 10 как исправить
  • Store data structure corruption windows 10 как исправить