Using scp to copy a file to Amazon EC2 instance?

I am trying to use my Mac Terminal to scp a file from Downloads (phpMyAdmin I downloaded online) to my Amazon EC2 instance. The command I used was: scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all-languages.tar.gz [email protected]:~/. The error I got: Warning: Identity file myAmazonKey.pem not accessible: No such file or directory. Permission denied (publickey). lost connection Both my … Read more

What is the difference between shallow copy, deepcopy and normal assignment operation?

import copy a = “deepak” b = 1, 2, 3, 4 c = [1, 2, 3, 4] d = {1: 10, 2: 20, 3: 30} a1 = copy.copy(a) b1 = copy.copy(b) c1 = copy.copy(c) d1 = copy.copy(d) print(“immutable – id(a)==id(a1)”, id(a) == id(a1)) print(“immutable – id(b)==id(b1)”, id(b) == id(b1)) print(“mutable – id(c)==id(c1)”, id(c) == id(c1)) … Read more

What is the difference between `sorted(list)` vs `list.sort()`?

list.sort() sorts the list and replaces the original list, whereas sorted(list) returns a sorted copy of the list, without changing the original list. When is one preferred over the other? Which is more efficient? By how much? Can a list be reverted to the unsorted state after list.sort() has been performed? 6 Answers 6