Message from Python discussions
December 2018
— It did
I have a large txt file with nearly 10,000 line and 20 columns.
I want to split them and append them into variables,
but the problem is that the columns are un evenly separated. That means, at some places the separation is just 1 space, and other it's a Tab...
I tried to split this with
line.split(" ")
and
line.split('\t')
both of them are not working correctly, they are splitting it the wrong way.
any way to split this easily? a picture of the file is attached.
— What happens if you use line.split(' ')
— *line.split()
— Yes, try split() with no arguments
— Looks like that's an old script
—
AttributeError: module 'port_setup' has no attribute 'port_setup_win'
i want to add a func from py file to another i.e from port_setup to the other.
but i get the error above..
— Ok guys thanks...
line.split() worked.
—
Traceback (most recent call last):
File "C:/Users/MDavid/Desktop/meaCli_Gui/main.py", line 6, in <module>
from port_setup import port_sp
File "C:\Users\MDavid\Desktop\meaCli_Gui\port_setup.py", line 3, in <module>
from main import server,main_window,main_output
File "C:\Users\MDavid\Desktop\meaCli_Gui\main.py", line 6, in <module>
from port_setup import port_sp
ImportError: cannot import name 'port_sp' from 'port_setup' (C:\Users\MDavid\Desktop\meaCli_Gui\port_setup.py)
— I have a problem with the imports i need stuff from main file in port_setup file and the oposite (from port_setup to main).
How to solve this collision?
— Socket = when port + ip connect each other
api = a function which allow you to use libraries in your app like using google sign up system in our own site
— in main.py:
from port_setup import port_sp(port_sp is a class port_setup is the module (file))
in port_setup.py:
from main import server,main_window,main_outputThough the error:
File "C:/Users/MDavid/Desktop/meaCli_Gui/main.py", line 6, in <module>from port_setup import port_sp
File "C:\Users\MDavid\Desktop\meaCli_Gui\port_setup.py", line 3, in <module>from main import server,main_window,main_output
File "C:\Users\MDavid\Desktop\meaCli_Gui\main.py", line 6, in <module>ImportError: cannot import name 'port_sp' from 'port_setup'
from port_setup import port_sp