text
stringlengths
226
34.5k
Make Python wait until a file exists before continuing Question: In my code, I write a file to my hard disk. After that, I need to import the generated file and then continue processing it. for i in xrange(10): filename=generateFile() # takes some time, I wish to freeze the program here ...
what exactly is passed as "address" in sendto for ipv6 Question: I am trying to send an **icmpv6 ping packet** across running as root (python 2.7 on Linux) I understand that **sendto** uses two tuple struct in case of ipv4 (and it works) and know that ipv6 uses a 4 tuple struct. Still i can't get it to work. It eithe...
wxpython : changing background / foreground image dynamically Question: I am writing a GUI flow using wxPython which has 4 pages (or more). They way I have approached is creating 4 (or more) classes with each class defining its own static (background) and dynamic images / content. In my application I would then program...
Multiple Django Databases - Map Model to Database in Same Application Question: I have searched all over for a solution for this but have been unable to find anything. I have one Django project, one application, two models and two database. I would like one model to speak and sync exclusively to one database. This is ...
Error in python package Question: I started a script which retrieves a value from a JSON object using python but am getting these errors File "c:\Python33\lib\json\__init__.py", line 319, in loads return _default_decoder.decode(s) File "c:\Python33\lib\json\decoder.py", line 352, in decode ob...
how to toggle event binding on tabs of notebook widget Question: i have simple application based on tkinter and ttk so i have notebook widget supposed to creates a limited number of tabs ; and the tabs are the same thing..but in need to do different actions on each one ..when press some button a tab with its own name i...
python itertools.permutations combinations Question: I have this variable: `message = "Hello World"` and I built a function that shuffles it: def encrypt3(message,key): random.seed(key) l = range(len(message)) random.shuffle(l) return "".join([message[x] for x in l]) ...
Pygame attribute, init() Question: I'm trying to use Pygame with Python 3.3 on my windows 8 laptop. Pygame installed fine and when I `import pygame` it imports fine as well. Although when I try to execute this small code: import pygame pygame.init() size=[700,500] screen=pygame.disp...
python beautiful soup how to json decode to dict Question: I'm new to beautifulsoup in python and I"m trying to extract dict from beatifulsoup I use beautifulsoup to extract json and got my beautifulsoup.beautifulsoup variable `soup` I"m trying to get value out of `soup` , but when I do `result = soup.findAll("bill")...
Finding time complexity of a specific python algorithm Question: Hi I need to understand what is the time complexity of the following algorithm. def complex(n): l=[] i=1 while i<n: l=list(range(i)) i*=2 I've got to the point where I realized it runs i...
Deleted __pycache__ and __init__.py Question: * Django 1.6 * Ubuntu 12.04 * Python 3.2.3 Accidentally deleted a Django app's `__pycache__` folder & its `__init__.py` file, and it crashed Django. when I `python3 manage.py runserver`, it'll instantly claims there's no module by the name _agepct_ even though the ap...
For loop issue in python while using regex for pattern matching in DNA analysis Question: Hey Stack Overflow I am fairly new to Python and I have an issue with my for loop that I can't quite seem to figure out. I am trying to read into a FASTA file which has the following example text: >seq1 AAACTAC...
plotting a range of data that satisfies conditions in another column in matplotlib python Question: I'm new to python. I have an array with four columns. I want to plot columns 2 and 3, pending that column 1 satisfies a condition. If column 1 does not satisfy this range, it is plotted in the next subplot. I have seen t...
how to assign variable to module name in python function Question: I have a set of modules, and I want to be able to call one of them within a function based on an argument given to that function. I tried this, but it doesn't work: from my.set import modules def get_modules(sub_mod): var...
Python mocking- understand the concept and necessity Question: **First of all I really want to understand WHY should I use mocking (Python Mock library).** What's the difference between quickly making a small object for the need of testing something and using a mock object? What are the advantages of mocking over oth...
Python get generated url to string Question: (Title might change not too sure what to call it) So I'm trying to open a URL that directs to a random page (This URL: [http://anidb.net/perl- bin/animedb.pl?show=anime&do.random=1](http://anidb.net/perl- bin/animedb.pl?show=anime&do.random=1)) and I want to return where th...
Pls help: using Python mechanize, but don’t know the form name on webpage Question: (I am a newbie in programming) I am trying to write some Python codes to login a forum, this is webpage: the [https://www.artofproblemsolving.com/Forum/ucp.php?mode=login&redirect=/index.php](https://www.artofproblemsolving.com/Forum/u...
mod wsgi using apache and python Question: I have used mod_wsgi to create a web server that can be called locally. Now I just found out I need to change it so it runs through the Apache server. I'm hoping to do this without rewriting my whole script. from wsgiref.simple_server import make_server ...
How to check for Python, the key associated with the certificate or not Question: I know that the blocks modulus in the certificate and private key must be the same if they are related. But how this can be checked by using Python? I am looking for a solution to the OpenSSL library, but I found none. Please tell me the ...
Explanation of program's behavior (Python) Question: import threading shared_balance = 0 class Deposit(threading.Thread): def run(self): for i in xrange(1000000): global shared_balance balance = shared_balance balance += 100 ...
Django, ImportError: cannot import name Celery, possible circular import? Question: I went through this example here: <http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html> All my tasks are in files called tasks.py. After updating celery and adding the file from the example django is throwing ...
Trying to understand a solution to project Euler # 3 Question: > The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime > factor of the number 600851475143 ? @ <http://projecteuler.net/problem=3> I have a deal going with myself that if I can't solve a project Euler problem I will understand the best...
Python: Iterate through folders, then subfolders and print filenames with path to text file Question: I am trying to use python to create the files needed to run some other software in batch. for part of this i need to produce a text file that loads the needed data files into the software. My problem is that the file...
Can oauth.get_current_user() be used with OAuth2? Question: I'm having a hard time finding a definitive answer about the use of OAuth2 within _my_ GAE app. First, this is **not** an endpoints app, just a plain old python app. I can get the `oauth.get_current_user()` method to return the authenticated user when expecte...
shuffle a python array WITH replacement Question: What is the easiest way to shuffle a python array or list WITH replacement?? I know about `random.shuffle()` but it does the reshuffling WITHOUT replacement. Answer: You are looking for [`random.choice()`](http://docs.python.org/2/library/random.html#random.choice) c...
Loop URL to scrape using beautiful soup python Question: I am using the following code to scrape the website. The following which I tried works fine for a page in the website. Now I want to scrape several such pages for which I am looping the URL as shown below. from bs4 import BeautifulSoup import u...
why does timeit module take longer time than the code produces output quickly in python? Question: here is the code to calculate fibonacci import timeit counter=0 def fibhelper(n): global counter counter+=1 if n==0 : return 0 elif n==1: return 1 els...
Looping through a list of tuples to make a POST request with each tuple Question: I have a list of tuples here: import datetime import requests from operator import itemgetter original = [(datetime.datetime(2013, 11, 12, 19, 24, 50), u'78:E4:00:0C:50:DF', u' 8', u'Hon Hai Precision In', ...
How to change runs of values in a column with Perl, Python or bash Question: I want to iterate through lots of tab-delimited files and change a single column in the following way: ORIGINAL Col1 Col2 .... afawer 1 asdgf 1 aser 1 qwerq 10 a3awer 10 1sdgf 11 a55...
Skip an iteration while looping through a list - Python Question: Is there a way to skip the first iteration in this for-loop, so that I can put a for-loop inside a for-loop in order to compare the first element in the list with the rest of them. from collections import Counter vowelCounter = Counter...
Python using import in a function, import content of variable and not its name? Question: I have a function that checks if a module is installed, if not it will install it. I am passing the extension through a function. However how can I stop it attempting to import the variable name and use its contents? Example: ...
Python Threading and interpreter shutdown- Is this fixable or issue Python Issue #Issue14623 Question: I have python script that uploads files to a cloud account. It was working for a while, but out of now where I started getting the '`Exception in thread Thread-1 (most likely raised during interpreter shutdown)'` erro...
Python: how to replace values in masked array according to a condition Question: I have an array. I want to replace the values `> 5` with `1`, and the values `<= 5` with `0`. I also must to take into account the invalid values (`999`). 1) My array: >>> import numpy >>> a = numpy.array([ [[2, 5, 99...
Need help on Socket Programming in Python (beginner) Question: I am learning socket programming and python. I need to create a client that sends a command to a server (list or get ). The server then validates the command. My client program can display "list" or "get" , but it doesn't show the error message when I enter...
if-else statement and code exit Question: basically I'm quite new to python so I decided to make a simple calculator, I have done the coding for the calculator and that all works and I am happy, however I would like an if-else statement to see if they would like to continue with another calculation. So this is the top ...
How can i deal a hand in python Question: im trying to deal a hand in python with random.shuffle and its keeps giving me an error, can some one help me figure out whats wrong with it. # [import statements] import q1fun # [constants] # [rest of program code] number = input("howmany ca...
Square root inside a square root python Question: I was wondering how to write a code showing the square root inside a square root. This is what I have so far: number=float(input("Please enter a number: ")) square = 2*number**(1/2)**(1/3) print(square) But that's not right as I'm getting a ...
Python using diffrent pip version that in PYTHONPATH Question: I installed python 2.7 on mine shared host (it already had python 2.6 but they didnt want to upgrade it or install any packages) and pip. Configured PYTHONPATH and PATH in .bashrc. I dont have root access to this machine. When I am checking sys.path with m...
Prepend sys.path from shell? Question: If You want to use given `python` binary You can prepend `PATH`. If You want to use given `libpython` You can prepend `LD_LIBRARY_PATH` Now suppose You want to use given package directory. I tried `PYTHONPATH` \-- but it doesn't work: $ python -c 'import sys; prin...
Storing value from a parsed ping Question: I'm working on some code that performs a ping operation from python and extracts only the latency by using awk. This is currently what I have: from os import system l = system("ping -c 1 sitename | awk -F = 'FNR==2 {print substr($4,1,length($4)-3)}'") pr...
Exception handling in Tkinter Question: So, I wrote a small Tkinter program in python. The program executes good, but its easy for an exception to occur if theres a non-digit character entered into a field. so, I tried to remedy it, but my remedy fails: and here is the issue: try: self....
How do I use Twisted (or Autobahn) to connect to a socket.io server? Question: I am trying to figure out a way to connect to a socket.io (node.js) server with a Python Twisted client. The server is a chat server which I didn't write, so I have no control over it. I tried a few things, mainly TCP connections, but I figu...
Python multiprocessing map_async ready() and _number_left not working as expected Question: This is a little complicated, and I am sure this is a newbie error, but I cannot for the life for me figure out where to even look. Trying to do a multiprocessing map_async to process a large number of files. Essentially, the c...
how to install python3.3 completely and remove python2.7 on Ubuntu12.04? Question: I have installed python3.3 with commands: sudo apt-get install python-software-properties sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python3.3 It works,but pyth...
Python: " AttributeError: Element instance has no attribute 'firstchild' " Question: I've looked everywhere, but can't seem to find anything that answers my problem. I'm fairly new to Python, so maybe I am not understanding something correctly. The error I keep getting, is "AttributeError: Element instance has no attri...
renaming a list of pdf files with for loop Question: i am trying to rename a list of pdf files by extracting the name from the file using PyPdf. i tried to use a for loop to rename the files but i always get an error with code 32 saying that the file is being used by another process. I am using python2.7 Here's my code...
Scrape data and write in single line for every iteration BS4 python Question: I have the following code. It all scraping the data. But my concern is to write the data in a single line for each iteration it goes. Here is my code import bs4 as bs import urllib2 import re page = urllib2.ur...
How to define a decimal class holding 1000 digits in python? Question: I need a class holding 1000 decimal digits to calculate something like pi number in a series. Taking time is not important. How can I define `__add__` & ... functions to do this? For example I need a value can hold this number: 3.1415926535897932384...
Clean Python multiprocess termination dependant on an exit flag Question: I am attempting to create a program using multiple processes and I would like to cleanly terminate all the spawned processes if errors occur. below I've wrote out some pseudo type code for what I think I need to do but I don't know what the best ...
Struggling with 'synchronisation' between Session's in SQLAlchemy Question: I've a created `delete_entity` function which delete's entities and I've a function which tests this functions. #__init__.py engine = create_engine('sqlite://:memory') Session = scoped_session(sessionmaker(engine)) ...
get numpy array from pygame Question: I want to access my Webcam via python. Unfortunately openCV is not working because of the webcam. Pygame.camera works like a charm with this code: from pygame import camera,display camera.init() webcam = camera.Camera(camera.list_cameras()[0]) webcam...
F2PY - Access module parameter from subroutine Question: I cannot get f2py to reference a parameter from a module in a separate subroutine where it is used to defined an input array dimension. I.e. the paramter is defeind in a module: ! File: testmod.f90 MODULE testmod INTEGER, PARAMETER :: dimsi...
how do you get the current local directory in python Question: I actually think I know the answer to this, and it is: current_working_directory = os.getcwd().split("/") local_working_directory = current_working_directory[len(current_working_directory)-1] this works for me. none of the other pos...
Python ImageDraw - how to draw a thick line (width or thickness more than 1 px) Question: Simple problem: Using the ImageDraw module in Python, draw a line between (x1, y1) and (x2, y2) with a thickness or width larger than 1 pixel. Answer: Quote from actual script, showing only the part actually involved in drawing ...
Strange behavior of Python 'is' operator if combined with 'in' Question: How does Python interpret "'a' in 'abc' is True"? I was trying to evaluate the following two expressions: >>> 'a' in 'abc' is True: False >>> ('a' in 'abc') is True: True (I know "is" keyword shouldn't generally be...
Why does python regex seem to fail to match beyond 112 bytes? Question: I have a file, **what.dmp** , which is 116 bytes long. And my python code looks like this: import binascii import re import sys print(sys.version) needle = re.compile(b".{112}") with open("what.dmp"...
Pygame - Keep Sprites from overlapping Question: I'm making a space invaders type game using python and pygame. I currently have where I can move my user ship back and forth along the bottom with my arrow keys, and my enemies spawn and move back and forth across the top. My problem is with the enemies. I have it set so...
Python Regex match multiline Java annotation Question: I am trying to take advantage of JAXB code generation from a XML Schema to use in an Android project through SimpleXML library, which uses another type of Assertion than JAXB (I do not want to include a 9MB lib tu support JAXB in my Android project). See question [...
Is it possible that processes created by subprocess module in Python still use up memory (are zombies), although subprocess.Popen.wait() was called? Question: According to the answers to another question in stackoverflow ([how to kill (or avoid) zombie processes with subprocess module](http://stackoverflow.com/question...
Use Redefined command from PExpect Question: How can I redefine a command in a bash script so that a python script called from the bash script will execute the redefined version when called via pexpect? _**test.sh_** #!/bin/bash function scp(){ echo "Skip SCP" } export -f scp pyt...
rpy2 module is invisible from python 2.7 on Mac 10.6.8 Question: I am a bit of a noob on Mac and my python installation is refusing to acknowledge the existence of the rpy2 module on my mac. It looks like it only sees it as a Python 2.6 module. How do I make it visible in 2.7 ? Do I need to downgrade my python ? If so,...
Python sum of the array elements Question: I have file with following lines: date:ip num#1 num#2 2013.09:142.134.35.17 10 12 2013.09:142.134.35.17 4 4 2013.09:63.151.172.31 52 13 2013.09:63.151.172.31 10 10 2013.09:63.151.172.31 16 32 2013.10:62.151.172.31 16 32 How ...
Custom constants in python humanname not working Question: I'm following the instructions [here on using the python- nameparser](https://code.google.com/p/python-nameparser/). My problem is that for human names containing "assistant professor," I'm getting 'assistant' is the title, and 'professor' is assigned the role...
Locating specific <p> tag after <h1> tag in Python Html Parser Question: I'm attempting to parse through a series of webpages and grab just 3 paragraphs after the header occurs on each of these pages. They all have the same format (I think). I'm using urllib2 and beautiful soup, but i'm not quite sure how to just jump ...
Python global keyword behavior Question: I am trying to use a global variable across modules by importing the variable and modifying it locally within a function. The code and the output is below. The last output is not what I expected, I thought it should be 15 since it has been already modified in global scope by fun...
How to plot an ogive? Question: I'm wondering if there exists a way to plot a histogram and an ogive using matplotlib in Python. I have the following for plotting a histogram a = np.array(values) plt.hist(a, 32, normed=0, facecolor='blue', alpha = 0.25) plt.show() But I don't know if matpl...
Wrapping Pyro4 name server Question: I made a class to allow me to start and stop a pyro name server from a script (i.e. not having to start multiple programs such as in the [tutorial](http://pythonhosted.org/Pyro4/tutorials.html)). The class is as follow: class NameServer(Pyro4.threadutil.Thread): ...
python import within import Question: i am trying to import a module within a module and then access the lower level module from the top, however it is not available. is this normal behaviour? # caller.py import first print second.some_var # first.py import second # second.p...
Conversion to datetime object leads to crash of numpy functions Question: My python script produces an strange error and I have no clue why. Maybe anybody else has an idea. Try to provide a example everybody else should be able to run. import datetime import numpy as np date = np.array([201...
Python 2.7 How to add images on the canvas with Tkinter Question: I need to add an image to the canvas. I have tried countless amounts of things, and finally decided to make a question on here. This is what I have imported from Tkinter import * import tkFont from PIL import ImageTk, Image ...
Deck card class in python Question: I am working on creating a class for the first time, and I am thinking that I have done every thing to get it run, but I still get bunch of issues which is `'list' object has no attribute 'shffule'` so the problem here is it will not shuffle the cards, and it will not tell the remain...
Computing Pointwise Mutual Information of a text document using python Question: My goal is to compute the PMI of the text below: `a= 'When the defendant and his lawyer walked into the court, some of the victim supporters turned their backs on him`' formula: PMI-IR (w1, w2) = log2 p(w1&w2)/p(w1)*p(w2); p...
Super object has no attribute 'append' Question: I am working on creating a class for the first time, and I am facing difficulties here and there, first read my code, and I will post the error after it import random class card_deck: suites= ["Clubs", "Diamonds", "Hearts", "Spades"] ...
got errors when import mod_python Question: After finishing install mod_python, I got 500 Internal Server Error. I looked up the log, it says: python_handler: Can't get/create interpreter. Then I open a python terminal and to test if I can import mod_python. Then I got errors as follows: >>> import mod_...
How can I terminate Question: I am learning socket programming and python. For a school assignment, I created a server that runs, but I don't know how to terminate it. The instruction says that my server runs repeatedly until terminated by a supervisor (don't lead open sockets). Can someone give me an example or point ...
Using Hadoop to run a jar file - Python Question: I have an existing Python program that has a sequence of operations that goes something like this: 1. Connect to MySQL DB and retrieve files into local FS. 2. Run a program X that operates on these files. Something like: `java -jar X.jar <folder_name>` This will op...
psutil module not fully working on debian 7 Question: I'm trying to get the amount of free memory in the system using python. basically the same info that i can get from `cat /proc/meminfo | grep MemFree`. >>> import psutil >>> psutil.NUM_CPUS # this works fine 2 >>> psutil.virtual_memory() # ...
IRC Client in Python; not a IRC Bot Question: I've searched extensively on this and only came up with bot specific clients. I know they're basically the same, but for what I want to do I just can't figure it out. I am trying to program a python client, that is pure and simple on it's face. For example when run from th...
python pandas text block to data frame mixed types Question: I am a python and pandas newbie. I have a text block that has data arranged in columns. The data in the first six columns are integers and the rest are floating point. I tried to create two DataFrames that I could then concatenate: sect1 = Data...
Save data to VTK using Python and tvtk with more than one vector field Question: I'm trying to save three sets of vector quantities corresponding to the same structured grid (velocity, turbulence intensity and standard deviation of velocity fluctuations). Ideally, I'd like them to be a part of the same vtk file but so ...
Making pig embedded with python script and pig cassandra integration to work with oozie Question: I am new to oozie and I have few problems. 1) I am trying to embed a pig action in oozie which has a python script import. I've placed the jython.jar file in the lib path and have an import in the pig script which will tak...
Python3 write string as binary Question: For a Python 3 programming assignment I have to work with Huffman coding. It's simple enough to generate the correct codes which result in a long string of 0's and 1's. Now my problem is actually writings this string of as binary and not as text. I attempted to do this: ...
How to convert a string with multiple dictionaries, so json.load can parse it? Question: How can I write a function in python that that will take a string with multiple dictionaries, one per line, and convert it so that json.loads can parse the entire string in single execution. For example, if the input is (one dicti...
Python: return list of sequentially occuring common items from lists and also a list of uncommon ones Question: lists = [[a,b,c,d],[a,b,c,d,e],[a,b,c,x],[a,b,c,d,e,f]....lots] common_items = [a,b,c] uncommon_items = [[d], [d,e], [x], [d,e,f]] common_elements(lists[0],lists[1]) def co...
How to loop using .split() function on a text file python Question: I have a html file with different team names written throughout the file. I just want to grab the team names. The team names always occur after certain text and end before certain text, so I've split function to find the team name. I'm a beginner, and ...
PySide. Extracting DOM HTML. AccessNetworkmanager Question: I need to extract all calendar data from page like "<http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/>". Firstly - to extract all html with inner dom. Using eclipse and Python 3.3, win7. Searched here answers, and coded smth based on th...
error: unpack requires a string argument of length 8 Question: I was running my script and I stumbled upon on this error WARNING *** file size (24627) not 512 + multiple of sector size (512) WARNING *** OLE2 inconsistency: SSCS size is 0 but SSAT size is non-zero Traceback (most recent call ...
Keep a Frame in an other window Frame Question: My programm create a Frame with three panels in an horizontal boxsizer. A menu with "new window" item for create a seconde Frame. I give the seconde panel as parent of the seconde window. I wante the seconde Frame stays in the seconde panel area of my first frame. if user...
Class scopes in Python Bottle routes Question: Inside a bottle route I am instantiating a class. Feasibly, this page may get called simultaneously and need to create simultaneous instances of this class named "newuser" in the function. I wanted to make sure there won't be conflicts since all instances are assigned th...
Python - Remove whitespaces and punctuation without functions Question: first of all, sorry for my bad english. I'm a beginner programmer and I have some problems with my python program. I have to make a program that normalizes the whitespaces and the punctuation, for example: If I put a string called "...
pip-3.3 install MySQL-python Question: I am getting an error pip version pip-3.3 -V pip 1.4.1 from /usr/local/lib/python3.3/site- packages/pip-1.4.1-py3.3.egg (python 3.3) how to install MySQLdb in Python3.3 helpp.. root@thinkpad:~# pip-3.3 install MySQL-python Downloading/unpacking MySQL-python ...
"No module named time" Question: I compiled Python from source using: wget http://python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2 tar jxvf Python-2.6.6.tar.bz2 cd Python-2.6.6 ./configure make make install Version of Python: as3:~# python -V ...
Renderer problems using Matplotlib from within a script Question: I've narrowed down to this call: fig.canvas.tostring_argb() #fig=matplotlib.pyplot.figure() this function raises an `AttributeError` when I run the code as a python script. `AttributeError: 'FigureCanvasGTKAgg' object has no attribut...
python : print output of each thread to seperate file no processes Question: I have several threads and each thread writes output to stdout. However I want to redirect the ouput of each thread to a separate file independently of each other, then merge them to keep he flow of each thread together. What I mean is the fo...
How to use Python kazoo library? Question: I am planning to use Python kazoo library for Zookeeper. It's all about Python question here not zookeeper at all I guess meaning how to use Python kazoo properly.. I am totally new to python so I have no idea how to get going and how to use kazoo to connect with zookeeper. ...
Using Matplotlib imshow to show GIF image Question: I need to show a background to a matplotlib plot using `ax.imshow()`. The background images that I will be using are GIF-images. Despite having PIL installed, the following code results in an error complaining that the Python Image Library (PIL) is not installed (whic...
Python unique values in a list Question: I am new to Python and I am finding set() to be a bit confusing. Can someone offer some help with finding and creating a new list of unique numbers( another words eliminate duplicates)? import string import re def go(): import re ...
Using Python instead of XML for loading resources in C++? Question: I am building a simple 2D game (for learning purposes) in c++ and am currently parsing XML files using TinyXML to load my textures and other resources. Recently, however, I have been intrigued by python and wish to use python instead of XML for various...
Convert Python Code to Use Buttons instead Question: I have tried but I am not sure how to make this code work using buttons instead of the canvas. Its for a calculator using tkinter. I need to make this work using Buttons but everything i have tried has failed. If someone could tell me how to do it or even do the whol...
Python: sorting a list by key returns error: 'string must be integers' Question: I've been searching to no avail and am hoping someone can point me in the right direction. I'm trying to: * call a url which holds a json-formatted file * convert the resulting dict to a list (I don't think I need the keys that get in...