def Test(request):

    save_path = '/usr/share/newfies/'

    name_of_file = ("Avatar")

    completeName = os.path.join(save_path, name_of_file+".xlm")         

    file1 = open(completeName, "w")

    toFile = raw_input("Write what you want into the field")

    file1.write(toFile)

    file1.close()

This is code for save file in specific directory.Output of this file is empty i 
want to get data from database i write database query in it but it did't 
work.Example\

def Test(request):

    save_path = '/usr/share/newfies/'

    name_of_file = ("Avatar")

    completeName = os.path.join(save_path, name_of_file+".xlm")         

    file1 = open(completeName, "w")

    toFile = Subscriber.objects.all().count()

    file1.write(toFile)

    file1.close()


Subscriber is table name in my database.

How can i get data ?
Thanks in advance !
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to