I need help with coding in python!
class CommandLine:

def __init__(self):

self.root = Directory('', None)

self.current_path = self.root


def run(self):

command = input('>>> ')

while command.strip().lower() != 'exit':

split_command = command.split()

if len(split_command):

if split_command[0] == 'ls':

self.current_path.display()

if len(split_command) >= 2:

if split_command[0] == 'cd':

self.change_directory(split_command[1])

elif split_command[0] == 'makedir':

self.current_path.create_directory(split_command[1])

elif split_command[0] == 'fcreate':

self.current_path.create_file(split_command[1])

elif split_command[0] == 'fwrite':

self.current_path.file_write(split_command[1])

elif split_command[0] == 'fread':

self.current_path.file_read(split_command[1])

elif split_command[0] == 'fclose':

self.current_path.close_file(split_command[1])

elif split_command[0] == 'fopen':

self.current_path.open_file(split_command[1])


command = input('>>> ')


def change_directory(self, dir_name):

pass



class Directory:

def __init__(self, name, parent):

pass


def display(self):

pass


def create_file(self, file_name):

pass


def create_directory(self, dir_name):

pass


def file_write(self, file_name):

pass


def file_read(self, file_name):

pass


def close_file(self, file_name):

pass


def open_file(self, file_name):

pass


class File:

pass



if __name__ == '__main__':

cmd_line = CommandLine()

cmd_line.run()
You must keep track of your current directory, and then you must be able to execute the commands listed below.

