def TransDate(self):
        TransDate = ['010917', '020917', '030917','040917','050917','060917','070917','080917','090917']

        # We select a random destination from the list and return it
        return random.choice(TransDate)

# Add the TravelProvider to our faker object
fake.add_provider(TransDate)

# We can now use the destination method:
f = open("Credit_Transaaction_011017.txt","w") #opens file with name of "test.txt"
for i in range(3000000):
    print(fake.credit_card_number()+ "," +fake.ssn()+ "," 
    	 +fake.ProductType()+ "," + str(random.randint(100000,5000000))+ "," 
    	 +fake.Currency() + "," +fake.merch_name()+ "," +fake.merch_category()+ "," 
    	 +fake.merch_group()+","+ str(random.randint(1,10000000))+ "," 
    	 +fake.TransDate()+ "," +fake.TransType() + ","  
    	 +fake.city()+ "," +fake.zipcode()+ "," +fake.country() 
    	 )
    
    f.write(fake.credit_card_number()+ "," +fake.ssn()+ "," 
    	 +fake.ProductType()+ "," + str(random.randint(100000,5000000))+ "," 
    	 +fake.Currency() + "," +fake.merch_name()+ "," +fake.merch_category()+ "," 
    	 +fake.merch_group()+","+ str(random.randint(1,10000000))+ "," 
    	 +fake.TransDate()+ "," +fake.TransType() + ","  
    	 +fake.city()+ "," +fake.zipcode()+ "," +fake.country() 
    	 )

f.close()