-1

Like in

C:\\Python33\\Directory\\test.txt\\*.*

It seems literally impossible to google this, so I'm asking here. I get "FileNotFoundError"s and "NotADirectoryError"s because of these things.

user3201152
  • 2,539
  • 2
  • 13
  • 4
  • 1
    What about a little more context? What is your specific problem? – glglgl Jan 16 '14 at 06:35
  • From double slashes, I am guessing this is in your `python` script. You have to provide that piece of code where this part is there. And Post Error Traceback in full. –  Jan 16 '14 at 07:04
  • Without understanding which line the script is failing, how do you expect us to help you? Post some code part. –  Jan 16 '14 at 07:07

3 Answers3

1

in some implementations *.* as a wildcard matches everything inside the directory

The issue you're probably having though is it looks like you're looking inside test.txt like it's a directory, while it is likely a text file.

Maybe you're trying to open('C:\\Python33\\Directory\\test.txt')? Hard to tell without knowing your specific problem.

mhlester
  • 22,781
  • 10
  • 52
  • 75
0

Asterisk is a wildcard character. It means match on everything. So * . * means match on all files in the directory.

If you have a specific python error you'll need to provide that script.

robnick
  • 1,720
  • 17
  • 27
  • ... and, you can't use the wildcard character in all places that you can use a pathname. The errors the OP mentions means that a wildcard is being used where it is not allowable. – GreenAsJade Jan 16 '14 at 06:04
  • You mainly use wildcards with the `glob` module. – Barmar Jan 16 '14 at 06:06
0

The * is called the wildcard. This can be used to select a group of files/directories.

* - Means files/directories with name of any length. And so this will match files/directories like 'name.txt', 'name' and so on.

.* - means files/directories name starting with a '.' and then followed by any number of characters. And so this will match '.name', '.name.extension' and so on.

*.* - Means files/directories names which start with any number of character followed by a '.' and then followed by any number of characters. This will match all hidden files and files with extension. And so this will not match files that dont have file extension.

Elisha
  • 4,811
  • 4
  • 30
  • 46
Kannan Mohan
  • 1,810
  • 12
  • 15