text stringlengths 226 34.5k |
|---|
How to add signed certificates to a bitcoin bip70 payment message? python
Question: References:
<https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki>
<https://github.com/aantonop/bitcoinbook/blob/develop/selected%20BIPs/bip-0070.mediawiki#paymentdetailspaymentrequest>
message PaymentRequest {... |
indentation error in python for raspberry pi
Question: I am creating a motion sensor with my Raspberry Pi with python. I had this
working fine to just print "motion Detected!", but now I'd like to add a
feature to also take a picture. I am getting an indentation error on the line
`camera = picamera.PiCamera()`. Removin... |
Adding a Second Text Area to a Flask App
Question: I have a simple flask app. I tried to add a second text area to the app to add
another function. I copied the text area exactly and I receive the following
message when I his submit on the lower box:
Bad Request The browser (or proxy) sent a request that this server c... |
Convert Unicode to ANSI or UTF8 in python
Question: I am using Python 2.7.8 and I have a script which does parsing:
def parse():
with open('myfile.txt') as f:
.
.
.
Print l
myfile.txt has a UNICODE coding. How can I add a code to this script so that
it reads the myfile.txt a... |
Generating 3D Gaussian distribution in Python
Question: I want to generate a Gaussian distribution in Python with the x and y
dimensions denoting position and the z dimension denoting the magnitude of a
certain quantity.
The distribution has a maximum value of 2e6 and a standard deviation
sigma=0.025.
In MATLAB I can... |
Right Format to Embed JSON in CSV
Question: I am trying to write a Python function that query an API that returns various
JSON snippets and want to put each of these snippets (some are objects, more
are json arrays) within a .csv file.
What's the right way to escape all commas, [, ], " and other symbols so that
Excel ... |
Java's FluentWait in Python
Question: In java selenium-webdriver package, there is a
[`FluentWait`](https://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/support/ui/FluentWait.html)
class:
> Each FluentWait instance defines the maximum amount of time to wait for a
> condition, as well as the freq... |
logic for python web scraper for business names
Question: I am new to python and was wondering if there was a way to get the business
name of a website through a python script.
I have 1000s of businesses I need to validate for their names and was
wondering if it was possible to scale this up by looking at their websit... |
Uploading files using Python requests module
Question: I need to load a file using a soap endpoint url...When I use the below code to
load it the files are getting loaded but they are not in a readable
format...When I load using SOAPUI tool it loads properly...
import requests
xml = '''<soapenv:... |
Python nesting list comprehensions with variable depth
Question: I am writing a program where I use different methods to fit a dataset, and in
the final step I want to take a distribution over the models, and then test it
against a validation set to pick the optimal distribution. In order to do so,
I need lists that su... |
python : speed dating & permutation
Question: I have 36 persons and 6 tables. I'd like to form 6 groups around each table.
Then form 6 other groups and 6 others again and again... until everybody met
everybody but nobody met someone twice.
So far I came up with this script, but it produces repetitions :
... |
Django CMS test - can't find namespace
Question: I've got a very strange problem with Django CMS tests. When I run:
`./manage.py test --settings=my_project.test_settings` I get that error:
> ERROR: test_guest_list_view (apps.news.tests.test_views.NewsListViewTest)
> Tests if guest can't see disabled entries
> \-------... |
Send mail to an IP Address using python
Question: So I am trying to send mails via a python script. It is working fine using the
usual format of the receiver address "[email protected]". When I'm now trying to
use the script with a receiver "user@[IP-Address] all my debug output looks
good and the sendmail method works, ... |
Python synchronise between threads and processes
Question: A bit of background:
I am writing a function in Django to get the next invoice number, which needs
to be sequential (not gaps), so the function looks like this:
def get_next_invoice_number():
"""
Returns the max(invoice_number) +... |
Python Indentation Error on import statement?
Question: I am writing a python script for the application maya. In the console i get
this error:
# Error: IndentationError: file <maya console> line 2: expected an indented block #
However this is a simple import statement. I'm not sure why i'm gettin... |
separate line output by groups
Question: My python script checks `mysqldump` and if any problems script prints :
* Dump is old for db;
* Dump is not complete for db;
* Dump is empty for db;
* MySQL dump does not exist for db;
Script logs these records to the file line by line.
My question is there are a way ... |
Pythonanywhere MySQL connection
Question: I'm new to pythonanywhere and am currently deploying my first app with it and
the bottle framework. I have created a db with the online console but I don't
know the syntax for accessing it. Is it the same syntax as when deploying
locally? Or is it something else? MySQLdb has be... |
Limit loop frame rate
Question: As like of
[pygame](http://www.pygame.org/docs/ref/time.html#pygame.time.Clock.tick) i
want to limit the frame rate of a loop. Pygame provide the
**pygame.time.Clock.tick()** way to do it:
> If you pass the optional framerate argument the function will delay to keep
> the game running s... |
Python Bloomberg API not connecting from ipython notebook
Question: based on following code [example of a simple historical data
request](https://code.google.com/p/pyalma/source/browse/trunk/InfoProviders/Bloomberg.py)
and the Python API example provided by Bloomberg I constructed the bdh
function below which works fin... |
Accessing python dateutil relativedelta values
Question: I am very new to python and I've run across a small problem that I haven't
been able to find an answer to by googling. I am running the following code:
from dateutil import relativedelta as rdelta
def diff_dates(date1, date2):
return rd... |
Python Two Identical Strings are viewed as Different
Question: I have two strings that by all indication look identical:
x1 = 'N C Soft - NCSOFT_Guild Wars 2 December 2013 :: BNLX_AD_Parallax_160x600'
x2 = 'N C Soft - NCSOFT_Guild Wars 2 December 2013 :: BNLX_CT_Parallax_160X600'
However, check... |
Convert netcdf "land" variable to latitude and longitude with Python
Question: I have a global meteorological dataset and I want to access the data for a
certain grid (lat,lon). However, the data is compressed, i.e. the parameters
of interest do not have the dimensions (lat, lon), but "land". "land" is a 1D
array of in... |
Can I show decimal places and scientific notation on the axis of a matplotlib plot using Python 2.7?
Question: I am plotting some big numbers with matplotlib in a pyqt program using python
2.7. I have a y-axis that ranges from 1e+18 to 3e+18 (usually). I'd like to
see each tick mark show values in scientific notation a... |
Python Py2app packaging directories
Question: am getting an error about calling a method from a group of python files
bundled with py2app
(1) I have read various info on the py2app importing large directories or
package groups etc. but it seems to have problems interacting with said files.
I hard coded each file to be... |
PIR sensor Motion Detection count Write to Text File in python
Question: I need to Write "pir sensor" motion detection COUNT to text file.
I tried with this code and this is work without writing to text file. when I
put write to file it gives an error `file = open("textFile.txt", "w")`
`IndentationError: unindent does... |
Resizing tkinter windows and contents
Question: I am using python tkinter to build a ui containing a matplotlib figure and
some buttons, but am having difficulty with resizing the window and it's
contents. I've looked at some of the examples on this site and the docs and as
I understand it, for a frame containing small... |
What is wrong with my Python 3.4.1 (last version) code?
Question: I was trying to do this code ... but I don't where's the problem.
I need do a program makes a person to 5 questions about the crime. The
questions are:
* Telephoned the victim?
* Was on the scene?
* Lives near the victim?
* Should(must) for ... |
Track name and list elements and give them default values extracted from a file: Python
Question:
Input file format is like below:
Label A
{
Zebra,
Lion,
Python,
Cat,
Dog,
Blah,
}
Label B
{
India,
Nigeria,
Malaysia,
Peru,
}... |
import function from standard library after importing similarly named function from other library
Question: This is a curiosity. Say I am using **IPython** interactively, which by
default imports
from numpy import sum
and after that I decide to use `sum` from the standard library. Say, to do
someth... |
Running subprocess on Windows causes TypeError: must be str without null characters or None, not str
Question: I'm trying to make a script that opens a program. I have a command that I
normally run manually in a Windows run (Windows Key + R).
command "C:\Riot Games\League of Legends\RADS\solutions\lol_ga... |
not able to get float value from python script in C# windows app
Question: I have a python script which reads datatable passed from C#. But when i try to
get the value of variable in python script.. it does not fetch value. This
issue occurs only for varible of type float. Example when i try to fetch value
of "ErrorRat... |
How to extract specific columns from a space separated file in Python?
Question: I'm trying to process a file from the protein data bank which is separated by
spaces (not \t). I have a .txt file and I want to extract specific rows and,
from that rows, I want to extract only a few columns.
I need to do it in Python. I ... |
python 3.4 spirograph error
Question:
from turtle import*
from math import*
def Xcord(R,r,p,t):
x= (R-r) * cos(t) - (r+p) * cos((R-r)//r*t)
def Ycord (R,r,p,t):
y= (R-r) * sin(t) - (r+p) * sin((R... |
Running a module that I've created out of Enthought Canopy
Question: I've created some module, and would like to access it through another Python
script in Enthought Canopy. When I attempt to do the same thing using python
directly through the command line, this works just fine -- I just import
myfile.py. Additionally,... |
In Python, how can I export a 3D isosurface into Blender
Question: I have some 3D (x,y,z,value) data in python and I can visualize the
isosurfaces in Mayavi. How can I export this isosurface into a file that I can
read into Blender?
Here is some example code:
import numpy
from mayavi import mlab
... |
Sierpinski triangle recursion using turtle graphics
Question: I am trying to write a program that draws a sierpinski tree with python using
turtle. Here is my idea:
import turtle
def draw_sierpinski(length,depth):
window = turtle.Screen()
t = turtle.Turtle()
if depth==0:
... |
Python's datetime strptime() inconsistent between machines
Question: I'm stumped. The date-cleaning functions I wrote work in Python 2.7.5 on my
Mac but not in 2.7.6 on my Ubuntu server.
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
... |
Parsing Relaxed Dates in Python
Question: Is there any package (like Natty in Java) in python that is able to parse a
relaxed date such as:
"Third day of September, 1988"
I tried using parsedatetime, and I get the correct month and year, but not the
correct day.
>>>>import parsedatetime
>>>>cal =... |
Python format Decimal near zero
Question: I'm trying to parse a near 0 number using the decimal.Decimal python module:
>>> import decimal
>>> from decimal import Decimal
>>> Decimal("0.00000161")
Decimal('0.00000161')
>>> Decimal("0.00000061")
Decimal('6.1E-7')
>>>
What wou... |
Where is the FiPy "base directory"?
Question: I have recently installed the FiPy package onto my Macbook, with all the
dependencies, through MacPorts. I have no troubles calling FiPy and NumPy as
packages in Python.
Now that I have it working I want to go through the examples. However, I
cannot find the "base director... |
WebDriverException: Message: 'ChromeDriver executable needs to be available in the path
Question: Every time I run my python algorithm I am getting this error in cmd:
Traceback (most recent call last):
File "newScrape.py", line 1, in <module>
import SScraper as SS
File "build\bdist.win32\egg\... |
How can i find the string inside single quotes in python regex
Question: I want to match the string inside these lines
key: value
key: 'value'
I am using this regex
`re.compile(r"(.*key: )(.*)")`
but \2 always catches single quotes as well.
I tried many things like
`(.*key: )'?(.*)'?` but d... |
Get full path for a file in python
Question: I'm trying to create a csv of paths to wav files in a series of directories.
Each row should correspond to a directory. Each cell in a row should contain
the path to a single file. The script below is "almost" working. It creates a
CSV with the files as cells. However, os.pa... |
sending video stream from server to client using socket programming in python
Question: I am trying to send video stream from server to client using python sockets
but facing errors. Here is my server side and client side code.There is some
problem with sending frame from server to client ,
Here is my **SERVER SIDE** ... |
understanding decorators in python
Question: I am having an object I cant touch, but would like to log the method calls. I
don't really understand decorators, but I was wondering if there is a more
elegant way to do something like this
import pprint
class myTest(object):
def __init__(se... |
How to drag images from Chrome to PyQt?
Question: I want to drag a picture from the browser but can not get the URL!
if ev.mimeData().hasUrls():
ev.mimeData().urls()
This code works well with images from Firefox(but I sometimes get the link of
the image not the source URL of the image - I a... |
Python change module name to its realname
Question: `app.py`:
import sys
for name, module in sys.modules.iteritems():
print name
I get:
encodings
site
__builtin__
sysconfig
__main__
....
as you can see, the module name is changed to `__main_... |
Python Paramiko Error
Question: I wrote a python program. I have conf file, I wrote router configuration
commands inside the conf file and I want to execute these commands inside
paramiko. I have a problem - the error message is below. Can you help me
please ?
# CODE:
#!/usr/bin/env python
import pa... |
computing the determinants of matrices in an array using python
Question: Say you have a numpy array of matrices e.g. an array of dimension (n,m,m).
Think of it as n matrices each of size mxm. Is there a way (not using a loop)
of computing the determinant of each each matrix in one go?
Answer: You can calculate the d... |
When importing a function it runs the whole script?
Question: I'm new to python and doing an assignment. It's meant to be done with linux
but as I'm doing it by myself on my own computer I'm doing it on windows.
I've been trying to do this test system that we use looking like this:
>>> import file
>... |
Python gc.get_referents() returning references that are unknown to inspect module
Question: I am trying to debug a memory leak and have tracked it down to a single
object, call it "parent".
`gc.get_referents(parent)` indicates that it is effectively gaining more and
more references to the object that is leaking. I'm t... |
Looking for built-in, invertible, list-of-list-accepting constructor/deconstructor pair for pandas dataframes
Question: Are there built-in ways to construct/deconstruct a dataframe from/to a Python
list-of-Python-lists?
As far as the constructor (let's call it `make_df` for now) that I'm looking
for goes, I want to be... |
WebStorm startup error on Lubuntu 14.04
Question: I am new to Linux. I am using Lubuntu 14.04. Python version is 2.7.6.
I have installed WebStorm 8 in following location:
david@david:/usr/opt/webstorm/bin$
When I run following command in bin folder:
./webstorm.sh
It gives me f... |
Ansible ec2 only provision required servers
Question: I've got a basic Ansible playbook like so:
---
- name: Provision ec2 servers
hosts: 127.0.0.1
connection: local
roles:
- aws
- name: Configure {{ application_name }} servers
hosts: webservers
sud... |
Asking for advice on Django deployment settings with Apache and mod_wsgi
Question: I have deployed Django with Apache and mod_wsgi following the official
documentation and other posts. While I have my site working I am concerned
that I may have gotten my setup wrong. I'd like some advice on my setup and if
it is follow... |
Calculating string difference in python
Question: I am trying to calculate the number of characters that differ between two
strings in python. Ideally I want a function just like strdif in C. I see
ndiff in python's difflib, but that returns a Differ object whereas I want a
simple integer (ex: "10011" vs "00110" return... |
adding backslash to symbols in python while using the regex library
Question: So I need to selectively add backslashes to characters that already have pre-
defined meaning (such as + and *)in the re library in python.
Say that I am give an array
arr = ["five", "+", "two", "*", "zero", "=", "five"]
... |
Python, Tkinter: Get Text from Checkbutton when Checked
Question: I'm working with the following code. My goal is to get the text of a
Checkbutton when it is checked, and append that text to a list. I want to
write the code dynamically, because the size of list 'x' may change. Here's
what I have so far:
... |
Python3 datetime negative number
Question: I am trying to time a the run time of a function using datatime.now() and
subtracting their differences to get a floating point number of seconds.
tStart = datetime.now()
*function*
tEnd = datetime.now()
# microseconds for more precisi... |
how to know which quarter does the current month belongs to ? (in python )
Question: I want to know to which quarter(Q1,Q2,Q3,Q4) does the current month belongs to
in python. I'm fetching the current date by importing time module as follows:
import time
print "Current date " + time.strftime("%x")
... |
Git and file renaming and replacing
Question: I don't generally have a problem with renaming with git, but I've run across a
really difficult problem I'm trying to work out.
For various reasons, I have a situation where we have a file `dir1/file`. Due
to some long ago decisions, it's in completely the wrong place and ... |
pycrypto random not supported on GAE?
Question: I have deployed a App engine application that uses pycrypto. I installed
pycrypto locally but when i deploy on the App Engine it says:
TargetAppError: Traceback (most recent call last):
File "/base/data/home/apps/s~shared-playground/55de226e3bc6746b0c... |
How to multiply two columns of a data file and add them in python?
Question: I want to multiply the contents two columns of a file generated from a bash
script and then add them up to get the summation. The problem is the file
contains some special character on the last column which I cannot get rid of.
How do I read t... |
update user installed packages with pip
Question: I'm using a bunch of python packages for my research that I install in my home
directory using the `--user` option of pip. There are also some packages that
were installed by the package manager of my distribution for other things. I
would like to have a pip command tha... |
How can I parallel parsing in python?
Question: I have the following code which converts graph from edges list to adjacency
matrix:
for line in open('graph.txt'):
converted = [sparse_to_dense.get(int(ID)) for ID in line.split()]
i = converted[0]
j = converted[1]
I.append(i... |
Failure prediction from sensor data using Machine Learning
Question: I am going to do a research project which involves predicting imminent failure
of an engine using time data obtained from sensors. The data basically
contains the readings of various embedded sensors every 10 minutes for many
months. Such data is avai... |
Python program to search videos using Bing
Question: I have been trying to search videos using bing search engine. But every-time I
try I get error HTTPError:HTTPError 403:Forbidden
import urllib
import urllib2
import json
def main():
query = "'pyscripter'"
print bing_sea... |
aws crontab not working using subprocess
Question: Crontab is working but not executing aws cli command. I am using python and
Subprocess.Popen
import subprocess
does not work...
proc = subprocess.Popen("aws rds describe-db-instances > /tmp/testoutput.txt", stdout=subprocess.PIPE, shell=True)
... |
Python : Searching a directory for files in a list
Question: ## Context
I have a list of filenames (many tens of thousands) that I would like to
locate within a directory. For all files that are located they must be copied
to a single output folder.
Using Python, what would be, **in your opinion, the most efficient* ... |
Unable to receive more than 20 MQTT messages using Mosquitto/Paho for Python
Question: I'm using the Mosquitto (now Paho) python MQTT client to connect to a HiveMQ
broker. The code is very basic, as taken from their documentation here -
<https://pypi.python.org/pypi/paho-mqtt>
#SUBSCRIBER
import paho... |
Python IRC bot disconnecting after 3 pings
Question: So i have coded a small twitch irc bot, but its getting disconnected, the bot
just stays ponging the pings and after 3 pongs my bot receives 0 data from
twitch and disappear from the viewer list.
Here is the code(the important part):
readbuffer = ""
... |
Adding tuples of lists to a list in python
Question: I don't understand the syntax of adding tuples whose elements are also
elements of a list to another list that encompasses all of the information.
I'm trying to create a trajectory list that contains tuples of flight data of
a projectile during flight. I want to use... |
How to mock an object returned by a mocked object?
Question: I don't quite have the hang of Python mocks.
Clearly I don't want my test code to call the actual method`requests.post()`
in the following method, so I want to to mock its behavior instead:
def try_post(self, url, body):
r = requests.p... |
How could I get square root of a symbol in python?
Question: I am using math.sqrt in python to compute the squre root of something, but
that "something" is a symbol instead of a known value. I am using that
"something" as an intermediate variable for later use.
import math
from math import sqrt
x... |
pytest fixtures doesn't work - why?
Question: I'm trying to use PyTest and I cannot obtain how to set fixtures. I've tried
following code:
import pytest
import random
@pytest.fixture()
def setup():
a = random.randint(0,10)
def test(setup):
assert 3 > a
if __n... |
How to set a environment variable in the current shell with Python?
Question: I want to set an environment variable with a
[Python](http://en.wikipedia.org/wiki/Python_%28programming_language%29)
script, influencing the shell I am starting the script in. Here is what I mean
python -c "import os;os.system... |
Updating data with bulkloader
Question: I'm using python script do upload some data to my app engine backend.
Here is it's definition in bulkloader.yaml
- kind: Subcategory
connector: csv
connector_options:
encoding: utf-8
property_map:
- property: __key__
ext... |
Python ElementTree: How to add SubElement at VERY specific position?
Question: I want to add a subelement to an xml file, but in a very specific position,
not appended to the end.
The standard way is:
subi = ET.SubElement(root[0][0], 'subi')
which is fine.
but: Let's say, root[0][0] already has t... |
No module named linear_modelsklearn._model
Question: from sklearn.linear_modelsklearn._model import SGDClassifier
No module named linear_modelsklearn._model
I am on OSX version 10.9.4
Python 2.7.6
numpy 1.9.0
scipy 0.14.0
scikit-learn 0.15.2
What I am missing? Thanks.
(import sklearn works fine but not t... |
Can a mock side_effect iterator be reset after it has been exhausted?
Question: `mock.reset_mock()` will not reset a side effect iterator. Is there a way to
do this without creating the mock again?
>>> from mock import MagicMock
>>> mock = MagicMock(side_effect = [1,2])
>>> mock(), mock()
(1,... |
Python eval function with numpy arrays via string input with dictionaries
Question: I am implementing the code in python which has the variables stored in numpy
vectors. I need to perform simple operation: something like
(vec1+vec2^2)/vec3. Each element of each vector is summed and multiplied.
(analog of MATLAB element... |
TypeError: 'str' does not support the buffer interface in 3.4.1
Question: I've created a server in Python. The code is:
from socket import *
serverSocket = socket(AF_INET, SOCK_STREAM)
localHost = # my address
port = 5369
serverSocket.bind( (localHost, port) )
serverSocket.listen(1)
... |
Serve static files with openshift and python
Question: I've set up [rawdog](http://offog.org/code/rawdog/) in an OpenShift
application and installed the Python and cron cartridges. I get the
application to serve the generated HTML, however the css stylesheet is not
available.
I use the following wsgi.py file.
... |
Syntax error for down()?
Question: I'm a beginner computer science student and using python in computer science
1. My assignment is to write a program that creates a spirograph. I think that
the code is all right to do that, but when i run it, an error message pops up
that says syntax error and it highlights `down()`, ... |
Importing correctly with pytest
Question: I just got set up to use pytest with Python 2.6. It has worked well so far
with the exception of handling "import" statements: I can't seem to get pytest
to respond to imports in the same way that my program does.
My directory structure is as follows:
src/
... |
Convert markdown image format to html
Question: I am using the markdown2 library in python to convert markdown to html.
However, it does not support the common image formatting
>
> [![alt text][some link]][img src link]
>
which should convert to
<a href="some link" rel="alt text"><img src="img s... |
Making/download a csv file with python
Question: I want to make a CSV with the Closed values of stocks, by downloading them
from Yahoo Finance using python 2.7 on Windows. The file is call "Historical
Prices". I have the tickers in a list and i want to know if I can make a csv
file with the closed values in a row. For ... |
To close a QtGui Window
Question: I am a beginner in python . Recently i got stuck in a problem . Problem is
stated as follows : I needed a progressbar in my app . So i googled and found
a similar code . With this code even if the progress is 100% main window is
not closing (while the progress window closes). Please he... |
MySql table into JSON format
Question: I would like to convert like 100 tables from MySql to MongoDb
So I think that the easiest way will be to import the data as JSON
Any generic query to convert MySql data to JSON format withou7t using PHP
/ruby /Python?
SELECT CONCAT(CONCAT('{"CompanyId":', compan... |
Acora doesn't work with gzip-opened files
Question: I'm trying to run Acora parsing on a file, which works as expected on plain
text files. When I try to run it on gzipped files using the python gzip module
(which is supposed to allow transparent reading of compressed files) I receive
nothing in return. This is not a c... |
Mayavi2 standalone script with command line arguments
Question: I am trying to parse command line argument to a MayaVi2 standalone script.
However, the `mayavi2.standalone()` function eats command line arguments
before me. For example:
#! /usr/bin/python
import sys, argparse
from mayavi.scripts i... |
Passing php array to python , doesn't work
Question: I'm trying to send php array encoded as JSON to python script , it doesn't
work . Here's my code :
<?php
$data = array('as', 'df', 'gh');
// $result = shell_exec('python /path/to/myScript.py ' . escapeshellarg(json_encode($data)))... |
Weird TypeError from json.dumps
Question: In python 3.4.0, using `json.dumps()` throws me a TypeError in one case but
works like a charm in other case (which I think is equivalent to the first
one).
I have a dict where keys are strings and values are numbers and other dicts
(i.e. something like `{'x': 1.234, 'y': -5.6... |
Python - Use to tablib to import Excel (xls, xlsx) files
Question: I'm having trouble figuring out how to import Excel files into my Python
script. I'm only a few days into Python so I'm guessing it's something very
obvious I'm missing. I'm using Python 3 and the tablib module. From the
examples on the tablib site, I'v... |
Opening a postgres connection in psycopg2 causes python to crash
Question: I'm getting the following error message when I try to open up a connection to
a postgres database. Perhaps it's related to OpenSSL, but I can't understand
the error message. Can anyone help?
>>> import psycopg2
>>> conn = psyc... |
Receive HTTP POST response by python
Question: I use the following example: <http://www.w3schools.com/php/php_forms.asp>
When I run it from browser, I see the results in the browser:
Welcome John
Your email address is [email protected]
When I run python POST http request:
imp... |
Python importing global variables inconsistent behaviour
Question: I'm having trouble importing a variable from a different python file to my
current one. I know this has been asked several time previously and I have
tried almost all those solutions, but no use.
In file top.py:
import sys, getopt, pdb
... |
Django - Always receiving __init__() takes exactly 2 arguments (5 given) when trying to store oauth2 credentials in db
Question: I've been trying to save credentials after a user uses their youtube account
to authenticate their account. I've been following this example to store my
new created credentials in my database... |
Using Python to append a list of names to a single URL during a crawl of a URL
Question: I am looking to create a script that would crawl my URL and would append a
name to the end of the url during a search. For example
192.168.1.100/map/**foo**
I would then want to parse through the response and if the status code is... |
Extracting all tweets on a topic from yesterday using Python's Tweepy?
Question: It seems that Python API allows people can dig back tweets tweeted a couple
days ago. Since I don't need to stream tweets instantaneously and yet I want
to collect all tweets on a particular topic (ie: fast car) for a period, I
think runni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.