importing the multiprocessing module crashes the IDE

20 views
Skip to first unread message

Ângelo Lopes

unread,
Feb 11, 2025, 2:11:27 PMFeb 11
to PyScripter
I did this to train the use of the multiprocessing module:

import multiprocessing

# Jogo da forca.
# Definitions.
while True:
      word = input("Type a word")
       players = input("Type the names")

    if word.isalpha and word >= 4:
            break

This should stop running when the user defines word and players correctly, but whenever "import multiprocessing" is in the code, it repeats the "while" loop even if the user does everything right.

Summary: when I import this module, the "while" loop repeats more than it should, even though "break" is executed.

I use Windows 10.

PyScripter

unread,
Feb 11, 2025, 3:57:54 PMFeb 11
to PyScripter
# This script continuously prompts the user to input a word and a list of player names. 
# It ensures that the word meets certain criteria before breaking out of the loop. 
while True: 
    # Prompt the user to input a word 
    word = input("Type a word: "
    # Prompt the user to input the names of players 
    players = input("Type the names: "
    # Check if the word consists only of alphabetic characters and has a length of at least 4 
    # Note: The condition `word.isalpha` should be `word.isalpha()` to call the method 
    # Also, `word >= 4` should be `len(word) >= 4` to check the length of the word 
    if word.isalpha() and len(word) >= 4: 
        # If the conditions are met, break out of the loop 
        break

Even after fixing the indentation the code fails at word >= 4 TypeError: '>=' not supported between instances of 'str' and 'int'
I was not sure what your code was supposed to do, so I asked DeepSeek to explain your code (Assistant, Explain from the context menu).  DeepSeek fixed a couple of issues, but I still don't get it.  

What is the user expected to type in each of the questions.  Can you show some sample input?
Reply all
Reply to author
Forward
0 new messages