কম্পিউটার

পাইথন - কিভিতে উইন্ডোর আকার সামঞ্জস্য


কিভি হল পাইথনের একটি প্ল্যাটফর্ম স্বাধীন GUI টুল। যেহেতু এটি অ্যান্ড্রয়েড, আইওএস, লিনাক্স এবং উইন্ডোজ ইত্যাদিতে চালানো যেতে পারে। কিভি আপনাকে একবারের জন্য কোড লিখতে এবং বিভিন্ন প্ল্যাটফর্মে চালানোর কার্যকারিতা প্রদান করে। এটি মূলত অ্যান্ড্রয়েড অ্যাপ্লিকেশন বিকাশ করতে ব্যবহৃত হয়, তবে এর অর্থ এই নয় যে এটি ডেস্কটপ অ্যাপ্লিকেশনগুলিতে ব্যবহার করা যাবে না৷

কিভি হল সেই প্ল্যাটফর্ম যেখানে আকারটি খুব বেশি গুরুত্বপূর্ণ নয় কারণ এটি সেই অনুযায়ী স্ব-সামঞ্জস্য করে তবে আমরা যদি কিছু পরিমাণে আকারটি ঠিক করতে চাই যে এটির উচ্চতা অনুসারে বা প্রস্থ অনুসারে বা বাউন্ডেশন থেকে মুক্ত তা ব্যবহারকারীর প্রয়োজনীয়তার উপর নির্ভর করে। পি>

উদাহরণ

# When there is no fix window size i.e fully resizable according to user:
from kivy.config import Config
# 0 being off 1 being on as in true / false you can use 0 or 1 && True or False
Config.set('graphics', 'resizable', True)
# import kivy module
import kivy
# this restrict the kivy version i.e below this kivy version you cannot use the app
kivy.require("1.9.1")
# base Class of your App inherits from the App class. app:always refers to the instance of your #application
from kivy.app import App
# if you not import label and use it through error
from kivy.uix.label import Label
# defining the App class
class MyLabelApp(App):
   def build(self):
      # label display the text on screen
      # markup text with different colour
         l2 = Label(text ="[color = ff3333][b]Hello !!!!!!!!!!![/b]
            [/color]\n [color = 3333ff]World!!! !!:):):):)[/color]",
               font_size ='20sp', markup = True)
         return l2
# creating the object
label = MyLabelApp()
# run the window
label.run()
# No resizing, fixed size with the width:
from kivy.config import Config
# 0 being off 1 being on as in true / false
# you can use 0 or 1 && True or False
Config.set('graphics', 'resizable', '0')
# fix the width of the window
Config.set('graphics', 'width', '500')
#fixing the height of the window
from kivy.config import Config
# 0 being off 1 being on as in true / false
# you can use 0 or 1 && True or False
Config.set('graphics', 'resizable', '0')
# fix the height of the window
Config.set('graphics', 'height', '400')

  1. পাইথন - কিভি উইন্ডোতে লেবেল যোগ করুন

  2. পাইথন - কিভিতে বোতাম অ্যাকশন

  3. পাইথন - কিভিতে বক্সলেআউট উইজেট

  4. পাইথন - কিভিতে অ্যাঙ্করলেআউট