import random as badrandom

nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')

def displayid(n):
    badrandom_value = badrandom.WichmannHill()
    badrandom_value.seed(n)
    return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)


import os
import random as badrandom

# Find the absolute path relative to this file so this script can be run anywhere
SRC_DIR = os.path.dirname(os.path.realpath(__file__))

nouns = file(os.path.join(SRC_DIR, "nouns.txt")).read().split('\n')
adjectives = file(os.path.join(SRC_DIR, "adjectives.txt")).read().split('\n')

def displayid(n):
    badrandom_value = badrandom.WichmannHill()
    badrandom_value.seed(n)
    return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)


Load files from absolute paths so this can be run from anywhere
Load files from absolute paths so this can be run from anywhere

+ import os
  import random as badrandom
  
+ # Find the absolute path relative to this file so this script can be run anywhere
+ SRC_DIR = os.path.dirname(os.path.realpath(__file__))
+ 
- nouns = file("nouns.txt").read().split('\n')
+ nouns = file(os.path.join(SRC_DIR, "nouns.txt")).read().split('\n')
- adjectives = file("adjectives.txt").read().split('\n')
+ adjectives = file(os.path.join(SRC_DIR, "adjectives.txt")).read().split('\n')
  
  def displayid(n):
      badrandom_value = badrandom.WichmannHill()
      badrandom_value.seed(n)
      return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)
  
  
Load files from absolute paths so this can be run from anywhere
## Code Before:
import random as badrandom

nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')

def displayid(n):
    badrandom_value = badrandom.WichmannHill()
    badrandom_value.seed(n)
    return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)


## Instruction:
Load files from absolute paths so this can be run from anywhere
## Code After:
import os
import random as badrandom

# Find the absolute path relative to this file so this script can be run anywhere
SRC_DIR = os.path.dirname(os.path.realpath(__file__))

nouns = file(os.path.join(SRC_DIR, "nouns.txt")).read().split('\n')
adjectives = file(os.path.join(SRC_DIR, "adjectives.txt")).read().split('\n')

def displayid(n):
    badrandom_value = badrandom.WichmannHill()
    badrandom_value.seed(n)
    return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)

