text stringlengths 226 34.5k |
|---|
No module named bumpy
Question: i am new mac user and new to python.
i just install python 2.7 and matplotlib and try to run this demo code:
"""
Simple demo with multiple subplots.
"""
import numpy as np
import matplotlib.pyplot as plt
x1 = np.linspace(0.0, 5.0)
x2 = np... |
remove widgets from grid in tkinter
Question: I have a grid in a tkinter frame which displays query results. It has a date
field that is changed manually and then date is used as a parameter on the
query for those results. every time the date is changed, obviously the results
change, giving a different amount of rows. ... |
Python filling a 2D list with recusion
Question: I need to create a program that will recursively fill a 2D list. The list
forms a grid like
I - I - I - - -
I I - - - - - -
I I I I - - - -
Then the user input column and row numbers. The program then fills that
section of "-" with "@". So... |
Python CSV Comparison
Question: This script compares two csv files...with two columns plz help me to modify
this script if sample1.csv and sample2.csv has more than 2 columns or 1
column.
f1_in = open("sample1.csv","r")
next(f1_in,None)
f1_dict = {}
for line in f1_in:
l = line.split(','... |
Sending different files from Client to Server in Python
Question: I am trying to send files from client to server in python. It is sending but
the problem is that I'm not getting same file name as it is. **Suppose
filename is File1.txt. When I send it to server, I receive it as file_.txt**.
The code I've wrote for this... |
Delay between for loop iteration (python)
Question: Is [this](http://stackoverflow.com/questions/11946232/how-to-add-some-delay-
between-each-iteration-of-for-loop-in-c "Delay iterations") possible in
Python? I wrote a great loop/script in Python and I’d like to add this delay
to it if at all possible.
m... |
Python Enclosing Words With Quotes In A String
Question: For Python I'm opening a csv file that appears like:
jamie,london,uk,600087
matt,paris,fr,80092
john,newyork,ny,80071
How do I enclose the words with quotes in the csv file so it appears like:
"jamie","l... |
Python How to post form with request
Question: I want use request to post the form with python and request This is form with
2 value user and pass to submit them
## can you help me pls .
<form method="post" action="/maxverif/0" name="loginf" id="connect">
<p class="title">
Connect
... |
ponyORM: trouble with query
Question: I have query with dynamic conditions,i.e.
select (lambda obj:obj.A = 'a' and obj.B = 'b' and ...)
So i write code for this:
def search(self,**kwargs):
q = unicode('lambda obj:', 'utf-8')
for field,value in kwargs.iteritems()... |
Using a python program to rename all XML files within a linux directory
Question: Currently, my code uses the name of an XML file as a parameter in order to
take that file, parse some of its content and use it to rename said file, what
I mean to do is actually run my program once and that program will search for
every ... |
Apache django not saving image with image field in form
Question: I have a form which is working fine if I don't add any image, but it gives
template not found error as per the apache log if I try to upload image. The
problem here is that my form with image is working fine on my local server
(django) but not uploading ... |
Drawing decision boundary of two multivariate gaussian in Python
Question: I will borrow the image from the following stack overflow question to help me
describing my problem: [Drawing decision boundary of two multivariate
gaussian](http://stackoverflow.com/questions/19576761/drawing-decision-
boundary-of-two-multivari... |
Python play song from point
Question: I would like to play a song with python, but all the libraries I've tried, had
problems on starting the song from a precise second.
I mean, I want to start a song from second 10, for example. I've tried pygame,
but I have issues with the play function.
The issue is: The music is ... |
Regular expression help in Python. Looking for an expression for RGB values
Question: Looks like I need a little help with a regular expression to match RGB values.
I've built the following expression but it doesn't find a match. It is also
insufficient because I need to expand it to check for three digits and only a
0... |
Python 3.3 how to get all methods (including all parents' methods) of a class in its metaclass?
Question: For example:
class Meta(type):
def __new__(cls, name, parents, attrs):
new_attrs={}
for k,v in attrs.items():
# Here attrs only has methods defined in ... |
Splitting a String Python within a list
Question: I have a list such as
a=['john(is,great),paul,school','robert,jack,john']
then I am building an empty list to append the split
b=[]
then I do this
for i in a:
b.append(i.split(','))
but list be is ap... |
Append child in the middle
Question: I would like to add an element to an XML file using minidom from python. Let's
assume i have the following xml file
<node-a>
<node-1/>
<node-2/>
<node-3/>
<node-a/>
in this case i can easily append an element "node-4" as follow
... |
How to force OS to free port with python
Question:
I use a port in my python program and close it,now I want to use it again.Just
that port not another port.
Is there any way to force OS to free port with python?
#!/usr/bin/python # This is server.py file
import socket ... |
how to display HSV image - tkinter, python 2.7
Question: I'm converting an RGB image to HSV, and trying to display the same in a Label.
But I'm getting error.
My code snippet is:
def hsv_img():
img1=cv2.medianBlur(img,3)
imghsv = cv2.cvtColor(img1,cv2.COLOR_BGR2HSV)
... |
How can you make \b accept words that start with '+' using regex in python?
Question:
re.search(r"\b\+359\b","Is your phone number +359 887438?")
Why is this regex not finding `+359` and how can i make `\b` consider words
starting with `+`?
Answer: You can't alter `\b`'s behaviour. You'd have to use a diff... |
Python SQL connect to wrong ip adress
Question: I'm trying to connect to my sql server using a simple python script.
import MySQLdb
db = MySQLdb.connect(host="192.168.0.156", user="root",
passwd="Imnottellingyoumypassword", db="mydatabase") # name of the data base
cur = db.cursor() ... |
python cannot kill process using process.terminate
Question: I have a python code as following:
import threading
import time
import subprocess, os, sys, psutil, signal
from signal import SIGKILL
def processing():
global p_2
global subp_2
.
.
.
... |
How to use python readlines method in random order
Question: How can one use the `readlines()` method to read a file in a random shuffled
manner i.e. `random.shuffle()`
file = open(filename)
data = file.readlines()
file_length = len(data)
Answer: Get them into a list with `line... |
Limiting number of processes in multiprocessing python
Question: My requirement is to generate `hundreds of HTTP POST requests per second`. I
am doing it using `urllib2`.
def send():
req = urllib2.Request(url)
req.add_data(data)
response = urllib2.urlopen(req)
while datet... |
splitext in write is not giving the basename
Question: I am trying to split text to the basename as:
#!/usr/bin/python3
import os.path
out.write(atoms[q]+" ")
out.write(str(os.path.splitext(atoms[q][0]))+" ")
which is yielding:
Mn7.pot ('M', '')
where obviously t... |
Split Cloud Endpoint API over multiple classes and multiple files
Question: I've started working on a Cloud Endpoint API as a first-time Python programmer
(with experience in Java and PHP).
I would like to keep everything together in one API but split different
resource calls over different files. The documentation gi... |
Invalid characters (&) in "where" request to Eve
Question: I found this problem in my development system and have reproduced it in the
Eve demo found [here](https://github.com/nicolaiarocci/eve-
demo/blob/master/README.rst)
This the code I run.
import requests
import json
import stri... |
Can't insert tuple to mssql db
Question: I am using `pymssql` in Python 3.3 to communicate with my Mssql db. And I am
trying to save the data from a user in a tuple to the database, but I keep
getting this weird error:
pymssql.ProgrammingError: (102, b"Incorrect syntax near '\\'.DB-Lib error message 102,... |
Having trouble with pythonic style and list comprehension
Question: I spent yesterday writing a small script in Python, which is not my primary
language, and it left me with some questions on how to do things in proper
'pythonic' style. The task is fairly simple, I have two arrays `fieldnames`
and `values`. Imagine the... |
pyside: QFileDialog returns an empty list
Question: When I run the script below, I am able to select several files in the file
dialog, but the value returned for the var "filenames" is: "[ ]", which
appears to be an empty list.
I think the solution must be somewhere on this page, but I can't figure out
what it is: <ht... |
How to handle cgi form with Python requests
Question: I'm trying to use the requests module in Python to handle a cgi and can't work
out what I've done wrong.
I've tried to use Google Dev Tools in Chrome to provide the right params and
data but I've not quite fixed it.
The site I'm trying to get data from is:
<http:/... |
Retrieve block of text from a file, using key-words as start-point in Python 2.7?
Question: I'm trying to read a paragraph of text from a file based on the paragraph's
title (first line). For example, let's say the file is as so:
Paragraph 1:1
This paragraph 1. This paragraph 1. This paragraph 1. Thi... |
Save Outfile with Python Loop in SPSS
Question: Ok so I've been playing with python and spss to achieve almost what I want. I
am able to open the file and make the changes, however I am having trouble
saving the files (and those changes). What I have (using only one school in
the `schoollist`):
begin pro... |
How to mock Python static methods and class methods
Question: How do I mock a class that has unbound methods? For example, this class has a
`@classmethod` and a `@staticmethod`:
class Calculator(object):
def __init__(self, multiplier):
self._multiplier = multiplier
def multipl... |
Ipython notebook align Latex equations in Ipython.Display module
Question: I am using ipython notebook to write latex equations with the following
modules
from IPython.display import display, Math, Latex
a simple example code might look like:
display(Math('a = \\frac{1}{2}'))
dis... |
subprocess.call() fails on Mac and Linux
Question: I'm running into a weird issue with subprocess.call() function. I am trying to
execute Java's 'jar' command using subprocess.call(). Here's the code:
import os
import subprocess
def read_war():
war_file_path = "jackrabbit-webapp-2.6.5.war... |
Python - splitting a string twice
Question: I have some data that looks like
"string,string,string:otherstring,otherstring,otherstring".
I want to manipulate the first set of "string"s one at a time. If I split the
input and delimit it based off a colon, I will then end up with a list. I then
cannot split this again b... |
cant import netsnmp in python on centos 6.5
Question: I am trying to use netsnmp in python but it is unable to import after
following all suggestions related to netsnmp in python. I installed netsnmp
using below commands
yum install net-snmp net-snmp-utils
easy_install ipython
snmpd service is ... |
Calculate time difference between entries in a file using python
Question: I have csv file with the data formatted like this `date,time,event,user,net` .
I need to go through each line of this file, and if event == start, continue
till it reach the line with event == end for the same user and net, then
calculate the ti... |
Python Exceptions Logging
Question: Im currently logging the exceptions of a program via...
def log_message(text):
log_file = "/var/log/logfile.txt"
try:
if os.path.isfile(log_file):
mode = "a"
else:
mode = "w"
... |
replacing strings in files from list in python
Question: So I need to find all files with certain extension in this case `.txt`. Then I
must open all these files and change certain string with another string... and
here i'm stuck.
here is my code:
import os, os.path
find_files=[]
for r... |
Python parallel execution - how to debug efficiently?
Question: Below is a Python problem, that demonstrates how to iterate a function `func`
in parallel using `multiprocessing.Pool`. The are `Np` number of elements to
iterate. The function `func` merely returns `Np` minus the index of the
iterable. As seen I use a que... |
Combining multiple text files belonging to different groups using Python
Question: In my directory the following files (1_xxx.txt, 2_xxx.txt, 1_yyy.txt,
2_yyy.txt, 1_zzz.txt, 2_zzz.txt) exists. The contents of those files are shown
below:
1_xxx.txt:
-114.265646442 34.0360392257
-112.977603537 31.... |
Ubuntu: Can't setup virtualenv for python
Question: I'm using Ubuntu. I tried to follow the [Deploying a Django on Amazon Elastic
Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html).
Rather than using `yum`, i used `apt-get` instead.
I followed every ahead steps well.
... |
How can I get and process a new S3 file for every iteration of an mrjob mapper?
Question: I have a log file of status_changes, each one of which has a driver_id,
timestamp, and duration. Using driver_id and timestamp, I want to fetch the
appropriate GPS log from S3. These GPS logs are stored in an S3 bucket in the
form... |
Errors while installing matplotlib on OS X 10.8
Question: I am trying to install matplotlib on my machine with OS X 10.8 and XCode
5.0.2. I get these weird errors of which I am not able to make sense. I used
`pip install matplotlib` to install the package, but then it returns the
following errors at the end. I am cluel... |
Get variables from the GUI in program
Question: first, sorry for my english - im still learning. I´m a student from Germany
and i learn Python.
I have a program which needs a lot of paramters for running so i build a gui
by wxGlade. Now i want to get this paramters in my application. I saw some
things. They used the G... |
Guessing the date format python
Question: I am writing a method in a Python module which tries to make live easier to
the users. This method implements the creation of events in that calendar.
def update_event(start_datetime=None, end_datetime=None, description=None):
'''
Args:
start_date: ... |
Loopback ('What u hear') recording in Python using PyAudio
Question: Good day,
I'm trying to record my speaker output with Python using PyAudio. Currently,
I'm able to record my microphone input and send this over to the 'listener'.
What I'm trying to do now is create a loopback, so it will record the output
from my s... |
Averaging out sections of a multiple row array in Python
Question: I've got a 2-row array called C like this:
from numpy import *
A = [1,2,3,4,5]
B = [50,40,30,20,10]
C = vstack((A,B))
I want to take all the columns in C where the value in the first row falls
between i and i+2, and aver... |
Google App engine python writing csv in arabic
Question: I am trying to write a CSV in Arabic script. I have encoded the string to
utf-8 and wrote it in the csv.
The problem is if I open the file in csv it shows strange characters like
`آلز سندويتش كاÙيه` however if I open the file in notepad++ it
shows ... |
Bool object is not callable in python connect for game ( is in the return line of def isWinner(bo, le):)
Question: # Tic Tac Toe
this is the beginning of the code for reference possibly this is the board
import random
def drawBoard(board):
# This function prints out the board that it wa... |
Django: syncdb not able to add any model in data base
Question: I'm new with Django and I'm not able to add any model to my DB?? Ok,this is
the Portfolio model :
from django.db import models
from core.models import Unit
# Create your models here.
class Portfolio(models.Model):
... |
Importing module functions from python packages
Question: I saw the command listed as below for `sklearn.tree.tree`
from ._tree import Criterion, Splitter, Tree
from . import _tree
Yet in the same tree folder I cannot find any file or class named `_tree`. Can
anyone tell me where exactly I can ... |
optional python arguments without dashes but with additional parameters?
Question: what I'd like to do in Python is accept arguments of the following format:
script.py START | STOP | STATUS | MOVEABS <x> <y> | MOVEREL <x> <y>
So in other words,
1. I don't want to deal with hyphens;
2. I have m... |
Do Python functions copy the input parameters to the function?
Question: I have the following example in Python:
import numpy as np
import timeit
# array size
m = 3000
# square array
a = np.random.rand(m, m)
# column vector
b = np.random.rand(m)
# solve... |
asyncio - How can coroutines be used in signal handlers?
Question: I am developing an application that uses asyncio from python3.4 for
networking. When this application shuts down cleanly, a node needs to
"disconnect" from the hub. This disconnect is an active process that requires
a network connection so the loop need... |
Changing of pixel values after writing the same image using imwrite opencv python function
Question:
import cv2
import numpy as np
im=cv2.imread('test.jpg')
cv2.imwrite('result.jpg',im)
Here test.jpg have size 19 KB and result.jpg have 41 KB even though they are
same images.
I observed that ther... |
Is print the only way to display something in .py file
Question: In the python command line, I can do
>>> a
array([ 0, 1, 3, 10, 1, 0, 0, 3, 6])
>>> print a
[ 0 1 3 10 1 0 0 3 6]
But in a .py file, I can only do print, but not directly 'a'. What if I want
to see the w... |
python matplotlib legend shows first entry of a list only
Question: I could not get all the legends to appear in matplotlib.
My Labels array is:
lab = ['Google', 'MSFT', 'APPL', 'EXXON', 'WMRT']
I use the below code to add the legend:
ax.legend(lab,loc="best")
Am seeing only '... |
2D-Array to tiled map PyGame, Python
Question: I have looked for similar questions, but I haven't found anything concrete
enough to actually apply to my situation.
Ok, so I've come up with something that will display the right amount of
images, in the right places, except for the Y axis. Basically, if I have
array:
... |
Module Name Error
Question:
>>> import EpicMatrix
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import EpicMatrix
ImportError: No module named EpicMatrix
>>>
I have created this module and saved it as .py file but still python is not
able to recogn... |
Fastest way to find nearest triangle number?
Question: In python I need a function that takes an integer and returns the absolute
value of n minus the nearest [triangle
number](http://en.wikipedia.org/wiki/Triangular_number) to n. The way I'm
doing it now is by generating a list of all the triangle numbers up to n. The... |
Best way to have a python script copy itself?
Question: I am using python for scientific applications. I run simulations with various
parameters, my script outputs the data to an appropriate directory for that
parameter set. Later I use that data. However sometimes I edit my script; in
order to be able to reproduce my ... |
Detecting collision in python and tkinter
Question: I have following setup: I have an archer who can shoot arrows, which are
always new instances of the class arrow and I have an instance of the class
blackMonster. My Question is whether it is even possible or not to detect
whether one of my arrow instances had a colli... |
Python Tkinter: Loop The Computer's Turn A Certain Amount of Times
Question: I'm writing a program for a dice game (Pig). In the game, the player will roll
a d6 until they decide to hold their score (passing to the computer) or until
they roll a 1, which will automatically make it the computer's turn.
The issue I'm ha... |
Is there any suggestions or standards of module dependency design of Python?
Question: Suppose all that need to be considered are only user defined functions and
system modules.
I've created 2 modules based on it's logical structure, then I'm not sure
what's next.
Say I put 10 functions in `fm1.py` and 8 functions in... |
Curl works but urllib doesn't
Question: Whenever I curl
[this](http://www.economist.com/blogs/schumpeter/2014/04/alstom-block), I'm
able to get the entire webpage. However, when I use the `urllib` or even
mechanize library in Python, I get a `403 error`. Any reason why?
Answer: You can user the requests lib:
... |
socket.gethostbyaddr() returns error on some computers and not for others
Question: I've looked for any other threads related to this topic, but after an
extensive search i was not able to find an answer that relates to my question.
Using Python, I'm trying to use socket.gethostbyaddr("ip here") to determine
the hostna... |
Pythonic way to group items in a list
Question: Consider a list of dicts:
items = [
{'a': 1, 'b': 9, 'c': 8},
{'a': 1, 'b': 5, 'c': 4},
{'a': 2, 'b': 3, 'c': 1},
{'a': 2, 'b': 7, 'c': 9},
{'a': 3, 'b': 8, 'c': 2}
]
Is there a pythonic way to extract and g... |
Am I using classes and implementing functionality correctly?
Question: I have to create a listening server that will receive HTTP POST / XML alert
traffic from a network sensor and parse out the received XML. Being a beginner
to Python, and having a tough time understanding classes, I wanted to get
advice on if I'm imp... |
Writing an Element to a file
Question: I am using `ElementTree` to create, parse and modify XML files and object. I
am creating the tree like this:
import xml.etree.ElementTree as etree
foo = etree.Element("root")
etree.SubElement(foo, "extra", { "id": "50" })
then, I want to write this to ... |
Can't get the url function to work with a specific syntax in django
Question: I've visited the documenation at
[https://docs.djangoproject.com/en/1.6/ref/templates/builtins/#std:templatetag-
url](https://docs.djangoproject.com/en/1.6/ref/templates/builtins/#std%3atemplatetag-
url) several times and i cant seem to get t... |
Pyramid web framework hello world not working
Question: I'm trying to run the ["hello world"
application](http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/firstapp.html)
for the Pyramid web framework but getting the following error. Can someone
please tell me what I need to install. Thanks
C... |
SYN Port Scanner Script: "Mac address to reach destination not found. Using Broadcast" error
Question: Im writing a SYN Port Scanner in Python with Scapy. There are no syntax errors
involved but when I run the script Im unable to send any packets to any
destination.

The script and the sh file are located in the same directory.
... |
While is this function still executing after?
Question: I made a simple choice game much like Rock, Paper, Scissors using Python. The
problem is that after you have won, and put in the winner's name, the while
loop still executes one more time. This is unacceptable! I've looked over it,
and looked over it again. With m... |
POST data to CGI file using XMLHttpRequest causes BadHeader
Question: When I try posting data to my CGI file, my CGI file says the actual post data
is invalid. I am using HTML/JavaScript for the front end and Python for the
backend.
Works:
<form name="login" action="/cgi-bin/register.py" method="POST">
... |
Django error in filtering datetime field by date : Join on field X not permitted
Question: I saw another post suggests that datetime field can be filtered by time, by
using `__date`. However when I tried on my machine it never worked.
This is my `models.py`
class Record (models.Model):
time = mo... |
How do I import a file type .1.tar.gz into Python?
Question: I am attempting to complete a computational project were I can duplicate
sentiment analysis, and find a correlation to parts of speech usage in a data
set saved in a tar.gz file. The file is currently saved in my user directory
on my University server. Access... |
Run a python image processing script in an android app
Question: I am using a python script to detect circles using Hough transfrom which
imports "opencv2" and "math" libraries.Can I run this script in an android
app?How can this be done?The following application is the one I want to run in
an android app.`import cv2 i... |
Adding values to dictionary in Python
Question: The code below:
rect_pos = {}
rect_pos_single = [[0,0], [50, 0], [50, 100], [0, 100]]
i = 0
while (i<3):
for j in range(4):
rect_pos_single[j][0] += 50
print rect_pos_single
... |
Shell script to update DB via flask
Question: I got started with [flask](http://flask.pocoo.org/docs/quickstart/#quickstart)
and I tried out the
[Flaskr](https://github.com/mitsuhiko/flask/tree/master/examples/flaskr/)
example. On the execution of a certain python script, I would like to update
one row of my database.
... |
Python: Resize Image to a fixed size, ignoring the initial aspect ratio
Question: I am trying to scale an incoming image which can be of (any type, any size) to
a fixed grayscale image (eg 14x14). What I do is:
from PIL import Image
...
img = Image.open(args.picture).convert('L')
img.thumbnai... |
How do i generate a documentation for a 1-file python project (script, no module) with sphinx?
Question: I have a python project which is stored in one file, it's a command line tool.
I've managed to generate a documentation with sphinx allready, but how do i
determine that my file is a script and _not_ a module?
An... |
My calculator program in Python allows character inputs
Question: I have created a Calculator program in Python using Tkinter and it is working
fully; but when I run it you can click on the Entry box at the top of my
Calculator and enter characters. I have written code so that when this happens
an Error occurs but thes... |
Python error check bug?
Question: I have the following script:
from multiprocessing import Lock, Pool
def worker():
r = other.work()
return r
def main():
pool = Pool(4)
result = pool.apply_sync(worker,())
result.wait()
In **worker()** , I ca... |
Converting a list from a .txt file into a dictionary
Question: Ok, I've tried all the methods in [Python: List to
Dictionary](http://stackoverflow.com/questions/4576115/python-list-to-
dictionary), but I can't seem to get this to work right. I'm trying to convert
a list that I've made from a .txt file into a dictionary... |
Python & requests | ImportError: No module named util
Question: I just installed the package requests on a new computer. I'm getting this
error when I try to import that module. Any ideas what's causing the issue w/
the util module?
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC... |
Python & SQLite3 Selecting from two tables
Question: I have written this code in python, which I basically opens up my SQLite3
database and looks at each row in the table 'contact' and then takes each 'id'
number and then looks at the matching 'id' in the table 'Users'. My problem is
that it only outputs the first one ... |
how to post multiple value with same key in python requests?
Question:
requests.post(url, data={'interests':'football','interests':'basketball'})
but,is not working,how to post `football` and `basketball` in `interests`
field?
Answer: Dictionary keys _must_ be unique, you can't repeat them. You'd use a seq... |
Connect OpenERP with mysql using cr?
Question: I would like to get some data from mysql in OpenERP.
In one way I can do it like that:
#!/usr/bin/python
import MySQLdb
# connect
db = MySQLdb.connect(host="localhost", user="appuser", passwd="",
db="onco")
cursor = db.cursor()... |
Threading and interpreter shutdown
Question: I have this piece of python code:
def __init__(self):
self.ip_list=[]
self.queue=Queue()
for i in range(5):
worker=threading.Thread(target=self.__executeCmd, name="executeCmd("+str(i)+")")
worker.setDaemon(True)
w... |
logging in multiple classes with module name in log
Question: I want to use the logging module instead of printing for debug information and
documentation. The goal is to print on the console with DEBUG level and log to
a file with INFO level.
I read through a lot of documentation, the cookbook and other tutorials on ... |
Can Python's comprehensions make groups?
Question: I have a list that looks like
[(1,2,5),(2,10,13),(5,24,56),(1,8,10),(2,3,11)]
How can I produce a dictionary by grouping by first element of tuples and
finding `min` element in second elements and `max` element in third elements:
{1:... |
Python Storing and Retrieving Date into Sqlite3 database
Question: I am aware of this [similar question on
SO](http://stackoverflow.com/questions/1829872/read-datetime-back-from-sqlite-
as-a-datetime-in-python) which is basically asking about the same thing.
However, I seems to be getting an error message. Let me expla... |
Python CSV take square root of data in the field
Question: I have a CSV file containing numbers in the fields,

I write a script, trying to take square root of numbers in every field in this
CSV file,
import sys, os
import csv,... |
Tornado Url Not Match with ? ("Interrogation") Sign
Question: I'm using tornado to create a web service. I learn many ways to handle URLs
but i can't find a way to handle this URLS:
> Main-Dns:xxxx(port)/{System}(this is static)/{word}?q={word}
My code:
import tornado.ioloop
import tornado.web
... |
How do you make a database using sqlite3 in python
Question: I'm trying to make a .db file which as a 1 to many realntionshp in it and it
will not work.
from sqlite3 import *
$sqlite3 testDB.db
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements... |
Python For In Loop Matrix for User Input
Question: So I have been searching on Overflow for a few days now for a problem that I
am working on. I understand the communities efforts to curb the homework
questions, but I am stumped and would like to learn this concept and move on
to learn more programming.
In Python I am... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.