Skip to content

Edit/add a line in a python file using another python file

I have got a python file with lines in specific order and I’m trying to add/remove lines in specific place in the file and then save it as a new one. For example: I would like to add an additional line(e.g. parameter3) between these lines and/or remove one of them. Answer Read the lines from file into a…

How to remove a specific element from a 2d array in Python?

I am new to Python and now I’m trying to create a game called Pong Everything looks to work fine but unfortunately, I can’t remove a specific element from 2D-Array /List once the ball touches a brick. Here is my code: In the following method, I want to remove the specific element: I have tried man…

Delegating single function to client server in python

I have a simple client-server program using the xml-rpc protocol. My code is presented below. But this does not work as I expect it to. Maybe someone knows why? In my module directed_graph there is function algorithm_dijkstra(vertex_name) that I want to execute on the server. Client: Server: Small clarificati…