Я установил Windows 10 в другом разделе наряду с Xubuntu, и затем я удалил его с помощью GParted. Попробованный для выполнения sudo update-grub
но это не удаляет опцию загрузиться из Windows Boot Manager, но добавляет его снова.
Found linux image: /boot/vmlinuz-4.4.0-57-generic
Found initrd image: /boot/initrd.img-4.4.0-57-generic
Found linux image: /boot/vmlinuz-4.4.0-53-generic
Found initrd image: /boot/initrd.img-4.4.0-53-generic
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Какие потребности быть сделанным для завершенного удаления его?
from BeautifulSoup import BeautifulSoup
import re
html_text = """
<h2>this is cool #12345678901</h2>
<h2>this is nothing</h2>
<h1>foo #126666678901</h1>
<h2>this is interesting #126666678901</h2>
<h2>this is blah #124445678901</h2>
"""
soup = BeautifulSoup(html_text)
for elem in soup(text=re.compile(r' #\S{11}')):
print elem.parent
Печать:
<h2>this is cool #12345678901</h2>
<h2>this is interesting #126666678901</h2>
<h2>this is blah #124445678901</h2>
Операции поиска BeautifulSoup поставляют [список] BeautifulSoup.NavigableString
объекты, когда text=
используется в качестве критерии в противоположность BeautifulSoup.Tag
в других случаях. Проверьте объект __dict__
, чтобы видеть, что атрибуты сделали доступным для Вас. Из этих атрибутов, parent
одобрен более чем previous
из-за изменения в BS4.
from BeautifulSoup import BeautifulSoup
from pprint import pprint
import re
html_text = """
<h2>this is cool #12345678901</h2>
<h2>this is nothing</h2>
<h2>this is interesting #126666678901</h2>
<h2>this is blah #124445678901</h2>
"""
soup = BeautifulSoup(html_text)
# Even though the OP was not looking for 'cool', it's more understandable to work with item zero.
pattern = re.compile(r'cool')
pprint(soup.find(text=pattern).__dict__)
#>> {'next': u'\n',
#>> 'nextSibling': None,
#>> 'parent': <h2>this is cool #12345678901</h2>,
#>> 'previous': <h2>this is cool #12345678901</h2>,
#>> 'previousSibling': None}
print soup.find('h2')
#>> <h2>this is cool #12345678901</h2>
print soup.find('h2', text=pattern)
#>> this is cool #12345678901
print soup.find('h2', text=pattern).parent
#>> <h2>this is cool #12345678901</h2>
print soup.find('h2', text=pattern) == soup.find('h2')
#>> False
print soup.find('h2', text=pattern) == soup.find('h2').text
#>> True
print soup.find('h2', text=pattern).parent == soup.find('h2')
#>> True
С bs4 (Красивый Суп 4), попытка OP работает точно как ожидаемый:
from bs4 import BeautifulSoup
soup = BeautifulSoup("<h2> this is cool #12345678901 </h2>")
soup('h2',text=re.compile(r' #\S{11}'))
возвраты [<h2> this is cool #12345678901 </h2>]
.
Откройте /etc/default/grub
с корнем и отредактируйте его со своим редактором.
Включают строку GRUB_DISABLE_OS_PROBER=true
в файл, затем сохраняют и выходят.
Теперь работает sudo update-grub
. Проблема будет решена.
Найденный Windows Boot Manager на/dev/sda1 @/EFI/Microsoft/Boot/bootmgfw.efi
, чтобы удалить tha и повториться, что Вы сделали прежде, затем используйте команду.Править: какие средства после sda1, который может быть проблемой