text stringlengths 226 34.5k |
|---|
Pyodbc - The specified DSN contains an architecture mismatch between the Driver and Application
Question: I'm trying to connect to a MS Access Database (.accdb file) via python.
I used pyodbc to do this connection:
import pyodbc
conn = pyodbc.connect("DRIVER = {Microsoft Access Driver (*.mdb, *.accd... |
Exceptions when reading tutorial CSV file in the Cloudera VM
Question: I'm trying to do a Spark tutorial that comes with the Cloudera Virtual
Machine. But even though I'm using the correct line-ending encoding, I can not
execute the scripts, because I get tons of errors. The tutorial is part of the
Coursera [Introducti... |
How to determine the cause for "BUS-Error"
Question: I'm working on a variscite board with a yocto distribution and python 2.7.3.
I get sometimes a **Bus error** message from the python interpreter.
My program runs normally at least some hours or days before the error ocours.
But when I get it once, I get it direc... |
Returning two randomly chosen groups from a list in python
Question: How would i write code that involves having a list of 9 people split as evenly
as possible into 2 cars but they are placed into each car randomly in python?
Essentially i'm looking for a return similar to this:
Car 1: Person8, Person2, Person4, Pers... |
Why does Python's base64.b64decode() ignore gibberish at end of string?
Question: I have a long token that I'm decoding using python's `base64.b64decode()`
method.
It works. But as you can see below, it returns the same result even if I
insert gibberish characters at the end. Why? Shouldn't these two strings
produce t... |
Python FTP Upload calling variable
Question: I'm uploading a file to the ftp server, the actual settings for the upload are
correct but it isn't uploading the correct filename, it is uploading filename
as the actual name of the file instead of capture......
#!/usr/bin/python
#
# Lightweight M... |
from EC2 Spark Python how to access S3 file
Question: I have a s3 file which I am trying to access through Python code. I am
submitting my code in an EC2 instance via spark submit. To do the submission I
use the following code post starting the master and slave.
./spark-submit --py-files /home/usr/spark... |
how to subclass google app engine ndb property to support python subclassed objects
Question: from this article <http://stackoverflow.com/a/32107024/5258689>
I have a dict() subclass - that allows me to do dict.key (use dot to access
keys i mean) - as follows:
class Permissions(dict):
"""
Exampl... |
An error occurred while calling z:org.apache.spark.api.python.PythonRDD.collectAndServe
Question: I am new to spark and facing an error while converting .csv file to dataframe.
I am using pyspark_csv module for the conversion but gives an error, here is
the stack trace for the error, can any one of give me suggestions ... |
Executemany on pyodbc only return result from last parameter
Question: I have a problem when I try to use pyodbc executemany function. I have an
Oracle database and I want to extract data for multiple days.
I cannot use between in my request, because the database is not indexed on the
date field and its taking forever... |
Unable to install threading with Anaconda 64-bit
Question: When I pip install or conda install "threading" I get an error saying it
cannot be found, I am having a similar problem with Queue. Does Anaconda only
fetch 64-bit libraries? I am trying to go through Parallel Programming with
Python.
How do I install this lib... |
Different behaviour of matplotlib in interpretor and in script
Question: Running following code inside python interpretor displays a figure with random
values
>>>fig = plt.figure();ax1 = fig.add_subplot(111);plt.ion();ax1 = ax1.imshow(np.random.rand(256,256))
while running the following script as a... |
Imbed matplotlib figure into iPython HTML
Question: I want to dynamically write and display HTML with a code cell in Jupyter
Notebook. The objective is to generate the HTML to display table, div, img
tags in some way I choose. I want to capture img data and place it where I
want in this auto generated HTML.
So far I'v... |
decoding json dictionary with python
Question: Ive got a script written to fetch data from an API, and return it, but now i
need to parse that data, this is an example of what the json data looks like,
with some of the dictionary values i am looking to pull.
{'results': [{'icpsr_id': 21133,
'twitt... |
python: import global variable from parent directory
Question:
applications/
app.py
extensions.py
controllers/
__init__.py
inner.py
app.py
import inner
from extensions import aaa
inner.test()
extensions.py
import os
... |
Python: parsing texts in a .txt file
Question: I have a text file like this.
1 firm A Manhattan (company name) 25,000
SK Ventures 25,000
AEA investors 10,000
2 firm B Tencent collab... |
Python Finite State Machine Issues (Skipping the Proccessing?)
Question: I'm creating a python program for finite state machine without it being object
oriented. However, my processing phase is off. It doesn't even seem to be
running through the triple for loop I created, I checked by attempting to
print the CurrentSta... |
what is the Default user-Agent of PyQt Web kit Qwebview and how to get it
Question: i am new to python and developing a GUI in PyQt which has a Web Browser. I
want to show the User-Agent going with the Url but not founding a way.my code
is -
class Manager(QNetworkAccessManager):
def __init__(self, ta... |
Linear Regression with 3 input vectors and 4 output vectors?
Question: Task:
As an example, we have 3 input vectors:
foo = [1, 2, 3, 4, 5, 6]
bar = [50, 60, 70, 80, 90, 100]
spam = [-10, -20, -30, -40, -50, -60]
Also, we have 4 output vectors that have linear dependency from input vectors:... |
Sort a big number of pdf files by the common part in their names with Python 3.5.1
Question: I need to sort a huge (ca. 20000) amount of pdf files by the most common part
in their names. The structure of each file is pretty same:
`XXX_1500004898_CommonPART.pdf` (some files are delimited with "`_`" and some
with "`-`")
... |
Search neighboring points using k-d trees
Question: I have a bunch of coordinates contained in three `numpy` arrays: `xarr`,
`yarr` and `zarr` (corresponding positions in each array belong to the same
point - i.e the first point is at `xarr[0]`, `yarr[0]`, `zarr[0]`). Given
another point in space at `P(x,y,z)` I would ... |
How to use autobahn.ws with django?
Question: Need for websockets in my project. Found out crossplatform solution
[autobahn.ws](http://autobahn.ws) but only tutorial for pure python is
available. How to use autobahn as chat server in django project?
Answer: Simply add the following bit of code to the python script wh... |
'AttributeError: 'module' object has no attribute 'file'' when using oauth2client with Google Calendar
Question: I'm using the example script for google calendars python api
(<https://developers.google.com/google-
apps/calendar/quickstart/python#step_3_set_up_the_sample>) to try and print
out all the calendar events. H... |
Login to web portal using Python
Question: So I have followed many guides on how to login to a portal using python using
urllib2 and to parse it using 'BeautifulSoup'.
I am trying to login to this [webportal](http://academia.srmuniv.ac.in) which
has its login form way nested
[there](http://%20https://academia.srmuniv.... |
Does Rust have an equivalent of Python's threading.Timer?
Question: I'm looking for a timer which uses threads, not plain `time.sleep`:
from threading import Timer
def x():
print "hello"
t = Timer(2.0, x)
t.start()
t = Timer(2.0, x)
t.start()
Answer: Y... |
Problems with fastcgi when installing Django on Justhost
Question: I am following the following tutorial at <http://flailingmonkey.com/install-
django-justhost/> to install Django on my Justhost web server. So far I have
managed to install Django and Python on my Justhost shared web server.
However, I am now stuck whe... |
Python - Help needed with parsing file. Is there a way to ignore EOF chars?
Question: I have a binary file that I am trying to extract strings from and I am having
quite the time doing so. :(
My current strategy is to read in the file using Python (using one of the
following functions: read(), readline(), or readlines... |
PyQt4 in Mac OS X for Python 3 doesn't seem to work
Question: I installed PyQT4 in Mac OS X El Capitan for Python 3 using the instructions
given in [this answer](https://stackoverflow.com/a/21714509/1815288). The
instructions gave the following commands:
brew install python3
brew install qt
brew ... |
Recursively rename file extensions
Question: I am having a difficult time creating a python script that will rename file
extensions in a folder and continue to do so in sub directories. Here is the
script I have thus far; it can only rename files in the top directory:
#!/usr/bin/python
# Usage: pytho... |
Removing randomly generated file extensions from .jpg files using python
Question: I recently recovered a folder that i had accidentally deleted. It has .jpg and
.tar.gz files. However, all of the files now have some sort of hash extension
appended to them and it is different for every file. There are more than 600
fil... |
How to exit a main program from the Multiprocessing Process in python
Question: I am spawning 3 processes using multiprocessing.process and waiting for them
to complete. If one of them fails then i want to stop all other processes and
also the main program. But when i use sys.exit the execution is only stopping
just th... |
How to handle exceptions in a Django migration?
Question: How do I catch an exception in a Django migration?
I have a migration that, because of various legacy reasons, I expect to fail
sometimes. I want to be able to catch that error and run some error handling
code in that case.
Specifically, I'm renaming a table, ... |
I'm writing a fuel conversion program and its not working :(
Question: I am a novice python code writer and i am starting small with a fuel
conversion program. The program asks for your name and then converts a miles
per gallon rate or a kilometers per litre rate. Currently, the program runs
fine until it gets to the c... |
Multivalue dict to list of individual dicts
Question: Having following _dict_ structure
>>> d = {
'email': ['e_val1', 'e_val2', 'e_val3', 'e_val4', 'e_val5'],
'id' : ['i_val1', 'i_val2', 'i_val3', 'i_val4'],
'ref' : ['r_val1', 'r_val2', 'r_val3', 'r_val4']
}
what woul... |
i can't click button type="submit" python mechanize
Question: i've this button :
<input class="bi bj bk bl" type="submit" name="add_photo_done" value="معاينة">
but i can't click on it i tried this code :
self.br.submit("add_photo_done")
but it's give me the following error:
... |
Why is nested `if` in Python much slower than parallel `and`?
Question: I'm answering a question on an online judge. A section of the solution looks
like this:
if j > 0 and i < m and B[j-1] > A[i]:
imin = i + 1
elif i > 0 and j < n and A[i-1] > B[j]:
imax = i - 1
It passes the j... |
Problems in using python tkinter
Question: Initially running the code, blinking will start row wise. What my software
should do is that if the user gives the input "1" in the last row textarea,the
blinking should start column wise.
Again if the user give the input "1" then the letter should be selected and
should be d... |
Paramiko finish process before reading all output
Question: I'm Trying to make a real time SSH Library, but as usually getting stuck on
things, I have taken this code from [Long-running ssh commands in python
paramiko module (and how to end
them)](http://stackoverflow.com/questions/760978/long-running-ssh-commands-in-
... |
Python RegEx String Parsing with inconsistent data
Question: I have a string that I need to extract values out of. The problem is the
string is inconsistent. Here's an example of the script that has the string
within it.
import re
RAW_Data = "Name Multiple Words Zero Row* (78.59/0) Name Multiple... |
Pickle data with a persistent_id to a binary object (dumps and loads)
Question: A first question I asked was [_how to load a pickle object and resolve certain
references_](http://stackoverflow.com/questions/37026745/how-to-load-a-pickle-
object-and-resolve-certain-references). A next problem I'm facing is that I
cannot... |
imp.load_source() throwing "No Module Named" Error Python 2.7
Question: I'm currently using Python 2.7, and I'm trying to load a file like this:
myPlt = imp.load_source('SourceFile', 'path/to/SourceFile.py')
However, SourceFile.py imports module OtherModule, which is in the same
directory as Source... |
matplotlib runs but does not generate a graph
Question: I am trying to complete <http://opencv-python-
tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_image_display/py_image_display.html#using-
matplotlib> it runs but does not display anything
import numpy as np
import cv2
from matplotli... |
Tricky filling holes in an image
Question: I need to fill holes in images using python. This is the image with objects
that I managed to get - they are really edges of objects I want, so I need to
fill them. [](http://i.stack.imgur.com/IpauJ.png)
It se... |
re.search in Python yields "none" when using a file as the input
Question: I am very new to stack overflow and to programming in general, and appreciate
any help you can provide!
I want to use the re.search function in Python to find text in a file (this is
just practice, because ultimately I want to use re.sub and re... |
My Spark app has a read time out when reading from Cassandra and I don't know how to solve this
Question: My Spark app has a read time out when reading from Cassandra and I don't know
how to solve this. Everytime it reaches the part of my code mentined below it
has a read time out. I tried to change the structure of my... |
Stuck on PHP to Python Translation
Question: I'm attempting to translate some PHP code to Python and I'm stuck on the 4th
line in the following code (included for context):
$table = array();
for ($i = 0; $i < strlen($text); $i++) {
$char = substr($text, $i, $look_forward);
if (!isset(... |
parsing XML file depends on tags which may or may not be existed
Question: Im trying to parse an XML file depends on a tag which may or may not be
existed !
how I can avoid this IndexError without using exception handler ?
python script:
#!/usr/bin/python3
from xml.dom import minidom
... |
Python read file into memory for repeated FTP copy
Question: I need to read a local file and copy to remote location with FTP, I copy same
file file.txt to remote location repeatedly hundreds of times with different
names like f1.txt, f2.txt... f1000.txt etc. Now, is it necessary to always
open, read, close my local fi... |
Tweepy Python library "media_ids parameter is invalid" and "Tweet must not have more than 4 mediaIds" when submitting status update. Codes 44 and 324
Question: I have some pretty simple code for uploading images to Twitter via the Tweepy
library and then posting a status update using the returned media ids. I've
seen a... |
Why is python ctypes class descriptor called when object is not being destroyed?
Question:
>>> from ctypes import *
>>> class A(Structure):
... _fields_ = [('a', c_int)]
... def __del__(self):
... print("destructor called")
...
>>> a = (A * 10)()
>>> a[0]
<__main__.A object at ... |
1D Random Walk from Matlab to Python
Question: I have a Matlab code that generates a 1D random walk.
%% probability to move up or down
prob = [0.05, 0.95];
start = 2; %% start with 2
positions(1) = start;
for i=2:1000
rr = rand(1);
down = rr<prob(1) & positio... |
How to parse through complex season and episode formatting in Python Pandas
Question: I'm trying to clean up some data and am struggling to do so in Python/Pandas.
I have a series of data with TV Show Titles. I would like to do the following:
1. check if there are integers at the end of the string
2. if there is o... |
Python: How can I tell if my python has SSL?
Question: How can I tell if my source-built python has SSL enabled? either
* after running configure, but before compiling (best).
* after compiling, when I can run the python.
Context:
* a script that populates a bare linux box.
* Prerequisite is to install opens... |
how to plot two very large lists in python
Question: I've two lists:
time_str = ['06:03' '06:03' '06:04' ..., '19:58' '19:59' '19:59']
value = ['3.25' '3.09' '2.63' ..., '2.47' '2.57' '2.40']
I tried below code but got error:
plt.plot(time_str,value)
plt.xlabel('Time'... |
Is there something wrong with splitting a command line with split(' ')?
Question: In most [answers](http://stackoverflow.com/questions/89228/calling-an-
external-command-in-python) (I found) to the question _"How to run an external
command"_ I see something along the lines
> If you want to run `ls -l` you need to use ... |
Creating a Python command line application
Question: So I wrote a Python 3 library, which serves as an application 'backend'. Now I
can sit down with the interpreter, import the source file(s), and hack around
using the lib - I know how to do this.
But I would also like to build a command line 'frontent' application u... |
LibreOffice problems drawing hash marks in shape using Python
Question: I am trying to create a hash mark pattern inside a shape using LibreOffice 5
on Windows 10 using the Python 3.3 that came with LibreOffice. Two thirds of
the code is similar to this
[post](http://stackoverflow.com/questions/36852645/create-flowchar... |
Changing rectangle color on click in Python using Tk
Question: I'm trying to get a Tk rectangle created on a canvas to change its color when
clicked. Right now, no color change happens when the rectangle is clicked.
What do I need to be doing differently?
This is in Python3.5, by the way.
from tkinter i... |
wxPython: Switching between multiple panels with a button
Question: I would like to have two (I will add more later) panels that occupy the same
space within the frame and for them to be shown/hidden when the respective
button is pressed on the toolbar, "mListPanel" should be the default.
Currently the settings panel i... |
Can't access Bluemix object store from my Notebook
Question: I'm trying to read a couple of JSON files from my Bluemix object store into a
Jupyter notebook using Python. I've followed the examples I've found, but I'm
still getting a "No such file or directory" error.
Here is the code that should authenticate the objec... |
ValueError: array length does not match index length
Question: I am practicing for contests like kaggle and I have been trying to use XGBoost
and am trying to get myself familiar with python 3rd party libraries like
pandas and numpy.
I have been reviewing scripts from this particular competition called the
Santander C... |
Strip Punctuation From String in Python
Question: I`m working with documents, and I need to have the words isolated without
punctuation. I know how to use string.split(" ") to make each word just the
letters, but the punctuation baffles me.
Answer: this is an example using regex, and the result is ['this', 'is', 'a',... |
I can't run a simple code using pyaudio - [Errno -9996] Invalid output device (no default output device)
Question: (I'm new at python)
I'm trying to run a simple code about pyaudio. I just copied and pasted a code
that I found on the pyaudio web site.
I get this error:
OSError ... |
Python: print function hang when printing global list of objects
Question: I'm currently writing a Python Telegram bot which is used to monitor Raspi IOs
and send messages to a channel. So basically it has a function that will
update a logging variable `llog`.
This function (`logUpdate`), as it's named, will remove en... |
Using Spark and Python in same IDE
Question: I am using Spyder(Anaconda) on Mac for Python development. I also have
installed PySprak on my machine, which i use from the terminal. Is it possible
to use both of them in Spyder, or somehow manage to import the spark context
into my python 2.7?
Answer: yes it is possible... |
python pandas groupby and subtract columns from different groups
Question: I have a dataframe df1
pid stat h1 h2 h3 h4 h5 h6 ... h20
1 a 3.2 3.5 6.2 7.1 1.2 2.3 ... 3.2
1 b 3.3 1.... |
plotting arrays in python upto a particular element
Question: I have a data file like this:
0.001 5.515e-01 1.056e+00 1.384e-01 1.273e+01 -1.808e-01 1.255e+01
0.002 2.335e-02 -1.100e-03 -8.850e-03 1.273e+01 -3.176e-01 1.241e+01
0.003 2.335e-02 -1.100e-03 -8.850e-03 1.273e+01 -3.1... |
CMake Error "NumPy import failure" when compiling Boost.Numpy
Question: Here is what I installed as described [here](https://github.com/mitmul/ssai-
cnn):
1. Python 3.5 (Anaconda3 2.4.3)
Chainer 1.5.0.2
Cython 0.23.4
NumPy 1.10.1
tqdm
2. OpenCV 3.0.0
3. lmdb 0.87
... |
How do I get variables from my main module in Python?
Question: I am a Structural Engineer by trade and I am trying to automate the creation
of 3D models using scripts.
So far I have created three modules; the GUI module using PyQt4, a main module
that controls the signals from the GUI, and an export module which "sho... |
Clear output and rewrite it in python
Question: Hi I'm trying to make a tic tac toe game in python and I've run into a
problem. 
As you can see on the picture it rewrites the playing board after your input,
what I want it to do is to clear the output a... |
List of lists (not just list) in Python
Question: I want to make a list of lists in python.
My code is below.
import csv
f = open('agGDPpct.csv','r')
inputfile = csv.DictReader(f)
list = []
next(f) ##Skip first line (column headers)
for line in f:
array = line.... |
How do I remove transparency from a histogram created using Seaborn in python?
Question: I'm creating histograms using seaborn in python and want to customize the
colors. The default settings create transparent histograms, and I would like
mine to be solid. How do I remove the transparency?
I've tried creating a color... |
First python app on C9 with error
Question: after doing the courses of python and reading some books i decided to do an
app. Since that seemed overwhelming I researched and found this
<http://sebsauvage.net/python/gui/> which im replicating on Cloud9.io, and got
here:
import Tkinter
class simpleapp_t... |
Get all td content inside tbody of tr in python using lxml
Question: I am getting values of header of html table below using lxml but when I am
trying to parse the contents of the td's inside tr which is in tbody using
xpath its giving me empty value because the data is generated dynamically.
Below is my python code wi... |
Having trouble with scipy.optimize.leastsq
Question: I am new to optimization and having trouble using the least squares
minimization. Here is the code I have tried so far:
def func(tpl, x): return 1./exp(x/360. * tpl)
def errfunc(tpl, x, y): func(tpl,x) - y
//x-axis
xdata = np.array([181,274])
//minimize sum(y - ... |
Cannot find “Grammar.txt” in lib2to3
Question: I am trying to get NetworkX running under IronPython on my machine. From other
sources I think other people have made this work.
(<https://networkx.github.io/documentation/networkx-1.10/reference/news.html>)
I am running IronPython 2.7 2.7.5.0 on .NET 4.0.30319.42000 in V... |
How can I import PCL into Python, on Ubuntu?
Question: So my situation is as follows: I am on an Ubuntu 14.04, and I am very simply,
trying to use PCL (point cloud library) in Python 2.7x.
I followed the instructions
here,(<http://pointclouds.org/downloads/linux.html>), however in Python if I
now do
> import pcl
I s... |
How can I get histogram number with pairs by using python code?
Question: I want to take hist no with pairs by using python code like when i put input
11 2 34 21 the output should be like that 11(1) 2(1) 34(1) 21(1)
Answer: First, let's create a list of numbers (I have added some repeats to make it
more interesting):... |
How to pack python flask_socketio app with pyinstaller
Question: I tried official demo code:
#test.py
from flask import Flask, render_template
from flask_socketio import SocketIO
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)
if __nam... |
Loop doesn't work, 3-lines python code
Question: _this question is about blender, python scripting_
I'm completely new in this, so please excuse me for any stupid/newbie
question/comment.
I made it simple (3 lines code) to make it easy addressing the problem.
what I need is a code that adds a new uv map for each obj... |
Access a hidden library function in Python?
Question: So when I was doing coding I came across this:
from hidden_lib import train_classifier
Out of curiosity, is there a way to access the function using the terminal and
see what's inside there?
Answer: You can use "inspect" library to do that, bu... |
Put python long integers into memory without any space between them
Question: I want to put many large long integers into memory without any space between
them. How to do that with python 2.7 code in linux?
The large long integers all use the same number of bits. There is totally
about 4 gb of data. Leaving spaces of ... |
Python How to supress showing Error in user created function before the function is called
Question: I have imported a user created file into my main code but an error in imported
file is being displayed before. How can I suppress that error and display it
only when the function is called
Importing file and its functi... |
A single string in single quotes with PyYAML
Question: When I edit a YAML file in Python with PyYAML, all of my string values are
saved back to the original file without quotes.
one: valueOne
two: valueTwo
three: valueThree
I wanted one of those strings to be surrounded with single quotes:
... |
Wand Rounded Edges on Images
Question: I've been scratching my head for a few days on how to complete the task of
making the edges rounded on an image taken from picamera using python-wand. I
have it setup now to where it grabs the image and composites it over the
banner/background image with the following:
... |
How to use python to convert a float number to fixed point with predefined number of bits
Question: I have float 32 numbers (let's say positive numbers) in numpy format. I want
to convert them to fixed point numbers with predefined number of bits to
reduce precision.
For example, number 3.1415926 becomes 3.25 in matla... |
how to update contents of file in python
Question:
def update():
global mylist
i = j = 0
mylist[:]= []
key = input("enter student's tp")
myf = open("data.txt","r+")
ml = myf.readlines()
#print(ml[1])
for line in ml:
words = line.split()
... |
has_permission() missing 1 required positional argument: 'view'
Question: i am working on a project for learning purpose with following config: Python
3.4.4 django==1.9.1 djangorestframework==3.3.3 OS (Windows 8.1)`
In project i having a model Post for that i have created permissions.py
from rest_framew... |
Adding frame over lable on python
Question: I want to create frame over the label and been trying lots of code but it is
not working out. Also trying to make checkbutton to left side of the screen
with no frame. Can anyone help me? Thank you
I got far as this [](http://i.s... |
Creating a timeout function in Python with multiprocessing
Question: I'm trying to create a timeout function in Python 2.7.11 (on Windows) with the
multiprocessing library.
My basic goal is to return one value if the function times out and the actual
value if it doesn't timeout.
My approach is the following:
... |
Less noisy graph and extra humps in python
Question: Here is the data file:
<https://jsfiddle.net/83ygso6u/>
Sorry for posting it in jsfiddle... didn't know where else to host it.
Anyway the second column should be ignored.
Here is the code and graph:
import pylab as plb
import math
from pyla... |
Extract non- empty values from the regex array output in python
Question: I have a column of type numpy.ndarray which looks like:
col
['','','5','']
['','8']
['6','','']
['7']
[]
['5']
I want the ouput like this :
col
... |
Why is the output of my subprocess not being printed?
Question: Here is my best attempt at asynchronously reading stdin/stdout from a
subprocess and printing it from Python:
import asyncio
import subprocess
from asyncio.subprocess import STDOUT, PIPE, DEVNULL
async def start_st... |
Python Gtk.MessageDialog Hides Parent Window
Question: I am working on a Gtk3 app written in Python. The main window for my app is
set up as follows:
#!/bin/python
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as Gtk
## OTHER IMPORTS
class Mai... |
Python Flask timed queuing script
Question: I just started using Flask, and I'm creating a web application that does two
main things server side: Accessing another online API (which I can only send
so many requests to per second) and sending page requests to a user connecting
to the server.
When a user connects to my ... |
pyinstaller and Tkinter
Question: I've built a Python (2.7) app that uses Tkinter and am trying to build a
Windows7 .exe using Pyinstaller (3.2). The app works find in windows is I run
it as `python myapp.py`, but once compiled into a pyinstaller distributable, I
get this error message:
ImportError: No m... |
How do I determine the window with the active keyboard focus using ScriptingBridge (or AppleScript)?
Question: From all the API documentation I can find, it seems that the right thing to do
is to check the "frontmost" window as returned by System Events or the
accessibility API, like so (example in Python here, but thi... |
py2neo - Unable to fetch Data from a remote server
Question: I am using Py2neo package to query my database which is located in a server
machine.
**My code snippet:**
from py2neo import Graph,authenticate
import time
from py2neo.packages.httpstream import http
http.socket_timeout = 9999
... |
How to manually populate Many-To-Many fields through JSON fixture in Django
Question: I have a JSON fixture and I want to populate a many-to-many field from my JSON
fixture but it seems Django only wants just one pk but I need to pass in a lot
of integers representing pks for the other related fields.
IS there anyway ... |
Should I use Pickle or cPickle?
Question: Python has both the `pickle` and `cPickle` modules for serialization.
`cPickle` has an obvious advantage over `pickle`: speed. Does `pickle` have
any advantages? If not, should I simply use `cPickle` always?
Answer: The **pickle** module implements an algorithm for turning a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.