text stringlengths 226 34.5k |
|---|
Check Contents of Python Package without Running it?
Question: I would like a function that, given a `name` which caused a `NameError`, can
identify Python packages which could be `import`ed to resolve it.
That part is fairly easy, and I've done it, but now I have an additional
problem: I'd like to do it without causi... |
Button binding in Kivy Python
Question: I am wondering how to get my code to work. I have a class wich creates a popup
window with buttons. Each button should be bound to subclass. But it doesnt
work. What´s wrong with my code?
class chooser:
def __init__(self):
None
def show(self,title,o... |
Open and read certain files in a directory; write all text in those files to cells in a .csv
Question: I've read a number of posts that get close to my problem, but I still haven't
been able to figure it out so hopefully you all can help me get there!
I have a directory with thousands of subfolders, each with 1-4 file... |
Equivalent of gmtime in Julia?
Question: Julia has `strftime` as a built-in but not `gmtime`.
julia> strftime
strftime (generic function with 3 methods)
julia> gmtime
ERROR: gmtime not defined
What is the preferred Julia way to do the equivalent of `gmtime`? The idea is
to turn sec... |
Python initialise Struct
Question: I have a block of memory with binary data. The block was created with
`ctypes.create_string_buffer`, so the data is mutable, and accessible as an
array.
Each 32 bits are made up of a pair, a 20 bit unsigned integer, and a 12 bit
unsigned integer.
I want to access the nth element pai... |
json_decode produces a string
Question: I have a small php code bellow that tries to read a .json file, extract the
content and then convert it to an array.
Instead I get a string.
The json.file is created in a python code that is also bellow.
**python script**
dict_test= {'Subcellular': ['Ribosome', ... |
Funcparserlib.lexer.Spec ImportError: cannot import name 'Spec'
Question: For learning purposes, I'm trying to convert a Chef interpreter project to
python 3.4 and trying to wrangle the libraries involved into their newest
versions, but when it comes to funcparserlib I'm a little over my head.
Here's the Chef script:
... |
python: find all Latin Squares of a set (or partial square with fewer columns)
Question: EDIT:
Thanks to commenter Douglas Zare, I have renamed the title of this post with
more appropriate terminology for anybody else who may be looking for something
similar. The code from David Eisenstat below was very helpful.
* *... |
Calling an R script with command line arguments from Python rpy2
Question: I want to be able to call R files from python using the rpy2 modules. I would
like to be able to pass arguments to these scripts that can be interpreted by
R's commandArgs function.
So if my R script (`trivial_script.r`) looks like:
... |
How to convert json response into Python list
Question: I get the JSON response by `requests.get`
req = requests.get(SAMPLE_SCHEDULE_API)
and convert it into dictionary
`data = json.loads(req.text)["data"]`
When I tried to convert the string into Python dict,
I got `ValueError: malformed node or... |
Bypass proxy and capture webpage data from server using HTTP GET request using mitmproxy in Python
Question: I need to bypass proxy using mitmproxy and capture web data using GET request.
I am using Windows 7 and python 2.7 and mitmproxy python
I tried the following code :
#!/usr/bin/env python
"""
... |
how to post in facebook using selenium webdriver and python
Question: I writen this code to post in facebook group from desktop program but it
didnnot work. I'm using python and selenium webdriver in this script.
Can someone help me?
from selenium import webdriver
from selenium.webdriver.suppor... |
How do I change the font size of ticks of matplotlib.pyplot.colorbar.ColorbarBase?
Question: I would like to know how to change the font size of ticks of `ColorbarBase` of
`matplotlib`. The following lines are a relevant part in my analysis script,
in which `ColorbarBase` is used.
import matplotlib.pyplo... |
What is my mistake?
Question: This is my rexster.xml file configured as below
<?xml version="1.0" encoding="UTF-8"?>
<rexster>
<http>
<server-port>8182</server-port>
<server-host>0.0.0.0</server-host>
<base-uri>http://localhost</base-uri... |
debugging errors in python multiprocessing
Question: I'm using the `Pool` function of the `multiprocessing` module in order to run
the same code in parallel on different data.
It turns out that on some data my code raises an exception, but the precise
line in which this happens is not given:
Traceback (... |
How to print variable length lists as columns in python?
Question: I need a way to print several lists of varying lengths as columns next to each
other tab delimited and with the empty cells remaining empty or containing
some fill character (e.g "-").
The methods attempted so far have not worked for lists of varying l... |
Scrapy: 'str' object has no attribute 'iter'
Question: I added `restrict_xpaths` rules to my scrapy spider and now it immediately
fails with:
2015-03-16 15:46:53+0000 [tsr] ERROR: Spider error processing <GET http://www.thestudentroom.co.uk/forumdisplay.php?f=143>
Traceback (most recent call last... |
Python Challenge level 17 in Python 3
Question: I recently started playing with [The Python
Challenge](http://www.pythonchallenge.com/). While fairly convoluted, the
required coding isn't very hard, which makes leaning many useful modules quite
interesting.
My question is about level 17. I understand the idea of follo... |
python how to include a file of lists in a script
Question: I have a file that gets generated by :
excerpt:
group0 = ['ParentPom']
group1 = ['Commons','http', 'availability','ingestPom','abcCommons','solrIndex','123Service']
...
group10=['totalCommons','Generator']
How c... |
advanced array of bytes searching
Question: I have a binary file and i have to track a "dynamic array of bytes" in this
file , this array is something like:
d0 30 60 XX 5d 48
Where XX can be any HEX value
I need to find all the occurences of this array in the binary file , i mean
all the array of bytes that starts w... |
Scheduling a Python program to sleep within a given time period
Question:
while True:
now = datetime.datetime.now();
if now.hour >= 22 and now.hour < 3:
print "sleep"
sleep_at = datetime.datetime.combine(datetime.date.today(),datetime.time(3))
sleep_til = ... |
Error when executing TwitterSearch in Python
Question: I am currently attempting to use TwitterSearch
(<https://github.com/ckoepp/TwitterSearch>) to import tweets into a csv for
analysis. However, I am getting the following error message when executing the
python script:
from .TwitterSearchException impo... |
How to parse code after it has been stripped of styles and elements in python
Question: This is a very basic question regarding html parsing:
I am new to python(coding,computer science, etc), teaching myself to parse
html and I have imported both pattern and beautiful soup modules to parse
with. I found this code on t... |
Passing file to function to parse
Question: I have an upload form that takes a file and sends it to a function to parse.
It is a CSV file and im using a DataField type to store it.
views.py
def upload(request):
# Handle file upload
if request.method == 'POST':
form = UploadFo... |
How do I grab all the links within an element in HTML using python?
Question: First, please check the image below so I can better explain my question:

I am trying to take a user input to select one of the links below "Course
Search By Term".... (ie. ... |
how to get data from 'ImmutableMultiDict' in flask
Question: I am learning how to use ajax and Flask ,so what I do is I send a ajax request
and I receive the data as `post` request in my python file
`My html file contains this code`
var data = {"name":"John Doe","age":"21"};
$.ajax({
url:'/pos... |
ImportError: cannot import name 'webdriver'
Question: I am newbie for selenium python. I have installed pyhton, pip etc.. I am
trying to run the below code but it is showing error ImportError: cannot
import name 'webdriver'
from selenium import webdriver
from selenium.webdriver.common.keys import Key... |
Uniformly scaled axes in 3d plot with python matplotlib
Question: I'm plotting a set of 3d coordinates (x,y,z) using Axes3D. My code reads
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x,y,z=data[::1,0],data[::1,1],data[::1,2]
fig=plt.figu... |
ImportError: libexslt.so.0: cannot open shared object file: No such file or directory
Question: I am trying to use python 2.7.8 came with splunk 6 for some XML parsing usign
lxml.
from lxml import etree
I see below error
[root@**** bin]# ./python some.py
Traceback (most recent ca... |
How should I encrypt API tokens in Python?
Question: I've written a basic Python application that uses Twitter's API. I need to be
able to encode my API secret as it should never be human-readable within my
program (Twitter's words). How should I do this in Python? Is it possible?
Answer: Store the API Key in an exte... |
Directly calculating conditional averages in a Python Dictionary
Question: I ‘m guessing there is a better method to go about avergaing a dict in Python,
but I’m unsure how to go about it. At the moment I have a dict of dicts and I
am trying to find a better method of finding say the average age of company
car owners i... |
Getting 'Missing required field: member' when trying to add a member to a google group via API
Question: Trying to use Google admin directory API in order to read members of a google
group (organization) - it works fine. When I try to add a member I get:
{ errors:
[ { domain: 'global',
... |
DJANGO celery task is executed from shell but it's not executed from view
Question: I am trying to create some asynchronous tasks with celery in my django
application
settings.py
BROKER_URL = 'django://localhost:6379/0'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_... |
Generate date ranges broken by month for a given period
Question: I'm struggling with writing a pythonic, clean generator method that, given a
date period, like `['2014-01-15', '2015-02-03]`, will give me this:
['2014-01-15', '2014-01-31']
['2014-02-01', '2014-02-28']
...
['2015-02-01', '2015... |
why simple led python program not working
Question: I am testing my pi for the first time and i cant able to run the first program
to light the led.
below is my code id from raspberry cookbook
import Rpi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCD)
GPIO.setup(18,GPIO.OUT)
while(T... |
imported modules becomes None when replacing current module in sys.modules using a class object
Question: an unpopular but "supported" python hack (see Guido:
<https://mail.python.org/pipermail/python-ideas/2012-May/014969.html>) that
enables `__getattr__` usage on module attributes involves the following:
... |
Sorting data in alphabetic, highest to lowest order using CSV
Question: How to sort data in alphabetic, highest to lowest order in notebook document
created by python, using CSV? I have a maths quiz with saves results in
notebook but it is in random order. How to sort all this data using python?
Answer:
import n... |
Python packaging for hive/hadoop streaming
Question: I have a hive query with custom mapper and reducer written in python. The
mapper and reducer modules depend on some 3rd party modules/packages which are
not installed on my cluster (installing them on the cluster is not an option).
I realized this problem only after ... |
How does pySerial implement the "with" statement without __enter__ and __exit__?
Question: pySerial can be used with Python's `with` statement like this:
with serial.Serial("/dev/ttyS1") as ser:
ser.write("AAAA")
ser.read(8)
I tried to see exactly what it is pySerial does to make th... |
How to download file from local server in Python
Question: Scenario is:
1. Client will Enter a file name e.g **xyz**
2. Server will show all the files that it have in different folders.
Client will select 1 or 2 or 3 (if there). and file will be downloaded.
**I have done searching part. I want help in downloadin... |
Python concordance command in NLTK
Question: I have a question regarding Python concordance command in NLTK. First, I came
through an easy example:
from nltk.book import *
text1.concordance("monstrous")
which worked just fine. Now, I have my own .txt file and I would like to
perform the sa... |
Comparing File Dates in a Directory
Question: I am trying to write a script in Python to upload a series of photos depending
on the dates they were created. I am having an issue of comparing the dates of
each of the files to a date before and after the dates I want so that I can
create an array to loop through for my u... |
How to fix the int error in a matching game using python?
Question: Okay, I've been trying this forever now. Keep getting stuck on a 'int' error.
Description:
A common memory matching game played by young children is to start with a deck
of cards that contains identical pairs. For example, given six cards in the
deck... |
python mailchimp api 2.0 json response error
Question: Hi I'm trying to set up a batch job taking data from the mysql database and
send those users to mailchimp to be used for direct email campaigns. I'm
having an issue with the my code running on python 2.6 Red Hat linux (Red Hat
4.4.7-4) and python 2.7.3 Debian 4.6.3... |
Wrong field type in osgeo.org for ogr.FieldDefn('field', ogr.OFTInteger)
Question: I have a problem with osgeo.org for python using versions
python version 2.7
osgeo.org version 1.3.39
I want to use osgeo to convert `MapInfo File` from MongoDB.
With
from osgeo import ogr, osr,... |
Using python scrapy to extract links from a webpage
Question: I am a beginner with python and using scrapy to extract links from the
following webpage <http://www.basketball-
reference.com/leagues/NBA_2015_games.html>.
The code that I have written is
from scrapy.contrib.spiders import CrawlSpider, Rule
... |
How to calculate inverse using cramer's rule in python?
Question: I'm trying to generate the inverse matrix using numpy package in python.
Unfortunately , I'm not getting the answers I expected.
Original matrix:
`([17 17 5] [21 18 21] [2 2 19])`
Inverting the original matrix by Cramer's rule gives:
`([4 9 15] [15 1... |
How can I filter statistics from facebook ads api using the python sdk?
Question: I would like to filter by data ranges, just to see the performance on a daily
basis, or for the last day, last week, last month...etc.
How can I add a date parameter different from start_date or end_date because?
I guess those parameters... |
Python - Fork Modules
Question: My requirement is to do something like below -
def task_a():
...
...
ret a1
def task_b():
...
...
ret b1
.
.
def task_z():
...
...
ret z1
Now in my main code I want to Execute Tasks a..z in parallel a... |
sorting a list in python
Question: I am trying to sort lists on a list : each list contains `[seq1,seq2,score]` ,
I want to sort the list `L` according to the score of (seq1,seq2) from the max
score to the minimum score, then each list take a rank to each (seq1,seq2)
according to the score
L=[ ['AA', 'CG... |
Prediction in Caffe - Exception: Input blob arguments do not match net inputs
Question: I'm using Caffe for classifying non-image data using a quite simple CNN
structure. I've had no problems training my network on my HDF5-data with
dimensions n x 1 x 156 x 12. However, I'm having difficulties classifying new
data.
Ho... |
Use python to connect to sqlplus in a remote host and execute sql commands
Question: Here is my situation : We have sqlplus set up in a remote machine and I want
to connect to that remote machine and then run sqlplus to execute sql queries.
I am trying to write a python script to do that.
Here is my code:
... |
Combine two large dictionary by key - Fastest approach
Question: I have a two large dictionaries: This is an example to demonstrate but you can
imagine each dictionary having close to 100k records.
d1 = {'0001': [('skiing',0.789),('snow',0.65),('winter',0.56)],'0002': [('drama', 0.89),('comedy', 0.678),(... |
completely connected subgraphs from a larger graph in networkx
Question: I have tried not to repost here, but I think my request is very simple and I
am just inexperienced with network graphs. When using the networkx module in
python, I would like to recover, from a connected graph, the subgraphs where
all nodes are co... |
asigning ids in kivy on the python side
Question: im using kivy. the what im trying to do is have and 'idea',a slider and a
label containing the slider's current value in a row in a grid layout
now getting the layout is fine but getting the label to have a text value the
same as the slider's current value is tricky. I... |
Why does Apache PySpark top() fail when the RDD contains a user defined class?
Question: I'm prototyping some code using Apache Spark's PySpark on my local machine,
via iPython Notebook. I've written some code that seems to work fine, but when
I make a simple change to it, it breaks.
The first code block below works. ... |
Django ReverseSingleRelatedObjectDescriptor.__set__ ValueError
Question: I am creating a custom data migration to automatically create GenericRelation
entries in the database, based on existing entries across two different
models.
**Example models.py:**
...
class Place
content_type = models.F... |
Python Socket Programming - Messages Getting Truncated
Question: I have a GPS modem (Sixnet BT-5800) that attempts to broadcast GPS NMEA
messages over ethernet to my Linux client on a timed interval.
On the client I have a python script running. I was hoping if someone could
identify if I'm doing something wrong here.... |
OpenCV in Python - Manipulating pixels
Question: I am using python 2.7 and OpenCV to set an image to all white pixels, but it
is not working.
Here is my code:
import cv2
import numpy as np
image = cv2.imread("strawberry.jpg") #Load image
imageWidth = image.shape[1] #Get image width... |
Basic python-while loop prints out extra space in random card generator
Question:
#!usr/bin/python
import random
seg1='''_________'''
seg2='''| |'''
seg3a="| Ace |"
seg32="| 2 |"
seg33="| 3 |"
seg34="| 4 |"
seg35="| 5 |"
seg36="| 6 |"
seg37="| 7 ... |
Problems to get element.tagName. Parsing an XML with Python and xml.dom.minidom
Question: I'm parsing an XML with Python (xml.dom.minidom) and I cant get the tagName of
a node.
The interpreter is returning:
AttributeError: Text instance has no attribute 'tagName'
when I try to extract (for exampl... |
Script that converts html tables to CSV (preferably python)
Question: I have a large number of html tables that I'd like to convert into CSV.
Pasting individual tables into excel and saving them as .csv works, as does
pasting the html tables into simple online converters. But I have thousands of
individual tables, so I... |
How to import access table to another access table using Python
Question: Good Morning.
I'm new to Python and I'm doing a internship at the moment. One part of the
script that they want me to make is to import a table from Access database 1
to Access database 2.
I was trying to do something with the 2 following libar... |
Python proxy - Need help to send HTTP header to the browser
Question: I'm making a proxy for my project and I'm trying to send to the browser
(Firefox) an HTTP header to continue the "Conversation" between me(Proxy
server) and the browser. The issue is: when I'm refreshing any page, the page
Keeping loading. I use sock... |
Python script chokes on a downloaded file because of unicode encode error
Question: I run a script 4 times a day that uses the requests module to download a file,
which I then throw into a database. 9 times out of 10, the script works
flawlessly. But the times it does not work is because of a character in the
downloade... |
How to use gst along with pyqt to stream video on pyqt widget
Question: Am using gst along with my pyqt. I want to display the video stream in my
widget. While doing so my application starts streaming the video and then
crashes. What am I doing wrong ?
Camera Code
from PyQt4 import QtCore
impor... |
matplotlib interactive plot with slices of image
Question: How would I make an interactive plot like the one displayed here? I'd like to
show an image with x and y slices of the image taken at a point that can be
adjusted by clicking on the image.
![desired interactive plot where the image can be clicked to adjust the... |
Read multiple csv files and write multiple netCDF files
Question: I have the following Python code works perfectly fine for a single .csv file
to convert for a netCDF file.
But, I have multiple files (365), as, 'TRMM_1998_01_02_newntcl.csv',
'TRMM_1998_01_03_newntcl.csv'....upto 'TRMM_1998_12_31_newntcl.csv'.
Can som... |
Python - taking most frequent element from array/converting numpy array to std array
Question: I'm in the process of implementing a K-nearest neighbour algorithm in Python
(for those of you that don't know about learning, it's an algorithm used to
classify objects based on data that is already classified, using Euclide... |
Tkinter understanding mainloop
Question: Till now, I used to end my Tkiter programs with: `tk.mainloop()`, or nothing
would show up! See example:
from Tkinter import *
import random
import time
tk = Tk()
tk.title = "Game"
tk.resizable(0,0)
tk.wm_attributes("-topmost", 1)
... |
image stack population is slow in numpy
Question: I am reading stack of separate tiff's into single 3D array via numpy/python.
When files are just read and plugged into some variable, speed scales linearly
with number of files, for example, loading 100 files takes 0.2s, loading 1000
files takes 2.46s and so on.
Howeve... |
Why can't I import modules from my PYTHONPATH in Python 3.4?
Question: I have a package installed in `/u/home/j/joelfred/python-dev-modules`. It
looks like:
/a
__init__.py
b.py
The source for `b.py` is simply:
def hello():
print('hi yourself')
And for `_... |
Compare two lists in python where the elements are in different order
Question: I have multiple lists e.g.
list1=[1,4,5]
list2=[4,1,5]
list3=[1,5,4]
two lists are considered same if they have the same elements. Also the lists
can be nested lists
list1=[[1,4],5,4]
list2=[5... |
py2neo raised finished(self) error
Question: Working with py2neo and I'm getting the error below when trying to append a
transaction:
statement ="MERGE (a:Person {name:\""+actorName+"\"}) "\
"\n"\
"MERGE (b:Series {title:\""+actorsFields[3]+"\", year:\""+actorsFields[5]+"\... |
Django development server seems to be using old version of python source file
Question: I'm re-writing the code of my website, and testing with Django's built-in web
server using the `manage.py runserver` command. Now I've come across a very
strange problem: The server seems to use the current version of `views.py` on
... |
Convert a String into python list that is already in list format
Question: i have users emails stored in database like this below.
['[email protected]','[email protected]','[email protected]']
I have to get each email of all users one by one. After querying i wrote the
following code.
cur.exe... |
mock patch not work with nosetests
Question: I just tried to learn the [mock](https://pypi.python.org/pypi/mock) and
[nosetests](https://nose.readthedocs.org/en/latest/) by running simple
examples, but got no luck:
john$ nosetests test_mylib.py
E
==================================================... |
pickling and unpickling user-defined class
Question: I have a user-defined class 'myclass' that I store on file with the `pickle`
module, but I am having problem unpickling it. I have about 20 distinct
instances of the same structure, that I save in distinct files. When I read
each file, the code works on some files an... |
How to output a multi-index DataFrame in latex with pandas?
Question: I am trying to output a multi-index DataFrame in a latex output using python
and pandas. So far, I have this:
import pandas as pd
l = []
for a in ['1', '2', '3']:
for b in ['first', 'second']:
for c in ... |
Python LinkedIn Search API 403 error
Question: I am trying to get public profiles of people who work in company X to get
their title, id, and connection. How do I properly use the Search API so I do
not get 403 Forbidden error?
from linkedin import linkedin
CONSUMER_KEY = 'XXX'
CONSUMER_SECR... |
Python sys.stdout.write() strange behavior in Mac terminal
Question: I am trying to make a progress bar for a process, but to keep things short
consider the following snippet:
import sys
import time
for i in range(10):
time.sleep(0.5)
sys.stdout.write('*')
sys.stdout.write('\... |
How do you kill Futures once they have started?
Question: I am using the new
[`concurrent.futures`](https://docs.python.org/3/library/concurrent.futures.html)
module (which also has a Python 2 backport) to do some simple multithreaded
I/O. I am having trouble understanding how to cleanly kill tasks started using
this m... |
Sending binary data multiple times using Sockets in Java/Android
Question: I need to send binary data multiple times with Java Sockets on Android
devices. This is a simple object that exports run() and send() methods.
public class GpcSocket {
private Socket socket;
private stati... |
How to implement recursive all possible combination of any set (JAVA)
Question: Can someone give me a few clues or help with writing a combination function
where it would output all possible combination of a set. I have an idea. But I
find it hard.
Something like this in Java.
String set[] = {"Java","C+... |
Flask Debugger not working under Windows
Question: I am a newbie to Python attempting to experiment with sample code under
Windows 8.1.
On <http://flask.pocoo.org/docs/0.10/quickstart/> it says "if you enable debug
support the server will reload itself on code changes, and it will also
provide you with a helpful debug... |
Connect to socket in infinate loop with python
Question: I have a ssh deamon running on my local machine. I want infinitely connect to
ssh deamon and echo received data. Here is my script.
[azatuni@noc python-tests]$ cat test.py
#!/usr/bin/python
import socket
s = socket.socket(socket.AF... |
scraping data using python
Question: Hello I'm new to this,
But I wrote the following script to scrape the following standings
<http://i.stack.imgur.com/98FPr.png>
website: <http://www.bbc.com/sport/football/spanish-la-liga/table>
Im trying to print the position and team name. Team name prints fine, but for
the posi... |
Python/Tkinter doesn't update label
Question: I am developing a password program that uses Tkinter to make it nicer and I am
having some issues. The Tkinter label does not update, yet it displays the new
password in the IDLE. I am still learning so please dumb it down a little bit.
If you need my source code, here it i... |
Creating a form with Elm
Question: I would like to create a form in Elm that takes 4 required inputs:
* 3 floating point values
* 1 input which can take the values of "long" or "short" (presumably) this would be a drop-down
When the values are entered, a computation occurs that yields a single line of
output base... |
Convert Levenshtein ratio to C++
Question: Is there a library for doing the following in C or C++? I don't mean a python
library that uses C or C++, but an actual C/C++ library:
>>> import Levenshtein
>>> ratio = Levenshtein.ratio('StackOver', 'Stackoverflow')
0.7272727272727273
Answer: Wh... |
Selenium using python
Question: I am trying to post something on <http://indianrailforums.in> using selenium
script. I am able to login and reach this page:
<http://indiarailinfo.com/blog> using the selenium script, but after I click
post button I am not able to send text in the text area.
This is my code:
... |
how to gfxdraw in a subclass of pygame.Surface [python/pygame]
Question: am i subclassing Surface the wrong way? the error says that gfxdraw.aacircle()
requires a Surface as 1st argument, but I can't figure out how to do that.
runnable code and exception below:
import pygame, sys, os
from pygame.loca... |
Delete results of a grep search across files
Question: I have a script which ultimately should grep a chunk of a text from a file and
delete it, then repeat this for every file in a directory. But the code I've
written below does not include the delete statement because I'm not sure how
to do that. [This post](http://s... |
Creating an element with 'class' attribute throws a syntax error
Question: When I try to do this with the `lxml` module:
div = etree.SubElement(body, "div", class="hmi")
I get a:
user@localhost:metk $ sudo python mbscan.py -r 192.168.0.0/24 --hmi
File "mbscan.py", line 481
... |
ImportError: No module named pygame and how to change the path of pygame?
Question: Okay, so I am brand new at this and I really need for this to be dumbed down
for me. My python version is 2.7.9 and I downloaded
pygame-1.9.1.win32-py2.7.msi and I am on a windows computer. I really need
someone to explain why this is n... |
Simple animation with Tkinter Python
Question: I've searched for a simple animation code with Tkinter but I've found very
different examples and I can't understand the correct way to write an
animation. Here my working code to display a simple moving circle:
import tkinter as tk
import time
... |
Node.js Python-shell: while true loop not working
Question: I've this simple `Python` script print out a message every second:
#!/usr/bin/python
import time
while True:
print u"Message"
time.sleep(1)
I'm trying to integrate a 3rd party Python script with the above struc... |
Exception in thread "main" java.lang.NoClassDefFoundError launch error
Question: I have the typical error in Java. I have the next structure:
bin/
lib/
src/
junior/
databases/
homework/Main.java
My **Main.java** code is:
package junio... |
How can I make a multithreading queue-system for incoming lines from a socket in Python?
Question: I'm fairly new to Python and I have a code that receives information from a
socket and processes each line one after one in a queue-system. The problem is
that if a line ever take an unusual amount of time to process, all... |
Turning an Access database into a web-based platform
Question: This might be a newbie question, but I have been thinking about it for a while
and here it is:
Our company is interested in creating a web-based program to facilitate the
reports of its field activities. We have been using Microsoft Access as our
reporting... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.