0% found this document useful (0 votes)
16 views4 pages

Thonny

Thonny is a beginner-friendly Python IDE that includes the Python Standard Library and Thonny-specific libraries, facilitating various functionalities like system interaction, mathematical operations, and GUI development. It also supports external libraries such as NumPy, Pandas, and Matplotlib for advanced data manipulation and visualization. Key functions from these libraries are available for users to perform tasks like HTTP requests, file handling, and data analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Thonny

Thonny is a beginner-friendly Python IDE that includes the Python Standard Library and Thonny-specific libraries, facilitating various functionalities like system interaction, mathematical operations, and GUI development. It also supports external libraries such as NumPy, Pandas, and Matplotlib for advanced data manipulation and visualization. Key functions from these libraries are available for users to perform tasks like HTTP requests, file handling, and data analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Thonny is a beginner-friendly Python IDE that comes with a set of built-in

libraries and supports external libraries. Here’s a breakdown of the key


libraries available in Thonny and their roles:

1. Built-in Python Standard Library

Thonny includes the Python Standard Library, which contains various


modules for different functionalities. Some important ones include:

 sys – Provides access to system-specific parameters and functions.


 os – Interacts with the operating system (e.g., file handling, process
management).
 math – Offers mathematical functions like sqrt(), sin(), cos(),
etc.
 random – Generates random numbers.
 time – Provides functions to handle time and delays.
 datetime – Deals with dates and times.
 json – Handles JSON data (serialization and deserialization).
 tkinter – Provides GUI development tools.
 threading – Supports concurrent execution of tasks.
 sqlite3 – Works with SQLite databases.
 http.client, urllib – Handles HTTP requests and web interactions.

2. Thonny-Specific Libraries

Thonny comes with some additional tools and libraries designed to make
Python programming easier:

 thonny – The main Thonny API, used for interacting with the IDE.
 thonny.ast_utils – Helps with parsing and analyzing Python code.
 thonny.memory – Manages memory visualization.
 thonny.plugins – Allows for adding custom plugins/extensions.
 thonny.backend – Handles communication between the user
interface and the Python interpreter.
3. External Libraries (Can Be Installed)

Thonny supports installing external libraries using pip. Some commonly


used ones include:

 numpy – Numerical computing and arrays.


 pandas – Data analysis and manipulation.
 matplotlib – Data visualization.
 pygame – Game development.
 requests – Handles HTTP requests.
 scipy – Scientific computing.
 tensorflow – Machine learning.
 pyserial – Communicates with serial devices (useful for Arduino
projects).
requests (Web Requests) Listing all functions of the libraries in Thonny would be extremely long,
but I can summarize the key functions for each major library. If you need
 requests.get(url) – Sends a GET request. details on a specific library, let me know!
 requests.post(url, data=payload) – Sends a POST request.

1. Python Standard Library (Built-in Modules)

sys (System-Specific Functions)

 sys.exit() – Exits the program.


 sys.argv – Gets command-line arguments.
 sys.version – Returns the Python version.
 sys.path – Shows the list of module search paths.

os (Operating System Interactions)

 os.getcwd() – Gets the current working directory.


 os.listdir() – Lists files in a directory.
 os.mkdir() – Creates a new directory.
 os.remove() – Deletes a file.

math (Mathematical Functions)

 math.sqrt(x) – Returns the square root.


 math.sin(x), math.cos(x), math.tan(x) – Trigonometric
functions.
 math.pi – Returns the value of π.
 math.factorial(n) – Returns factorial of n.

random (Random Number Generation)


 random.randint(a, b) – Returns a random integer between a and b. 2. Thonny-Specific Functions
 random.choice(list) – Picks a random item from a list.
 random.shuffle(list) – Shuffles a list randomly. These are functions provided by the thonny module for interacting with the
Thonny IDE.

 thonny.get_backend() – Returns the backend used by Thonny.


time (Time Handling)  thonny.get_vm() – Gets the virtual machine instance.
 thonny.get_workbench() – Returns the Thonny workbench (main
 time.sleep(seconds) – Pauses execution for given seconds. UI).
 time.time() – Returns the current time in seconds.

3. External Libraries (Optional but Useful)


datetime (Date and Time Functions) numpy (Numerical Computing)
 datetime.datetime.now() – Returns the current date and time.
 numpy.array([list]) – Creates an array.
 datetime.datetime.today() – Returns today’s date.
 numpy.mean(array) – Returns the mean of an array.
 datetime.timedelta(days=n) – Adds/subtracts days from a date.
 numpy.sum(array) – Returns the sum of all elements.

json (JSON Handling) pandas (Data Handling)


 json.dumps(obj) – Converts Python object to JSON string.
 pandas.DataFrame(data) – Creates a table-like data structure.
 json.loads(json_string) – Converts JSON string to Python object.
 pandas.read_csv('file.csv') – Reads a CSV file.
 pandas.to_csv('file.csv') – Writes data to a CSV file.

tkinter (GUI Development)


matplotlib (Data Visualization)
 tkinter.Tk() – Creates a window.
 tkinter.Button() – Creates a button.
 plt.plot(x, y) – Creates a line plot.
 tkinter.Label() – Displays a label.
 plt.scatter(x, y) – Creates a scatter plot.
 tkinter.mainloop() – Runs the GUI event loop.
 plt.show() – Displays the graph.

You might also like