Newbie Question - Breaking a Function into two The Next CEO of Stack OverflowCalling a function of a module by using its name (a string)How to merge two dictionaries in a single expression?How can I do a line break (line continuation) in Python?Convert two lists into a dictionary in PythonHow to flush output of print function?How to return multiple values from a function?Using global variables in a functionLimiting floats to two decimal pointsHow to make a chain of function decorators?How do I concatenate two lists in Python?

Players Circumventing the limitations of Wish

Spaces in which all closed sets are regular closed

Towers in the ocean; How deep can they be built?

Does higher Oxidation/ reduction potential translate to higher energy storage in battery?

It is correct to match light sources with the same color temperature?

Is it correct to say moon starry nights?

Help! I cannot understand this game’s notations!

From jafe to El-Guest

Film where the government was corrupt with aliens, people sent to kill aliens are given rigged visors not showing the right aliens

Can this note be analyzed as a non-chord tone?

TikZ: How to fill area with a special pattern?

What was Carter Burke's job for "the company" in Aliens?

Cannot shrink btrfs filesystem although there is still data and metadata space left : ERROR: unable to resize '/home': No space left on device

The Ultimate Number Sequence Puzzle

Purpose of level-shifter with same in and out voltages

What happened in Rome, when the western empire "fell"?

Defamation due to breach of confidentiality

Vector calculus integration identity problem

What is the process for cleansing a very negative action

(How) Could a medieval fantasy world survive a magic-induced "nuclear winter"?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Is it convenient to ask the journal's editor for two additional days to complete a review?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

IC has pull-down resistors on SMBus lines?



Newbie Question - Breaking a Function into two



The Next CEO of Stack OverflowCalling a function of a module by using its name (a string)How to merge two dictionaries in a single expression?How can I do a line break (line continuation) in Python?Convert two lists into a dictionary in PythonHow to flush output of print function?How to return multiple values from a function?Using global variables in a functionLimiting floats to two decimal pointsHow to make a chain of function decorators?How do I concatenate two lists in Python?










1















So I am new to python and I have a function that I need to break into two parts. Previously it was one function but after some advice from someone that knows way more than me, I was given the tip that my function did too much, and I need to break it down to two separate things; so here I am.



Below is the code broken into two parts.



I am wondering do I have to mention the pathlist in both functions?



What this is supposed to do is check if the files exist and then if they do then run the second function to remove the actual directories.



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(pathslist)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]

def remove_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))









share|improve this question
























  • "Do I have to mention the pathlist in both functions?" If you want to perform operations on an input, you sure do.

    – esqew
    Mar 8 at 17:34











  • I guess I was second guessing it was able to pull and use the pathlist from the other function or do the directories need to be listed in both spots?

    – Jason Lucas
    Mar 8 at 17:35












  • The advice to break this up is vaguely bogus. You should certainly not have identical code in many places.

    – tripleee
    Mar 8 at 17:38











  • While M is harmless, you should generally use double backslashes, forward slashes, or raw strings when passing around Windows file names.

    – tripleee
    Mar 8 at 17:44












  • @tripleee The advice to break up the code is good; I just don't think OP did it in the best way.

    – thumbtackthief
    Mar 11 at 13:39
















1















So I am new to python and I have a function that I need to break into two parts. Previously it was one function but after some advice from someone that knows way more than me, I was given the tip that my function did too much, and I need to break it down to two separate things; so here I am.



Below is the code broken into two parts.



I am wondering do I have to mention the pathlist in both functions?



What this is supposed to do is check if the files exist and then if they do then run the second function to remove the actual directories.



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(pathslist)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]

def remove_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))









share|improve this question
























  • "Do I have to mention the pathlist in both functions?" If you want to perform operations on an input, you sure do.

    – esqew
    Mar 8 at 17:34











  • I guess I was second guessing it was able to pull and use the pathlist from the other function or do the directories need to be listed in both spots?

    – Jason Lucas
    Mar 8 at 17:35












  • The advice to break this up is vaguely bogus. You should certainly not have identical code in many places.

    – tripleee
    Mar 8 at 17:38











  • While M is harmless, you should generally use double backslashes, forward slashes, or raw strings when passing around Windows file names.

    – tripleee
    Mar 8 at 17:44












  • @tripleee The advice to break up the code is good; I just don't think OP did it in the best way.

    – thumbtackthief
    Mar 11 at 13:39














1












1








