HOW TO DEAL WITH DEPRESSION? - Drashti Panjrolia

WHY DON'T WE GROW FRUITS AND VEGETABLES ON ROADS?

Why Blame Cigarettes When Even Perfume Causes Cancer? -Mousmi Shrivastava

Latest Posts

June 27, 2024

Why a Happy Work Place is a Necessity Now?

Drashti Panjrolia

Why a Happy Work Place is a Necessity Now? 

- By Drashti Panjrolia



In the fast world where everything is expensive, and having a job is a necessity for most of us ;happy work place is the bare minimum one can expect. Most of industries have 9-5 timings and we spend the most crucial parts of our lives at office. Toxic work place is where working overtime is glorified. Rude behaviour is justified. Where favouritism is a daily practice. Where there is lack of support and people at top are not even aware about it until informed. Where employees are quick to blame others for mistakes. Where employees are not motivated, devalued for their work and give resignation every now and then.Where there is constant pressure, overwork and unreasonable demands. Where there is no respectful two way communication between seniors and juniors. Where there is biased behaviour , intimidation, bullying or harrasment. Does any of one sounds familiar to you?? Well Congrats if it's just one!!as then it might be a happy work place. But if all of them sounds familiar to you then my friend you are working at a toxic work place. We all earn for our families so we can provide them , spend a better quality life with them.  But if we can't spend time with them then what is this money for ? A toxic work place can bring mental issues to us. We may feel stressed 24/7. We face strained relationships with our loved ones. There is burnout and emotional exhaustion. There are headaches, sleep disturbances and lower self esteem. There is no job satisfaction and no scope for maintaining work life balance. In long term one may have weakened immune system and cardiovascular issues. On contrary a happy work place is where there is perfect work life balance. There are rewards and recognitions. Seniors and juniors have healthy and respectful two way communication. Leaders at top are concerned about even the most junior employees too. There is Teamwork and cooperation. There is opportunity for growth. Well who am I to call a workplace happy or toxic because happiness has a personal definition for everyone. Afterall it's upto you what is happy work place for you. But this is what most of people would believe a workplace to be happy or toxic. But I am not here to tell you problems. I am here to give you solutions. 😁 

What to do if you work at Toxic work place?

1)  AVOID 

If this job is utmost important to you and the issues are temporary not permanent you can try to avoid the issues and find your own happiness. As Happiness is handmade ❤️

2) TALK

Talk to your trusted colleagues about the issues and see if they can help you on this matters. Try talking with leadership at top. ( Of course sometimes the toxic work place leaders don't know what is going on but surely they want to work on it!)

3) COMMUNICATE

You can communicate the issue directly with the parties involved in the issue. Communication is the key. Communicate what you feel and how you want your work place to be like. 

4) KNOW WHAT YOU WANT

You should not be ready for overwork and rude behaviour. If you don't like express at that moment until it becomes a habit. Set your boundaries before it becomes a habit. 

5) LEGAL CASE

You can file a legal case if you face harrassment at work place if there are relevant laws for the same. Try consulting a good lawyer. 

> This are just my suggestions if you can't exit your toxic work place. But I would always say you and your mental health is most important than any toxic job. Recently a man from a very prestigious college of India committed suicide due to toxic work culture and it is not a small issue at all. Knowing when to exit is a must!! Try updating your LinkedIn profile and resume. Start applying for new jobs. Consider further education or training. Start networking and explore new opportunities. Remember if you die tomorrow then your work place would replace you but your family won't be able to replace you. Your mental health is a priority. Your happiness is an essential. Your self-care is a necessity.

- Drashti Panjrolia 

Note : The work is original and the author does not claim over images. 


March 16, 2023

Tkinter GUI Programming

Education for free
 Tkinter GUI Programming
 


                                  


 (image 1)*

Python provides various options for developing graphical user interfaces (GUIs). Most important are listed below.


● Tkinter Tkinter is the Python interface to the Tk GUI toolkit shipped with Python. We would walk through Tkinter in this blog.

● wxPython This is an open-source Python interface for wxWindows http://wxpython.org.

 JPython JPython is a Python port for Java which gives Python scripts seamless access to Java class libraries on the local machine http://www.jython.org.

Tkinter Programming.

Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit.

Creating a GUI application using Tkinter is an easy task. All you need to do is perform the following steps

 Import the Tkinter module.

● Create the GUI application main window.

● Add one or more of the above-mentioned widgets to the GUI application.

● Enter the main event loop to take action against each event triggered by the user.

Example :

 



 



Tkinter widgets.

There are various widgets like button, canvas, checkbutton, entry, etc. that are used to build the python GUI applications.

Python Tkinter Geometry.


The Tkinter geometry specifies the method by using which, the widgets are represented on display. The python Tkinter provides the following geometry methods.

 1) The pack() method.

