text stringlengths 226 34.5k |
|---|
Keyboard event handling in Python?
Question: So I am not very good with keyboard event handling in Python. I have read the
[Python Curses](https://docs.python.org/2/library/curses.html) tutorial on
their official website and looked for answers on SO but it still does not make
sense to me. So for starters I want to make... |
Qprogressbar with two values
Question: I have some unusual question : For visualization of packing progress i think
about qprogressbar with two values in one bar - one showing bytes read, and
another showing write-out bytes, which gives also imagine about compress
ratio.
It is possible with QT4 ?
Also, I have very li... |
wxPython on Python 3 Miniconda environment
Question: Trying out wxPython Phoenix for Python 3.3 on OS X. (I'm not sure which
version of Python 3 Phoenix supports, I force-install it.
>>> import wx
>>> wx.App()
This program needs access to the screen. Please run with a
Framework build of pytho... |
Drawing rectangle using mouse events in Tkinter
Question: This is with respect to [Draw rectangle on mouse click
[Python]](http://stackoverflow.com/questions/12837575/draw-rectangle-on-mouse-
click-python). I tried out the first solution and it works perfectly. Can
someone please tell me, what to do if I want to see th... |
Python: Surpass SSL verification with urllib3
Question: Connectiing to SSL server is throwing an error:
> error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
> failed
I'm using this urllib3 python library for connecting to server, using this
method:
urllib3.connectionpool.connect... |
threading.Condition.wait(timeout) ignores threading.Condition.notify()
Question: I have an application that uses 2 threads. I want to be able to shut down both
threads by waiting for a condition variable `exitCondition`. I am using python
3.3 which unlike python 2.7 makes `threading.Condition.wait()` return `True`
when... |
Py-StackExchange raise a valueError
Question: I try to use the StackExchange API and I found the Py-StackExchange library
for Python. I installed it through easy_install in Windows.
Here is the code:
from stackexchange import Site, StackOverflow
so = Site(StackOverflow)
my_favourite_guy = s... |
Python: "@" followed by a function -> What does it stand for?
Question: I'm currently learning Python and I came across a notation I was wondering
about:
import taskmanager as tm
#........
@tm.task(str)
def feat(folder):
BLA BLA BLA ...
the code is a small excerpt from... |
Scrapy installation fails
Question: Below is the end of the log file with the error I receive when I try to
install Scrapy. I am rather inexperienced so it may be obvious to one of you.
My computer is windows 8.1 64-bit. I have looked at the msvccompliler.px and
there is no apparent indent error at the given line.I am ... |
Using Python 2.7 modules in Ubuntu 12.04
Question: I have implemented a Stack.py module that I would like to be able to import,
but when I tried to save it to usr/lib/python2.7 Ubuntu didn't allow it. Now,
I go to usr/lib and python2.7 folder doesn't even show up anymore in the
graphic interface, although I am able to ... |
Python pandas dataframe read from_records, "AssertionError: 1 columns passed, passed data had 22 columns"
Question: I have a list where `a` is `806` in length. I want to import to a dataframe
where the first item in the list is the column name. My code is:
import pandas as pd
b = pd.DataFrame.from_re... |
How to Select Items in Dropdown in Selenium
Question: Firstly, I have been trying to get the dropdown from this web page:
<http://solutions.3m.com/wps/portal/3M/en_US/Interconnect/Home/Products/ProductCatalog/Catalog/?PC_Z7_RJH9U5230O73D0ISNF9B3C3SI1000000_nid=RFCNF5FK7WitWK7G49LP38glNZJXPCDXLDbl>
This is the code I h... |
Matplotlib figure not responding when used with multiprocessing
Question: I'm trying to create a very basic app that will update charts in matplotlib
from a streaming data source. Data is received in a separate process. But my
matplotlib figure keeps dying on me even for the most basic display. The
matplotlib window lo... |
Python 2.7, Ubuntu 14.04: directory to load data from on sys.path, but file still not found
Question: Ok, this is a little bit of a strange one. I had some Python code that needed
to load data from another folder using scipy's loadmat (this bit is not really
relevant, but explains the remainder of the code). Before, I ... |
Converting an RPy2 ListVector to a Python dictionary
Question: The natural Python equivalent to a named list in R is a dict, but
[RPy2](http://rpy.sourceforge.net/) gives you a
[ListVector](http://rpy.sourceforge.net/rpy2/doc-2.3/html/vector.html?highlight=listvector#rpy2.robjects.vectors.ListVector)
object.
... |
Internal Server Error with Django and uWSGI 2 Emperor mode
Question: I have been trying to read everything I can find concerning this issue (and
have learned much while doing so). The closest link I could find is
[here](http://stackoverflow.com/questions/17555699/internal-server-error-with-
django-and-uwsgi) and [ here... |
Why does python parse dates differently on Ubuntu and MacOS?
Question: I've got some code that inexplicably works differently on Ubuntu and MacOS
compiles of the same python version. Any explanation or workaround would be
welcome.
First, the setup on Ubuntu Python. The machine is running in UTC. Using PST in
the time ... |
Cannot compile simple PyCuda OSX application
Question: I've followed the PyCuda instructions here:
<http://wiki.tiker.net/PyCuda/Installation/Mac>
I'm trying to compile the following code:
import pycuda.autoinit
import pycuda.driver as drv
import numpy
from pycuda.compiler import Source... |
Python parse large db over 4gb
Question: I'm trying to parse a `db` file with python that is over 4 gb.
Example from the db file:
% Tags relating to '217.89.104.48 - 217.89.104.63'
% RIPE-USER-RESOURCE
inetnum: 194.243.227.240 - 194.243.227.255
netname: PRINCESINDUSTRIEALI... |
Moving a Java Swing Graphic
Question: I want to recreate a game I made in Python and after learning the basics of
Swing, I moved on to drawing Graphics. Now I'm stuck. I created a black square
and would like to move its coordinates by 10 to the right. What I want is to
be able to make an animation by moving the square ... |
Add page number to a Word document using Python
Question: Is there a way to add page numbers to the lower right corner of a Word
document using Python win32com? I am able to add headers and footers, but I
can't find a way to add page numbers in the format PageNumber of TotalPages
(for example: 1 of 5)
Below is the cod... |
WSGI - Why does it cache the output for : os.popen("date").read() in multi threads and picks one randomly?
Question: I woke up and refreshed my wsgi script via web.
within this wsgi script there is this python code.
import os
ooo = os.popen("date").read()
the system date was incorrect. so i r... |
Scraping data from multiple URL
Question: I wish to scrape data from [a
link][http://cbfcindia.gov.in/html/SearchDetails.aspx?mid=1&Loc=Backlog](http://cbfcindia.gov.in/html/SearchDetails.aspx?mid=1&Loc=Backlog)!
, However the MID parameter is incremental in URL to give 2nd, 3rd URL .....
till 1000 URLs, so how shall I... |
How/where to specify Open SQL in PyRFC call to SAP RFC_READ_TABLE
Question: How do I specify the Open SQL WHERE clause in an RFC_READ_TABLE query using
PyRFC?
I'm trying to get started with PyRFC to have python do table extractions from
SAP (in the absence of a supportive/cooperative basis team). In this example
from ... |
In Python, is it possible to overload Numpy's memmap to delete itself when the memmap object is no longer referenced?
Question: I am trying to use memmap when certain data doesn't fit in memory and employ
memmap's ability to trick code into thinking it's just an ndarray. To further
expand on this way of using memmap I ... |
How to monitor VLC media player on Windows 7 using Python?
Question: I want to know what's currently playing on [VLC media
player](http://en.wikipedia.org/wiki/VLC_media_player) (Windows 7) using
Python 2.7. Just knowing the details of the track/video is sufficient.
**Research:** I came to know that VLC media player h... |
Post Request to web server with Flask
Question: When you run this python script, you will see a feature of network connection
with flask on 127.0.0.1:5000/
But, I could not figure out to print all of features of network from starting
to run script. I mean I'm losing the previous data, so I could print any one
feature ... |
Django project wont run on ubuntu with aditional installed apps
Question: My setup
* Local machine 10.9.3
* Django 1.6.2 - local machine
* Server Ubuntu 12.04
* Django 1.6 - ubuntu server
When deploying a django project to a server running Ubunto 12.04 I found that
having an additional, but non existent appl... |
Calling celery task hangs for delay and apply_async
Question: I have created a celery app with following directory structure (as given in
celery site):
proj
|-- celery.py
|-- celery.pyc
|-- __init__.py
|-- __init__.pyc
|-- tasks.py
`-- tasks.pyc
Following are contents of cel... |
no json module when running python script in docker container
Question: I'm trying to run a simple python script that takes a json string as an
argument in a docker container. However I get the following error:
Traceback (most recent call last):
File "/root/simple.py", line 2, in <module>
i... |
How to get all values from Python tuple keys from dictionaries into one list?
Question: My question may be a bit weird, but I don't know how else to put it. The
situation is that I've got a dict with tuples as keys:
{(1, 2): 'a', (3, 4): 'b', (5, 6): 'c'}
I now want to get a list (or tuple) of all ... |
How to add form-data variables to a post request using python requests module?
Question: I am trying to create a command line utility to upload files to tempsend.com
using Python's `requests` module.
I have read the docs and it seems like what I am trying to accomplish should
be quite easy, but I can't get it to succe... |
Writing multiple dictionaries to CSV with one header with Python
Question: I am trying to write multiple dictionaries to a csv file, where header (key)
gets written only once and rows (values) are written based on the key. I was
able to figure this out for two dictionaries, but what if I am getting
multiple dictionarie... |
PyCharm import external library
Question: I am using PyCharm as an editor for python code in Houdini. Whenever I try to
import the main Houdini library (hou) I get an error flagged in PyCharm. If I
include the code snippet:-
try:
import hou
except ImportError:
# Add $HFS/houdini/... |
Create a custom widget with PyGObject
Question: I am trying to create a custom widget with **PyGObject**. For example I want
to create this `CustomButton` widget which adds an image and a label in a
button (it's just for the example) :
#!/usr/bin/python
#-*- coding: utf-8 -*
from gi.reposito... |
AttributeError: 'NoneType' object has no attribute 'replace'
Question: right sorry that I'm not all good at python but my problem is that i need to
replace a character
here is the thing i am trying to change all i need to change is # to an A for
all of the lines
def puzzle():
print ("#+/084&;")
... |
Scala: Help me understand comprehensions and case classes in this code
Question: I am trying to wrap my head around Scala, and I am finding it quite
challenging so far. I found this library (<https://github.com/snowplow/scala-
maxmind-geoip>) I used in the past with Python for finding out stuff like the
country base on... |
Python 2.x optionnal subparsers - Error too few arguments
Question: I have been trying to set up a main parser with two subs parser so that when
called alone, the main parser would display a help message.
def help_message():
print "help message"
import argparse
parser = argparse.Argu... |
Can't reenable menus in Python tkinter on Mac
Question: I have a GUI that I created in Tkinter which has a menu. I want a button that
when clicked toggles the menu being enabled / disabled.
So I wrote the following minimal example (based off of
<https://mail.python.org/pipermail/tkinter-
discuss/2004-September/000204.... |
Finding common elements between a list and a dictionary in python
Question: I have two files like this, A list of proteins -
TRIUR3_05947-P1
TRIUR3_06394-P1
Traes_1BL_EB95F4919.2
And a dictionary of tab-delimited contigs and proteins -
contig22 TRIUR3_05947-P1
contig15 TR... |
Why is 'Unexpected indent' occuring in this Python code?
Question: The following is Python code that I typed:
import builtins
try:
a = input("Enter name :- ")
if (a=='Joey'):
print("Yeah right ?!?")
print("How come")
else:
print("No Proble... |
Initializing multiple python dictionaries to the same keynames and values
Question: I want to be able to loop through my main function and _bin_ values to certain
keys in these dictionaries. All six dictionaries have the same keynames but
the dictionaries are unique. Is there a better way to 1. initialize all the
dicti... |
What is wrong with this Python Multiprocessing Code?
Question: I am trying to create some multiprocessing code for my project. I have created
a snippet of the things that I want to do. However its not working as per my
expectations. Can you please let me know what is wrong with this.
from multiprocessing... |
NameError: name Timer is not defined
Question: I have a small python program written for python 2.7.3:
import time
def fun():
print('Hi')
for i in range(3):
Timer(i, fun).start()
When I run it, I get the error:
`NameError: name 'Timer' is not defined`
How can I find out wh... |
Python numpy index
Question: i have a numpy array p like this:
array([[ 0.92691702, 0.07308298],
[ 0.65515095, 0.34484905],
[ 0.32526151, 0.67473849],
...,
[ 0.34171992, 0.65828008],
[ 0.77521514, 0.22478486],
[ 0.96430103, 0.03569897]])
If i do x=p[... |
Problems overriding _iterencode method on JSONEncoder that employs a generator
Question: I am trying to create my own custom encoder that mostly reuses the JSONEncoder
behaviour:
BinaryJSONEncoder(JSONEncoder):
def _iterencode(self, o, markers):
sys.stderr.write("Calling custom _itere... |
Newb to Writing Integration Tests
Question: Here is my test file:
from flask import Flask
from flask.ext.testing import TestCase
class TestInitViews(TestCase):
render_templates = False
def create_app(self):
app = Flask(__name__)
app.conf... |
multithreaded file download in python and updating in shell with download progress
Question: in an attempt to learn multithreaded file download I wrote this piece of cake:
import urllib2
import os
import sys
import time
import threading
urls = ["http://broadcast.lds.org/churchmus... |
How to add a custom array to a polydata in paraview?
Question: I know that I can use the Calculator filter for operations on arrays, but I
want to perform some more complicated computations. I managed to do it in
Paraview python shell, but the missing step now is to go back to the viewer
again (or save the new polydata... |
pandas.rpy.common.load_data() usage/documentation?
Question: I am trying to convert some `<class 'rpy2.robjects.vectors.Matrix'>` variables
into Pandas dataframes.
There is a lot of copy-paste instructions of how to do so on the internet, all
giving the brief example:
pandas.rpy.common.load_data("infert... |
Python, trying to parse html to attain email address
Question: I am using beautifulsoup to attain an email address, however I am having
problems. I do not know where to start to parse through this, to attain the
email address.
> #input: url
> #output: address
>
> def urlSC(url):
>... |
Python regex not matching images on website (it matches in regex helper)
Question: I do not understand what is wrong with my script below.
It is supposed to parse out images using regex. I've verified that my regex is
correct by using <http://regex101.com/>.
The problem is it doesn't even grab the first image on the ... |
Recommended tools for benchmarking Ruby and Perl
Question: I want to compare the execution time for mathematical equations for different
dynamic, interpreted programming languages like Ruby, Perl, and Python.
In Python, there is the convenient `timeit` module, which allows me to time,
where I can simply time for, e.g.... |
ValueError: The channel sent is invalid on a Raspberry Pi - Controlling GPIO Pin 2 (BOARD) using Python causes Error
Question: So I have a tiny little fan connected to pin 6(Ground) and pin 2. I am trying
to manually start and stop the fan when needed but I am getting this error
when trying:
ValueError: The channel se... |
How to use docker-py (official docker client) to start a bash shell?
Question: I'm trying to use docker-py to run a docker container and drop me into a bash
shell in that container. I get as far as running the container (I can see it
with `docker ps`, and I can attach to it just fine with the native docker
client), but... |
"Can't extract file(s) to egg cache" error in GAE
Question: I have Windows 7 and Python 2.7 with setuptools installed.
After i download pitz module (easy_install pitz), Google App Engine stop
working:
bad runtime process port ['']
Traceback (most recent call last):
File "G:\Program Files ... |
How to use custom typeface for vertex labels in python igraph?
Question: In R igraph, there is an easy way to set a custom typeface for vertex labels
and other texts on graph plots:
plot(G,vertex.label.family="DINPro")
However as I see, `vertex_label_family` parameter is not available in python
igr... |
How to programmatically access a Python package's dependencies?
Question: I am trying to access a PyPI package's dependencies (i.e. its install_requires
metadata). This information does not seem to be available from either the JSON
or XMLRPC APIs. The [documentation](https://wiki.python.org/moin/PyPIXmlRpc)
for the XML... |
Bulbs : Creating "in" and "out" edges between two vertices in TitanDB
Question: I am using TitanGraphDB + Cassandra.I am starting Titan as follows
cd titan-cassandra-0.3.1
bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties
I have a Rexster shell that I can use... |
Calling the sendLine() method after the connectTCP method has been called on twisted
Question: I made a simple server that uses the LineReceiver. I can manage to send and
receive messages when I test with Telnet.
I want to take things a little bit further and use a small GUI to send and
receive the messages.
The way ... |
wxPython/ReportLab: How to create and open a .pdf file on button clicked
Question: Good day all, For about 3days I have been trying hardest to get my way around
this! I have a perfectly working wxFrame as well as a perfectly working
ReportLab pdf script. See the code files below respectively (Note: data1.py is
the GUI ... |
Execute command on linux terminal using subprocess in python
Question: I want to execute following command on linux terminal using python script
hg log -r "((last(tag())):(first(last(tag(),2))))" work
This command give changesets between last two tags who have affected files in
"work" directory
I ... |
pip error code 1 when installing pyopenssl
Question: Hi I am trying to install pyopenssl so i can use scrapy. When i run the
installation i get this error with pip. I also get the same error when trying
to install scrapy...
Command python setup.py egg_info failed with error code 1 in /private/var/folders... |
python 3.4: random.choice on Enum
Question: I would like to use random.choice on an Enum.
I tried :
class Foo(Enum):
a = 0
b = 1
c = 2
bar = random.choice(Foo)
But this code is not working, how can I do that ?
Answer: An `Enum` is not a _sequence_ , so you cannot pass... |
WSGI (python) how to get POST data from an HTML form?
Question: This is the HTML form that "gets" /1.wsgi
<form action="/1.wsgi" method="get">
<input type="text" name="one">
<input type="submit" value="Send">
</form>
this is my 1.wsgi script:
from cgi import parse_qs
... |
Read in binary mode interpreting newline character
Question: I have a binary file that I am trying to parse based on a protocol. In the
binary data there is this value `'\nW\xe1A'` which was generated by the C
struct like so:
struct. pack( '< f',28.1675).
When I try to open the file with `'rb'` and... |
error: no such table UNABLE TO CREATE DB
Question: i am trying to run a database and make entries into it using the following
code to run the database. even though i make proper entries, i still get an
error "no such table: user"
from flask import Flask, request, flash, url_for, redirect
from flask.e... |
python: pickle misbehaving in django shell as opposed to python shell?
Question: As an additional question stemming from [my previous
question](http://stackoverflow.com/questions/24240001/pickle-cant-store-an-
object-in-django-locmem-cache-during-tests/24241848#24241848) it turns out
that pickle behaves differently in ... |
Looking through a list for a certain or relatively close value
Question: I have a csv file that looks like this:
Type Mag ra dec
3 24.6 223.2 50.833
6 24.5 223.19 50.834
With more than 500 values per column. I want to look for a certain value and
anything cl... |
Import Numerous Modules
Question: I'm working on my making a simple tester for my project, my project is a group
of many self contained python files (e.g. solution1.py, solution2.py, etc.).
My tester works, but it requires me to do `import solution1, solution2, ...`,
how can I just import everything that matches a patt... |
Sending email without keyfile (only certfile) using Python smtplib
Question: Trying to send email with a certificate file using the following script:
import smtplib
client = smtplib.SMTP(myhost, myport)
client.ehlo()
client.starttls(certfile=mycertfile)
client.ehlo()
client.... |
Python3 Convert list of HEX values to Bytes
Question: I have a list of bytes that are represented in string format, for example,
when I print the list in Python3.3 I get the following output:
DATA = ['FF', 'FF', 'FF', 'FF']
I would like to convert these into bytes, for example 0xFF,0xFF,0xFF,0xFF.... |
searching google images from python
Question:
#!/usr/bin/env python
import urllib
import mechanize
from bs4 import BeautifulSoup
from urlparse import urlparse
def getPic(search):
search = search.replace(" ","%20")
try:
browser = mechanize.Browser()... |
Idiomatic Clojure implementation of maze generation algorithm
Question: I am implementing algorithms to create and solve mazes in both Python and
Clojure. I have experience with Python and am working to learn Clojure. I am
likely doing too literal of a conversion from Python to Clojure and I am
looking for input on a m... |
Qmark in pymysql query
Question: I'm new to python, just moving from php5. I read about the qmark param
notation to prepare a query but I get the following:
Traceback (most recent call last):
File "t.py", line 10, in <module>
cursor.execute("SELECT * FROM object WHERE otype = ?", ["user"])
... |
Using python to save a JPG image that was edited in the script
Question: Referring to the answer to [this
question](http://stackoverflow.com/questions/14452824/saving-image-in-python-
pil), I tried to save my own JPG image files, after some basic image
processing. I've only applied a rotation and a shear. This is my co... |
Python barcode scanner buffer is not clearing
Question: OS is Windows 7 x64 (running Python x86) but code needs to be exportable to
Windows XP and Ubuntu Linux.
This part of the problem is Windows 7 x64 specific, possibly.
I am using a USB barcode scanner that is HID Keyboard compatible.
I open a command prompt in t... |
Deploying Project in PythonAnywhere. Settings Module Import Errror
Question: I´m trying to deploy my django 1.6.4 project on pythonAnywhere using python
2.7
I already configured a virtual enviroment and the wsgi file according to the
guidelines on the website. But I´m getting a 404 when I check the site. The
error lol... |
Creating Rules for Word Permutations Based on a word's POS Tag
Question: I have another question and since this community has been so great helping me
along I thought I would give it another shot.
Right now I have Python 3 code that imports a CSV file where the first column
is full of words in the following format:
... |
Raspberry Pi connection with Arduino over XRF continuous sensor monitoring
Question: I'm trying to make a system for monitoring sensor continuously including
registering the time when the sensors are offline (not reachable by the
server).
The system is based on Raspberry Pi as server and Arduino Leonardo as node
with ... |
Python: How can I plot a generic 3D object if I have x, y and z as functions of some parameters?
Question: For instance, for the unit sphere, one has
x = cos(phi)sin(theta)
y = sin(phi)sin(theta)
z = cos(theta)
I would like to simply plot the set of points where phi and theta are in the
int... |
Python Data Insert From Beautiful Soup Table to MYSQL
Question: I am trying to insert data into a MYSQL table from a html table using
beautiful soup written in python. Currently I was able to do this by creating
an interim csv file but it does not seems to work in Linux and seems
inefficient. Below is my code that work... |
Flask flash and url_for with AJAX
Question: _I am currently stuck on a rather "big" problem, and I will try to be as clear
and concise as I can about it. I am developing a tool in Python, using Flask.
It's meant to be an intranet. The idea is that I have a client page. There's
its name, numerous other infos, and a mass... |
How to convert a hex-string into an unpacked IEEE 754 format number:-
Question: using Python 2.7.3: How to convert a hex-string into an unpacked IEEE 754
format number:-
I have a string of hex data in this form:
data = '38 1A A3 44'
I would like to convert this to a floating point number by using
... |
Most efficient way to look for the last digit of a number?
Question: I recently had a question in a Python exam where we were asked to check for
numbers to be ending in 8 and I came across two ways and I was wondering which
one was the most efficient or if there was an even better way to do so.
(If n is the desired nu... |
Determining if string B could be the result of a deletion/addition to string A
Question: Assume I have a base string of length 29, and a list of arbitrary strings of
lengths 28 and 30. How would I determine the number of these strings which
could be the result of a deletion/addition of one character performed on the
ba... |
bs4: "soup.title.string" doesn't work on IDLE but Terminal
Question: Mac OS X 10.9 Python 2.7 IDLE BeautifulSoup 4 installed (successfully)
I followed [BS4
documentation](http://www.crummy.com/software/BeautifulSoup/bs4/doc/) and was
practicing some of the functions **on IDLE**. The following code works and was
able t... |
Django/python and isues with xlwt locale formatting
Question: I am using django-excel-view which uses django-excel-response which in turn
uses xlwt. I have a scenario where users can switch locale which lets them
view floats with a standard decimal point or in some languages a comma decimal
point.
When exporting the v... |
Forcing an existing module to be installed in a specific path
Question: I have a module already installed in `/usr/lib64/...` by administrator
Python 2.7.6 (default, Nov 11 2013, 13:13:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more ... |
web scraping - how to download image into a folder python
Question: I have this code where i would like to download the image and save it into a
folder but i am getting the src of the image.I have gone through stack
overflow where i found this [Batch downloading text and images from URL with
Python / urllib /
beautiful... |
Kivy Label.text Property doesn't update on the UI
Question: I have an issue with the updated text property of a label not displaying
correctly on my UI. I check the text property and can verify that it is being
set to the new value but that value isn't being shown when the label is
rendered.
The Label is on a differen... |
Return array, ctypes
Question: I am a really newbie using ctypes. I am loading a windows dll file, and trying
to read the array `GetDfuFileInfo` returns. I actually ended up on loading the
file in ctypes because I dont know how to pass a `dfu_file*` pointer to the
`GetDfuFileInfo` function. Is this even possible?
C++ ... |
read numbers from a file specified on the command line and print the sum of the numbers
Question: Write a program that inputs a list of numbers from a file and prints their
sum. The file name comes in as a command-line argument. Assuming the file
"orange" contains the numbers:
6 26 10 8
Your progr... |
sqlalchemy BC dates with postgresql
Question: I am working on postgresql database through sqlalchemy. I need to work with BC
dates with postgresql "date" column type (it supports BC dates
<http://www.postgresql.org/docs/9.2/static/datatype-datetime.html>). But while
I can insert BC dates in form of string (for example ... |
Python, paramiko, invoke_shell and ugly characters
Question: When I run the Python code below:
import workflow
import console
import paramiko
import time
strComputer = 'server.com'
strUser = 'user'
strPwd = 'passwd'
client = paramiko.SSHClient()
client.set_missin... |
Counting like elements in a list and appending list
Question: I am trying to create a `list` in `Python` with values pulled from an active
`excel` sheet. I want it to pull the step # value from the excel file and
append it to the list while also including which number of that element it is.
For example, `1_1` the first... |
Django 1.6 : MySQL ERROR 1049 (42000): Unknown database
Question: According to the django tutorial on its official website, django creates
database schema according to the model defined in the `models.py`. But the
default engine for database is `sqlite3`. And it is working.
now when I installed the `mysql` and `Mysql ... |
Reading csv file to python ValueError: could not convert string to float
Question: Any help with this would be appreciated. Please keep in mind that I am a
beginner in Python. This is the portion of the code that I am having trouble
with:
__author__ = 'peter'
from datetime import datet... |
Python 3D array. Calculate R squared
Question: I have 2 ndarrays with 3 dimensions. I need to calculate the Rsquared over
these ndarrays. To clarify.
Array1.shape = Array2.shape = (100, 100, 10)
So...
resultArray = np.ones(100*100).reshape(100,100)
for i in range(Array1.sha... |
Scrapy first tutorial dmoz returning en error "TypeError: Can't use implementer with classes. Use one of the class-declaration functions instead."
Question: Getting an error when running the first tutorial for scrapy.
Scrapy : 0.22.2
lxml : 3.3.5.0
libxml2 : 2.7.8
Twisted : 12.0.0
Python : 2.7.2 (default, Oct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.