(The commands are explicitly different from linux so that you don't accidentally execute them in the shell, except for ls and cd which are harmless.)

Command


ls
Lists contents of the directory
cd [dirname]
Change directory up or down one level.
makedir [dirname]
Make a directory
fcreate [filename]
Creates a file, sets it closed.
fwrite [filename]
Write to a file, only if it's open.
fread [filename]
Read a file, even if it's closed.
fclose [filename]
Close a file. Prevents write.
fopen [filename]
Open a file. Reset the contents

Answers

Answer 1

Answer:

B

Explanation:


Related Questions

Which file format should Wilson use for sending these images?

Answers

I can’t see the answer choices but I would like to say it’s JPEG am not sure. Could you at least provide the answer choices? Thanks!
JPEG I assume, please leave more context clues next time

Consider six memory partitions of 128 KB, 512 KB, 192 KB, 256 KB, 512 KB, and 448 KB (in order). How would each of the first-fit and best-fit algorithms place processes of 210 KB, 420 KB, 110 KB, 450 KB, and 76 KB (in order)

Answers

Answer:

Following are the solution to the given question:

Explanation:

Please find the image file in the attachment.

The first fit (FF) System for both the allocation for capital for the first attach appends information to just the memory through scanning the very first space, that's at least wide enough to accommodate the data, from the start. So space is allocated to information.

Its best solution is to allocate the least stable division which meets the challenging performance effects. It assessment searches throughout the whole list of free partition for the very first time, taking into account the smallest appropriate hole. It tries to find another whole near the process required size.

Identify the potential problem(s) involved with generating or collecting valid data.
A. Cost.
B. Bias.
C. Error.
D. Access to data.
E. All of the above.
F. None of the above.

Answers

Answer:

B. Bias.

C. Error.

Explanation:

Two of the biggest problems that can occur when generating or collecting valid data are Bias and Errors. Biases automatically make the collected data invalid since this causes the data those involved to purposefully skew the data towards the direction that best suits their biases/beliefs which makes the entire study invalid and therefore the data as well. The second main problem would be human error such as entering the wrong data numbers, choosing the wrong subject, losing the data itself, etc. Humans make mistakes and making one during a study can immediately invalidate all of the data that has been collected.

From 1995 to 1997, the number of web users

Doubled
Tripled

Quadrupled

Remained the same

Answers

Quadrupled. I think sorry if you get it wrong i do not remember much
Yup it quadrupled in 1997

find the error in the statement below

if height _variable >59;

print ("you can ride this roller coaster.")​

Answers

Since this code is in python, you have to follow python syntax.

All if statements must end with a colon not a semi colon. For instance,

if height_variable > 59; should be if height_variable > 59:

Also, the print statement should be indented into the if statement.

if height_variable > 59:

   print("you can ride this roller coaster.")

The person who created the Internet is called​

Answers

Answer:

Vinton Cerf and Bob Kahn

Explanation:

Computer scientists Vinton Cerf and Bob Kahn are credited with inventing the Internet communication protocols we use today and the system referred to as the Internet.

A business owns a printer but the printer is used for cloud printing purposes. What type of resource is this?

Answers

I’m confused , what are the choices ?

help with these 2 questions srry for the horrible pic​

Answers

Answer:

the first one is email address nd the second one is semi-blocked letters ? sorry if im wrong.

Explanation:

Answer:

I cant read

Explanation:

Universal Containers (UC) wants to customize basic Salesforce Reports using Lightning Experience. In which two ways can Reports be customized? Choose 2 answers v A. Add a chart. B. Add a Lightning Component. C. Add links to external pages. D. Add a filter.

Answers

Answer:

A. Add a chart.

D. Add a filter.

Explanation:

Workflow management systems can be defined as a strategic software application or program designed to avail companies the infrastructure to setup, define, create and manage the performance or execution of series of sequential tasks, as well as respond to workflow participants.

An example of a work management system is Salesforce.com.

A Salesforce Reports using Lightning Experience refers to an intuitive and powerful software tool used for visualizing and analyzing Salesforce data such as customization, filtering, grouping and creating a summary report.

In this scenario, Universal Containers (UC) wants to customize basic Salesforce Reports using Lightning Experience.

Hence, the two ways in which Reports can be customized are by adding a chart and a filter.

We have discussed four approaches to dealing with moral issues. Which approach is closest to your way of analyzing moral issues? Now that you are aware of different approaches, do you think you might modify your approach to include other perspectives? Explain why or why not.

Answers

Answer:

The four approaches are: The principle approach, in which decisions are made according to a principle such as the Ten Commandments or the Golden Rule The consequence approach, in which decisions are made according to their likely outcomes The virtue/character approach, in which decisions are made according to the ...

helpppp pleaseee thanksss​

Answers

Answer:

B!

Explanation:

i think... Here is an example

Certification is a requirement in pursuing a career as a line installer.

True

False

Answers

Answer:

False

Explanation:

This is rue because, in line installation career, there is no single need for certification but rather to acquire the required skill.

The ability to learn how to be a line installer from an experienced personel is far important than someone who tried to obtain a certification without any acquired skilled to show for it.

Answer:

False

Explanation:

edg2021

Employer training or apprenticeships are required of electrical line installers and repairers. These programs often last up to five years. Certification is not mandatory; however, certification for line installers and repairers is available and does show that you have the right skills and knowledge for this technical job. Often learning on the job is the best way to get experience in this type of position, but it still requires basic understanding of equipment, data communications, and the physical layer of a network.

Which of the following has the greatest impact on telecommunications design?

cost of materials used in manufacturing

availability of resources used in manufacturing

consumer functionality demands


currently trending fashion designs

Answers

Answer:

A

Explanation:

Hope Brainly understood

Answer:

consumer functionality demands

Explanation:

edg2021

In other words, the design is based on what the consumers want (their demands) and how well the design they choose works and fuctions

Design innovation has come a long way in a few years, and it shows no signs of slowing down. Tablets with detachable keyboards, smartphones with better cameras, and more versatile touch screen capability on everything all require technical design and engineering professionals. Along with the technical features, designers must create a device that’s sleek, appealing to consumers, and easy to use, but also rugged enough to survive being dropped, sat on, exposed to water, and dirty. Just as great car design is a successful mix of form and function, design is a major factor in a device’s popularity and sales.

Derek is creating an animation for his class project. What is the first step Derek should follow while creating the animation?
A. storyboarding
B. preparing a script
C. adding voices to the animation
D. choosing an animation tool

Answers

Answer:

1. Script,2.Storyboarding,3.Choosing a Animation tool, 4. Adding voices to the animation

Explanation:

Script comes first since that you have to follow everything on there, then you have to make a illustration of the storyboard, then it comes to choosing which animation tool is better, and last but definitely not least is adding voices to that animation.

Answer: preparing a script

Explanation:

Repeated execution of a set of programming statements is called repetitive execution.

a. True
b. False

Answers

Answer:

False

Explanation:

define an array of 12 structures of type DayMon. Name the array maps[] and initialize the array with the names of the 12 months in a year and the number of days in each month.

Answers

Answer:

#include<stdio.h>

int main(){

 

   int i,n;

   char* maps[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};

   for(i=0;i<12;i++){

       printf("%s\n", maps[i]);

   }

   printf("\n");

 

   int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};

   for(i=0;i<12;i++){

       printf("%s %d\n", maps[i], days[i]);

   }

   printf("\n");

 

   return 0;

}

