-1

I'm learning Python and Django and I have a question.

I would like to know how to define a function that does nothing and continue with the flow of program execution while I read an archive.

while True:
     empty()
     with open(r'archive.txt') as myfile:
        for line in myfile:
            print(line)

How I can write a function that does nothing like for example:

def empty(): 
GilZ
  • 6,290
  • 5
  • 28
  • 39
ymd_
  • 179
  • 14

2 Answers2

4

I guess it is like in pure python

def empty():
    pass
aperezfals
  • 1,291
  • 1
  • 7
  • 25
2

If you're using Python 2.x:

def empty():
    pass

With Python 3.x you can also do this:

def empty():
    ... # this is called Ellipsis, simply three dots in a row
ForceBru
  • 41,233
  • 10
  • 61
  • 89