-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,418
  • 5
  • 30
  • 40
ymd_
  • 189
  • 15

2 Answers2

4

I guess it is like in pure python

def empty():
    pass
aperezfals
  • 1,341
  • 1
  • 10
  • 26
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
  • 43,482
  • 10
  • 63
  • 98