How to run two modules at the same time in IDLE

2024/10/10 6:21:20

I am working on a super simple socket program and I have code for the client and code for the server. How do I run both these .py files at the same time to see if they work ?

Answer

You can run multiple instances of IDLE/Python shell at the same time. So open IDLE and run the server code and then open up IDLE again, which will start a separate instance and then run your client code.

https://en.xdnf.cn/q/69924.html

Related Q&A

Passing 2 dimensional C array to python numpy

I need some help regarding passing C array to python(numpy). I have 2d array of doubles NumRows x NumInputs, it seems that PyArray_SimpleNewFromData does not convert it right way - it is hard to see be…

Best way to implement numpy.sin(x) / x where x might contain 0

What I am doing now is:import numpy as npeps = np.finfo(float).epsdef sindiv(x):x = np.abs(x)return np.maximum(eps, np.sin(x)) / np.maximum(eps, x)But there is quite a lot of additional array operation…

Scrapy process.crawl() to export data to json

This might be a subquestion of Passing arguments to process.crawl in Scrapy python but the author marked the answer (that doesnt answer the subquestion im asking myself) as a satisfying one.Heres my pr…

Embedding Python in C: Error in linking - undefined reference to PyString_AsString

I am trying to embed a python program inside a C program. My OS is Ubuntu 14.04I try to embed python 2.7 and python 3.4 interpreter in the same C code base (as separate applications). The compilation a…

How can I add properties to a class using a decorator that takes a list of names as argument?

I would like to add many dummy-properties to a class via a decorator, like this:def addAttrs(attr_names):def deco(cls):for attr_name in attr_names:def getAttr(self):return getattr(self, "_" +…

How to reshape only last dimensions in numpy?

Suppose I have A of shape (...,96) and want to reshape it into (...,32,3) keeping both lengths and number of preceding dimensions, if ever, intact.How to do this?If I writenp.reshape(A, (-1, 32, 2))it…

Relative import of submodule

In Python, how do I perform the equivalent of the followingimport http.clientbut using a relative import:from . import http.client import .http.clientFor a package http in the current package? I want …

Python regular expression to replace everything but specific words

I am trying to do the following with a regular expression:import re x = re.compile([^(going)|^(you)]) # words to replace s = I am going home now, thank you. # string to modify print re.sub(x, _, s)T…

How do I raise a window that is minimized or covered with PyGObject?

Id been using the answer provided in the PyGTK FAQ, but that doesnt seem to work with PyGObject. For your convenience, here is a test case that works with PyGTK, and then a translated version that does…

How to bind multiple widgets with one bind in Tkinter?

I am wondering how to bind multiple widgets with one "bind".For expample: I have three buttons and I want to change their color after hovering.from Tkinter import *def SetColor(event):event.w…