Glob quick question` Programming Software Development by hughesadam_87 …, file2, DIRECTORY1, DIRECTORY2[/CODE] When I use the glob command: [CODE]os.chdir(element_directory) '''This is needed …for the 'glob' import to understand where it is looking for the… raw files''' file_list = glob.glob("*")[/CODE] It returns the files, and … Re: Glob quick question` Programming Software Development by jlm699 … could ignore the directories yourself like so: [code=python] file_list = glob.glob('*') for file in file_list: if not os.path.isdir(file… a list comprehension: [code=python] file_list = [ file for file in glob.glob('*') if not os.path.isdir(file) ] [/code] Re: Glob quick question` Programming Software Development by vegaseat The main idea about using module glob is to look for specific files. If you give glob a more specific wildcard like '*.jp*' then it will only list .jpg or .jpeg files and not subdirectories. The way you are using glob makes little sense and you might better use os.listdir(folder). Re: glob and whitespaces Programming Software Development by d5e5 …quot;http://perldoc.perl.org/functions/glob.html"]http://perldoc.perl.org/functions/glob.html[/URL] Instead you can …to override the behaviour of Perl's built-in glob function.[CODE]#!/usr/bin/perl use 5.006; use… strict; use warnings; use File::Glob ':glob'; my @files = </home/david/Programming/untitled folder/*>… glob and whitespaces Programming Software Development by abdolah hello i used this while(my $file=glob("$dir/*")){ but as the directory has whitespace in path-name it cause error ,how i can solve this? thnx. Re: Use glob with urrlib2 Programming Software Development by Gribouillis glob.glob() does not accept url arguments, read the documentation. If the site doesn't give you an url to list the directory, I don't think it can be done. Use glob with urrlib2 Programming Software Development by flebber … is creating a list of file names with glob from two sources and comparing them and download …is where i was going. [CODE]import urllib2, urlparse, glob def getfile(base, fileExt): base = ('http://www.tvn.com… files = [] files = files.append(urllib2.urlopen(base + glob.glob('?_C.rtf')))[/CODE] PS I checked with urllib that the… Re: Use glob with urrlib2 Programming Software Development by Gribouillis …not directly an answer but there is a solution using glob and urrlib here [URL="http://pastebin.com/m6ae1ae41…"]http://pastebin.com/m6ae1ae41[/URL] Docs say glob is to find filenames and urllib/urllib2 is to build… keep trying. Any thoughts appreciated.[/QUOTE] In your example, glob is only used to search a local directory. A url… Re: Use glob with urrlib2 Programming Software Development by flebber … not directly an answer but there is a solution using glob and urrlib here [URL="http://pastebin.com/m6ae1ae41"…;]http://pastebin.com/m6ae1ae41[/URL] Docs say glob is to find filenames and urllib/urllib2 is to build… Problem in glob() Programming Web Development by divyakrishnan … folder which is in another machine. On my localhost the glob() is working fine, BUT on the server it displays the…/$sub_code/$sub_code".N."$churunano/*.jpg*"; $count = count(glob($dir_path)); How to find the count of the files? Re: Problem in glob() Programming Web Development by pritaeas > Note: This function will not work on remote files as the file to be examined must be accessible via the server's filesystem. Taken from: http://php.net/glob What you could do is put a script with glob on that server, and retrieve the result using cUrl. Re: pygame, global name "glob" Programming Software Development by woooee You have to define glob. Try a google for one of the online books like: "dive into python" glob pygame, global name "glob" Programming Software Development by lewashby … in sysfont.py [COLOR="Red"]NameError: global name 'glob' is not defined[/COLOR] [CODE]import pygame from pygame.locals… my fist thread - pygame, global name "glob" Programming Software Development by lewashby I posted a thread labeled pygame, global name "glob" but am unable to resolve the issue so I … Re: my fist thread - pygame, global name "glob" Programming Software Development by vegaseat … have an old version of pygame that uses module [B]glob[/B] to search for the font files. Re: Quick Question about glob.glob Programming Software Development by abaddon2031 I fount the answer. It is best to use the [fnmatch](https://docs.python.org/2/library/fnmatch.html#fnmatch.fnmatch) useing this did just what i wanted glob to do in a much more compact and simpler form. Re: Use glob with urrlib2 Programming Software Development by flebber Is there another function that could perform this? Re: Use glob with urrlib2 Programming Software Development by TrustyTony possibly there is ftp access: [url]http://docs.python.org/library/ftplib.html[/url] Re: Use glob with urrlib2 Programming Software Development by flebber [QUOTE=pyTony;1615800]possibly there is ftp access: [url]http://docs.python.org/library/ftplib.html[/url][/QUOTE] Thanks having a read now. also found a python downloader script. I din't want most of it but the concept is that it figures out what files there are given a base url. The full 140 0dd lines are here [URL="https://github.com/… Re: Use glob with urrlib2 Programming Software Development by Gribouillis [QUOTE=flebber;1615821]Thanks having a read now. also found a python downloader script. I din't want most of it but the concept is that it figures out what files there are given a base url. The full 140 0dd lines are here [URL="https://github.com/mobileProgrammer/Automatic-Downloader/blob/master/downloader.py"]https://github.com/… Re: Use glob with urrlib2 Programming Software Development by flebber Well if I navigate to the page containing the files the full url is a mess. [CODE]http://www.tvn.com.au/tvnlive/v1/system/modules/org.tvn.website/jsptemplates/tvn_sectionals.jsp?TVNSESSION=2DC7A10ABB1C10265323569B4D89208A.tvnEngine1[/CODE] However I found the link by right clicking on the file and selecting copy link address. On the page there are… Re: Use glob with urrlib2 Programming Software Development by Gribouillis [QUOTE=flebber;1615852]Well if I navigate to the page containing the files the full url is a mess. [CODE]http://www.tvn.com.au/tvnlive/v1/system/modules/org.tvn.website/jsptemplates/tvn_sectionals.jsp?TVNSESSION=2DC7A10ABB1C10265323569B4D89208A.tvnEngine1[/CODE] However I found the link by right clicking on the file and selecting copy link address… Re: Use glob with urrlib2 Programming Software Development by flebber Reading beautiful soup now but here [URL="http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsing HTML"]http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsing HTML[/URL] it gives a lot of examples. One thing though how do you tell beautiful soup which url it wants to do its stuff with. Looking at the most… Re: Use glob with urrlib2 Programming Software Development by snippsat This may help you,but this may not be an easy task for you if new to this and python. Files i get from code under is. [CODE]110702SRace01_B.rtf 110702SRace03_B.rtf 110702SRace04_B.rtf 110702SRace05_B.rtf 110702SRace06_B.rtf 110702SRace07_B.rtf 110702SRace08_B.rtf[/CODE] Files will be in folder you run script from. [CODE]from … Re: pygame, global name "glob" Programming Software Development by Firewolf I don't get the NameError error when running your code. I just get following warning, but the code in running fine. [CODE]/usr/lib64/python2.6/site-packages/pygame/sysfont.py:139: DeprecationWarning: os.popen3 is deprecated. Use the subprocess module. flin, flout, flerr = os.popen3('fc-list : file family style')[/CODE] What version of … Re: pygame, global name "glob" Programming Software Development by vegaseat Works just fine with Python 2.5.4 and Pygame 1.8.0 on a Windows XP machine. Font "arial" may only be available with the Windows OS. Re: pygame, global name "glob" Programming Software Development by Firewolf Don't think it is a problem with a missing font. If the font is missing, Pygame uses a standard font. You can try with gibberish, e.g. font = pygame.font.SysFont("abcdefgh", 16)... and it will this run fine. Besides Arial is available on Linux too. I'm using Python 2.6.2 with PyGame 1.8.1 on Fedora 12. No problem with running the code… Re: my fist thread - pygame, global name "glob" Programming Software Development by msprayb I thought I had the answer to this, but upon closer examination I do not have the answer. I believe it has to do with calling from the SYSTEM itself and not from a module within font.py issues compiling an executable Programming Software Development by pynoobie …\\*.gif"), glob.glob("images\level_objects\\*.png")]), ("sounds", [glob.glob("sounds\\*.wav"), glob.glob("sounds\\*.mid"), glob.glob("sounds… Further Adventures in Learning Python Programming Software Development by Reverend Jim …].mp4") 'Awards Day [[]1994].mp4' so using `glob.glob(glob.escape(filename))` instead of `glob.glob(filename)` handles the case where filename contains `[` or… dos wildcard patterns. >>> glob.escape("*.mp4") '[*].mp4' >>> glob.glob(glob.escape("*.mp4")) [] Regular (as…