gpt4 book ai didi

python - 文本输入的 Kivy 错误

转载 作者:行者123 更新时间:2023-12-03 18:25:41 27 4
gpt4 key购买 nike

我正在尝试在我的电脑上运行此代码,我尝试了各种方法,但总是遇到相同的错误,我不知道该怎么办...

import kivy
kivy.require('1.0.7')
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.codeinput import CodeInput
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.core.window import Window
from kivy.uix.accordion import Accordion, AccordionItem

Window.clearcolor = (1, 1, 1, 1)


class Myapp(App):

def build(self):

self.layout = BoxLayout(padding=50,orientation="vertical",spacing=30)
Labe_Prin = Label(text="Bienvenido al login",font_name="data/fonts/Union_soap.ttf",color=(0,0,0,0.5),font_size=50)
Label1 = Label(text="Ingrese Usuario: ",color=(0,0,0,1),font_size=(50*0.75),bold=True,italic=False,font_name="data/fonts/English_.ttf")
Entrada1 = TextInput(multiline = False,size_hint=(1,.3),bold=True,font_size=12.3,foreground_color=(.5,.1,.3,1),text="Usuraio",use_bubble=True) #focus=True,use_handles=True
Label2 = Label(text="Ingrese Contrasenia: ",color=(0,0,0,1),font_size=(50*0.75),bold=True,italic=False,font_name="data/fonts/English_.ttf")
Entrada2 = CodeInput(multiline = False,size_hint=(1,.3),italic=True,font_size=12.3,foreground_color=(.5,.1,.3,1),text="Contrasenia",use_buble=True) #Contrasenia

def press(self):
print Entrada1.text
print Entrada2.text

Boton1 = Button(size_hint=(1, .4), text='Login',on_release=press)


self.layout.add_widget(Labe_Prin)
self.layout.add_widget(Label1)
self.layout.add_widget(Entrada1)
self.layout.add_widget(Label2)
self.layout.add_widget(Entrada2)
self.layout.add_widget(Boton1)

return self.layout

if __name__=="__main__":
Myapp().run()

我有这个错误...
[CRITICAL          ] [Cutbuffer   ] Unable to find any valuable Cutbuffer provider at all!
xclip - OSError: [Errno 2] No existe el archivo o el directorio
File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python2.7/dist-packages/kivy/core/clipboard/clipboard_xclip.py", line 17, in <module>
p = subprocess.Popen(['xclip', '-version'], stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception

xsel - OSError: [Errno 2] No existe el archivo o el directorio
File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python2.7/dist-packages/kivy/core/clipboard/clipboard_xsel.py", line 15, in <module>
p = subprocess.Popen(['xsel'], stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception

我可以执行代码,但我无法构建到android

最佳答案

我遇到了同样的错误,但安装 xclip & xsel 为我解决了这个问题。

关于python - 文本输入的 Kivy 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33534976/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com