Textures don't show in 3d view after loading them into node via python. Blender 2.66 Textures don't shows in 3d view after loading them into node via python. I can see them in render mode, but not in edit. Also after selecting image texture node they show-up in 3d view, but I can't do that from script.
Script works with preloaded (with another script) images

import bpy
import os
import os.path
os.system('cls')

bpy.context.scene.render.engine = 'CYCLES'

tex_name_list = []
mat_names = []
for ob in bpy.data.objects:
   print(ob.name)
   for mat_slot in ob.material_slots:
      for mtex_slot in mat_slot.material.texture_slots:
         if mtex_slot:
            if hasattr(mtex_slot.texture , 'image'):   
               mat_name = "{}".format(mtex_slot.name)
               for img in bpy.data.images:
                  #print(img.name)
                  mat = mat_slot.material
                  if img.name == (mat_name):
                     if not mat.use_nodes:
                        print("{} - {}".format(img.name, mat_name))
                        mat.use_nodes = True
                        tex_node = mat.node_tree.nodes.new('TEX_IMAGE')
                        mixShad_node = mat.node_tree.nodes.new('MIX_SHADER')
                        trns_node = mat.node_tree.nodes.new('BSDF_TRANSPARENT')
                        diff_node = mat.node_tree.nodes['Diffuse BSDF']
                        matOut_node = mat.node_tree.nodes['Material Output']
                        mat.node_tree.links.new(tex_node.outputs['Color'], diff_node.inputs['Color'])
                        mat.node_tree.links.new(tex_node.outputs['Alpha'], mixShad_node.inputs['Fac'])
                        mat.node_tree.links.new(diff_node.outputs['BSDF'], mixShad_node.inputs[2])
                        mat.node_tree.links.new(trns_node.outputs['BSDF'], mixShad_node.inputs['Shader'])
                        mat.node_tree.links.new(mixShad_node.outputs['Shader'], matOut_node.inputs['Surface'])                     
                        tex_node.image = img
Ok got it finally.
You need set active Image Texture node:

mat = bpy.data.materials['&lt;Your material name&gt;']
mat.node_tree.nodes.active = mat.node_tree.nodes.new('TEX_IMAGE')