Explanation:

The C source code above declares two arrays, the maps array which is initialized with the months of the year and the days array which is initialized with the number of days of each month in the maps array. Both arrays are printed out side by side like a table of months and the days in each month.

Neil notices that a single address is generating traffic from its port 500 to port 500 of several other machines on the network. This scan is eating up most of the network bandwidth and Neil is concerned. As a security professional, what would you infer from this scan

Answers

Answer:

It means that the attacker want to determine the type of VPN Implementation and checking for IPSec

Explanation:

VPN means Virtual Private Network and is deployed to share infrastructure with the same access or security policies as a private network among multiple sites.

Evaluate a career in the telecommunications industry that most interests you. What about the career appeals to you?
What qualifications do you already possess to make you successful in this career? Which skills do you still need to
develop to pursue this career?
Your answer should be at least 150 words in length.

Answers

Answer:

Network administrator and programmer.

Am still in A-level, am doing Physics, chemistry, Maths and ICT.

I have an A in physics, B in Chemistry and Maths and A† in ICT

In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set MINIMUM to X.” Read this STATEMENT very carefully and Answer the below Questions.

A. Will this Algorithm RUN?? Yes or No with a justification

B. Will X Replace Any Value or Not?

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The given problem scenario is:

In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set MINIMUM to X.

The answer to question A is: this algorithm will not run because:

If you a list of a positive number and you have already set it MINIMUM to 1, the comparison result with MINIMUM will not obtain. For example, lets suppose a list of numbers L. L={1,2,3,1,1,5,4,3,2}. You have already set the Minimum to 1. When you compare each number X in the list, if X >MINIMUM, then set MINIMUM to X.  

This will not work, because there are positive numbers in the list and the minimum positive number is 1. So the algorithm, will not execute the if-part.

In short, the pseudo-code of this problem is given below:

L={list of positive number e.g. 1,2,3,.......Xn}

MINIMUM=1

foreach ( X in L)

{

(if X<MINIMUM)

   {

       MINIMUM=X

   }

}

The answer to question B is X will not be replaced because X  replaced with MINIMUM only when if-part of this algorithm get executed. However, it is noted that X will not replace any value, if if-part will get executed, the Variable MINIMUM will get replaced with any value.

Select the statement below that would most likely appear in a description of the Link-State routing protocol. Assume the referenced routers are all part of the same network: Group of answer choices Each router talks, sends updates, to all other routers on the network Each router only talks, sends updates, to its neighbors Each router will be controlled by a large master router All of the above

Answers

Answer:

Each router only talks, sends updates to its neighbors

Explanation:

There are two types of routing protocol, they are, link-state and distance-vector routing protocol. The link-state protocol is performed by nodes or routers prepared for packet switching. Each node is responsible for mapping out the route of the network, using the reachability protocol to assert the connectivity to neighboring nodes, updating its route and sending the link-state update messages periodically to neighboring nodes.

It seems like no matter what I do this code is still giving me the error "
Program end never reached (commonly due to an infinite loop, infinite recursion, or divide/mod by 0).
Tests aborted"
import java.util.Scanner;
public class DivideByTwoLoop {
public static void main (String [] args) {
int userNum = 0;
userNum = 20;
while(userNum >= 1){ System.out.print(userNum + " ");
userNum = userNum/2;
}
if((userNum >1) && !(userNum ==0)){
System.out.print(userNum);
} else {
}
while(userNum !=0) System.out.print(userNum + " ");
System.out.println("");
return; }
}