1








So I am new to python and I have a function that I need to break into two parts. Previously it was one function but after some advice from someone that knows way more than me, I was given the tip that my function did too much, and I need to break it down to two separate things; so here I am.



Below is the code broken into two parts.



I am wondering do I have to mention the pathlist in both functions?



What this is supposed to do is check if the files exist and then if they do then run the second function to remove the actual directories.



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(pathslist)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]

def remove_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))









share|improve this question
















So I am new to python and I have a function that I need to break into two parts. Previously it was one function but after some advice from someone that knows way more than me, I was given the tip that my function did too much, and I need to break it down to two separate things; so here I am.



Below is the code broken into two parts.



I am wondering do I have to mention the pathlist in both functions?



What this is supposed to do is check if the files exist and then if they do then run the second function to remove the actual directories.



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(pathslist)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]

def remove_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))






python python-3.x






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 17:38









tripleee

95.2k13133189




95.2k13133189










asked Mar 8 at 17:32









Jason LucasJason Lucas

297




297












  • "Do I have to mention the pathlist in both functions?" If you want to perform operations on an input, you sure do.

    – esqew
    Mar 8 at 17:34











  • I guess I was second guessing it was able to pull and use the pathlist from the other function or do the directories need to be listed in both spots?

    – Jason Lucas
    Mar 8 at 17:35












  • The advice to break this up is vaguely bogus. You should certainly not have identical code in many places.

    – tripleee
    Mar 8 at 17:38











  • While M is harmless, you should generally use double backslashes, forward slashes, or raw strings when passing around Windows file names.

    – tripleee
    Mar 8 at 17:44












  • @tripleee The advice to break up the code is good; I just don't think OP did it in the best way.

    – thumbtackthief
    Mar 11 at 13:39


















  • "Do I have to mention the pathlist in both functions?" If you want to perform operations on an input, you sure do.

    – esqew
    Mar 8 at 17:34











  • I guess I was second guessing it was able to pull and use the pathlist from the other function or do the directories need to be listed in both spots?

    – Jason Lucas
    Mar 8 at 17:35












  • The advice to break this up is vaguely bogus. You should certainly not have identical code in many places.

    – tripleee
    Mar 8 at 17:38











  • While M is harmless, you should generally use double backslashes, forward slashes, or raw strings when passing around Windows file names.

    – tripleee
    Mar 8 at 17:44












  • @tripleee The advice to break up the code is good; I just don't think OP did it in the best way.

    – thumbtackthief
    Mar 11 at 13:39

















"Do I have to mention the pathlist in both functions?" If you want to perform operations on an input, you sure do.

– esqew
Mar 8 at 17:34





"Do I have to mention the pathlist in both functions?" If you want to perform operations on an input, you sure do.

– esqew
Mar 8 at 17:34













I guess I was second guessing it was able to pull and use the pathlist from the other function or do the directories need to be listed in both spots?

– Jason Lucas
Mar 8 at 17:35






I guess I was second guessing it was able to pull and use the pathlist from the other function or do the directories need to be listed in both spots?

– Jason Lucas
Mar 8 at 17:35














The advice to break this up is vaguely bogus. You should certainly not have identical code in many places.

– tripleee
Mar 8 at 17:38





The advice to break this up is vaguely bogus. You should certainly not have identical code in many places.

– tripleee
Mar 8 at 17:38













While M is harmless, you should generally use double backslashes, forward slashes, or raw strings when passing around Windows file names.

– tripleee
Mar 8 at 17:44






While M is harmless, you should generally use double backslashes, forward slashes, or raw strings when passing around Windows file names.

– tripleee
Mar 8 at 17:44














@tripleee The advice to break up the code is good; I just don't think OP did it in the best way.

– thumbtackthief
Mar 11 at 13:39






@tripleee The advice to break up the code is good; I just don't think OP did it in the best way.

– thumbtackthief
Mar 11 at 13:39













1 Answer
1






active

oldest

votes


















3















Not exactly. If you are passing in the entire pathslist to remove_directory, you're going to try to remove each one whether or not it exists, making your check_directory function unnecessary. I think what you mean is in your check_directory function to only pass the path that exists in to remove_directory:



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(path)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]


def remove_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))


You may want to try writing a comment for every function you write describing what it does. The second you use the word "and" or an additional verb, that's a hint that you may be better off splitting the function into multiple parts (that's just a rule of thumb, not an absolute). In addition, you want to avoid repeating code--if you have the same lines of code in two separate functions, that's another hint that you need to rethink your design.



