PYTHON MIDTERM PROJECT WORD-CHAR COUNTER WITH SIMPLE GUI MAHMUT KAMALAK 16290155 BIOMEDICAL ENGINEERING
OBJECTIVE In this python programming project, I applied to count the total words and characters in a string. The program will take the string as input from the user, count the words and characters and then it will print out the results on the GUI.
OVERVIEW – BLANK DIAGRAM
What is Tkinter ?  The tkinter package (“Tk interface”) is the standard Python interface to the Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, as well as on Windows systems. (Tk itself is not part of Python; it is maintained at ActiveState.)  Tkinter is lightweight and relatively painless to use compared to other frameworks. This makes it a compelling choice for building GUI applications in Python, especially for applications where a modern sheen is unnecessary, and the top priority is to build something that’s functional and cross-platform quickly.
Step -1  To use Tkinter , firstly we have to import Tkinter modules.
Step 2  Opening the new empty window with ‘Tk()’  Giving a name to window with ‘title()’  Adjusting the background color with ‘configure()’  Adjusting the size of window with ‘geometry()’  Arranging the permissions to resizable with ‘resizable()’ window
Step 3  I created the TEXT label with adjusting of ; Label() 1. Name of label ---- text=‘ ‘ 2. Background color----bg=‘ ‘ 3. Word color----fg=‘ ’ 4. Size of label----width=‘’ 5. Position of label on the window--- grid()
Code and Window for Step-3 w i n d o w
Step-4  I created entry label with ‘Entry()’  Configured to arrange the entry type with ‘StringVar()’  Adjusting location of label on the window with ‘grid()’ window
Step -5  I created the ‘Character’ and ‘word’ labels with adjusting of ; Label() 1. Name of label ---- text=‘ ‘ 2. Background color----bg=‘ ‘ 3. Word color----fg=‘ ’ 4. Size of label----width=‘’ 5. Position of label on the window--- grid()
Code and Window for Step-5 windo w
Step-6  I created entry labels with ‘Entry()’ for char and word  Configured to arrange the entry type with ‘DoubleVar()’ to be able integer values for char and word results.  Adjusting location of label on the window with ‘grid()’ window
Step -7  Buttons ,which are clear and calculate, were created to call functions and buttons were configured with ‘Button()’  Location of buttons were adjusted with ‘grid()’  Clear button calls ‘clear’ function.  Calculate button calls ‘calculatee’ function
Code and Window for Step -7
Step-8  To calculate number of words of the input text, ‘calculate’ function was defined.  With get() function , string is getting from ‘ft_entry’.  And, with using str() function, we get string values.  In addition, values is seperated word by word from sentences by using ‘split()’ function,and we get word list, like figure.i and figure.o  Number of words is calculated by using len() function.  Finally , we send the number of words to word label with ‘set()’ func. Figure.i Figure.o İnput to output for split()
Step -9  On the continue of ‘calculatee’ function; in the list ,which is created by split() before, the every word is entried to len() function and number of characters are sent to mt_value2 by set() function.  On the other hand , ‘clear’ function was defined to clear input and outputs by using set(‘’).
Codes for Step -8 and Step-9
Example -1  INPUT : ‘mahmut kamalak 16290155’  OUTPUT :
Example -2  INPUT : ‘I am learning python programming’  OUTPUT :
Example -3  INPUT : In this python programming tutorial, we will learn how to count the total words and characters in a string. The program will take the string as input from the user, count the words and characters and then it will print out the result.  OUTPUT :
FULL CODE SOURCE -1
FULL CODE SOURCE -2
FULL CODE SOURCE -3
REFERENCES  https://docs.python.org/3/library/tkinter.html  https://www.lucidchart.com/ ( designing blank diagram)

Char word counter in Python with simple gui - PROJECT

  • 1.
    PYTHON MIDTERM PROJECT WORD-CHAR COUNTERWITH SIMPLE GUI MAHMUT KAMALAK 16290155 BIOMEDICAL ENGINEERING
  • 2.
    OBJECTIVE In this pythonprogramming project, I applied to count the total words and characters in a string. The program will take the string as input from the user, count the words and characters and then it will print out the results on the GUI.
  • 3.
  • 4.
    What is Tkinter?  The tkinter package (“Tk interface”) is the standard Python interface to the Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, as well as on Windows systems. (Tk itself is not part of Python; it is maintained at ActiveState.)  Tkinter is lightweight and relatively painless to use compared to other frameworks. This makes it a compelling choice for building GUI applications in Python, especially for applications where a modern sheen is unnecessary, and the top priority is to build something that’s functional and cross-platform quickly.
  • 5.
    Step -1  Touse Tkinter , firstly we have to import Tkinter modules.
  • 6.
    Step 2  Openingthe new empty window with ‘Tk()’  Giving a name to window with ‘title()’  Adjusting the background color with ‘configure()’  Adjusting the size of window with ‘geometry()’  Arranging the permissions to resizable with ‘resizable()’ window
  • 7.
    Step 3  Icreated the TEXT label with adjusting of ; Label() 1. Name of label ---- text=‘ ‘ 2. Background color----bg=‘ ‘ 3. Word color----fg=‘ ’ 4. Size of label----width=‘’ 5. Position of label on the window--- grid()
  • 8.
    Code and Windowfor Step-3 w i n d o w
  • 9.
    Step-4  I createdentry label with ‘Entry()’  Configured to arrange the entry type with ‘StringVar()’  Adjusting location of label on the window with ‘grid()’ window
  • 10.
    Step -5  Icreated the ‘Character’ and ‘word’ labels with adjusting of ; Label() 1. Name of label ---- text=‘ ‘ 2. Background color----bg=‘ ‘ 3. Word color----fg=‘ ’ 4. Size of label----width=‘’ 5. Position of label on the window--- grid()
  • 11.
    Code and Windowfor Step-5 windo w
  • 12.
    Step-6  I createdentry labels with ‘Entry()’ for char and word  Configured to arrange the entry type with ‘DoubleVar()’ to be able integer values for char and word results.  Adjusting location of label on the window with ‘grid()’ window
  • 13.
    Step -7  Buttons,which are clear and calculate, were created to call functions and buttons were configured with ‘Button()’  Location of buttons were adjusted with ‘grid()’  Clear button calls ‘clear’ function.  Calculate button calls ‘calculatee’ function
  • 14.
    Code and Windowfor Step -7
  • 15.
    Step-8  To calculatenumber of words of the input text, ‘calculate’ function was defined.  With get() function , string is getting from ‘ft_entry’.  And, with using str() function, we get string values.  In addition, values is seperated word by word from sentences by using ‘split()’ function,and we get word list, like figure.i and figure.o  Number of words is calculated by using len() function.  Finally , we send the number of words to word label with ‘set()’ func. Figure.i Figure.o İnput to output for split()
  • 16.
    Step -9  Onthe continue of ‘calculatee’ function; in the list ,which is created by split() before, the every word is entried to len() function and number of characters are sent to mt_value2 by set() function.  On the other hand , ‘clear’ function was defined to clear input and outputs by using set(‘’).
  • 17.
    Codes for Step-8 and Step-9
  • 18.
    Example -1  INPUT: ‘mahmut kamalak 16290155’  OUTPUT :
  • 19.
    Example -2  INPUT: ‘I am learning python programming’  OUTPUT :
  • 20.
    Example -3  INPUT: In this python programming tutorial, we will learn how to count the total words and characters in a string. The program will take the string as input from the user, count the words and characters and then it will print out the result.  OUTPUT :
  • 21.
  • 22.
  • 23.
  • 24.