Answers

Explanation:

I ran this on an online compiler with no issues, so I would try to use a different compiler if I were you. For example, sometimes the compiler can run a different program than the one you're currently on.

I would also recommend cleaning up the code. You don't need anything outside of the first part, as the latter 2 parts don't do anything because the number is already 0 by then.

Here's what I ended up with:

int userNum = 20;

       

       while(userNum >= 1){

           System.out.print(userNum + " ");

           userNum = userNum/2;

       }

       

       return;

My output is:

20 10 5 2 1

(Comparable interface) Write Rectangle class that implements the Comparable interface. Override the equals method so that two Rectangle objects are equal if their areas are the same.

Answers

Answer:

class Rectangle(object):

   def __init__(self, area):

       self.area = area

   def __eq__(self,other):

       return self.area == other.area

d = Rectangle(43)

e = Rectangle(23)

print(d == e)

Explanation:

The python program defines a class called Rectangle that accepts one argument 'area' and compare one instance of the object with another instance. The '__eq__' method helps to define the equality of the instance based on their area values. If the areas are equal, the equality statement returns true and false if not.

If an element contains text or another element, it is marked using a ______tag set in which an opening tag and a closing tag enclose the element content.

a. single-sided
b. two-sided
c. one-sided
d. double-sided

Answers

Answer:

b. two-sided

Explanation:

If an element contains text or another element, it is marked using a two-sided tag set in which an opening tag and a closing tag enclose the element content.

For example, <p>it is very important to "check" the expiration date of goods before buying them.</p>. In this scenario, the <p> represents the opening tag while the </p> represents the closing tag in HTML programming.

1. How many column can you insert in a MS Word in maximum?
A. 40
B. 45
C. 50
D. 55
2 What​

Answers

Answer:

63 columns

Explanation:

In Microsoft Word you can insert a table with up to 63 columns, that is the limit to the number of columns allowed in a Word document.

brainliest? plz!

The Chief Information Officer (CIO) has determined the company’s new PKI will not use OCSP. The purpose of OCSP still needs to be addressed. Which of the following should be implanted?A. Build an online intermediate CA.B. Implement a key escrow.C. Implement stapling.D. Install a CRL.

Answers

Answer:

B. Implement a key escrow.

Explanation:

A key escrow can be defined as a data security method of storing very essential cryptographic keys.

Simply stated, key escrow involves a user entrusting his or her cryptographic key to a third party for storage.

As a standard, each cryptographic key stored or kept in an escrow system are directly linked to the respective users and are encrypted in order to prevent breach, theft or unauthorized access.

Hence, the cryptographic keys kept in an escrow system are protected and would not be released to anyone other than the original user (owner).

In this scenario, the Chief Information Officer (CIO) has determined the company's new public key infrastructure (PKI) will not use online certificate status protocol (OCSP). However, the purpose of online certificate status protocol (OCSP) still needs to be addressed. Thus, what should be implemented is a key escrow because the online certificate status protocol (OCSP) is an internet protocol used for maintaining the security of a server and obtaining a digital certificate that has been revoked.

Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the text field without clicking on it. What is correct way using?
1. .
2. .
3. .
4. Can't be done with only HTML5, need help of Javascript or something else.

Answers

Answer:

The answer is "Option 2".

Explanation:

In HTML5, text inputs use an autofocus attribute, which, when the page is loaded, uses a template to concentrate primarily on text fields. This attribute is a Boolean property that represents the HTML autofocus attribute, showing if the related <select> element will receive an output focus whenever the page loads if it is overruled by the user. An only form-associated entity can have this property specified in a text.


on the surface of a magnetic disk fragmentation occurs when file is stored in non-contigious sectors on the disks surface?

Answers

manyetik disk parçalanması, dosya disk yüzeyinde bitişik olmayan sektörlerde depolandığında meydana gelir.

Which one of the following choices identifies employer-sponsored health insurance?

a. NPI
b. CMP
c. NDC

Answers

Answer:

The answer is option A "NPI"

Explanation:

* The National Provider Identifier (NPI) is a Health Insurance Portability and Accountability Act (HIPAA) Authoritative simpleness Standard. The NPI is an unique ID number for covered medical services suppliers. Covered medical care providers and all well being plans and medical services clearing houses should use the NPIs in the managerial and monetary exchanges received under Health Insurance Portability and Accountability Act.

* The NPI is a 10-digit, insight free numeric identifier (10-digit number). This implies that the numbers don't convey other data about medical care providers, for example, the state in which they live or their clinical strength. The NPI should be used in lieu of inheritance supplier identifiers in the Health Insurance Portability and Accountability Act principles exchanges.

* In the US and different nations that don't have national health systems, employers frequently offer medical coverage as an advantage to workers.

If you're a beginner to data analysis, what is the first thing you should check when you build data queries?
a. workflow diagrams
b. calculations
c. differentials
d. record counts

Answers

D. Record Counts, trust me I took notes on this and it’s also in my quizlet

George wanted to make his website more interactive. He decided to create animation for his website. Which software can George consider to design this animation?

A. Reaper
B. Vegas Pro
C. Flash
D. Audacity
E. Quark Xpress

Answers

Answer:

C. Flash

Explanation:

Adobe Flash is a discontinued multimedia software platform used for production of animations, Rich web applications, desktop applications, mobile apps, mobile games, and embedded web browser video players. Flash displays text, vector graphics, and raster graphics to provide animations, video games, and applications.

-Wikipedia

Answer:

C.Flash

Explanation:

Other Questions
3. a stone thrown up is caught by the thrower after 6 seconds how high did it go and where was it 4 seconds after start (g = 9.8m/s2)?? A plot of corn is 15 3/8 yards wide. It is 15 8/15 times as long as it is wide. How long is the plot of corn? PLEASE HELP I'M BEING TIMED!!! LOTS OF POINTS TO THE PEOPLE WHO SOLVE! FIRST ANSWER GETS BRAINLIEST!!! Which of the following was not an economic effect of colonization?A. Privileged access to colonial marketsB. A one-way flow of wealthC. Global economic developmentD. Greater trade restrictions Help plsss Brainliest plus 15 points plzzzzzzzzzzzzzzzzzzzzzzzzz There are 150 children at summer camp. Using the table below, what is the percentage, to the nearest whole percent, of children that did not sign up for canoeing? Are these equivalent ratios? If so, what number did the numerator and denominator get multiplied(or divided by)? PLEASE HELP!!!I'm not asking for 125 words but enough ideas that will get me there.How are epic poems created from oral tradition? Answer should be at least 125 words. 2. Archduke Franz Ferdinand Carl Ludwig Joseph Maria of Austria (18December 1863 28 June 1914) was the heir presumptive to the throne ofAustria-Hungary.[1] His assassination in Sarajevo is considered the mostimmediate cause of ??A. Spanish flu B. Decline of the mayan empire C. sinking of the titanic D ww1 Kevin is interested in a carreer where he can design visual concepts to comunicate ideas advertisements logos and websites Name the two boys that represent 'stolen childhood 'in the text of Lost spring? State the family background of each boy in the Lost spring? 44 kg of onions cost $308. How much would 30 kg cost? Sydney placed 10 guppies in a fish tank she recorded the number of guppies in the tank Would you multiply M by the third equation (6x^5.....) since it is subtraction A ramp has a height of 5.8 feet and an angle of 80. What is the length of the ramp, y to the nearest tenth of a foot? Verify that f has an inverse. Then use function f and the given real number a to find (f-1)'(a). Helppp pleaseeeee!!!! A shipping box, in theshape of a cube, has a volume of 2,300cubic inches. Estimate the length of the sideof the shipping box to the nearest Integer Which of the following inequalities is equivalent to -6 > x?A. x -6D. x -6 Which of the following statements describe how an enzyme affects a chemical reaction in an organism?They decrease the free energy in a chemical reaction by increasing the required activation energy.They increase the free energy in a chemical reaction by lowering the required activation energy.They increase the rate at which a chemical reaction occurs by lowering the required activation energy.They decrease the rate at which a chemical reaction occurs by increasing the required activation energy. Steam Workshop Downloader