I could not find a dedicated photo-editing section, hence posting here. Apologies if wrong place.  Query:  I have thousands of photos, which I need to show time/date/custom-text on all photos.  Editing all individuals photos will be impossible!   Is there any way to do this in batch-mode?
Is there any utility which will read a photo's date and time from its EXIF data and embed it into the corner of the photo?
Flattening a shallow list in Python Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  &gt;&gt;&gt; reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  &gt;&gt;&gt; [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  &gt;&gt;&gt; from itertools import chain &gt;&gt;&gt; list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  &gt;&gt;&gt; chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) &gt;&gt;&gt; print(list(chain)) &gt;&gt;&gt; [1, 2, 3, 5, 89, 6] Correct usage of "lest" Which of the followings is/are the correct usage of the word "lest"? How are these different from each other?   ...hesitant to speak out lest he be fired. ...hesitant to speak out lest he'd be fired. ...hesitant to speak out lest he would/will be fired.   P.S. I took point number 1 as the reference for this question from the definition of lest from the Merriam-Webster Dictionary. How can I output colored text to the terminal in Python? The question is :   Show that $I=\langle 2+2 i\rangle$ is not a prime ideal of $\mathbb Z[i]$. Also find the number of elements in $\mathbb Z[i]/I$ and its characteristic.  My try:  I started with elements $2, 1+i \in \mathbb Z[i]$. Clearly, the product is $0$ in the coset representation.  The part where i am struck at is the number of elements and the characteristic.  Well, $2+2i+\langle 2+2i\rangle=0+\langle 2+2i\rangle$  Can we directly write $i^2=-1$ in the coset representation? antonym for beneficiary Is there an antonym for beneficiary that is not simply "giver" or "payer"? I'm looking for a word that roughly mean someone who loses financially in the case of an event. I've recently read a  from a local paper that included the following:     The pair was drinking prior to the shooting.   To me, this appears wrong and I would say that the proper way to make the statement would be:     The pair were drinking prior to the shooting.   Is the original article correct? Why does the browser renders a newline as space? I'm a big fan of the podcast Astronomy Cast and a while back I was listening to a Q&amp;A episode they did. A listener sent in a question that I found fascinating and have been wondering about ever since.   From the show :      Arunus Gidgowdusk from Lithuania asks: "If you took a one kilogram mass and accelerated it close to the speed of light would it form into a black hole? Would it stay a black hole if you then decreased the speed?"   Dr. Gay, an astrophysicist and one of the hosts, explained that she'd asked a number of her colleagues and that none of them could provide a satisfactory answer. I asked her more recently on Facebook if anyone had come forward with one and she said they had not.  So I thought maybe this would be a good place to ask. My coach said that for all positive integers $n$, $n^4+4^n$ is never a prime number.  So we memorized this for future use in math competition.  But I don't understand why is it? How do I ping a website or IP address with Python? Add warning when changing display name The policy on changing one's display name :  only one display name change is allowed every 30 days  However, there is no warning whatsoever when actually changing one's display name.  Thus, it came as quite a bit of a shock to me when I found out today that I might be stuck as &quot;Unicorns are Yummy&quot; on Stack Overflow for the next freakin' month. I would like to recommend that a warning be added to the &quot;Edit Profile&quot; page to warn people. Or, at least make the policy concerning display name changes more obvious. Workaround I was able to change my display name back (phew!) by copying my profile from Meta Stack Overflow. I still think a warning should be implemented, though. I get these weird characters when I try to print out a vector element! In Italian, when I write a sentence about an action (e.g. eating fish, playing), I would use the infinitive, such as  mangiare pesce fa bene alla salute (which literally is "to eat fish is healthy"), or giocare aiuta ad imparare (which literally is "to play helps to learn").   I would use the gerund in giocando si impara, but that would roughly mean "When playing, you learn." and in this case the infinitive would not be correct. (Giocare si impara is not what you would say in Italian.)  Should I use the infinitive, or the gerund, in sentences similar to the following ones?   To play with fire is dangerous. To win the lottery is just a matter of luck. To escape from Alcatraz is impossible. To practice makes you perfect.   Is the infinitive always wrong, when the verb is the subject of a sentence? If a product of relatively prime integers is an $n$th power, then each is an $n$th power I'm trying to follow a line in a derivation for $P(Z&gt;X+Y)$ where $X,Y,Z$ are independent continuous random variables distributed uniformly on $(0,1)$.  I've already derived the pdf of $X+Y$ using the convolution theorem, but there's a line in the answer that says:  $P(Z&gt;X+Y) = \mathbb{E}[\ P(Z&gt;X+Y\ |\  X+Y )\  ]$ where $\mathbb{E}$ is the expectation.  I'm not familiar with this result. Could anyone give a pointer to a similar result if one exists?  Thanks. Where to get 2010 Census Block data? I would like to download 2010 Census Block Data for several towns and I can't seem to find it on American Factfinder.   Is it there? And if not, does anyone know where I could find it? Reflection of sound waves from the open end of an organ pipe & relationship b/w nodes & pressure We know that standing waves are created when any wave traveling along the medium will reflect back when they reach the end. But in an open organ pipe, there is nothing to oppose the wave and reflect it back. So then how are standing waves created in such a case? In standing waves where is the pressure greater, at nodes or anti-nodes? DNS subdomain (child) NS records If we have example.com we would setup things something like this: $ORIGIN example.com. @  1D  IN  SOA ns1.example.com. hostmaster.example.com. (                   2002022401 ; serial                   3H ; refresh                   15 ; retry                   1w ; expire                   3h ; nxdomain ttl                  )           IN  NS     ns1.example.com.           IN  NS     ns2.example.com.  since in the parent zone .com. there is already NS record for the example.com. child zone and A glue record for the ns1.example.com. for what purpose do we state NS records again in the child zone? and also, do we need to state A record for the name servers in the child zone itself? Should student or supervisor be corresponding author for publications based on student research? Papers published from an academic project (MSc or PhD) usually have two authors; the first author is the student who mainly conducted the research, and the second author is the professor who supervised the projects.  The corresponding author is the one who take the responsibility of a paper, and thus, some believe that students are not yet prepared to take this responsibility.  Ideally, who should be corresponding author for papers published by MSc or PhD projects?  I understand that it mainly depends on personal agreements and preferences, but I want to know which case is more reasonable from academic logic? Importing an .obj file and nothing is showing