Edit: As pointed out in the comments, the way you've written it means that calling check_directory will remove the directory if it exists. It seems reasonable to expect that someone would call check_directory for reasons other than wanting to remove it, and you'd be better off having remove_directory call check_directory rather than the other way around:



 def check_directory(path):
# returns true if path is an existing directory
return os.path.exists(path) and os.path.isdir(path)

def remove_directory(pathlist):
for path in pathlist:
if check_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))






share|improve this answer




















  • 3





    I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

    – esqew
    Mar 8 at 17:38











  • @esqew That's a good point.

    – thumbtackthief
    Mar 8 at 17:39











  • @thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

    – Jason Lucas
    Mar 8 at 19:30












  • @JasonLucas That means somewhere you're calling check_directory without passing in an argument.

    – thumbtackthief
    Mar 8 at 19:54











  • to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

    – Jason Lucas
    Mar 8 at 20:21












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068229%2fnewbie-question-breaking-a-function-into-two%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3















Not exactly. If you are passing in the entire pathslist to remove_directory, you're going to try to remove each one whether or not it exists, making your check_directory function unnecessary. I think what you mean is in your check_directory function to only pass the path that exists in to remove_directory:



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(path)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]


def remove_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))


You may want to try writing a comment for every function you write describing what it does. The second you use the word "and" or an additional verb, that's a hint that you may be better off splitting the function into multiple parts (that's just a rule of thumb, not an absolute). In addition, you want to avoid repeating code--if you have the same lines of code in two separate functions, that's another hint that you need to rethink your design.



Edit: As pointed out in the comments, the way you've written it means that calling check_directory will remove the directory if it exists. It seems reasonable to expect that someone would call check_directory for reasons other than wanting to remove it, and you'd be better off having remove_directory call check_directory rather than the other way around:



 def check_directory(path):
# returns true if path is an existing directory
return os.path.exists(path) and os.path.isdir(path)

def remove_directory(pathlist):
for path in pathlist:
if check_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))






share|improve this answer




















  • 3





    I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

    – esqew
    Mar 8 at 17:38











  • @esqew That's a good point.

    – thumbtackthief
    Mar 8 at 17:39











  • @thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

    – Jason Lucas
    Mar 8 at 19:30












  • @JasonLucas That means somewhere you're calling check_directory without passing in an argument.

    – thumbtackthief
    Mar 8 at 19:54











  • to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

    – Jason Lucas
    Mar 8 at 20:21
















3















Not exactly. If you are passing in the entire pathslist to remove_directory, you're going to try to remove each one whether or not it exists, making your check_directory function unnecessary. I think what you mean is in your check_directory function to only pass the path that exists in to remove_directory:



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(path)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]


def remove_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))


You may want to try writing a comment for every function you write describing what it does. The second you use the word "and" or an additional verb, that's a hint that you may be better off splitting the function into multiple parts (that's just a rule of thumb, not an absolute). In addition, you want to avoid repeating code--if you have the same lines of code in two separate functions, that's another hint that you need to rethink your design.



Edit: As pointed out in the comments, the way you've written it means that calling check_directory will remove the directory if it exists. It seems reasonable to expect that someone would call check_directory for reasons other than wanting to remove it, and you'd be better off having remove_directory call check_directory rather than the other way around:



 def check_directory(path):
# returns true if path is an existing directory
return os.path.exists(path) and os.path.isdir(path)

def remove_directory(pathlist):
for path in pathlist:
if check_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))






share|improve this answer




















  • 3





    I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

    – esqew
    Mar 8 at 17:38











  • @esqew That's a good point.

    – thumbtackthief
    Mar 8 at 17:39











  • @thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

    – Jason Lucas
    Mar 8 at 19:30












  • @JasonLucas That means somewhere you're calling check_directory without passing in an argument.

    – thumbtackthief
    Mar 8 at 19:54











  • to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

    – Jason Lucas
    Mar 8 at 20:21














3












3








3








Not exactly. If you are passing in the entire pathslist to remove_directory, you're going to try to remove each one whether or not it exists, making your check_directory function unnecessary. I think what you mean is in your check_directory function to only pass the path that exists in to remove_directory:



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(path)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]


def remove_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))


