I think/hope this a an easy question that I just can't find the answer to - how do I create a directory where the title contains a colon? I'm scraping data from a website with variables for section and year, and creates a directory:  if 'C:Path/Data/%s' % stat:                 directory = 'C:Path/Data/%s' % stat                             else:                                 directory = 'C:Path/Data/%s' % stat.replace('/', ' ')             if not os.path.exists(directory):                 try:                     os.makedirs(directory)                 except OSError as e:                     if not e.errno != errno.EEXIST:                         raise   I have some error handling in there based on what's coming back. I had to bring in errno to skip the section that was erring. I want to bring in that data however - and I believe the issue is the title of the section, and thus the directory, contains a : in a directory like:  /Year: some_data/   I receive this error:  OSError: [Errno 22] Invalid argument: Failed with OSError   My question is - how do I create or handle the creation of a directory with a : in the title? I'm just skipping over it for now.  I apologize if this is a duplicate but I couldn't find anything specifically. I'm running python 3.6 in Jupyter Notebook on Windows 10. Thank you.
My problem is that, I can not give name of my folder or file with special characters like \ / : * ? " &lt; > | in windows based O.S. This is very important for me, that giving name of file/folder which contain this type of characters.  I already search and refer so many site,for this problems but all are hopeless. I also read Microsoft support page, they suggest use other characters. This is its link,    I already try Alt button + ASCII code number of this type of special characters, from numpad key, just example rename file/folder and press Alt+60 (for &lt; characters) Still it giving message that, A filename cannot contain any of the following characters: \ / : * ? " &lt; > |   Suggest me suitable solution so that I can give name of my file/folder with this type of special characters.
Two identical files; Apache says one is forbidden I've got this one file, favicon.ico. It's actually a large group of nested files, but purely for example, just this one.  If I do cp favicon.ico favicon2.ico, Apache can read the second one just fine.  If I do mv favicon.ico favicon3.ico, Apache throws a 403 on favicon3.ico.  If I su apache, I can read the file as apache.  stat says both files are identical, except for the inode number.  Is there some hidden flag somewhere or something that I'm missing? I've never seen anything like this.  error_log says (13)Permission denied: access to /favicon3.ico denied How can I find out which process is locking a file or folder in Windows?  For instance, when trying to delete a folder, Windows reports this:     The action can't be completed because the folder is open in another program   Happens the same with a file, but how do I find out what program or application is currently using it and preventing me from deleting the file or folder? File sync error (AUTH_FAILED) Recently I started getting a File sync error on all 3 of my PCs running Ubuntu One.  One is running Ubuntu, the other 2 are running Windows 8.  Looking at the list of clients on the web, none of them were there anymore.    I found this article:      On how to fix the issue for my Ubuntu PC and it worked perfectly.  Now I am looking for a similar fix for Windows but haven't found one yet.  I've tried un-installing Ubuntu One and re-installing it, but it must still be holding the keys somewhere because it never asked me to login again.    Does anyone know where I can clear these keys to get my files syncing on Windows again? Is one time pad cipher reuse and random key secure? For each $y \in \mathbb{R}$ either no $x$ with $f(x) = y$ or two such values of $x$. Show that $f$ is discontinuous. This is from Apostol's Mathematical Analysis.  Let $f$ be a function defined in $[0, 1]$ such that for each real number $y$ either there is no value of $x \in [0, 1]$ such that $f(x) = y$ or there are exactly two such values of $x$. Prove that a) $f$ must be discontinuous on $[0, 1]$. b) $f$ has an infinite number of discontinuities in $[0, 1]$.  Long back I had tried to solve the problem. I reasoned for a) as follows: Suppose that $f$ is continuous and let $m, M$ be its minimum and maximum values on $[0, 1]$. Clearly if $m = M$ then $f$ is constant and clearly for every $x \in [0, 1]$ we have $f(x) = m = M$ which contradicts given property of $f$. So we must have $m &lt; M$. Clearly there are now four distinct points $a, b, c, d$ in $[0, 1]$ such that $f(a) = f(b) = m, f(c) = f(d) = M$. By checking possible linear orderings of $a, b, c, d$ I could find a find a value of $y \in (m, M)$ for which there exist more than 2 values of $x$ such that $f(x) = y$. However this approach looks very clumsy and I suspect much simpler and easier proof is possible. Part b) seemed bit complex and my only guess was that probably $f$ was discontinuous on each subinterval of $[0, 1]$ but I could not prove this claim (may be the claim is wrong!). Perhaps there is a simpler solution to this part of the problem. Apostol's also asks to provide an example of such a function. Any hints on the overall problem will be appreciated.  Update: After looking at Marc's answer, I think I have found a way to show that there are infinitely many discontinuities. Earlier the solution was a part of the question itself but it made the question look quite lengthy hence I moved it to a separate answer. Prove $(1-a)(1-b)(1-c)(1-d)\geq abcd$ if $a^2+b^2+c^2+d^2=1$ Let $a,b,c,d\geq0$, $a^2+b^2+c^2+d^2=1$ Prove $\displaystyle (1-a)(1-b)(1-c)(1-d)\geq abcd$ I mutiplied both with $\displaystyle (1+a)(1+b)(1+c)(1+d)$ to use $1-a^2=b^2+c^2+d^2$ and try using the cauchy-schwarz and holder but it is doesn't work. How to get git-completion.bash to work on Mac OS X? I have followed  to  add git-completion.bash to my /opt/local/etc/bash_completion.d/git-completion  and I put PS1='\h:\W$(__git_ps1 "(%s)") \u\$ ' in my .bashrc_profile  But now I am getting this -bash: __git_ps1: command not found everything I do a cd.  Can you please tell me what am I missing? How do I remove a file I accidentally created named $file? I was working on a shell script and I accidentally created a file with the variable as its name. Now I have $file in my ls output, and cannot remove it.  What can I do? Radius of Convergence of a given Power series In film reviews/essays about a book or film, does the title of the movie/book always have to be highlighted/put in italics? Dropping one of the columns when using one-hot encoding How can I type a Unicode character (for example, em-dash —?) The title pretty much says it all: how can I type Unicode characters - specifically the em-dash —? Do parts of a hash carry the properties of the entire hash? When I need to generate unique id's based on some information hashing is typical choice. However, sometimes that id needs to be of a particular size.  I've seen a lot of schemes (HMAC-MD5-96 in SSH, CGA in SeND for IPv6) that use a portion of a hash, so I'm thinking it might be alright to use it that way.    Which properties of a hash are preserved and which do not apply anymore?  Obviously, with less bits, the chance of collision goes up, but can I still rely on the partial hash for uniform character distribution?  What about the ?  I'm guessing that if a hash modifies the entire hash upon the smallest change to the input, that would imply that a portion of that hash would be equally well changed.  Am I thinking about this correctly?  Also, would these behaviors be different for different hashing algorithms? I use wubi to install Ubuntu 10.10 on my ntfs partition. So I want to change the home folder to a folder on the ntfs partition. I could keep the personal configuration, software and so on after reinstalling the Ubuntu.  So I use ntfs-config to manage the disk partition, it's mounted when system is startup. And the permission of all files and directories are 777.  Then I modified the /etc/passwd to set the home folder to the folder on the ntfs partition. I can successfully login the account, however it looks like the .bashrc and .profile are not loaded correctly. I can't use the input method(even can't configure ibus), no sound device. However everything works well after changing the home folder back to /home/.  Could anybody give me a hint to make it work? Thanks. Proof that disjoint cycles commute I'm trying to prove that in a symmetric group two disjoint cycles commute. But I suspect that something is not right about my proof (a sense of vagueness). Some hints would be appreciated.  Here's my proof:  Let $\sigma=(s_1 s_2 ... s_n)$, $\tau=(t_1 t_2 ... t_m)$ for some integers $m, n$. That is, $s_i \neq t_j$ for any $i \in [1, n]$, $j \in [1, m]$. Now, $\sigma\tau=(s_1 ... s_n)(t_1 ... t_m)$ is a cycle of disjoint permutations, which cannot be represented by any other disjoint permutations. Thus $\sigma\tau=\tau\sigma$. Get last result in interactive Python shell How does some of the black hole (BH) mass escape the event horizon (EH) of either BH, or the merged EH of two merged BHs? I am new to dslr's and got a nikon 3000 with 18-55 lens as a gift.  I already see some limitations with the lens for walking about or on trails.  So my question is being new should I go with a 55-200 or 55-300 or is there another step before I go with a telephoto lens. Indirectly access environment variable Given I have in a bash script  ev=USER   How can I get the environment variable value for $USER using ev?  Tried naively doing:  echo ${"$"$ev}   which results in bad substitution.  I'd expect to get back whatever the value of $USER is. I am using a chi-sq test between two proportions (). I am using this over the z-test for proportions because I do not think my data is normal.   My question is how do I get the difference (shift) estimate &amp; confidence intervals for this test.   For example,     Data1: 193/252=.77   Data2: 154/227=.68   P-value=.032 (I used the formula in the link above. I will also add my exact code below)  Shift Estimate: I assume its the difference between proportions, ie .77-.68=.09. Is this correct?   Confidence Interval: ??????????????????  Code for generating P-value (matlab):   % Pooled estimate of proportion  p0 = (n1+n2) / (N1+N2); % Expected counts under H0 (null hypothesis)  n10 = N1 * p0;  n20 = N2 * p0; % Chi-square test, by hand  observed = [n1 N1-n1 n2 N2-n2];  expected = [n10 N1-n10 n20 N2-n20];  chi2stat = sum((observed-expected).^2 ./ expected);  p = 1 - chi2cdf(chi2stat,1);  H=0; if(p&lt;.05), H=1; end