Maggie Samson
Quiz by , created more than 1 year ago

Geography Quiz on GEOM 73 - Python Quiz 9, created by Maggie Samson on 14/04/2019.

41
1
0
Maggie Samson
Created by Maggie Samson over 5 years ago
Close

GEOM 73 - Python Quiz 9

Question 1 of 10

1

FTP stands for:

Select one of the following:

  • File Transfer Protocol

  • File Translation Protocol

  • File Translation Procedure

  • File Transfer Procedure

Explanation

Question 2 of 10

1

Which method of the ftp class of the ftplib module uses ASCII mode to transfer files?

Select one of the following:

  • retrtxt()

  • retrbinary()

  • retrascii()

  • retrlines()

Explanation

Question 3 of 10

1

When can you use urllib instead of ftplib to read and transfer files from an FTP server?

Select one of the following:

  • anonymous FTP servers with a web interface

  • password protected FTP servers without a web interface

  • password protected FTP servers with a web interface

  • anonymous FTP servers without a web interface

Explanation

Question 4 of 10

1

How do you set the current directory using ftplib on an FTP server so you can navigate to the files you need?

Select one of the following:

  • ftp.cwd(pathname)

  • ftp.path(pathname)

  • ftp.dir(pathname)

  • ftp.setdir(pathname)

Explanation

Question 5 of 10

1

When working with a ZIP file in Python using the zipfile module, how do you determine which files are present in the ZIP file without extracting them?

Select one of the following:

  • open the file using something like zipfile.ZipFile("example.zip", "r"), then use the namelist method

  • open the file using something like zipfile.ZipFile("example.zip", "r"), then use the ziplist method

  • open the file using something like zipfile.ZipFile("example.zip", "r"), then use the read method

  • create a list of the files using something like zipfile.ListFiles("example.zip")

Explanation

Question 6 of 10

1

Which compression method is the default employed by the zipfile module in Python?

Select one of the following:

  • ZIP_STORED

  • TAR

  • GZIP

  • ZIP_COMPRESSED

  • ZIP_DEFLATED

Explanation

Question 7 of 10

1

How would you extract all files in a ZIP file to the current working directory using the zipfile module in Python?

Select one of the following:

  • ZipFile.openall()

  • ZipFile.extractall()

  • ZipFile.unzip()

  • ZipFile.extract("*")

Explanation

Question 8 of 10

1

You should never use XML to store geospatial data since it is text-based and will therefore render your geospatial data useless.

Select one of the following:

  • True
  • False

Explanation

Question 9 of 10

1

Which of the following module or libraries are used to work with XML data in Python? (check all that apply)

Select one or more of the following:

  • xml.sax

  • xmlopen

  • xmlparser

  • xml.dom

  • xmllib

  • xml.etree.ElementTree

Explanation

Question 10 of 10

1

XML files are notorious for missing or incorrect tags. Which module/library would you use in Python to parse XML files that contain tag errors?

Select one of the following:

  • ElementTree

  • AlphabetSoup

  • BeautifulSoup

  • XMLfix

  • parseXML

Explanation