text stringlengths 226 34.5k |
|---|
Python: Loop acting on several files and writing new ones
Question: I have the following code which takes the file "University2.csv", and writes
new csv files "Hours.csv" - "Hours -Stacked.csv" and "Days.csv".
Now I want the code to be able to loop and run on several files
(University3.csv, University4.csv etc.) and p... |
Python Tkinter on Debian Beaglebone: lost font styling when changed directory name
Question: I have installed non-system fonts onto BeagleBone Black (Debian Jessie) and
have been using them in a GUI created using python 2.7 script via Tkinter and
tkFont. When I changed the name of the directory my file was stored in, t... |
HTML: parameter in javascript function
Question: Can we put a string parameter in a JS function, while i'm in html? Like this:
<form name="form3" action="mat.py" method="get" onsubmit="return validation(param1,param2)"/>
I can also say that i'm working in Python, so my code is like that: there's
j... |
Slicing a String after certain key words are mentioned into a list
Question: I am new to python and I am stuck with a problem. What I'm trying to do that I
have a string containing a conversation between two people :
str = " dylankid: *random words* senpai: *random words* dylankid: *random words* senpai... |
How to copy a cropped image onto the original one, given the coordinates of the center of the crop
Question: I'm cropping an image like this:
self.rst = self.img_color[self.param_a_y:self.param_b_y,
self.param_a_x:self.param_b_x:, ]
How do I copy this image back to the o... |
Getting "TypeError: unsupported operand type(s) for -: 'list' and 'list'"
Question: Hi I know there are a few people that had this issue but none of the solutions
I've seen are helping. I'm taking a set of data, reading the file then
creating arrays from the data to input into this equation: `Dist = 10 **
((app_m - abs... |
Python list comparing characters and counting them
Question: I have a little question about how to check and compare two or more characters
in the list in Python.
For example, I have a string "cdcdccddd". I made a list from this string to
easier comparing the characters. And the needed output is: c: 1 d: 1 c: 1 d: 1
c... |
Bigger color-palette in matplotlib for SciPy's dendrogram (Python)
Question: I'm trying to **expand** my `color_palette` in either `matplotlib` or
`seaborn` for use in `scipy`'s **dendrogram** so it colors each cluster
differently.
Currently, the `color_palette` only has a few colors so multiple clusters are
getting m... |
Module ImportError using PySpark
Question: I have a pyspark job (spark 1.6.1, python 2.7). The basic structure is:
spark_jobs/
__init__.py
luigi_workflow.py
my_pyspark/
__init__.py
__main__.py
spark_job.py
stuff/
__init__.py
module1.py... |
Converting python code to cython
Question: I have a python program that uses OpenCV. The program runs as expected as it
is at the moment. Now I would like to use Cython to compile my python code to
C code. I am doing this instead of re-writing the entire program in C because
I would still like other python programs to ... |
Python 2.7.1 import MySQLdb working via cmd but no in a .py file
Question: Okay, i have Python2.7.1 installed in a windows 32.
The problem is, when i try to import MySQLdb module via python in cmd,
python recognizes the module well,
but when i try the same script in a python file i got: ImportError: No module
named ... |
How to `pip install` a package that has Git dependencies?
Question: I have a private library called `some-library` _(actual names have been
changed)_ with a setup file looking somewhat like this:
setup(
name='some-library',
// Omitted some less important stuff here...
in... |
python treeview column "stretch=False" not working
Question: I want to disable column resize, but "stretch = False" is not working, I don't
know why, my python version 3.4.3 .
from tkinter import *
from tkinter import ttk
def main():
gMaster = Tk()
w = ttk.Treeview(gMaster, s... |
Convert escaped utf-8 string to utf in python 3
Question: I have a py3 string that includes escaped utf-8 sequencies, such as
"Company\\\ffffffc2\\\ffffffae", which I would like to convert to the correct
utf 8 string (which would in the example be "Company®", since the escaped
sequence is c2 ae). I've tried
... |
Which library to import in Python to read data from an Excel file, for automation testing using Selenium?
Question: Which library to import in Python to read data from an Excel file, I want to
store different `xpaths` in Excel file for automation testing using Selenium?
Answer: The [xlrd](https://pypi.python.org/pypi... |
prevent the sub windows to open multiple times
Question: I am creating an application by using the language wxPython. I have a simple
problem in which I cant really find the solution in the internet.
I have a main user interface with a menubar which contain a menu called new
file. By clicking the new file, a new windo... |
Python: issue with building mock function
Question: I'm writing unit tests to validate my project functionalities. I need to
replace some of the functions with mock function and I thought to use the
Python mock library. The implementation I used doesn't seem to work properly
though and I don't understand where I'm doin... |
How to upload a picture to woocommerce with python/django POST request
Question: I have created a woocommerce web page and I am trying to use Django/Python
synchronized with my page. From the documentation [woocomerce post
request](https://woothemes.github.io/woocommerce-rest-api-docs/?python#create-
a-product):
... |
Bind to pgcrypto from python
Question: I'd like to call some pgcrypto functions from python. Namely
[px_crypt](http://doxygen.postgresql.org/px-
crypt_8c.html#a6e88d87094f37fecc56c0abfb42d1fc3). I can't seem to figure out
the right object files to link it seems.
Here's my code:
#include <Python.h>
... |
Using regex, best way to get all punctuations from a line in Python?
Question: i tried something like this but it's a bit long:
punct_tab=[]
for line in f:
tab=line.split()
for word in tab:
if re.search(r",",word)!=0:
punct_tab.append(',')
if... |
Spaces in directory path python
Question: I'm a noob at coding Python and I've run into something that no amount of
Googling is helping me with. I'm trying to write a simple Directory listing
tool and I cannot seem to deal with Spaces in the directory name in OSX. My
code is as follows:
def listdir_nohid... |
Very Large number Calculations with No Loss in Accuracy?
Question: Very Large number Calculations with No Loss in Accuracy ?
Given a 1700 digit number, we want to store the value and perform two
functions on it with NO loss of accuracy, its ok if calc time takes longer but
better if faster.
Where `x` = a 1700 digit l... |
python kernel crashes on mouse hover over Tkinter window
Question: I want to plot graph in jupiter notebook. When I use the following code
%pylab inline
import numpy as np
x=np.linspace(0,10,40)
plt.plot(x,x**2)
plt.show()
everything works fine but if I change `%pylab inline` to `... |
Convert Time to printable or localtime format
Question: In my python code I get start and end time some thing like:
end = int(time.time())
start = end - 1800
Now start and end variables holds values like 1460420758 and 1460422558.
I am trying to convert it in a meaningful format like :
... |
Change the style or background of a cell in Dominate table (Python)
Question: Here's a sample from my csv file (imagine that the xxxx.img are actually
<http://my.website.me/xxxx.img>)
LHS_itemname,LHS_img, LHS_color, RHS_itemname, RHS_img, RHS_color
backpack, bck.img, blue , lunchbox, lch... |
How to create a Text Node with lxml?
Question: I'm using lxml and python to manipulate xml files. I want to create a text
node with no tags preferably, instead of creating a new `Element` and then
append a text to it. How can I do that?
I could find an equivalent of this in `xml.dom.minidom` package of python
called `... |
Python encoding issue in script if string not hard-coded
Question: I have an encoding issue with strings I get from an external source. This
source sends the strings encoded to me and I can decode them only if they are
part of the script's code. I've looked at several threads here and even some
recommended tutorials (s... |
Why does using multiprocessing with pandas apply lead to such a dramatic speedup?
Question: Suppose I have a pandas dataframe and a function I'd like to apply to each
row. I can call `df.apply(apply_fn, axis=1)`, which should take time linear in
the size of `df`. Or I can split `df` and use `pool.map` to call my functi... |
How to get original favorite count, and each user's follower count, from Twitter streaming API in Python
Question: I'm attempting to extract individual pieces of data from the public stream of
tweets for two tracked keywords, using the Python package
[TwitterAPI](https://github.com/geduldig/TwitterAPI/blob/master/READM... |
How to use a list in other function?
Question: I have a list like this `cs_id["CS_A1","CS_b7",...]` in a function. At the end
of the function the list ist filled with 80 values. How can I use this list
(and values) in another function? Here I want to use the list `cs_id[]` from
function unzip in function `changecs`. (B... |
Collapse information according to certain column of a line
Question: For the matrix as below
A 20 200
A 10 150
B 60 200
B 80 300
C 90 400
C 30 300
My purpose is trying to: for each category (labelled as A,B,C..in the 1st
column), I'd like to f... |
Accessing GET Form data from - Javascript Form in Django
Question: I'm having trouble with Django in terms of getting data from a Javascript
form. Here is my Javascript code...
function save() {
var form = document.createElement("form");
console.log(form);
form.setAttribute('m... |
What is "backlog" in TCP connections?
Question: Below, you see a python program that acts as a server listening for connection
requests to port _9999_ :
# server.py
import socket
import time
# create a socket object
serversocket = socket.sock... |
Python vector field of ODE of three variables
Question: I am trying to plot a vector field of a ODE model with three variables. I
would like to average the vectors along the third axis, and present the vector
field together with the information of the standard deviation of their values.
The ODE system is:
... |
What is a good way to make several attempts to handle one exception in Python?
Question: Let's say, I have a preferred solution to handle exception.
But exception still occurs sometimes and I have to use the second, less
preferred, solution.
I use code like the following, it might look not cool. If there is better
... |
BeautifulSoup: Get all product links from specific category
Question: I want to get all the product links from specific category by using
BeautifulSoup in Python.
I have tried the following but don't get a result:
import lxml
import urllib2
from bs4 import BeautifulSoup
html=urllib2.urlopen(... |
OrientDB: text searching using gremlin
Question: I am using OrientDB and the gremlin console that comes with.
I am trying to search a pattern in text property. I have Email vertices with
ebodyText property. The problem is that the result of querying with SQL like
command and Gremlin language is quite different.
If I ... |
python autopy problems/confusion
Question: so im trying to make a bot script that when a certain hex color is on a
certain pixel it will execute some code to move the mouse,click etc. and i
have it to where it takes a screenshot every 1 second to the same png file and
updates the png file's pic. i have the hex color fo... |
Python regex findall to read line in .csv file
Question: I have a .csv file (or could happily be a .txt file) with some records in it:
JB74XYZ Kerry Katona 44 Mansion_House LV10YFB
WL67IAM William Iam 34 The_Voice_Street LN44HJU
etc etc
I have used python to open and read the file, t... |
Python function such as max() doesn't work in pyspark application
Question: Python function max(3,6) works under pyspark shell. But if it is put in an
application and submit, it will throw an error: TypeError: _() takes exactly 1
argument (2 given)
Answer: It looks like you have an import conflict in your application... |
Python Turtle - Click Events
Question: I'm currently making a program in python's Turtle Graphics. Here is my code in
case you need it
import turtle
turtle.ht()
width = 800
height = 800
turtle.screensize(width, height)
##Definitions
def text(text, size, color, pos1, pos2... |
Scrapy and xpath to crawl my site and export URLs - what am I doing wrong?
Question: I'm trying to set up a basic Scrapy to crawl my website and extract all the
page URLs of my site. I would think this would be fairly easy.
Here's my items.py, copied from the tutorial:
from scrapy.item import Item, Fiel... |
Delete an element in a JSON object
Question: I am trying to loop through a list of objects deleting an element from each
object. Each object is a new line. I am trying to then save the new file as is
without the element contained within the objects. I know this is probably a
simple task but I cannot not seem to get thi... |
Write simultaneously to float array with python multiprocessing
Question: I coded a matrix multiplier a while ago, in an attempt to make it faster I
tried to make it threaded just to discover that threads run on the same
process.. I later discovered the multiprocessing library which I have
implemented in the code below... |
How to make this Battleship game more user friendly in terms of values?
Question: I have a Battleship game set up in Python, however the grid i set up ranged
between 0 and 5. Meaning the first row and columns of the battleship will be
(0,0) I don't want this however, as any stranded user will likely count from
1, so th... |
How can I subtract two values which I have got from a .txt file
Question: So far I have managed to print out certain parts of the `.txt` file in Python
however I cannot figure out how to subtract the amount paid from my total
amount and then add up the outstanding value from each column.
import csv
... |
is this Python's pass by reference' behavior?
Question: I thought Python assignment statements were 'pass by value'. For example
b=0
a=b
b=1
print(a) #prints 0
print
(b) #prints 1
However, I am confused by a different behavior when dealing with other kinds
of data. From this tu... |
Python: Reading a global variable inside a function creator
Question: So, I want to create a function creator that reads a global variable every
time it's called, and not just when it's created. That's not the case, since
Python replaces my var reference with it's current value.
import operator
... |
Multi dimensional dictionary in python
Question:
#!/usr/bin/python
import sys
from collections import defaultdict
from collections import Counter
new_dic_defaultdict = defaultdict(dict)
#new_dic_defaultdict = defaultdict(int)
file="SMSCDR_POSTPAID_150901235000_10.84.0.29_AS.l... |
move up the files from subdirectory in root directory
Question: I have the following folder hierarchy:
----Folder
------Subfolders
-----------Sub-sub-folder
--------------Files
So I have multiple subfolders, and in every Subfolder I have one Sub-sub-
folder that contains multiple files,... |
python multiprocessing using multiple arguments
Question: I can use multiprocessing to easily set up parallel calls to "func" like this:
import multiprocessing
def func(tup):
(a, b) = tup
return str(a+b)
pool = multiprocessing.Pool()
tups = [ (1,2), (3,4), (5,6), (7,... |
python3 - No module named 'html5lib'
Question: I'm running a python3 program that requires `html5lib` but I receive the error
`No module named 'html5lib'`.
Here are two session of terminal:
sam@pc ~ $ python
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
>>> import html... |
How to list the names of PyPI packages corresponding to imports in a script?
Question: Is there a way to list the **PyPi package** names which correspond to modules
being imported in a script?
For instance to import the module
[`scapy3k`](https://github.com/phaethon/scapy) (this is its name) I need to
use
... |
Display SQLite output in TK python
Question: Im trying to get a row from my db to display on a tk text widget if 1 and
remove from display if 0.
The code I have so far shows the row for one card. When I scan a seccond time
I get an error of.
SQLite objects created in a thread can be used in that same th... |
Sending csv file using Requests.PUT in python [400 Client error: Bad Request]
Question: I am trying to send a csv file using Request module but I keep getting "400
Client Error: BAD REQUEST for url" error. According to the specification that
I have, here is an example that was given for curl; `curl -X PUT -H "Content-
... |
How to hide SDL library debug messages in Python?
Question: I am trying to write a simple python app, which will detect a 2-axis joystick
axis movements and call other functions when one axis has been moved to an
endpoint. I don't do programming regularly, I'm doing sysadmin tasks.
Using the pygame library this would ... |
How to split each line from file using python?
Question: I try to split contents from file, this file has many lines and we don't know
how much lines as example i have these data in the file:
7:1_8:35_2016-04-14
8:1_9:35_2016-04-15
9:1_10:35_2016-04-16
using paython i want to loop at each l... |
Plotting data from CSV in python
Question: I have CSV files in following format in a folder.It also have additional
column which I dont care
Date Price
20150101 1
20160102 3
I want to iterate through all the files in folder and create graph for date on
x-axis and price on... |
Python3 Portscanner can't solve the socket pr0blem
Question: When I run this code I am getting this socket error:
> [WinError 10038] An operation was attempted on something that is not a
> socket
but even if I delete the `s.close()` it gives me wrong results.
It is a port scanner that are going to try connecting to ... |
How do you use dask + distributed for NFS files?
Question: Working from [Matthew Rocklin's
post](http://matthewrocklin.com/blog/work/2016/02/22/dask-distributed-part-2)
on distributed data frames with Dask, I'm trying to distribute some summary
statistics calculations across my cluster. Setting up the cluster with
`dcl... |
Traversing from one node in xml to another using Python
Question: I am very new to XML with Python and I have the following XML string that I
get as a response from a network device:
'<Response MajorVersion="1" MinorVersion="0"><Get><Configuration><OSPF MajorVersion="19" MinorVersion="2"><ProcessTable><P... |
how to make a phrase in python that is input by a user not case
Question: I am trying to fix my code so when the user enters a phrase for instance
**cat** but in the directory that they are telling the script to look at to
find the phrase the word is spelled **Cat** or **CAt** or **CAT** or **cAT**
it will still return... |
Multiplication of floating point numbers gives different results in Numpy and R
Question: I am doing data analysis in Python (Numpy) and R. My data is a vector 795067 X
3 and computing the mean, median, standard deviation, and IQR on this data
yields different results depending on whether I use Numpy or R. I crosscheck... |
Python: How to output the FASTA header or chromosome index figure according to the location?
Question: I have the code which help me to move the window of size 5 when it moves from
left to right. The file is in fasta format with header >chromosome for example
followed by the index of the chromosome. I would like to out... |
how to do 'knife ec2 server create' from python script
Question: I am trying to convert my ant script to python. The ant script runs knife ec2
server create command. What is the best practice to run knife ec2 server
create from Python?
BTW, is python the right scripting technology for automation?
Answer: I'm not fam... |
Python multiprocessing refuses to loop
Question: I've recently discovered Multiprocessing for Python, so I'm playing around
with it a little bit and I ran into a wall.
This is the script I'm working with:
import multiprocessing, time
def p_def():
print "running p"
time.s... |
How to create variables from an CSV file in Python
Question: I am an absolut noobie in coding. So I have a problem to solve. First I have a
CSV file looking like this for example:
text.csv:
> jan1,A
> jan2,B
> jan3,C
> jan4,A
> jan5,B
> jan6,C
Now I want to import this "data" from the CSV in a Python ... |
Parsing xml file in python which contains multifasta BLAST result
Question: I'm trying to parse xml file which contains multifasta BLAST result - Here is
the
[link](https://drive.google.com/file/d/0B9-yqnpWUqL3eEhHWEkxc2ZVcnM/view?usp=sharing)
\- it's around 400kB in size. Program should return four sequence names. Eve... |
flask-RESTful : why do I get an AssertionError when parsing an argument with the wrong type?
Question: I'm using flask-RESTful for the first time. In the [docs](http://flask-
restful.readthedocs.org/en/0.3.5/quickstart.html#argument-parsing) it says :
> Using the reqparse module also gives you sane error messages for ... |
ajax request python array list
Question: I am making ajax call and fetching details in python and saving it in mongodb.
**Scenario:** I tried `request.POST.getlist('arrayList[]')`
> _Works:_ if array contains values inside it. Eg: ['abcd', '1234']
>
> **_Doesn't work:_** if array contains arrays inside it. Eg: [[arr1... |
Debugging a c-extension in python
Question: I run [bayesopt](http://rmcantin.bitbucket.org/html/) with python bindings. So
I have a `bayesopt.so` that I import from python (a C-extension).
When I run it, it core dumps. I want to load this core dump in gdb to see what
the issue is. How can I do this? Or get information... |
Django - Creating form for editing multiple instance of model
Question: Note: Django/Python beginner, hope this question is clear
I need to create a form where multiple instances of a model can be edited at
once in a single form, and be submitted at the same time.
For instance, I have two models, Invite and Guest, wh... |
Create a subclass object with initialized parent object
Question: I have a BaseEntity class, which defines a bunch (a lot) of non-required
properties and has most of functionality. I extend this class in two others,
which have some extra methods, as well as initialize one required property.
class BaseEnt... |
Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment
Question: I downloaded Quokka Python/Flask CMS to a CentOS7 server. Everything works
fine with command
sudo python3 manage.py runserver --host 0.0.0.0 --port 80
Then I create a file /etc/... |
Can't edit a URL with python
Question: I am new to python and just wanted to know if this is possible: I have scraped
a url using `urllib` and want to edit different pages.
**Example** : `http://test.com/All/0.html`
I want the `0.html` to become `50.html` and then `100.html` and so on ...
Answer:
found_url = '... |
How to use compile_commands.json with clang python bindings?
Question: I have the following script that attempts to print out all the AST nodes in a
given C++ file. This works fine when using it on a simple file with trivial
includes (header file in the same directory, etc).
#!/usr/bin/env python
fro... |
Convert table using python pandas
Question: I have a table like this:
vstid vstrseq date page timespent
1 1 1/1/16 a 20.00
1 1 1/1/16 b 3.00
1 1 1/1/16 c 131.00
1 1 1/1/16 d .000
1 1 ... |
pip install produces OSError: [Errno 13] Permission denied:
Question: I'm wanting to install ten packages via pip in virtualenv.
I possibly used `sudo` improperly in my haste to get it "working" as suggested
by <http://stackoverflow.com/a/27939356/1063287>, ie I installed virtualenv
with sudo:
`sudo virtualenv --no-s... |
Merging 2 lists in Python
Question: With my current script
from lxml import html
import requests
from bs4 import BeautifulSoup
import re
import csv
import itertools
r = requests.get("http://www.mediamarkt.be/mcs/productlist/_128-tot-150-cm-51-tot-59-,98952,501091.html?la... |
Convert list of tuples w/ lenght 5 to dictionary in Python
Question: what if I have a tuple list like this:
list = [('Ana', 'Lisbon', 42195, '10-18', 2224),
('Eva', 'New York', 42195, '06-13', 2319),
('Ana', 'Tokyo', 42195, '02-22', 2403),
('Eva', 'Sao Paulo', 21098, ... |
Printing lists in column format in Python
Question: I'm setting up a game of solitaire and I'm trying to figure out some ways that
I could print each list of cards in column format. Any ideas on how I could go
about doing this with the following lists?
[6♦]
[2♣, 6♠, A♣, 7♣, J♣, XX]
[4♥, 2♥, 4♠, 8... |
Python paho-MQTT connection with azure IoT-Hub
Question: I am trying to connect with Azure IoT-Hub with MQTT and send and receive
messages.
I am following the official documentation given
[here](https://azure.microsoft.com/en-in/documentation/articles/iot-hub-mqtt-
support/)
But it always get disconnected with result... |
Remove punctuation in sentiment analysis in python
Question: I have the following code I made. It works great but problems arise when I add
sentences with commas, full-stops etc. I've researched and can see strip() as
a potential option to fix it? I can't see where to add it and have tried but
just error after error!
... |
Python: what's the difference - abs and operator.abs
Question: In python what is the difference between :
`abs(a)` and `operator.abs(a)`
They are the very same and they work alike. If they are the very same then why
are two separate functions doing the same stuff are made??
If there is some specific functionality fo... |
I succesfully installed scikit-flow by using pip but somehow it doesn't work when I import and use it
Question: I've already installed scikitlearn the other day and The code which I tried to
execute is as follows.
import skflow
from sklearn import datasets, metrics
iris = datasets.load_iris(... |
Matplotlib animation inside your own PyQt4 GUI
Question: I'm writing software in Python. I need to embed a Matplotlib time-animation
into a self-made GUI. Here are some more details about them:
### 1\. The GUI
The GUI is written in Python as well, using the PyQt4 library. My GUI is not
very different from the common... |
Writting more data to file than reading?
Question: I am currently experimenting with how Python 3 handles bytes when reading, and
writing data and I have come across a particularly troubling problem that I
can't seem to find the source of. I am bassically reading bytes out of a JPEG
file, converting them to an integer ... |
How to convert a array of dimension 3 * 200 * 120 into a 1*600 *120 in python?
Question: I have an array like this:
`[ array([[2,3,4,5,6,10]]) array([[7,3,9,1,2,3]]) array([[3,7,34,345,22,1]])
]`
I would like to convert the above array as follows:
`[[2 3 4 5 6 10] [7 3 9 1 2 3] [ 3 7 34 345 22 1]]`
Answer: Use
[`n... |
Issue with Images in GUI python
Question: I am using python 2.7 and for some reason it doesn't recognize some of the
modules. I want to print an image with Tkinter and its just doesn't work.
from Tkinter import *
import ImageTk
root = Tk()
frame = Frame(root)
frame.pack()
... |
Graphing a colored grid in python
Question: I am trying to create a 2D plot in python where the horizontal axis is split
into a number of intervals or columns and the color of each column varies
along the vertical axis.
The color of each interval depends on the value of a periodic function of
time. For simplicity, let... |
Unable to use Stanford NER in python module
Question: I want to use Python Stanford NER module but keep getting an error,I searched
it on internet but got nothing. Here is the basic usage with error.
import ner
tagger = ner.HttpNER(host='localhost', port=8080)
tagger.get_entities("University of C... |
Error to cloning project with puppet on vagrant
Question: I am trying to install django and clone a github project with a puppet script.
I am using modules as follows:
* files
* (empty directory)
* manifests
* nodes.pp
* web.pp
* modules
* django
* manifests
* init.pp
* f... |
When i import collections in my Python file, I can't access Ordered Dictionary?
Question: [missing ordered dictionary in
collections](http://i.stack.imgur.com/5x7NC.jpg)
It is all said, I cant acces ordered dictionary. I have searched everywhere
but there is no solution. Please help.
Answer: You need to look for `co... |
Python MINIDOM Object How to get only the element name from DOM Object
Question: I have a python DOM object output, I need to get only the "Elements" from it.
Example:
[<DOM Text node "u'\n\t\t\t'">, <DOM Element: StartTime at 0x397af30>, <DOM Text node "u'\n\t\t\t'">, <DOM Element: EndTime at 0x397afd0... |
Python Selenium Firefox driver - Disable Images
Question: Before I have used the code below, but it doesn't work anymore with firefox
update.
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
firefoxProfile = FirefoxProfile()
firefoxProfile.set_preference('permissions.default.... |
None type object attribute error Python
Question: Made a text game in python 2.7 following LPTHW by Zed Shaw. It consisted of
importing different files into one and calling it. The game is working but at
the end it gives me an attribute error.
Traceback (most recent call last):
File "Main.py", line 1... |
Importing resource file to PyQt code?
Question: I have seen Qt documentary and a lot of questions less-similar to this one,
But i still haven't figured out how can i do it.
I'm not entirely sure how can i import resource file to Python code, so pixmap
appears without any issues.
* * *
I have all files in same direct... |
How to debug "pika.exceptions.AuthenticationError: EXTERNAL" error when establishing TLS connection to RabbitMQ?
Question: I have a RabbitMQ 3.6.1 server on Ubuntu 14.04 running properly. I tried to
configure an SSL listener according to [official
documentation](https://www.rabbitmq.com/ssl.html). No problems during th... |
searching three different words using regex in python
Question: I am trying to search three different words in the below output
+---------------------+---------------------------+------------------+------------+-----------+------------+----------+-------------------+----------------+
| radius-serv... |
Python regex not greedy enough, multiple groups
Question: When trying to do some regexp matching in python, I stumbled over an oddity. I
wanted to match decimal numbers on the form xxx.yyy and divide them into three
groups for further processing. I ran something like the following snippet.
#!/usr/bin/env... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.