text stringlengths 226 34.5k |
|---|
Receiving unknown strings lengths?
Question: So I'm converting a Python program I wrote to Erlang, and it's been a long
time since I used Erlang. So I guest I'm moved back to beginner level. Anyways
from experience every language I use when dealing with sockets have send/recv
functions that always return the length of ... |
NLTK: sentiment analysis: result one value
Question: So sorry for posting this, as the answer probably is in either this: [NLTK
sentiment analysis is only returning one
value](http://stackoverflow.com/questions/15106032/nltk-sentiment-analysis-is-
only-returning-one-value)
or this post: [Python NLTK not sentiment calc... |
Is it possible to restrict access to globals for a block of code in python?
Question: I would like users of my program to be able to define custom scripts in python
without breaking the program. I am looking at something like this:
def call(script):
code = "access modification code" + script
... |
What's wrong with maths script?
Question: Sorry if this is a beginner mistake but... I'm a beginner. Here's the script:
num1 = input("Num1:");
num2 = input("Num2:");
try:
val = int(num1)
except ValueError:
print("ERROR : Num1 is not a number!")
val2 = inf(num2)
... |
Why is views method not being invoked?
Question: I have a web directory with `urls.py` in a directory (RazorWare_Web) as
follows:
from RazorWare_Web.views import home
urlpatterns = patterns('',
url('/', home.index, name="index"),
url(r'^razor... |
How can I get my Python script to work using bash?
Question: I am new to this site so hopefully this is the correct location to place this
question.
I am trying to write a script using python for Linux, that:
1. creates a file `file.txt`
2. appends the output of the `'lsof'` command to `file.txt`
3. read each l... |
IPython notebook stops evaluating cells after plt.show()
Question: I am using iPython to do some coding. When I open the notebook and run some
codes by doing SHIFT+ENTER it runs. But after one or two times, it stops
giving any output. Why is that. I have to shutdown the notebook again open it
and then it runs for few t... |
Python prime numbers generators in terminal
Question: I have this code:
# Developing a program to generate all prime numbers
def gen_primes():
n = 2
primes = set()
while True:
for p in primes:
if n%p == 0:
break
... |
pattern to dictionary of lists Python
Question: I have a file like this
module1 instance1(.wire1 (connectionwire1), .wire2 (connectionwire2),.... ,wire100 (connectionwire100)) ; module 2 instance 2(.wire1 (newconnectionwire1), .wire2 (newconnectionwire2),.... ,wire99 (newconnectionwire99))
Ther wi... |
How can python do imports after I clear sys.path - Import precedence
Question: I have a python module named Queue that conflicts with the default queue in
python.
While trying to force the import of the default queue, I tried to simply clear
sys.path.
I was of the understanding that the imports are looked up from sys... |
Connecting between existing .db to Postgres using pgAdmin
Question: Completely new to SQL.
I've created a db in Python using SQLAlchemy, now I want to connect/import it
to postgres, using pgAdmin III. How can I do it?
Answer: Postgres can restore databases from file by pg_restore. It can handle files
that is just a... |
Python Octal Escape String
Question: I'm doing a web application login automation. The web app prefix and suffix
few octal escaped character with password , make md5 hash of the password at
client side and send to server.
So when I Md5 encrypt the string using Java Script, I get below result.
The webapp uses <https:/... |
Insert multiple images in a single PDF according to image.coordinates - Python
Question: I have a image path's and corresponding coordinates as a dict. Ex: {'coords':
[u'530,88,592,99'], 'filepath': 1.jpg}, {'coords': [u'7,12,152,85'],
'filepath': 2.jpg}, {'coords': [u'448,12,594,86'], 'filepath': 3.jpg} I would
like t... |
Python: how to get a number followed by a specific key word from a string
Question: Let's say I have a string like this:
Benchmark\r\n\tRunning for engine innodb\r\n\tAverage number of seconds to run all queries: 0.374 seconds\r\n\tMinimum number of seconds to run all queries: 0.374 seconds\r\n\tMaximum ... |
__init__ and instance show different values for instance attributes
Question: I am attempting to create a subclass of `Response` from the "Requests" library
for Python. When I execute the following with Python 2.7.6 and Requests 2.5.3:
import requests
class Page(requests.Response):
# A P... |
Python: why is random.randint(1,100) returning two values?
Question: I'm trying to work through python assignments because I already know java and
C#, and managed to place out of the python class in my college with my AP
Computer Science score.
This is a SetTitle function that I have created. The Write function has
al... |
Send python email using SMTP with a subject
Question: I am trying to send an email in Python using SMTP, with a From address, To
address, BCC address, subject, and message. I have the email sending, and it
even sends to the BCC as it should, the only issue is that the **message** of
the email says:
To: e... |
Difference between send(None) and Next()
Question: By redefining the yield statement to be an expression in [PEP 342-- Coroutines
via Enhanced Generators](https://www.python.org/dev/peps/pep-0342/) powerful
new functionality was added to Python. David Beasley has an excellent
presentation on Python coroutines [A Curiou... |
Replace all the values in a certain column with certain values using csv reader Python
Question: This is the question continous from my previous question. Thank to many
people, I could modify my code as below.
import csv
with open("SURFACE2", "rb") as infile, open("output.txt", "wb") as outfile:
... |
Split string using regular expression, how to ignore apostrophe?
Question: I am doing a spell check tutorial in Python and it uses this regular
expression:
import re
def split_line(line):
return re.findall('[A-Za-z]+(?:\`[A-Za-z)+)?',line)
I was wondering if you could help me change thi... |
import module from a different directory
Question: I have a project within which we write scripts for standalone utilities, in
whatever language possible.
These scripts are separated on a team basis; as I work for the feeds team we
keep everything in the feeds folder.
Now we are trying to take our frequently used mod... |
Python 2.7 : Remove elements from a multidimensional list
Question: Basically, I have a 3dimensional list (it is a list of tokens, where the first
dimension is for the text, second for the sentence, and third for the word).
Addressing an element in the list (lets call it mat) can be done for example:
mat[2][3][4]. Tha... |
xlrd error message
Question: I'm trying to use `xlrd` to manipulate an `.xls` file as follows:
>>> import xlrd
>>> workbook = xlrd.open_workbook('6h.xls')
And I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wayne-szalinsk... |
Passing a list of randomForest objects back to R with rpy2
Question: I am trying to combine a number of random forest models using rpy2. The
`combine` command in R looks fairly straight forward but I am not sure how to
pass the RF objects from python to R.
Simple example:
import pandas as pd
import ... |
How to use vcvarsall.bat in Python for NMake
Question: I'm trying to make a python script to make some generation of MakeFile with
CMake. I'm newbie in Python and just know the basic.
My script runs well but I can't use following command `"cmake
-DCMAKE_BUILD_TYPE=Debug -G"NMake Makefiles" ..\\..\\graphics"` because i... |
CertificateError: hostname doesn't match
Question: I'm using a proxy (behind corporate firewall), to login to an https domain.
The SSL handshake doesn't seem to be going well:
CertificateError: hostname 'ats.finra.org:443' doesn't match 'ats.finra.org'
I'm using Python 2.7.9 - Mechanize and I've g... |
Trying to install virtualenvwrapperwith pip3
Question: I am working to set up a django project on ec2 with an Ubuntu 14.4 LTS
instance. I want to write my code using python 3 and django. I've been advised
that the best way to do this is to use virtualenvwrapper. I tried:
ubuntu:~$ sudo pip3 install virtu... |
Job scheduling for data scraping on Python
Question: I'm scraping (extracting) data from a certain website. The data contains two
values that I need, namely **(grid) frequency value** and **time**.
The data on the website is being updated every second. I'd like to
continuously save these values (append them) into a li... |
replace headers in csv file and writing selected columns using python 2.7
Question: On a weekly basis, I need to replace the header in a csv file (that has a date
dependent name) and delete two of the columns. I though the easiest way would
be to write a new csv file with the pertinent information(i.e. without columns
... |
Python relative import of an importable module not working
Question: I need to use the function MyFormatIO which is a part of the neo library. I
can successfully import neo and neo.io BUT I cannot use the MyFormatIO
function. `import neo.io` doesn't spit out any errors but `from neo.io import
MyFormatIO` returns `NameE... |
How to get read excel data into an array with python
Question: In the lab that I work in, we process a lot of data produced by a 96 well
plate reader. I'm trying to speed up the process by writing a script that will
calculate the percent cytotoxicity from light absorbance (the easy part :])
and output a bar graph using... |
datetime.now in python different when running locally and on server
Question: I am using Heroku to run some python code.
The code that i have written uses a predefined time like example: **16:00**
and compares that with the current time and the calculates the difference like
this:
now = datetime.datetim... |
py2neo: py2neo.packages.httpstream.http.SocketError: timed out - execute, stream or Transactions?
Question: First of all. I'm sorry if this is not complicity structured. I'm just not
sure where to start or end, but did my best to give you as many information as
possible.
I work on a AWS M3.large, py2neo 2.0.4 and neo4... |
How to insert unescaped html fragment in Beautiful Soup 4
Question: I have to parse some nasty government created html
(<http://www.spokanecounty.org/detentionservices/inmateroster/detail2.aspx?sysid=84060>)
and to ease my pain I would like to insert some html fragments into the
document to wrap some content into more ... |
How to decompress zip files across a Windows folder in Python
Question: I have a large folder having 900+ sub-folders, each of which has another
folder inside it which in turn has a zipped file. Its like -
-MyFolder
\-----MySubfolder
\---------MySubSubfolder
\-------------MyFile.zip
How can I decompress all t... |
odeint from scipy.integrate in Python giving wrong result?
Question: I am trying to solve the ivp y'=-y-5 * exp(-t) * sin(5 t), y(0)=1, using the
following code:
%pylab inline
%matplotlib inline
from scipy.integrate import odeint
def mif(t, y):
return -y-5*exp(-t)*sin(5*t)
... |
Load CSV file with Spark
Question: I'm new to Spark and I'm trying to read CSV data from a file with Spark.
Here's what I am doing :
sc.textFile('file.csv')
.map(lambda line: (line.split(',')[0], line.split(',')[1]))
.collect()
I would expect this call to give me a list of the two f... |
Displaying only the highest of a person's 3 most recent scores, saved in a .txt file
Question: I am trying to learn the fundamentals of using Python for a personal project.
I have created a program which asks the user ten geographical questions, and
then saves their score to a .txt file, in this format:
... |
ImportError from different apps
Question: I am importing the models from different apps but I am getting this error and
I am not sure why this is occurring.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Pyt... |
Print to an empty file in python 3
Question: can someone tell me why in python 3.4.2 when I try
import codecs
f = codecs.open('/home/filename', 'w', 'utf-8')
print ('something', file = f)
it gives me an empty file?
Previously it was working well, but only suddenly it stopped printing to ... |
Python/Django Calculate Expiration for Model
Question: I have been unsuccessfully trying to calculate an expiration hour/minute for a
Django model that I have. Here is the base code I am working with:
class Bribe(models.Model)
date_offered = models.DateTimeField()
def expiration(self... |
Tor Stem - To Russia With Love Connection Issues
Question: I am trying to get the [To Russia With Love
tutoial](https://stem.torproject.org/tutorials/to_russia_with_love.html) from
the Stem project working.
from io import StringIO
import socket
import urllib3
import time
import socks... |
PyQt5 focusIN/Out events
Question: I am using Python 3.4 and Qt 5 for the first time. It's easy and I can
understand most of functionality which I need. But (there is always "but") I
don't understand how to use `focusOut`/`clearFocus`/`focusIn` events.
Am I right that old way:
QObject.connect(self.someW... |
Making Python game server sockets visible for outside world?
Question: How can i connect by my 80.xxx.xxx.xxx ip (from internet)
My ports are enabled but the game client just dont see any server on
80.xxx.xxx.xxx ip i think the problem is in the server code.
Note: The game client-server connection works perfect on LA... |
Writing code to codes.db incorrectly
Question: I am trying to make a random code generator in python that writes to a
database. I have the codes generating and writing to the database, but instead
of adding full codes to the database it loops through letters. Here is my code
for the code generator:
impor... |
python connect to postgresql with libpq-pgpass
Question: I read there is a more secure way to connect to postgresql db without
specifying password in source code using
**<http://www.postgresql.org/docs/9.2/static/libpq-pgpass.html>**. But
unfortunatelly I was not able to find any examples of how to import it to my
pyth... |
Python Sqlite3 - Data get overwritten
Question: When ever i try to insert data to my database, it's like it simply just
overwrite whole file or not saving it correctly. My thoughts about this script
was that if i ran it multiple times it would output this:
(1, 126)
(2, 127)
(3, 126)
(4, 127)
... |
Passing results to depending on job - python rq
Question: How do I pass the result of a job to a job that depends on it?
What I currently do is passing id of the first job to the second,
first = queue.enqueue(firstJob)
second = queue.enqueue(secondJob, first.id, depends_on=first);
And inside `... |
Parse xml with python
Question: I'm trying to parse a XML document with Python, this is my code:
from xml.dom import minidom
xmldoc = minidom.parse("aula.xml")
hosts = xmldoc.getElementsByTagName("host")
for host in hosts:
address = host.getElementByTag("address")
... |
Bi-variant interactive function plotting using IPython
Question: I want to plot two functions, say sine and cosine, with different frequencies
--- so the first variable is the function to plot and the second is it
frequency. I want to have a selector widget that selects the function and a
slider that chooses the freque... |
Maya, PYTHON: how do i select all but one in a list?
Question: # how do i deselect all objects except for my last selection?
When I'm working with 2 objects there's no problem because all i have to do is
toggle list[0] which would be first object that i selected (this is how i have
it working below).
im... |
Can't get my sprites to collide?
Question: I feel like I've tried everything, and I'm getting pretty freaking tired of
this now.... I'm a python and pygame noob trying to make my own game from
scratch without looking at tutorials, but i don't know how to solve this, i
must have missed something.
Here is my statement t... |
Send message to a Python Script
Question: I'm trying to write a little python program for shutdown or Reboot my
Raspberry PI, drived by a button connected to an GPIO. The program can show
the current status of the raspberry PI (Booting,Running,Halting,Rebooting) via
two leds. The python program is executed as daemon, s... |
Stitching images together Opencv -Python
Question: My program takes in an image and crops the image into seperate images
according to the scale parameter, e.g. scale = 3 produces 9 images of equal
size. I then work out mean rgb of each cropped image and set all pixel values
in the image equal to the mean rgb value.
I ... |
Compiling .py-file to .exe in Python 3.3
Question: I can't figure get py2exe working.
I wish to convert this test.py to test.exe:
test.py code:
print("Hello World!")
**EDIT:**
Apparently I used python 2.x approach. When I instead used the 3.3 command:
py -3.3 -m py2exe.build_exe ... |
python :- can't start new thread
Question: i need to know why when i run the below code it gives me this error
Traceback (most recent call last):
File "C:\Users\moksh\Desktop\moksh.py", line 29, in <module>
server_B_thread.start()
error: can't start new thread
Code:
... |
Getting the index information of a specific string in a nested list? In python 3
Question: So I have a list with lots of nested lists in which include a students name
and their test score, I was wondering how to retrieve the index (position) of
the sub list that contains a specific students scores by searching with the... |
Can you change the color of the turtle pen in a while loop using a list?
Question: I want to know if you could change the color of the python turtle pen when a
while loop iterates and continue to change everytime the while loop iterates.
So far I have this but want to make it change color too.
from turtl... |
Count occurrences of item in JSON element
Question: I'm using Python to parse the UK police API. What I want is to analyse the
JSON response I'm getting in order to calculate how many times a certain
offence occurs. This is an example of a response from the API.
{
category: "anti-social-behaviour... |
How print python method documentation using inspect or __doc__ method
Question: I have following code :
import os
import imp
import sys
import inspect
import urlparse
from cgi import escape
def get_module(ClassName, Path):
fp, pathname, description = imp.find_module(C... |
How to get around the pickling error of python multiprocessing without being in the top-level?
Question: I've researched this question multiple times, but haven't found a workaround
that either works in my case, or one that I understand, so please bear with
me.
Basically, I have a hierarchical organization of function... |
Selenium (from Python) hangs if I close my browser window
Question: If I start Selenium from Python and close the browser window, my script hangs
the next time I try to get the WebDriver to do something. Note that I'm
closing the browser _window_ while leaving the browser itself open--I'm on a
Mac, and it's possible fo... |
ImportError: Module use of python27.dll conflicts with this version of Python
Question: Im currently trying to make a python script for Harris Corner Detection, and I
keep getting this error no matter what other articles/fixes I find. Thanks for
any help you can give.
Edit: Its the first line of the code that gives th... |
Run python behave from python instead of command line
Question: Is there any way to run python behave from within python and not via command
line?
default usage: run behave command in base folder with features/steps
desired usage: call a function (or have a certain import) which executes the
behave tests in a specifi... |
Python, not able to append to a list from a recursive function
Question: I am in the mid-way of writing a code to find all possible solutions of a
input similar like `"a&b|c!d|a"`, where a,b,c,d all are booleans and &-`and`,
|-`or` !-`not` are the operators. By solution I mean the set of values of
these variables which... |
How do I correctly write a CSV file on individual rows and columns?
Question: I am producing a small recipe input and output program in **Python** , however
I am having trouble writing the ingredients to a **CSV** file. I am trying to
print each item of a list to a comma separated file, using this code:
... |
Maya Python: OptionMenu Selection With Button
Question: I'm new to python in Maya and I'm trying to build a UI which can generate
shapes and transform them. The problem I think lies in the ObjectCreation
function but I'm not to sure. So far this what I've got:
import maya.cmds as cmds
#check to ... |
Python Debugging Using Pdb
Question: I'm using a interactive graphical Python debugger with ipdb under the hood
(Canopy's graphical debugger). The script I am working on has multiple
imported modules and several calls to their respective functions. Whenever I
attempt a debugging run, execution gets stuck somewhere with... |
Multilevel JSON diff in python
Question: Please link me to answer if this has already been answered, my problem is i
want to get diff of multilevel json which is unordered.
x=json.loads('''[{"y":2,"x":1},{"x":3,"y":4}]''')
y=json.loads('''[{"x":1,"y":2},{"x":3,"y":4}]''')
z=json.loads('''[{"x":3,... |
PHP calling python not working
Question: I'm having issues getting a python script to run through PHP. I can run my
python script manually with no problems, but cannot run it through PHP. I am
calling the PHP script from a web page that I want to execute a python script.
I have searched all over to try and figure this ... |
Calculating distance between two elements only in the array in python
Question: So I have two questions: First I'm trying to print my array that contains 1004
elements but it's printing only the first 29 elements and then jumping to 974
to continue printing. How can I get the full array of 1004 elements?
This is my co... |
python mysql connector query returns none
Question: I am having an issue with mysql connector. I did search for quite a while, but
have found nothing.
If I execute the first file that just has the query, it works as expected. But
if I try to make a db class and put the query in there, it returns None. I
have taken out... |
PythonNet FileNotFoundException: Unable to find assembly
Question: I am trying to execute a Python script that uses Python For .Net
(<https://github.com/pythonnet/pythonnet>) to load a C# library called
"Kratos_3.dll" which is in the same folder as the script but the file cannot
be found.
I have installed clr using "p... |
Python script not iterating through array
Question: So, I recently got into learning python and at work we wanted some way to make
the process of finding specific keywords in our log files easier, to make it
easier to tell what IPs to add to our block list.
I decided to go about writing a python script that would take... |
NoReverseMatch at /rango/ newbie got stuck in tango w django tutorial
Question: The error message debug mode:
> NoReverseMatch at /rango/ Reverse for 'category' with arguments '('other-
> frameworks',)' and keyword arguments '{}' not found. 1 pattern(s) tried:
> ['rango/category/(?P\w+)/$'] Request Method: GET Request... |
Installing pygame for python 3.x, getting difficulties
Question: I have just installed the latest version of python, 3.4.3 32 bit and the
corresponding pygame. I get this error when importing pygame
>>> import pygame
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
... |
Python script for EC2 snapshots, use datetime to delete old snapshots
Question: I am a beginner with Python and I have written a python script which takes a
snaphot of a specified volume and then retains only the number of snapshots
requested for that volume.
#Built with Python 3.3.2
import boto.ec2
... |
import matplotlib.pyplot gives ImportError: dlopen(…) Library not loaded libpng15.15.dylib
Question: [I am aware that this exact same question has been asked
before.](http://stackoverflow.com/questions/27281943/import-matplotlib-pyplot-
gives-importerror-dlopen-library-not-loaded-libpn) I did follow the
instructions gi... |
charmap codec cant encode characters in position xx - xx
Question: I am trying to use unicodecsv python library in python 2.7.x
import codecs
import unicodecsv
def read(self, path):
with codecs.open(path, "rb", encoding = "utf-8") as f:
r = unicodecsv.reader(f, encoding =... |
Python: Mocking a context manager
Question: I don't understand why I can't mock NamedTemporaryFile.name in this example:
from mock import Mock, patch
import unittest
import tempfile
def myfunc():
with tempfile.NamedTemporaryFile() as mytmp:
return mytmp.name
... |
Build STASM with OpenCV for iOS
Question: I'm trying to build stasm for iOS for facial recognition, using OpenCV.
The steps I'm doing are:
* Build OpenCV for iOS (python opencv/platforms/ios/build_framework.py ios)
* Download the build script from here: <https://github.com/juan-cardelino/stasm>, and edit the CMak... |
Running background tasks in Meteor.js
Question: This is my scenario:
1. Scrape some data every X minutes from example.com
2. Insert it to Mongodb database
3. Subscribe for this data in Meteor App.
Because, currently I am not very good at Meteor this is what I am going to do:
... |
Python 2.7: Running a python file within a package
Question: I have three folders:
/main
__init__.py
main.py
/p1
__init__.py
p1.py
/p2
__init__.py
p2.py
However some parts of `p1` depend on `p2` and the way in which I i... |
numpy array casting ruled not 'safe'
Question: Indexing one numpy array with another - both are defined as dtype='uint32'.
Using numpy.take to index and get an unsafe casting error. Not come across
this before. Any idea what is going on?
Python 2.7.8 |Anaconda 2.1.0 (32-bit)| (default, Jul 2 2014, 15:13... |
Extended APDUs and T=0/1 communication protocols
Question: I have a JCOP V2.4.2 R3 java card that it is mentioned in its datasheet "The
card support both `T=1` and `T=0` communication protocols"
I have also an ACR38 smart card reader that it support both T=0 and T=1
protocols. (I have T=0 communication with one card s... |
Unit testing bottle py application that uses request body results in KeyError: 'wsgi.input'
Question: When unit testing a bottle py route function:
from bottle import request, run, post
@post("/blah/<boo>")
def blah(boo):
body = request.body.readline()
return "body is %s" % body
... |
Why some eigen vector signs from C++ Armadillo are different from Python and R
Question: I was wondering why the sign of the elements in the eigen vectors from
Armadillo is the opposite from other languages like Python (i.e. numpy) and R.
For example:
C++
using namespace arma;
vec eigval;
... |
Pexpect eats bash prompt
Question: This expect script launches a bash shell that includes the prompt:
#! /usr/bin/env expect
spawn -noecho "bash"
expect "$ "
send "echo 'Hello, "
interact
e.g. `user@host:/path/to/working/directory$ echo 'Hello,`
I tried doing th... |
Qt 5.4 Ctrl+Z shortcut conflict in Python? Doesn't work until its button has been pressed
Question: In Qt Designer 5.4, I have a QPushButton and have set its shortcut to
`Ctrl`+`Z`. I'm using pyuic5 to turn it into Python code. This is the
resulting line in the Python code:
self.quickTextUndoButton.setSh... |
Code signing in Mac with Perl scripts compiled with PAR::Packer fails
Question: Does anyone have experience getting compiled Perl binaries to code sign on
OSX? When trying to compile a Perl script in PAR, it returns an error when I
try to code sign it. I've gotten around this error by not trying to code sign
it as a bi... |
Matrix multiplication using slicing. Python
Question: I have the following code:
from numpy import *
a = random.rand(3,4)
b = random.rand(4,2)
c = linspace(0,0,6)
c.shape = (3,2)
for i in range(a.shape[0]):
for j in range(b.shape[1]):
for k in range(b.shape[0]):
... |
Why I only get the last output in my output file?
Question: I tried to find particular columns based on a list of column's name by using
pandas in python 2.7. For example,
>>>df = pd.read_csv('database.csv')
A,B,C,D,E,F,G # A to G columns in database
1,2,3,4,5,6,7
>>>name_list = pd.r... |
AppEngine urlfetch validate_certificate=False/None not being respected
Question: In the AppEngine developer appserver I am getting an error like this:
SSLCertificateError: Invalid and/or missing SSL certificate for URL ...
when I am making a fetch like this to an `https` server with a self-signed
c... |
Django. ImportError. Cannot import Model
Question: This is weird. I can't find the error. I can't run the server (or anything)
cause I get an error:
ImportError: cannot import name Libro
So these are the models:
perfiles.models.py-
from django.db import models
from django.contri... |
python3 - can't pass through autorization
Question: I need to build webcrawler for internal usage and I need to login into
administration area. I'm trying to use requests lib, tried this ways:
import urllib.parse
import requests
base_url = "https://target.url"
data = ({'login': 'log... |
Assigning variables and sending to database once all values assigned python
Question: This is my first python script. I am trying to get data from an Arduino, read
it on a Raspberry Pi and save it to the database. The code works separately (I
can assign the variable correctly and send the data to the database but can't... |
Merge multiple csv files and add a new column
Question: I have a bunch of csv files that i need to merge into one file but with an
additional date column
xxxxx20150216.csv
xxxxx20130802.csv
xxxxx20130803.csv
xxxxx20130804.csv
I am using the following code from
(<http://cbrownley.wordpress.com/2014/03/09/pythons-vo... |
Python program that stops looping and gets stuck randomly
Question: I've been trying hard to learn Python for some time now and I'm stuck trying
to make this simple program work.
As you can see, what I'm trying to do is get 4 values to 'battle' until one is
left. It goes fine and dandy until anywhere from loop #11 to ... |
Creating a line plot in python using data from a-for loop
Question: I have some previous code which will print out
'The number for january is x' - etc, throughout one year.
I'm trying to plot the x vs the months using this:
import matplotlib.pyplot as plt
for m, n in result.items():
print '... |
'utf-8' codec can't decode byte reading a file in Python3.4 but not in Python2.7
Question: I was trying to read a file in python2.7, and it was readen perfectly. The
problem that I have is when I execute the same program in Python3.4 and then
appear the error:
'utf-8' codec can't decode byte 0xf2 in posi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.