In the "import as" example, the name "selenium" is assigned in the global namespace but it is not used in the module. Only "se" is effectively used.
In the other example, the "selenium" name is assigned and is effectively used.
There are different ways to work around this and avoid putting an unused name in the globals. For example:
from selenium import webdriver
webdriver.Firefox("foo")
Or another example:
import selenium as se
__import__('selenium.webdriver')
se.webdriver.Firefox("foo")
Or you keep the code as-is, and you just ignore this pyflakes message.
In the "import as" example, the name "selenium" is assigned in the global namespace but it is not used in the module. Only "se" is effectively used.
In the other example, the "selenium" name is assigned and is effectively used.
There are different ways to work around this and avoid putting an unused name in the globals. For example:
from selenium import webdriver Firefox( "foo")
webdriver.
Or another example:
import selenium as se _('selenium. webdriver' ) Firefox( "foo")
__import_
se.webdriver.
Or you keep the code as-is, and you just ignore this pyflakes message.