On Thu, Oct 22, 2015 at 4:01 PM, Cynthia Alice Andrews
<the.cynthia.andr...@gmail.com> wrote:
> At this point I feel like I am wasting my time by not asking for help. I
> can't figure out why the file keeps coming back empty. There are no error
> message, just an empy file. Very frustrating.


Unfortunately, the formatting of your code broke a bit.  Can you try
showing us the code again, and make sure that it's in text mode?

On a first glance, I suspect that the code isn't actually even getting
to the point that it's supposed to write to files.  Here's why:
there's a reference to a variable "write_to_file", and I can't tell
where that variable is supposed to be set.  That, plus the fact that
you haven't seen any error messages, most likely means at least two
things:

1.  You probably need to correct the variable from "write_to_file" to
"data", if I read the intention of the program correctly.

2.  You probably need to also correct a bug in the control flow,
because your program isn't reaching the point where it's trying to
write.  Otherwise, you would have seen a runtime error when Python
tries to use the name "write_to_file" which hasn't been defined
anywhere.



Looking more at the code...

    > for x in range(len(drama_actor)):

This looks unusual.  drama_actor is just a single string: ranging
across the characters of a string looks very unusual.  Are you sure
you want to do this?
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to