Showing posts with label python Basic. Show all posts
Showing posts with label python Basic. Show all posts

Wednesday, 13 May 2020

Text Editor Python Using tkinter

Text Editor using python




from tkinter import *
from tkinter.filedialog import *
from tkinter.messagebox import *
from tkinter.font import Font
from tkinter.scrolledtext import *
import file_menu
import edit_menu
import format_menu
import help_menu

root = Tk()

root.title("Text Editor-Untiltled")
root.geometry("300x250+300+300")
root.minsize(width=400, height=400)

text = ScrolledText(root, state='normal', height=400, width=400, wrap='word', pady=2, padx=3, undo=True)
text.pack(fill=Y, expand=1)
text.focus_set()

menubar = Menu(root)

file_menu.main(root, text, menubar)
edit_menu.main(root, text, menubar)
format_menu.main(root, text, menubar)
help_menu.main(root, text, menubar)
root.mainloop()





Tuesday, 12 June 2018

Python P2 Python Command line + exit Command


Python  P2   Python Command line + exit Command

Exit Syntax 
   exit Use to Stop Python Program

 exit()
 means When You use Command Line Python At that time use exit() from Command.

How to Start Command line Python :

  1. Open terminal / CMD
  2. type python
  3.  your Command Line Python Open :)

Now type any python on it

look like ......

$python
python>> [Your Command Here]


example :

$ python  
python>> print("hello MAC+tech")
hello MAC+tech
 python>>



Intro Python P1 + Run Python 1st Program

Python?

It was created in 1991 by Guido van Rossum .

use :

  1. web development (server-side)
  2. Data Mining And Analytics.  
  3. graphics 
  4. System S/w
  5. software development
  6. mathematics
  7. system scripting.
  8. AI Application
  9. Embedded Development  
 Some features :
  1. Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
  2. Python has a simple syntax similar to the English language.
  3. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
  4. Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
  5. Python can be treated in a procedural way, an object-orientated way or a functional way.
 Let's Start...... :)  

Run Program

$python File.py

Here Command Python , file name is the any File Name..

Run  Steps :
  open Any Editor And Type  :
                                    
                                    print("Hello, MAC+tech Word!")

Save any name ex mypro1.py

Type python  mypro1.py

O/U :
 Hello, MAC+tech Word!
    





create and activate a Python virtual environment on macOS and Windows

create and activate a Python virtual environment on macOS and Windows: Prerequisites: Python 3: Ensure you have Python 3 installed. You ca...