Module imported in one function NameError in another function called afterward

I have a Python3 script that installs pip3 and and a digitalocean module for creating droplets.

I have broken up the script into 3 functions, Install(), Run(), and Uninstall. In the Install function I can install pip3 and the digitalocean module.

I have multiple functions that I want to call in the Run() function. At the beginning of Run() I import the digitalocean module. When I call another function that uses this module I get “NameError: name ‘digitalocean’ is not defined”.

Everything I have read says that I can import in a function and then use that import in another function. I don’t know if Python3 is diffrent? Something I am missing?(has to be)

Here is relevant code that has the bulk pulled out. Let me know if you need more.

#!/usr/bin/python3  import importlib.util from subprocess import Popen, PIPE, STDOUT import sys import subprocess import time   accessToken                 = 'ABC' dropletName                 = 'newDropletAndTag' tagName                     = dropletName  def Install():     pass     #This function installs the package and other things if they are not already present.    def CreateDroplet():     newDroplet = digitalocean.Droplet(  token       = accessToken,                                          name        = dropletName,                                         region      = 'NYC1',                                         image       = 'ubuntu-16-04-x64',                                         size_slug   = 's-1vcpu-1gb',                                         ssh_keys    = sshKeysList,                                          backups     = False                                         )      def Run():     import digitalocean     myManager = digitalocean.Manager(token=accessToken)     myDroplets = myManager.get_all_droplets(tag_name=tagName)      Install()      CreateDroplet()   def Main():     #START OF SCRIPT     print('\n\n\n')     print('---- Start Of Script ----')     Run()     print('---- End Of Script ----')     print('\n\n\n')     #END OF SCRIPT if __name__ == '__main__':     Main() 

How to export a SP list with a view called “MyView” with PnPPowershell?

Hi I have this code which work great. But now I want to export the list in a certain view I have created. How can I do that.

$  hashTable = @() $  items = Get-PnpListItem -List "MySchedule" foreach($  item in $  items) { $  HashTable += New-Object psobject -Property @{  'Datum'=$  item.FieldValues.Datum.ToLocalTime().ToString("dd.MM.yyyy"); '00:00 - 07:59'=$  item.FieldValues._x0030_0_x003a_00_x0020__x002d__; '08:00 - 16:59'=$  item.FieldValues._x0030_8_x003a_00_x0020__x002d__; '17:00 - 23:59'=$  item.FieldValues._x0031_7_x003a_00_x0020__x002d__;   'Opmerkingen'=$  item.FieldValues.Opmerkingen;    }  }  $  hashTable | Select Datum,'00:00 - 07:59','08:00 - 16:59','17:00 - 23:59',Opmerkingen | epcsv "c:\temp\myschedule.csv" -NoT 

Gr, P

What is this style called?

I am trying to find the name of the style of the following websites. It’s a mix of classic bootstrap and material design. But instead of full material design it offers more depth and just looks a lot nicer.

  • https://vwo.com -> the dropdown cards and feeling of depth on this one are amazing
  • https://balance.io/
  • https://dev.status.im/
  • https://makerdao.com/en/

I’ve seen more of this style lately and would like to know more about it. I really like the simple card style, especially the dropdown menu card on this site. There always seems to be some overlay of one element into another.

Preprocess Node function not being called

I’m attempting to perform an action in a preprocess node hook inside my .theme file, but I can’t seem to get it to fire.

Here’s the content of my customtheme.theme file

<?php  function mytheme_preprocess_page(&$  variables){      $  menu = \Drupal\block\Entity\Block::load('custom_main_menu');      $  variables['main_menu'] = \Drupal::entityTypeManager()         ->getViewBuilder('block')         ->view($  menu); }  function mytheme_preprocess_node(&$  variables){     die('Test'); } 

Everytime I load a node, even though I have a die() statement in my mytheme_preprocess_node function it never fires, and the page loads just fine. I’m making sure that I’m loading pages that are nodes. Such as basic pages, and other custom content types. What’s odd is that the mytheme_preprocess_page function does fire. It’s able to load the main_menu variable inside the page.html.twig template just fine. I also made sure I was clearing the cache.

Why would a preprocess_page hook function fire but not a preprocess_node function.

Corrupted partition un mountable MAC osx no name just called diisk0s2 how to navigate

HAve a corrupt partition has no name just disk0s2 Ran file recovery on it and recovered some files. Think its corrupt disk utility can partially verify and cannot repair and think its read only and unmountable because its full. Would like to navigate to it through command line and dlete files to free up space see if i can mount it again or better yet lay the osx back on top and make it bootable.