text stringlengths 226 34.5k |
|---|
Python 3.5.1 regex doesn't match as expected
Question: I tested my regex with _Regex101_ already, but when I tried in _Python 3.5.1_
it returns `None`
Here's my [Regex101](https://regex101.com/r/fC0lI5/4)
And here's my Python code. Not sure if I miss anything.
Python 3.5.1 |Anaconda 2.4.0 (x86_64)| (de... |
New line in Python for loop with sqlite3
Question: I'm trying to create a small function that prints successive lines from a
database I'm working with. What I currently have written does that quite well,
except it's all a blocky mess and "\n" is interpreted literally rather than
actually creating a new line.
... |
Python parameterized unittest by subclassing TestCase
Question: How can I create multiple TestCases and run them programmatically? I'm trying
to test multiple implementations of a collection on a common TestCase.
I'd prefer to stick to with plain unittest and avoid dependencies.
Here's some resources that I looked at... |
Unicode error Python3 calendar module
Question: I'm trying to print a simple calendar from python `calendar` module:
import calendar
c = calendar.LocaleTextCalendar(0, 'Russian')
s = c.formatmonth(2016, 5)
print(s)
On linux it works well, but on Windows I got an error: `UnicodeEnco... |
rename a zipped file in python
Question: I have a zipped file. Inside of it I have a`.tvx` file - which I want to
rename to `.xml` . So I tried the following: (of course, I imported all the
relevant modules).
with zipfile.ZipFile(file_name) as z:
for filename in z.namelist():
if not o... |
How to read star (*) as system command
Question: I have this code :
> >>> import os
> >>> os.chdir('/u01/APPLTOP/instance/domains/*.oracleoutsourcing.com/ICDomain/servers/IncentiveCompensationServer_1/logs')
> Traceback (most recent call last): File "<stdin>", line 1, in ?
> OSError: [Errno... |
Could not import module written in c# with IronPython
Question: Currently i'm struggeling with writing IronPython modules in c#. At first i
have some empty partial class, which represents the module base:
[assembly: PythonModule("demo", typeof(Demo.IronPythonAPI.PythonAPIModule))]
namespace Demo.Iron... |
Python selenium didn't find css element
Question: I imported the code from Selenium Ide in python. The selenium test works fine
without clicks on the item and scroll seamlessly clicks on an item. HTML
selenium code :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ... |
ReportLab displays images with wrong orientation
Question: I'm using reportlab to generate PDF documents from a python API. The documents
include pictures (previously taken with a camera or mobile device) loaded with
:
from reportlab.platypus import Image
img = Image(path)
story.append(img)
... |
how to return simple function in django html file?
Question: I need return calculate_c value in html
urls.py
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^$', views.my_view, name='my_view'),
]
views.py
from django.... |
How does Flask start a new SQLAlchemy transaction at the start of each request?
Question: I tried to totally seperate Flask and SQLAlchemy using [this
method](http://flask.pocoo.org/docs/0.10/patterns/sqlalchemy/#declarative) but
Flask still seems to be able to detect my database and start a new transaction
at the begi... |
asyncio: loop.run_until_complete(loop.create_task(f)) prints "Task exception was never retrieved" even though it clearly was propagated
Question: For some reason this program prints the following warning:
Task exception was never retrieved
future: <Task finished coro=<coro() done, defined at /usr/lib... |
Python fibonacci number
Question: This is not a homework question, i'm simply trying to learn. Trying to write a
simple program that reads in 2 numbers.
Compute the Nth fibonacci number and Mth fibonacci number and then find the
greatest common factor of those two numbers.
Must ensure user types in a positive number ... |
Changing Tensorflow MNIST code with interactive session into session
Question: So, I have been learning tensorflow, and I have tried to change the code on
the documentation from being run on an interactive session to being run in a
regular session, so that I can run the python file containing the code from
command line... |
Django, upgrading to 1.9
Question: I evolve my Django version to 1.9 (before I had the 1.6 or 1.7), so I modify
many obseltes things...
But I have a problem with theses lines in my urls.py :
import django
import main_app
from django.conf.urls import patterns, include, url
from django.views.... |
Python code not working. Trying to compute two fibonacci numbers and find greatest common factor
Question: Can someone please help with this code. I'm attempting to write the simplest
program possible that reads in 2 numbers (m,n), then computes the nth
fibonacci number and the mth fibonacci number and then finds the g... |
Selenium WebDriver Python, search WebElement
Question: i am using Selenium to scrape some stuff live, but i can't seem to search a
WebElement even tho the docs say i can.
while True:
try:
member = self.pdriver.find_all("sv:member_profile")[index]
self.pdriver.info_log("Fou... |
what does this regular expression in python mean (.+?)
Question: I saw this regular expression being used in a program - (.+?) But I don't
understand What does this mean. I know that, . is for any character except
newline \+ is for one or more characters ? is for zero or one character
But don't understand what this en... |
urllib slower than browser to access html
Question: The following python script takes 3 seconds on my PC to load the source code
of a twitter page, which is much higher than it takes to retrieve the source
code of other websites, such as youtube. When I load the same twitter page in
my browser, the "network" tab in goo... |
urllib2.urlopen(url).read() fails to read the URL content
Question: I am trying to read the web content of the link: `http://www.quikr.com/Mobile-
Phones/y149` using following python command:
import requests
import urllib2
hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (... |
Why python json module produces different encoding on same file
Question: I'm trying to parse a json with some Finnish characters included. A goog
example would be a region called Etelä-Karjala. I had it all working locally
when I opened the json as a file and then loaded with json.load. The unicode I
got for this regi... |
Dask array rfft doesn't seems to work
Question: I'm trying to do some real fft in some large arrays and decided to give dask a
try. I've run into a problem where the function dask.array.rfft does not seems
to work no matter what I do. Here's a minimal example.
import numpy as np
import dask.array as ... |
Virtualenv: "main.py" gives error but "python main.py" works perfectly fine
Question: I created a new virtualenv to test fuzzywuzzy. I activate my env and "pip
install fuzzywuzzy"
I create a file "main.py" with the following code:
from fuzzywuzzy import fuzz
r = fuzz.ratio("this is a test", "th... |
Cannot get button to toggle a change in pygame
Question: I am wondering why it is that my "GO" button will not toggle the
def game_start()
permanently, it toggles it while holding the button, but when you let go of
the button its goes back to the main menu?
I am also curious to if there is a way o... |
regular expression Python search
Question: I'm trying to extract some info from the source code in a webpage and I'm
having trouble figuring out how to go about it. Part of the source code is as
follows:
<th>Model #:</th>
<td>1561496564</td>
... |
Import java class in jython
Question: I am dealing with NLP in python. There is a NLP tool namely Zemberek for
turkish language. But it is written in java. So I have to use jython to be
able to import these classes. I installed jython 2.7. Also, I installed
Eclipse Mars as an IDE for java. On the Internet I found the f... |
Python multiprocessing on For Loop
Question: First of all, I know there are quite some threads about multiprocessing on
python already, but none of these seems to solve my problem.
Here is my problem: I want to implement Random Forest Algorithm, and a naive
way to do so would be like this:
def random_tr... |
Averaging values in a nested loop in python
Question: I have to perform a running average. In the code below, the input file
(stress1.txt) contains two columns of x and y values. Every y between 0.9x and
1.1x needs to be averaged. The last part of the code that goes over the two
lists is correct, in the sense that it r... |
Terminating a python text adventure
Question: so I'm writing a little text adventure and have lots of nested if statements.
However, there comes times where I want to terminate the program in one of
these if statements to give a "GAME OVER". I've tried quit() and exit(), but
at best they still output an error message:
... |
Python Doesn't Have Permission To Access On This Server / Return City/State from ZIP
Question: What I'm trying to do is retrieve the city and state from a zip code. Here's
what I have so far:
def find_city(zip_code):
zip_code = str(zip_code)
url = 'http://www.unitedstateszipcodes.org/' + ... |
Error deploying Django with ImageKit using Apache "cannot import name conf"
Question: I'm trying to deploy my Django site with Apache but I'm running into issues
with the ImageKit library. Here's the error from /var/log/apache2/error.log:
No handlers could be found for logger "django.request"
[1.2.3.... |
Django settings SECRET_KEY
Question: I have the following structure of my project
project
--project
----settings
------base.py
------development.py
------testing.py
------secrets.json
--functional_tests
--manage.py
**development.py** and **testing.py** 'inherit' fr... |
Handling same type exceptions separately in Python
Question: Say I have the following four variables:
>>> f1 = (print, 1, 2 ,3 ,4)
>>> f2 = (exit, 1, 2 ,3 ,4)
>>> f3 = (1, 2, 3, 4)
>>> f4 = 4
In a hypothetical program, I expect each of those variables to hold a tuple,
whose first item s... |
How do I make an object mutable in python?
Question: So from what I've gathered user-made classes are supposed to be mutable by
default, but I've experienced the opposite. Here's my code:
import copy
class vector:
def __init__(self, entries):
if type(entries) == list:
... |
Importing system-wide installed module into Anaconda
Question: I have an issue with module importing within Anaconda. I'm using the latest
Anaconda 3 installed in my Linux home directory in order to have the latest
jupyter, scipy, numpy and so on. I also have installed a scientific package
(Kwant) for quantum transport... |
Django URL pattern does not match with my config
Question: I'm new with Django, I'm having a problem with the url of the page
"`DetailLivre.html`" it shows :
Using the `URLconf` defined in `Ilhem.urls`, Django tried these URL patterns,
in this order:
^Bibliotheque/ ^$ [name='index']
^Bibliotheque/ ^... |
Create a single-file executable using py2exe
Question: I have written a python code which displays a window using Tkinter. It also
calls another python file present in the same folder. I converted the .py
files into a .exe file using py2exe. But i am facing the below issues:
1. The output (in dist folder) is a set o... |
PuLP not printing output on IPython cell
Question: I am using [PuLP](https://pythonhosted.org/PuLP/ "PuLP") and IPython/Jupyter
Notebook for a project.
I have the following cell of code:
import pulp
model = pulp.LpProblem('Example', pulp.LpMinimize)
x1 = pulp.LpVariable('x1', lowBound=0, cat='In... |
Executing multiple python pandas dataframe methods on one csv
Question: I'm a bit new to programming in general. I've picked up a small project to
automate some csv changes via pandas dataframe.
I've been able to figure out a few of the changes I need to make,
unfortunately, when I print the current data frame, it onl... |
How to set gunicorn to find a flask application?
Question: Please somebody help me that gunicorn find a flask application. I guess
application name is defined inside create_function() hides the application
from run.py; however, I don't know how to fix it. Here is the error when to
run gunicorn with the application:
... |
Python: ImportError happens on IDE suggestion
Question: **This is my packages structure:**
[](http://i.stack.imgur.com/PHZaf.png)
**This is my __init.py__ inside settings package:**
from settings import *
**This is my functions.py... |
Python CSV write to file unreadable (Chinese characters)
Question: I am trying to performing text analysis on Chinese texts. The program is
provided below. I got the result with unreadable characters such as
`浜烘皯鏃ユ姤绀捐`. And if I change the output file `result.csv` to `result.txt`, the
characters are correct as `人民日报社论`... |
tracking frequency of words in an ebay search result
Question: using python 3.5, what im looking to do is to go to the results page of an
ebay search by means of generating a link, save the source code as an xml
document, and iterate thru every individual listing, of which there could be
1000 or more. next i want to cr... |
How do I display the hosts inside the Google Chrome sqlite3 "cookie" database using Python
Question: I'm using Python to access the "cookie" chrome sqlite3 db to retrieve the host
keys, but getting error below
import sqlite3
conn = sqlite3.connect(r"C:\Users\tikka\AppData\Local\Google\Chrome\User Dat... |
Django: django-admin startproject ImportError
Question: I have two Python VE's one in which I created a Django project that is located
on the Desktop. I recently created another VE to start another Django project.
However, when I run `django-admin startproject projectname` within the new VE,
I get an ImportError saying... |
overflow error Plot
Question: I want do stuff with sound/ audio and music processing. Before this i created
a sample signal with a 10 second sweep. I have a simple script which have to
plot some signals. First signal is a simple sine; second a sweep; Both with
frequency just below Nyquist frequency so thats no problem.... |
How do I get the current length of the Text in a Tkinter Text widget
Question: I am writing a light webtexting application, and I'm trying to display the
current number of characters in a TKinter Text widget used for writing the
message to be sent in the webtext. The code I have at the moment can be seen
below, I'm usi... |
Integer slicing in pandas different for rows and columns?
Question: Coming from R I try to get my head around integer slicing for pandas
dataframes. What puzzles me is the different slicing behavior for rows and
columns using the same integer/slice expression.
import pandas as pd
x = pd.DataFram... |
Why is self superfluous for a method when using bottle in a class?
Question: I usually use `bottle` in a naked script:
import bottle
@bottle.route('/ping')
def ping():
return "pong"
bottle.run()
It works fine, a call to `http://127.0.0.1:8080/ping` returns `pong`. I no... |
Derived class doesn't recognise arguments of method from parent
Question: I'm trying to make a set of functions to operate easily through some data. The
problem I'm facing is: it seems to recognize and use methods from the parent
class, except one: `show()`, giving me errors about **unexpected arguments**.
Here's a sa... |
How to remove select characters from xml parse in python / django?
Question: **Context**
I am working on a django project and I need to loop through a nested
dictionary to print the values
Here's the dictionary:
> {body{u'@copyright': u'All data copyright Unitrans ASUCD/City of Davis
> 2015.', u'predictions': {u'@ro... |
Daily Hurst Exponent
Question: I am trying to estimate daily Hurst exponent values of a stock returns (e.g.
for each day to have also Hurst exponent - something like that:
<https://www.quandl.com/data/PE/CKEC_HURST-Hurst-Exponent-of-Carmike-Cinemas-
Inc-Common-Stock-CKEC-NASDAQ>).
I am using this Python code (taken fr... |
Loop over (or vectorize) variable length matrices in Theano
Question: I have a list of matrices `L`, where each item `M` is a `x*n` matrix (`x` is a
variable, `n` is a constant).
I want to compute the sum of `M'*M` for all items in `L` (`M'` is the
transpose of `M`) as the following Python code does:
fo... |
object not callable python when parsing a json response
Question: I have a response from a URL which is of this format.
'history': {'all': [[u'09 Aug', 1,5'],[u'16 Aug', 2, 6]]}
And code is :
response = urllib.urlopen(url)
data = json.loads(response.read())
print data["fixtur... |
Accessing QML TextField value in Python
Question: I have a form in QML with two TextFields. How do I access the value entered in
the fields in Python?
I'm using PyQt5.5 and Python3.
import sys
from PyQt5.QtCore import QObject, QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtQuick ... |
IP Camera Python 3 Error
Question: I am working on using Python 3 to take an IP web camera's stream and display
it on my computer. The following code only works in python 2.7
import cv2
import urllib
import numpy as np
stream=urllib.urlopen('http://192.168.0.90/mjpg/video.mjpg')
byt... |
Python 3 IP Webcamera byte Error
Question: I am working on using Python 3 to take an IP web camera's stream and display
it on my computer. The following code only works in python 2.7
import cv2
import urllib.request
import numpy as np
stream=urllib.request.urlopen('http://192.168.0.90/mj... |
Python Multiprocessing get does not timeout
Question: I'm testing some code to timeout a function call using multiprocessing with
`Process` and `Queue`. The `Queue.get()` method takes an optional timeout
parameter. I wrote the following test to confirm it throws a timeout error
when the called process takes longer than... |
python-ldap: Unable to find a callback when using GSS-API
Question: I am trying to use python-ldap on Windows to query an Active Directory server.
This is what I have so far:
import ldap
import ldap.sasl
email_address = 'user.name@host.company.com'
ldap_url = 'ldap://domain.company.com:3... |
tkinter python checkbox issues
Question: The intent of this python file is to read in a file similar to the one below,
modify the lines that have "PL" in the shape field. the issues I am having is
the OK box is bleeding into the initial file selection button. Also, the OK
button does not show up in the initial checkbox... |
Calling a C function from a Python file. Getting error when using Setup.py file
Question: My problem is as follows: I would like to call a C function from my Python
file and return a value back to that Python file. I have tried the following
method of using embedded C in Python (the following code is the C code called
... |
why unnable to do annotation adjacent to legend?
Question: I am trying to add text to a location that is adjacent to the legend. Here is
what I have tried:
import matplotlib.pyplot as plt
x = y = [1,2,3,4,5]
fig, ax = plt.subplots()
ax.plot(x,y)
leg = ax.legend(['line 1'], loc=6, frameon=... |
How to write a django view to search in database?
Question: i have been trying to make a search engine for my database(sqlite3). i have
stored name of the places in the database. And i want to show an empty form to
the user and get the input from that form and pass these as arguments to
database_table.objects.filter() ... |
Calculate date 5 days from today, adding an extra day for each day in the next 5 days that is a weekend day
Question: I am testing using Robot Framework and need to create my own Python keyword.
Taking the current date as day 0 (tomorrow as day 1), I am trying to calculate
what the date will be 5 days from today. If a... |
How do I get my tkinter picture viewer working?
Question: I've been trying to teach myself tkinter and wanted to make a program that
would find all the pictures in the directory and sub-directories of a folder
and then display them one by one with a button to either save the file into
the "Yes", "Maybe", or "Skip" fold... |
why even after adding the -url: /images in app.yaml, i can't access /images/med-9.png ,
Question: I am learning python, specifically web development using python, and am
following the course cs253 in udacity, now after performing the unit 4
excercise, i want to add an image in my html template, i have made a directory
... |
Raising exceptions with django_rest_framework
Question: I have written a view that decrypts a GPG encrypted file and returns it as
plain text. This works fine in general. The problem is, if the file is empty
or otherwise contains invalid GPG data, gnupg returns an empty result rather
than throw an exception.
I need to... |
Python overlapping timer with UDP listener
Question: I'm looking for insight on including a timer with/within the WHILE loop of a
UDP listener service. The service is part of a device auto-discovery system I
need to interact with.
The process requiring the listener has three requirements/responsibilities:
* Broadca... |
Installing disqus on django
Question: I am trying to install disqus on my django project. I have followed these
instructions:
First, add disqus to your INSTALLED_APPS. You don’t need to run syncdb as
there are no models provided.
Next, add DISQUS_API_KEY and DISQUS_WEBSITE_SHORTNAME to your settings. You
can get your... |
Playing a Lot of Sounds at Once
Question: I am attempting to create a program in python that plays a particular
harpsichord note when a certain key is pressed. I want it to remain responsive
so you can continue to play more notes (kind of like a normal electric piano.)
However, because the wav files that the notes are ... |
Python Pandas Compare 2 Large DataFrames of Text for Similarity
Question: I have two large dataframes I want to compare. I want a comparison result
capable of a column and / or row wise comparison of similarities by percent.
_This part is simple._ However, I want to be able to make the comparison
ignore differences bas... |
How to use Tensorflow Optimizer without recomputing activations in reinforcement learning program that returns control after each iteration?
Question: EDIT(1/3/16): [corresponding github
issue](https://github.com/tensorflow/tensorflow/issues/672)
I'm using Tensorflow (Python interface) to implement a q-learning agent ... |
Python numpy fill masked elements in matrix according to order in another matrix
Question: I'm trying to do a Uniform Order Crossover for a genetic algorithm. In that, I
have two 2D arrays p1 and p2 and a 2D bit array, b. p1, p2 and b are of the
same shape. I mask elements in p1 corresponding to 1s in b and elements in... |
Error iterating through file - Python
Question: I'm trying to iterate through a txt file with a long string and deleting the
double quotes(") and commas(,) and writing it in a new file but it keeps
getting a error. Please help.
Code:
from sys import argv
script, filename = argv
long_St... |
Numba 3x slower than numpy
Question: We have a vectorial numpy **get_pos_neg_bitwise** function that use a
mask=[132 20 192] and a df.shape of (500e3, 4) that we want to accelerate with
numba.
from numba import jit
import numpy as np
from time import time
def get_pos_neg_bitwise(df, mask... |
Python module import in interactive shell
Question: I moved my python module into the site-package folder along with the working
default modules, but when I choose to import my modules they come back with
this error.
>>> import go
Traceback (most recent call last):
File "<p... |
Reading a file with Fortran formatted small floats, using numpy
Question: I am trying to read a data file written by a Fortran program, in which every
once in a while there is a very small float like `0.3299880-104`. The error
message is:
>np.loadtxt(filename, usecols = (1,))
File "/home/anaco... |
Python - part of str [urllib3 data]
Question: I'm Trying to delete 2 chars from start of the str and 1 char from the end
import urllib3
target_url="www.klimi.hys.cz/nalada.txt"
http = urllib3.PoolManager()
r = http.request('GET', target_url)
print(r.status)
print(r.data)
prin... |
Checking divisibility for (sort of) big numbers in python
Question: I've been writing a simple program in python that encodes a string into a
number using [Gödel's
encoding](https://en.wikipedia.org/wiki/G%C3%B6del_numbering#G.C3.B6del.27s_encoding).
Here's a quick overview: you take the first letter of the string, fin... |
Error Spyder Python + opencv 3
Question: I have installed Opencv 3.1.4 on Spyder Python 2.7, all running on Windows
Vista 32bits.
My code is
import cv2
import sys
cascPath = "C:\opencv\sources\data\haarcascades\haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifie... |
Python real-time keyboard input
Question: I am not looking for `input()` or `raw_input()`. I am looking for what sounds
like is available in the msvcrt module, specifically `msvcrt.kbhit()` and
`msvcrt.getch()`, but am unable to get it working.
I tried example 1, here:
<http://effbot.org/librarybook/msvcrt.htm>
and ... |
SOAP client in python, how to replicate with XML
Question: I am using suds to send XML and I got my request working, but I'm really
confused by how to replicate my results using XML. I have the XML request that
my suds client is sending by using:
from suds.client import Client
ulr = "xxxxxxx"
cli... |
how to get the value of multiple maximas in an array in python
Question: I have an array
a =[0, 0, 15, 17, 16, 17, 16, 12, 18, 18]
I am trying to find the element value that has `max` count. and if there is a
tie, I would like all of the elements that have the same `max` count.
as you can see the... |
Why is my Runge-Kutta Python script defining elements of an array in this abnormal way?
Question: I am a newcomer to Python, my knowledge of the programming language is still
in its infancy, so I copied the Runge-Kutta Python script shown
[here](http://rosettacode.org/wiki/Runge-Kutta_method#Python) and modified it
for... |
Getting a legend in a seaborn FacetGrid heatmap plot
Question: How can we get legends for seaborn `FacetGrid` heatmaps? The `.add_legend()`
method isn't working for me.
Using code from [this previous
question](http://stackoverflow.com/q/31864770/1461210):
import pandas as pd
import numpy as np
i... |
Python logging - excluding submodule
Question: I have a python **main** which users various submodules. structure is like
this:
root:.
│ main.py
│
└───MyModule
file1.py
file2.py
special.py
MyModule outputs some important logs (each file does logger ... |
Importing scapy to blender
Question: I'm trying to import the scapy module into blender:
from bge import logic
import socket
from scapy.all import *
But I face this exception:
[](http://i.stack.imgur.com/LDwIf.png)
I copie... |
loading a dll in Python
Question: I am using Windows 10 and Visual Studio 2015 with Python 3.4.4 (from the
Python Software Foundation)
I want to call some functions in a DLL I wrote. I have tried several
approaches found on this forum but get one type of error or another. I have
worked from examples but may be misunde... |
Python: Why does my inner-nested while-loop continue to execute indefinitely
Question: Python 3.4.3
I am trying to create an interactive drawing program using Python and turtle.
My program runs by first asking the user to specify the length of the sides of
the shape. If the length is greater than zero, the program wil... |
Flask: Peewee model_to_dict helper not working
Question: i'm developing a little app for a University project and i need to json encode
the result of a query to pass it to a js library, i've read elsewhere that i
can use model_to_dict to accomplish that, but i'm getting this error
> AttributeError: 'SelectQuery' objec... |
Python include Scrapy from subdirectory
Question: I would like to know if there's a way that I can put Scrapy into a
subdirectory and import it. I did this with BeautifulSoup, rather than
installing it, I just drop the bs4 directory into the directory of my app, and
import it:
`from bs4 import BeautifulSoup`
In the s... |
roc curve with sklearn [python]
Question: I have an understanding problem by using the roc libraries.
I want to plot a roc curve with a python <http://scikit-
learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html>
I am writing a program which evalutes detectors (haarcascade, neuronal
networks) and wan... |
Not able to start python program via sh / crontab
Question: I try to start a python program called ocrmypdf from a script or as a cronjob.
It works perfectly from the terminal,
pi@piscan:~ $ ocrmypdf
usage: ocrmypdf [-h] [--verbose [VERBOSE]] [--version] [-L FILE] [-j N] [-n]
[--flo... |
tkinter wait_window() raising tkinter.TclError: Bad window path name
Question: I've been messing around with python's tkinter, and wrote the following code
for dialog practice:
import tkinter as tk
class Dialog(tk.Toplevel):
def __init__(self, parent, title=None):
tk.Toplevel... |
FTP Access erro : ftraise NotImplementedError NotImplementedError
Question: I am using one rhc openshift server.
So ii is installed python on it and i installed **_pyftpsync_** module on its,
so i want to connect to anther host via ftp, but i got this error:
res = self._sync_dir()
File "/var/lib/... |
Why does Python allow function calls with wrong number of arguments?
Question: Python is my first dynamic language. I recently coded a function call
incorrectly supplying a wrong number of arguments. This failed with an
exception at the time that function was called. I expected that even in a
dynamic language, this kin... |
Python not concatenating string and unicode to link
Question: When I append a Unicode string to the end of str, I can not click on the URL.
Bad:
base_url = 'https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xml&titles='
url = base_url + u"Ángel_Garasa"
pri... |
Reading/writing files in Python
Question: I am trying to create a new text file of stock symbols in the russell 2k from
one that looks like this:
[](http://i.stack.imgur.com/eM2nr.png)
All I want is the ticker symbol at the end of each line. So I have... |
How to access a remote datastore when running dev_appserver.py?
Question: I'm attempting to run a localhost web server that has remote api access to a
remote datastore using the `remote_api_stub` method
`ConfigureRemoteApiForOAuth`.
I have been using the following Google doc for reference but find it rather
sparse:
<... |
Python, assign function to variable, change optional argument's value
Question: Is it possible to assign a function to a variable with modified default
arguments?
To make it more concrete, I'll give an example. The following obviously
doesn't work in the current form and is only meant to show what I need:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.