Python Forum
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Function Call
#1
Complete Noob to programming.  With that out of the way,  Going into the function does not appear to be happening.

I put a print statement in the "if then" to verify my condition was in fact matching (it is, 35 times).
I commented out that print statement;  I then commented out all the function, and added a very simple print statement.
I get zero output within the function.
Would love to know what I'm missing.

Many Thanks,
PappaBear


original_file = open('c:\\scripts\\original-objects.txt', 'r')
new_file = open('c:\\scripts\\converted-objects.txt', 'w')
print("Prepped both input/output files")
addressword = "object "

def found_new_address_object():
print ("Now in Function")
# commented out conversion steps
# writing out to a new file, etc
return

original_lines = original_file.readlines()

print ("Starting for loop")
for counter in range(len(original_lines)):
if addressword in original_lines[counter]:
#print ("yes on if statement")
found_new_address_object
Reply


Messages In This Thread
Simple Function Call - by PappaBear - Apr-04-2017, 10:59 PM
RE: Simple Function Call - by Mekire - Apr-04-2017, 11:06 PM
RE: Simple Function Call - by PappaBear - Apr-04-2017, 11:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 801 May-02-2023, 08:40 AM
Last Post: Gribouillis
  how to call an object in another function in Maya bstout 0 2,089 Apr-05-2021, 07:12 PM
Last Post: bstout
  In this function y initially has no value, but a call to foo() gives no error. Why? Pedroski55 8 3,509 Dec-19-2020, 07:30 AM
Last Post: ndc85430
  Struggling for the past hour to define function and call it back godlyredwall 2 2,233 Oct-29-2020, 02:45 PM
Last Post: deanhystad
  list call problem in generator function using iteration and recursive calls postta 1 1,922 Oct-24-2020, 09:33 PM
Last Post: bowlofred
  function call at defined system time? Holon 5 3,255 Oct-06-2020, 03:58 PM
Last Post: snippsat
  How to call/read function for all elements in my list in python johnny_sav1992 1 2,092 Jul-27-2020, 04:19 PM
Last Post: buran
  Simple automated SoapAPI Call with single variable replacement from csv asaxty 1 2,119 Jun-30-2020, 06:38 PM
Last Post: asaxty
  Python: Call function with variabele? Ending in error. efclem 5 2,972 Apr-22-2020, 02:35 PM
Last Post: buran
  got SyntaxError while building simple function zarize 2 2,134 Feb-14-2020, 10:51 AM
Last Post: zarize

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020