The pack() widget is used to organize widget in the block. The positions widgets added to the python application using the pack() method can be controlled by using the various options specified in the method call.

 However, the controls are less and widgets are generally added in the less organized manner.

 SYNTAX : widget.pack(options)

 A list of possible options that can be passed in pack() is given below. 

● expand : If the expand is set to true, the widget expands to fill any space.

 fill : By default, the fill is set to NONE. However, we can set it to X or Y to determine whether the widget contains any extra space.

 ● size : it represents the side of the parent to which the widget is to be placed on the window.

 Example :

 



Output :

 



2) The grid() method.

The grid() geometry manager organizes the widgets in the tabular form. We can specify the rows and columns as the options in the method call. We can also specify the column span (width) or rowspan(height) of a widget.

This is a more organized way to place the widgets to the python application.

SYNTAX : widget.grid(options)

A list of possible options that can be passed inside the grid() method is given below.

  Column : The column number in which the widget is to be placed. The leftmost column is represented by 0.

 ● Columnspan : The width of the widget. It represents the number of columns up to which, the column is expanded.

 Row : The row number in which the widget is to be placed. The topmost row is represented by 0.

● Rowspan : The height of the widget, i.e. the number of the row up to which the widget is expanded.

 Example :


Output :

 



3) The place() method.

The place() geometry manager organizes the widgets to the specific x and y coordinates.

SYNTAX : widget.place(options)

A list of possible options is given below.

 Anchor : It represents the exact position of the widget within the container. The default value (direction) is NW (the upper left corner).

 bordermode : The default value of the border type is INSIDE that refers to ignore the parent's inside the border. The other option is OUTSIDE.

● height, width : It refers to the height and width in pixels.

 x, y : It refers to the horizontal and vertical offset in the pixels.

 Example :

 



 Output :

 



Now, Let’s Build a Text Editor !

 

Building a Text Editor

In this section, you’ll build a text editor application that can create, open ,edit, and save text files. There are three essential elements in the application:

1. A Button widget called btn_open for opening a file for editing

2. A Button widget called btn_save for saving a file

3. A TextBox widget called txt_edit for creating and editing the text file

The layout contains a single row and two columns:

1. A narrow column on the left for the buttons

2. A wider column on the right for the text box

 Example:

 



● Line 1 imports tkinter.

● Lines 3 and 4 create a new window with the title "Simple Text Editor".

 Lines 6 and 7 set the row and column configurations.

● Lines 9 to 12 create the four widgets you’ll need for the text box, the frame, and the open and save buttons.

 These two lines 12 and 13 create a grid with two rows and one column in the frm_buttons frame since both btn_open and btn_save have their master attribute set to frm_buttons.

 Output :



Example :

 Lines 5 to 7 use the askopenfilename() dialog from the tkinter.filedialog module to display a file open dialog and store the selected file path to filepath.

 Lines 8 and 9 check to see if the user closes the dialog box or clicks the Cancel button. If so, then filepath will be None, and the function will return without executing any of the code to read the file and set the text of txt_edit.

 Line 10 clears the current contents of txt_edit using .delete().

 Lines 11 and 12 open the selected file and .read() its contents before storing the text as a string.

 Line 13 assigns the string text to txt_edit using .insert().

 Line 14 sets the title of the window so that it contains the path of the open file.

 Lines 19 to 22 use the asksaveasfilename() dialog box to get the desired save location from the user. The selected file path is stored in the filepath variable.

 Lines 23 and 24 check to see if the user closes the dialog box or clicks the Cancel button. If so, then filepath will be None, and the function will return without executing any of the code to save the text to a file.

 Line 25 creates a new file at the selected file path.

 Line 26 extracts the text from txt_edit with .get() method and assigns it to the variable text.

● Line 27 writes text to the output file.

 Line 28 updates the title of the window so that the new file path is displayed in the window title.

 Output :



Conclusion :

From this blog, you learned how to get started with Python GUI programming. Tkinter is a compelling choice for a Python GUI framework because it’s built into the Python standard library, and it’s relatively painless to make applications with this framework.

 Throughout this tutorial, you’ve learned several important Tkinter concepts:

 How to work with widgets

  How to control your application layout with geometry managers

 How to make your applications interactive

 How to use five basic Tkinter widgets: Label, Button, Entry, Text, and Frame



KRISHNA THAKOR ( 21CE142)

GRISHA VEKARIYA ( 21CE153)

( Guest authors ) 

NOTE: THE WORK IS ORIGINAL AND AUTHOR DOES NOT CLAIM OVER *IMAGE 1

Our Team

  • Dhruv Panjrolia
  • Drashti Panjrolia
  • Mousmi Shrivastava
  • Kalindi Chokshi