Kivy-Python3-textinput with socket-error-"text input' does not support the buffer interface"

12 views
Skip to first unread message

שחר ביתן

unread,
Feb 22, 2017, 7:24:58 AM2/22/17
to Kivy users support
Hi, I'm trying to create a Python server(with Python 3) receives information from the client(developed with Kivy). I tried to use sockets but i got error .
my client:


from kivy.app import App
#kivy.require("1.8.0")
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
import socket




class LoginScreen(GridLayout):
    def __init__(self,**kwargs):
        super(LoginScreen, self).__init__(**kwargs)
        self.cols=2
        my_socket = socket.socket()
        host=socket.gethostname()
        my_socket.connect((host,80))

        self.add_widget(Label(text='username'))
        self.username = TextInput(multiline=False)
        self.add_widget(self.username)
        my_socket.send(self.username)
        mt_socket.close()
        
        self.add_widget(Label(text='Password'))
        self.password = TextInput(multiline=False,password=True)
        self.add_widget(self.password)
        




class SimpleKivy(App):
    def build(self):
        return LoginScreen()


if __name__=='__main__':
    SimpleKivy().run()


my server:

import socket
import db # import my db

    
server_socket = socket.socket()
server_socket.bind(('0.0.0.0',80))
server_socket.listen(5)

(client_socket, client_address) = server_socket.accept()
client_username = client_socket.recv(1024)



data_entry_login(client_username,"dsfsds","dsfsfsdd","2")#insert to my db

client_socket.close()
server_socket.close()
Reply all
Reply to author
Forward
0 new messages