[Tutor] Re: accepting wild chars from pythons command line

Derrick 'dman' Hudson dman@dman.ddts.net
Mon Oct 21 23:17:09 2002


--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 21, 2002 at 02:39:38AM -0700, roslyn jose wrote:
|=20
| hi,
|=20
| i have a list of .txt files that i would like to enter from command
|  line, but as its a hassle to write all the names i would like to just
|  type in *.txt at the python command line. could someone tell me how i
|  can have python interpret that wils char, is there any built in
|  function?? thanks.

Actually, python will never see the '*' character.  The /shell/
expands it first.  Depending on your system and environment, that
shell is often one of  bash, ash, csh, tcsh, ksh, zsh, command.com or
cmd.exe.  The beauty of shell metacharacters is that the shell handles
their expansion and your program can't tell the difference.

-D


--EeQfGwPcQSOJBaQU
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj20x1wACgkQO8l8XBKTpRTeRgCgheP1EWpWjqtsUbq7kijUBIl5
NuQAoKobT9DyNQevahel9y+z2sM8X4JR
=g/5b
-----END PGP SIGNATURE-----

--EeQfGwPcQSOJBaQU--