I am trying to merge two dictionaries of dictionaries in aws lambda python 3 This does not work, I am using boto3 a = {'Action': 'DELETE', 'ResourceRecordSet': {'AliasTarget': {'HostedZoneId': 'BLABLABLA', 'EvaluateTargetHealth': False, 'DNSName': 'BLABLA'}, 'Type': 'A', 'Name': 'BLABLABLA'}}  b = {'Action': 'UPSERT', 'ResourceRecordSet': {'TTL': 60, 'Type': 'CNAME', 'Name': 'BLABLA', 'ResourceRecords': [{'Value': 'blablabla'}]}}  c = a_dictionary.update(b_dictionary) print(c)   The print command prints none
556
I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged (i.e. taking the union).  The update() method would be what I need, if it returned its result instead of modifying a dictionary in-place. &gt;&gt;&gt; x = {'a': 1, 'b': 2} &gt;&gt;&gt; y = {'b': 10, 'c': 11} &gt;&gt;&gt; z = x.update(y) &gt;&gt;&gt; print(z) None &gt;&gt;&gt; x {'a': 1, 'b': 10, 'c': 11}  How can I get that final merged dictionary in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.)
4570
I'd like to call a function in python using a dictionary.  Here is some code:  d = dict(param='test')  def f(param):     print(param)  f(d)   This prints {'param': 'test'} but I'd like it to just print test.  I'd like it to work similarly for more parameters:  d = dict(p1=1, p2=2) def f2(p1, p2):     print(p1, p2) f2(d)   Is this possible?
28456
I have two commands I'd like to combine into one, but I'm not sure how to go about combining them. Is this possible?   Here are the commands. They work individually, I just can't seem to get them to work together:  /give @p jukebox 1 0 {CanPlaceOn:["minecraft:melon_block"]}     /give @p jukebox 1 0 {display:{Name:"Box"}}   Can you help me to add one of the commands to the other one?
118370
I was using the following command   curl -silent http://api.openstreetmap.org/api/0.6/relation/2919627 http://api.openstreetmap.org/api/0.6/relation/2919628 | grep node | awk '{print $3}' | uniq   when I wondered why uniq wouldn't remove the duplicates. Any idea why ?
55914
I'm trying to put together an add-on that contains two operators.  I've gotten each operator file to run properly independently, but I'm having trouble figuring out how to write an init.py file that would allow me to distribute them as a single add-on.  I've posted everything on Github.  The three files aren't too long:   I've read a few other threads, but nothing seems to work for me.  How can I get my init.py to register my operators properly?
94033
While i'am trying to execute this code IN IDLE, i got error :  import arcpy import math import arcview from arcpy import env   arcpy.env.workspace = "D:/Users/saadiya/Documents/ArcGIS/Default.gdb" arcpy.env.overwriteOutput = True  #Create a table of neighbors  arcpy.PolygonNeighbors_analysis("Parcelles_class_copy","Voisins_table") #Parcelles_class_copy est le résultat de la conversion de dwg en polygon   #Select each table neighbors for i in range(1,8) :     expression = '"src_OBJECTID"=' + str(i)     output_table = "output_table" + str(i)     arcpy.TableSelect_analysis("Voisins_table", output_table, expression)     #print expression  #***************** supprimer la table Voisins_table ********************************************************************** arcpy.Delete_management("Voisins_table")  #Joint table of neighbors to feautre class arcpy.AddJoin_management("Parcelles_class_copy","OBJECTID", output_table,"nbr_OBJECTID","KEEP_ALL")  del expression       #Select a target parcel  target_parcel = "target_parcel" + str(i) whereclause1 = '"Parcelles_class.OBJECTID"=' + str(i) arcpy.Select_analysis("Parcelles_class_copy",target_parcel,whereclause1) arcpy.RemoveJoin_management("Parcelles_class_copy",output_table)   i got this error :   ERROR 000840: The value is not a Raster Catalogue Layer ERROR 000840: The value is not a Raster Layer. ERROR 000840: The value is not a Mosaic Layer Failed to execute (Addjoin)
63624
I have an IEnumerable&lt;T&gt; and an IEnumerable&lt;U&gt; that I want merged into an IEnumerable&lt;KeyValuePair&lt;T,U&gt;&gt; where the indexes of the elements joined together in the KeyValuePair are the same. Note I'm not using IList, so I don't have a count or an index for the items I'm merging. How best can I accomplish this? I would prefer a LINQ answer, but anything that gets the job done in an elegant fashion would work as well.
22636
If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll).  How can I do this in C#?  I tried the Merge statement on the datatable, but this returns void.  Does Merge preserve the data?  For example, if I do:   dtOne.Merge(dtTwo);   Does dtOne change or does dtTwo change and if either one changes, do the changes preserve?  I know I can't do this because Merge returns void, but I want to be able to store the Merger of both dtOne and dtTwo in dtAll:  //Will Not work, How do I do this dtAll = dtOne.Merge(dtTwo);
31124
I am making a shapekey of a model shrinkwrapped to another model. The shrinkmap modifier is too inaccurate to wrap to the model alone. So, my first step was to roughly hand position the geometry around of the first model around the second, then use shrinkwrap. The rough positioning was done as a shape key. I can then apply shrinkwrap, but its as a separate shapekey. The two do not work well together. I need them to be the same shapekey. How do I apply a modifier to an existing shapekey, or merge/combine/join the two shapekeys?
60856
I have a string that looks like this:  "Name1=Value1;Name2=Value2;Name3=Value3"   Is there a built-in class/function in Python that will take that string and construct a dictionary, as though I had done this:  dict = {     "Name1": "Value1",     "Name2": "Value2",     "Name3": "Value3" }   I have looked through the modules available but can't seem to find anything that matches.    Thanks, I do know how to make the relevant code myself, but since such smallish solutions are usually mine-fields waiting to happen (ie. someone writes: Name1='Value1=2';) etc. then I usually prefer some pre-tested function.  I'll do it myself then.
98774
Motivation: I would like to add multiple empties with sequential, but meaningful, names using the Python API with Blender.  Issue: I cannot name the objects as I add them.  Question: What can I add to the bpy.ops.object.add() code to give a name, or how can I change the name immediately after adding the object?  So far, to insert empties with (x,y,z) coordinates (1.1,1.1,1.1), (2.2,2.2,2.2), (3.3,3.3,3.3), and (4.4,4.4,4.4):  import bpy  x = (1.1,2.2,3.3,4.4) y = (1.1,2.2,3.3,4.4) z = (1.1,2.2,3.3,4.4)  for index,val in enumerate(x):     bpy.ops.object.add(type='EMPTY', location=(x[index],y[index],z[index]))   They are added with sequential names:   Empty.001 Empty.002 Empty.003 Empty.004   Here is a screenshot of the output:   But, I want them to have names:   SpecifiedName.001 SpecifiedName.002 SpecifiedName.003 SpecifiedName.004   I cannot seem to just add the property name = "SpecifiedName" to read:  bpy.ops.object.add(type='EMPTY', location=(x[index],y[index],z[index])) ###DOES NOT WORK!!!###   If you are curious as to the final outcome I am looking to do, I want to plot several different datasets in x,y,z coordinates. Each empty from each dataset (and cooresponding name) will be linked to an mesh like a sphere or cube. This gives me the chance to animate a flythrough or rotation of 3D scatter plot data.
82169
I am new to Python and QGIS and attempting to create some plugins to replicate in-house tools used in other GIS programs. I have added a custom menu using Python and added the plugin to the menu using the following code within the initGui method:  self.menu = QMenu("&amp;Menu Name", self.iface.mainWindow().menuBar()) actions = self.iface.mainWindow().menuBar().actions() lastAction = actions[-1] self.iface.mainWindow().menuBar().insertMenu(lastAction,self.menu) self.action = QAction(QIcon(":/plugins/Trial/icon.png"),"Trial plugin", self.iface.mainWindow()) self.action.triggered.connect(self.run) self.menu.addAction(self.action)   However, if I try and add another plugin to the same menu I end up with duplicated menu item names with only one plugin in the menu, rather than all the plugins under the same menu. Is there a way of adding multiple plugins to an existing custom menu item?
100842
Is it possible to copy the whole rows of File1 in a new File3 following the instruction given by File2 by using a simple bash script using sed or awk?  File1: /*two or more columns*/ AC    456324 DC    689712 GH    123677 KL    236587  File2: /*one column*/ AC DC  File3:  AC    456324 DC    689712   I'm actually performing this using Python dictionaries and I wondered if you knew a simple way out.
68655
How to add an empty object with python using bpy and not using any ops? My code so far is doing this:  bpy.ops.object.empty_add(type='PLAIN_AXES',radius=RADIUS,location=loc)   For normal object like mesh or lamp there is object_data created using normal bpy.data.object.new calls, but for empties it seems that this method does not exist. So is this possible to avoid using the operators? The reason I'm asking is because when I add an empty using bpy.ops it changes the active object, etc. causing the script to be more bloated with unnecessary code lines.
98898
So I have two YAML files, "A" and "B" and I want the contents of A to be inserted inside B, either spliced into the existing data structure, like an array, or as a child of an element, like the value for a certain hash key.  Is this possible at all? How? If not, any pointers to a normative reference?
64496
I have two lists of objects. Each list is already sorted by a property of the object that is of the datetime type. I would like to combine the two lists into one sorted list. Is the best way just to do a sort or is there a smarter way to do this in Python?
119344
File1.txt      id                            No     gi|371443199|gb|JH556661.1| 7907290     gi|371443198|gb|JH556662.1| 7573913     gi|371443197|gb|JH556663.1| 7384412     gi|371440577|gb|JH559283.1| 6931777   File2.txt   id                              P       R       S  gi|367088741|gb|AGAJ01056324.1| 5       5       0  gi|371443198|gb|JH556662.1|     2       2       0  gi|367090281|gb|AGAJ01054784.1| 4       4       0  gi|371440577|gb|JH559283.1|     21      19      2   output.txt   id                              P       R       S  NO  gi|371443198|gb|JH556662.1|     2       2       0  7573913  gi|371440577|gb|JH559283.1|     21      19      2  6931777   File1.txt has two columns &amp; File2.txt has four columns. I want to join both files which has unique id (array[1] should match in both files (file1.txt &amp; file2.txt) and give ouput only matched id (see output.txt).  I have tried join -v &lt;(sort file1.txt) &lt;(sort file2.txt). Any help with awk or join commands requested.