You may want to try writing a comment for every function you write describing what it does. The second you use the word "and" or an additional verb, that's a hint that you may be better off splitting the function into multiple parts (that's just a rule of thumb, not an absolute). In addition, you want to avoid repeating code--if you have the same lines of code in two separate functions, that's another hint that you need to rethink your design.



Edit: As pointed out in the comments, the way you've written it means that calling check_directory will remove the directory if it exists. It seems reasonable to expect that someone would call check_directory for reasons other than wanting to remove it, and you'd be better off having remove_directory call check_directory rather than the other way around:



 def check_directory(path):
# returns true if path is an existing directory
return os.path.exists(path) and os.path.isdir(path)

def remove_directory(pathlist):
for path in pathlist:
if check_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))






share|improve this answer
















Not exactly. If you are passing in the entire pathslist to remove_directory, you're going to try to remove each one whether or not it exists, making your check_directory function unnecessary. I think what you mean is in your check_directory function to only pass the path that exists in to remove_directory:



def check_directory(pathslist):
for path in pathslist:
if os.path.exists(path) and os.path.isdir(path):
remove_directory(path)

dirs_to_delete = [
'C:MyDirectoryPath1',
'C:MyDirectoryPath2',
'C:MyDirectoryPath3'

]


def remove_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))


You may want to try writing a comment for every function you write describing what it does. The second you use the word "and" or an additional verb, that's a hint that you may be better off splitting the function into multiple parts (that's just a rule of thumb, not an absolute). In addition, you want to avoid repeating code--if you have the same lines of code in two separate functions, that's another hint that you need to rethink your design.



Edit: As pointed out in the comments, the way you've written it means that calling check_directory will remove the directory if it exists. It seems reasonable to expect that someone would call check_directory for reasons other than wanting to remove it, and you'd be better off having remove_directory call check_directory rather than the other way around:



 def check_directory(path):
# returns true if path is an existing directory
return os.path.exists(path) and os.path.isdir(path)

def remove_directory(pathlist):
for path in pathlist:
if check_directory(path):
shutil.rmtree(path)
print(colored('Found ' + path + ' removing', 'green'))







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 11 at 13:49

























answered Mar 8 at 17:36









thumbtackthiefthumbtackthief

2,61252763




2,61252763







  • 3





    I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

    – esqew
    Mar 8 at 17:38











  • @esqew That's a good point.

    – thumbtackthief
    Mar 8 at 17:39











  • @thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

    – Jason Lucas
    Mar 8 at 19:30












  • @JasonLucas That means somewhere you're calling check_directory without passing in an argument.

    – thumbtackthief
    Mar 8 at 19:54











  • to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

    – Jason Lucas
    Mar 8 at 20:21













  • 3





    I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

    – esqew
    Mar 8 at 17:38











  • @esqew That's a good point.

    – thumbtackthief
    Mar 8 at 17:39











  • @thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

    – Jason Lucas
    Mar 8 at 19:30












  • @JasonLucas That means somewhere you're calling check_directory without passing in an argument.

    – thumbtackthief
    Mar 8 at 19:54











  • to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

    – Jason Lucas
    Mar 8 at 20:21








3




3





I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

– esqew
Mar 8 at 17:38





I've upvoted because you're answering the direct question. A bit out of scope of the topic at hand, but the method name check_directory becomes a bit mis-leading if this were to become part of a bigger project. Someone using check_directory might be curious to know why it's also deleting the directory they pass in. A better paradigm would be to call check_directory() in remove_directory()

– esqew
Mar 8 at 17:38













@esqew That's a good point.

– thumbtackthief
Mar 8 at 17:39





@esqew That's a good point.

– thumbtackthief
Mar 8 at 17:39













@thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

– Jason Lucas
Mar 8 at 19:30






@thumbtackthief - I edited my code but when calling the function i am getting a error - TypeError: check_directory() missing 1 required positional argument: 'path'

– Jason Lucas
Mar 8 at 19:30














@JasonLucas That means somewhere you're calling check_directory without passing in an argument.

– thumbtackthief
Mar 8 at 19:54





@JasonLucas That means somewhere you're calling check_directory without passing in an argument.

– thumbtackthief
Mar 8 at 19:54













to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

– Jason Lucas
Mar 8 at 20:21






to call the function "check_directory" to start checking for folders do i need to do anything other then check_directory()

– Jason Lucas
Mar 8 at 20:21




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068229%2fnewbie-question-breaking-a-function-into-two%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived