Skip to content

writing to files #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions Seth_A99501/day19.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Succefully save to lecture_note.txt\n",
"The content of the file saved is\n",
"resource utilization The amount of a given resource (hardware or software) that is being used. minicomputer mainframe The largest class of computers (along with supercomputers), hosting hundreds of users and many and/or large jobs. minicomputer A mid-sized computer, smaller than a mainframe but larger (in resources and users) than a workstation. workstation A powerful personal computer (PC) for engineering and other demanding workloads. server In general, any computer, no matter the size, that provides resources to other computers. embedded computer A computer system within some other, larger system (such as a car) that performs specifi c, limited functions and has little or no user interface. operating system A program that manages a computer’s hardware, provides a basis for application programs, and acts as an intermediary between the computer user and the computer hardware. middleware A set of software frameworks that provide additional services to application developers. device driver An operating system component that provides uniform access to various devices and manages I/O to those devices. interrupt A hardware mechanism that enables a device to notify the CPU that it needs attention. interrupt vector An operating-system data structure indexed by interrupt address and pointing to the interrupt handlers. A kernel memory data structure that holds the addresses of the interrupt system call Software-triggered interrupt allowing a process to request a kernel service. random-access memory (RAM) Rewritable memory, also called main memory. Most programs run from RAM, which is managed by the kernel. dynamic random-access memory (DRAM) The common version of RAM, which features high read and write speeds. nonvolatile memory (NVM) Persistent storage based on circuits and electric charges. Multiprocessor has evolved over time and now includes multicore systems, in which multiple computing cores reside on a single chip. Multicore systems can be more efficient than multiple chips with single cores because on-chip communication is faster than between-chip communication. nonuniform memory access (NUMA) systems with multiple CPUs (Section 1.3.2), that is not the case. On these systems, a given CPU can access some sections of main memory faster than it can access others. Astorage-area network (SAN) is a private network (using storage protocols rather than networking protocols) connecting servers and storage units, as shown in Figure 11.13. The power of a SAN lies in its flexibility. Multiple hosts and multiple storage arrays can attach to the same SAN, and storage can be dynamically allocated to hosts. The storage arrays can be RAID protected or unprotected drives (Just a Bunch of Disks (JBOD)). A SAN switch allows or prohibits access between the hosts and the storage. As one example, if a host is running low on disk space, the SAN can be configured to allocate more storage to that host. SANs make it possible for clusters of servers to share the same storage and for storage arrays to include multiple direct host connections. SANs typically have more ports—and cost more—than storage arrays. SAN connectivity is over short distances and typically has no routing, so a NAS can have many more connected hosts than a SAN. high-performance computing A computing facility designed for use with a large number of resources to be used by software designed for parallel operation. kernel mode A CPU mode in which all instructions are enabled. The kernel runs in this mode. user mode A CPU mode for executing user processes in which some instructions are limited or not allowed.\n"
]
}
],
"source": [
"#write user input to a text file\n",
"file_name=\"lecture_note.txt\"\n",
"user_input=input(\"Write your notes:\")\n",
"with open(file_name, \"w\") as file:\n",
" file.write(user_input)\n",
" print('Succefully save to',file_name)\n",
" \n",
"#read and display user \n",
"file_name=\"lecture_note.txt\"\n",
"with open(file_name,'r') as file:\n",
" content=file.read()\n",
" print('The content of the file saved is')\n",
" print(content)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}