text stringlengths 226 34.5k |
|---|
Time - get yesterdays date
Question: I'm trying to get todays and yesterdays time using Python's `time` module.
This for me works for todays date:
dt = time.strptime(time.strftime("%d/%m/%Y"),'%d/%m/%Y')
But I don't know how to get yesterdays date. I've found many tutorials where
the `datetime` mo... |
Python use dictionary keys as function names
Question: I would like to be able to use dictionary keys as function names, but I'm not
sure if it's possible. As a quick example, instead of `class().dothis(dictkey,
otherstuff)`, I'd like to have an option for `class().dictkey(otherstuff)`.
Here's a not working code exampl... |
Pass a numpy array to a C function in cython
Question: I'm wrapping a third party camera library interface with Cython so I can call
it from a python program. For the most part things work very well, but I've
hit a snag in my acquireImage() function. I've tried to create a contiguous
numpy array, pass that to the libra... |
Read all lines in file and execute in a random order
Question: I would like to create a python script that reads an input file in a random
order rather than sequentially while running through a loop, so each time the
script runs it would always run in a random order.
Is this possible?
Answer: This is certainly possi... |
Python base deployment techniques/package libraries for different environment like development, production or staging
Question: I am familiar with environment settings for Node.js using npm packages like
["settings](https://www.npmjs.com/package/settings)". This package allowed me
to import different environment settin... |
Getting the drawing off the main thread
Question: I remember seeing a post somewhere about being able to get the drawing in
python off the main thread, but I can't seem to find it. My first attempt goes
something like this but it doesn't work. It doesn't crash initially (it does
eventually) but no drawing takes place. ... |
Sort Average In A file
Question: I have a file with 3 scores for each person. Each person has their own row. I
want to use these scores, and get the average of all 3 of them. There scores
are separated by tabs and in descending order. For example:
tam 10 6 11
tom 3 7 3
tim ... |
Maya Python: How do i call on and edit attributes of an object in one function when that object was created in another function?
Question: # The Plan:
I've been working on a script for measuring the distance between 2 vertices
that the user selects and scaling up or down that the object based on a
desired length betwe... |
XLRD - Extract Data from two columns into a dict with multiple values
Question: I have an excel sheet with data that looks like this.
Column1 Column2 Column3
1 23 1
1 5 2
1 2 3
1 19 5
2 56 1
2 22 2
3 2 ... |
plain Password is logged via my python script
Question: I have a sample python script: sample.py. The script takes the argument as the
user name and password to connect to some remote server. When I run the script
sample.py --username --password , the password is being logged in linux
messages files. I understand this ... |
Default parameter doesn't work
Question: I got the following problem in Python code.
The error is:
Traceback (most recent call last): File "cmd.py", line 16, in <module>
func(b="{cmd} is entered ...") # Error here
File "cmd.py", line 5, in func
exceptMsg = b.format(errStr=errStr, deb... |
How to construct SOAP message with pysimplesoap?
Question: I'm trying to call a SOAP service from the Dutch government land register
([WSDL here](http://www1.kadaster.nl/1/schemas/kik-
inzage/20141101/verzoekTotInformatie-2.1.wsdl)) with
[PySimpleSoap](https://github.com/pysimplesoap/pysimplesoap). So far I did
this to... |
Access dictionary keys and values in pandas dataframe column
Question: I've got a simple dataframe with a column populated by a python dictionary, in
the form:
User CLang
111 {u'en': 1}
112 {u'en': 1, u'es': 1}
112 {u'en': 1,... |
Read filenames from CSV and then copy the files to different directory
Question: I have been able to write a batch file to find files and put the file paths
into a CSV. I haven't been able to figure out how to read the file locations
from the CSV and then move the files to a different storage device with the
same folde... |
SAP - Python sapnwrfc and pyrfc fail
Question: I know that the newest library to connect python and SAP is
[PyRFC](http://sap.github.io/PyRFC/), I am using Windows to develop a django
app and when I try to install the `pyrfc-1.9.3-py2.7-win32.egg` that is what
corresponds to my system, It gives me error while importing... |
Accessing .zipx with Python
Question: I'm attempting to write a very simple script that counts the number of
entries/files a given ZIP file has, for some statistics.
I'm using the `zipfile` library, and I'm running into this problem where the
library appears not to support .zipx format.
bash-3.1$ python... |
'Thread' object has no attribute '_children' - django + scikit-learn
Question: I'm having problems with a django application that uses a random forest
classifier (<http://scikit-
learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html>)
to classify items. The error that I'm receiving says:
... |
Python trouble converting milliseconds to datetime and back
Question: So I have two functions for converting python `datetime.datetime()` objects to
and from milliseconds. I cannot figure out where this is going wrong. Here's
what I'm working with:
>>> import datetime
>>> def mil_to_date(mil):
... |
Is there any smart way to combine overlapping paths in python?
Question: Let's say I have two path names: **head** and **tail**. They can overlap with
any number of segments. If they don't I'd like to just join them normally. If
they overlap, I'd like to detect the common part and combine them accordingly.
To be more s... |
Summing specific values within an array in python[Solved]
Question: I am trying to do operations with values that I have added into an array.
step 1:
Loaded a xls file with xlrd library and created an array.
<http://i.imgur.com/Ig6Lz3L.png>
Here is the code.
import xlrd
datafile = "data.xls"
... |
Python "import comtypes.client" calls pwd.py indirectly
Question: I have not a deep experience in Python. Working on last application found very
interesting thing. I put the script with name pwd.py in the same directory as
the main script. I created pwd.py to test some basic modules and methods, no
more purpose.
But I... |
Python Sorting and Organising
Question: I'm trying to sort data from a file and not quiet getting what i need. I have
a text file with race details ( name placement( ie 1,2,3). I would like to be
able to organize the data by highest placement first and also alphabetically
by name. I can do this if i split the lines but... |
Python 2.6: Get input from bash command with Popen and communicate and store as variable
Question: I need to get the input from a Bash command and store it as a Python variable
(sprice; a single float). On Python 2.7 the following works well:
bashCommand = "curl -s 'http://download.finance.yahoo.com/d/qu... |
Create own IVR that will access Database
Question: I'm currently interning with a company and have been tasked with researching
some methods of using telephony. The goal is to provide our clients with the
ability to call in and through an IVR-prompted questions, get information
back. The information will be from our da... |
Reading row data from CSV file
Question: I'm currently trying to create a program that reads a CSV file, more
specifically row data (data in lines across)
**Sampledata.csv:**
['Time', 'Date', 'Color ', 'Name']
['1pm', '01-01-99', 'blue', 'jack']
['2pm', '02-02-99', 'green', 'kevin']
['3pm',... |
pip broke after uninstalling a module
Question: I used pip uninstall on shapely and got an exception, which I did not save.
Since then every pip or easy install command will pop this exception :
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
... |
curve fitting with lmfit python
Question: I am new to python and trying to fit data using lmfit. I am following on the
lmfit tutorial here: <http://lmfit.github.io/lmfit-py/parameters.html> and
this is my code (based on the code explained in the above link):
import numpy as np
import lmfit
impor... |
WebSocket broadcast to all clients using Python
Question: I am using a simple Python based web socket application:
from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer
class SimpleEcho(WebSocket):
def handleMessage(self):
if self.data is None:
... |
Python/Eclipse/wxPython -- CallAfter undefined variable? callAfter is as well -- confused
Question: I'm using Eclipse Luna and the latest pydev with it. I have wxpython 3.0
installed. First, I could import wx and I tried in the console to print
**version** , perfect, but then I do import wx.lib.pubsub -- it says
unreso... |
Defining a custom pandas aggregation function using Cython
Question: I have a big `DataFrame` in pandas with three columns: `'col1'` is string,
`'col2'` and `'col3'` are `numpy.int64`. I need to do a `groupby`, then apply
a custom aggregation function using `apply`, as follows:
pd = pandas.read_csv(...)
... |
python curl execute command with parameter
Question: I need to execute the following command
curl -v -H 'X-Auth-User: myaccount:me' -H 'X-Auth-Key: secretpassword' http://localhost:8080/auth/v1.0/
when I run this from terminal it works perfectly. and gives me result like
following
* ... |
Can't pass parameters to function from WxPython Menu Item
Question: I'm having trouble getting sensible output when I try to bind menu buttons to
a function. First, I pass a few items to create a menu in my application:
imported_applications = ["foo", "bar"]
application_menu = wx.Menu()
... |
running process in background on hangs PHP page
Question: I have a PHP page that launches a python script, yet the PHP page hangs until
the script finishes. Is there a way to run the script that will not make it
hang?
**PHP code**
The problem occurs in case alarm_on. All other cases work fine.
<?php
... |
Flask-Assets not working at all... = Insanity
Question: I have simply tried setting up _[flask-assets](http://flask-
assets.readthedocs.org/en/latest/)_ (based on _webassets_), however just can't
get it to work.
I have the standard setup;
* python virtualenv
* pip to install the bare essentials (flask, flask-asse... |
Python3 and Sqlite3 can't Insert
Question: I am trying to write a function to do a simple insert. Here is what I have
tried so far
#! /usr/bin/env python3
#import
import sqlite3 as lite
#trying an insert version 1 (does nothing)
def createTableTask():
"""
Create a new ta... |
issue saving uploaded files in django
Question: I tried the simplest way of saving files in my django media folder this is my
.conf apache wsgi configuration file
ServerName testapplication.com
WSGIScriptAlias / /home/seba/git/CNBLUE/supergestor/supergestor/wsgi.py
WSGIPythonPath /home/seba/git/C... |
Copy certain files from one folder to another using python
Question: I am trying to copy only certain files from one folder to another. The
filenames are in a attribute table of a shapefile.
I am successful upto writing the filenames into a .csv file and list the
column containing the list of the filenames to be trans... |
Python - Optional Command Line Argument
Question: I would like to have an option -n, that will allow users to specify a size of
a list. The default will be 30. So:
./findNumberOfPlayers.py -n10
I haven't done any command line arguments with python before but am confused
with how to include `-n10` w... |
Finding the simplest way to wrap a double->double C function to Python
Question: I need to wrap a C function of interface
double foo(double)
to python, so that in python console
>>foo_py(2.9)
should give me the double value of foo(2.9). Eventually, I use the exported
foo_py in ... |
Print a dictionary in python
Question: I have a file that looks like this:
5 John Doe
3 Jadzia Kowalska
13 Heather Graham
44 Jane Doe
I read it in, split it up and save it up in a dictionary with the number as
the key and a list as the value and each word as a separate string in the
li... |
read from stdin python
Question: I am trying to take a filename input from the first command line argument and
if there is none then to read from `stdin` but for some reason my `if`
statement does not seem to be working. I have pasted it below. Any help would
be greatly appreciated.
import sys
... |
Opening a password protected page in Python and Selenium WebDriver
Question: I am trying to open this local IP in my web browser.
from selenium import webdriver
driver = webdriver.Firefox()
url = 'http://165.269.261.210/source/'
page = urllib.urlopen(url)
when I run the a... |
what is the equivalent of ni si in IDA python?
Question: I want to make a simple IDA-python script which sets a break point to some
specific memory address then continue and filter break point hits with some
rules..
In case of gdb. I can make a gdb script such as
bp 0x12345678 c if ~~~ else ~~~ ni si ... c ...
how c... |
how to pass argparse arguments to another python program in unchanged condition?
Question: I am working on a script under which some sub program will run. for example
**test.py** is the main program and under that **test1.py** , **test2.py** ,
**test3.pl** will run and I need to pass the arguments from the main
program... |
Tweepy: Filtering stream gives multiple errors
Question: I'm trying to run the following script from this tutorial [tulane.edu-
twitter](http://www.tulane.edu/~howard/CompCultES/twitter.html) and I'm
getting the following errors:
File "GetTextFromTwitter.py", line 61, in <module>
stream.filter(... |
how can I serve external folder with twisted?
Question: there is a captiveportal script in python that works with twisted but it load
the portal page in the script (search CAPTIVE_TEMPLATE)
<https://github.com/bendemott/captiveportal/blob/master/captiveportal>
how can I load a full index.html folder with js and css a... |
Possible to execute Python bytecode from a script?
Question: Say I have a running CPython session,
Is there a way to run the data (`bytes`) from a `pyc` file directly? _(without
having the data on-disk necessarily, and without having to write a temporary
pyc file)_
Example script to show a simple use-case:
... |
Import csv as list in python
Question: I am trying to import a csv file as a list:
file = open('curr.csv', 'rt')
f = file.read()
f = f.split(',')
print(f)
The csv file is only 'GBP, USD' so I want the list ['GBP', 'USD']. However the
result I get is:
['GBP', 'USD\n']... |
How to specify gamma distribution using shape and rate in Python?
Question: With [Scipy gamma
distribution](http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.stats.gamma.html),
one can only specify shape, loc, and scale. How do I create a gamma variable
with shape and rate?
Answer: Inverse scale (`1/sc... |
Why is my computation so much faster in C# than Python
Question: Below is a simple piece of process coded in `C#` and `Python` respectively
(for those of you curious about the process, it's the solution for Problem No.
5 of [Project Euler](https://projecteuler.net/problem=5)).
My question is, the `C#` code below takes... |
wxPython - Set Items in ListCtrl and Get Selected Item
Question: I have the following code for creating a ListCtrl called "browser list".
self.browserList=wx.ListCtrl(panel, pos=(20,150), size=(250,100), style.wx.LC_REPORT|wx.BORDER_SUNKEN)
self.browserList.InsertColumn(0, '')
self.browserList.In... |
Python 3 - Multiprocessing - Queue.get() does not respond
Question: I want to make a brute force attack and therefore need some speed... So I came
up to use the multiprocessing library... However, in every tutorial I've
found, something did not work.... Hm.. This one seems to work very well,
except, that I whenever I c... |
Python: Logging into website with python using GET request
Question: I'm using python 3.4.3 and I'm trying to login to OKCupid using requests.
The page that my code returns is the initial login page, not the page a user
would see after successfully logging in. I have tried looking at several
answers on here and other ... |
Bad request API google Python
Question: I was getting usually send the request by the code below, but out of nowhere
he started the mistake and do not want to send. Could anyone help me?
The code:
import urllib2
import json
url = "https://www.googleapis.com/qpxExpress/v1/trips/search?k... |
Multiprocessing code works upon import, breaks upon being called
Question: In a file called `test.py` I have
print 'i am cow'
import multi4
print 'i am cowboy'
and in `multi4.py` I have
import multiprocessing as mp
manager = mp.Manager()
print manager
I am confu... |
Use size in Python
Question: I created a ndarray array in python
temp = np.array([1, 2, 3, 4])
To measure the length of this array, I can use
temp.size
or
np.size(temp)
both return 4. But I'm wondering what's the difference between the two
expressions? Also... |
How do I create a CSV file from a model & then add it as an email attachment?
Question: I'm trying to generate a CSV from an object stored in my database and then add
the csv to an email as an attachment.
I'm using Django 1.7 & Python 2.7.
I'm getting this error with the following code: "AttributeError: '_csv.writer'... |
Missing SimpleJson Module
Question: I have Ansible playbook run against a machine with CentOS release 5.6 (Final).
I have simplejson installed in the target machine and the module is importable
from the python interpreter. But still my playbooks fails with the below
error.
Error: ansible requires a json ... |
how to parse a particular output like in rows as the output comes in a clubbed way in python?
Question: When I run the code below, the output comes as such. I need the output to show
in rows **and** only the values under the caption.
Desired output:
caption : 3PAR
3PAR
Actual output:... |
How to install Python 2.7 on Ubuntu 9.10
Question: Now we're developing our software on the customer side, and there is:
maestro@UIServer:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"
system is installed. We... |
Unable to identify link class
Question: I am very new to Programming and Python and am trying out to code this simple
scraper to extract all the profile URLs of therapists from this page
[http://www.therapy-
directory.org.uk/search.php?search=Sheffield&services[23]=1&business_type[individual]=1&distance=40&uqs=626693]... |
py2exe: Skip archive ignored
Question: I'm probably making a stupid error somewhere but i can't find it. Here is my
setup.py:
import py2exe
from distutils.core import setup
setup(windows=['Gui.py'],
data_files = [('Drivers', ['Drivers/chromedriver.exe',
... |
Extracing song length and size from HTML using Python
Question: I am making a simple mp3 down-loader from a Website. In doing so I stuck while
parsing time and size of audio:
<div class="mp3-info">
1.69 mins
<br/>
2.33 mb
</div>
Now I need to parse `1.69 mins` and `2.33 mb` ... |
Python script to harvest tweets to a MongoDb works with users but not hashtags. Any ideas why not?
Question: I'm playing around the Twitter API and am in the process of developing a
script to pull all Tweets with a certain hashtag down to a local mongoDB. I
have it working fine when I'm downloading tweets from users, b... |
Python: Read values into empty array and then back into file
Question: I would like to read numbers from a txt file (highscore.txt) in python and
assign those values to an empty array (highscores).
Then I'd like to add another value into the array and then overwrite the file
with the new values in the array.
I've put... |
Trouble with downloading images using Scrapy
Question: I'm getting the following error when attempting to download images using a
spider with Scrapy.
File "C:\Python27\lib\site-packages\scrapy\http\request\__init__.py",
line 61, in _set_url
raise ValueError('Missing scheme in request ... |
How to improve the speed of my selection process, python
Question: **Edit: Due to errors in my code i updated with my oldest, but working code**
I get a list of speed recordings from a database, and I want to find the max
speed in that list. Sounds easy enough, but I got some requirements for any
max speed to count:
... |
Splitting time by the hour Python
Question: I have a dataframe df1 like this, where starttime and endtime are datetime
objects.
StartTime EndTime
9:08 9:10
9:10 9:35
9:35 9:55
9:55 10:10
10:10 10:20
If endtime.hour is not the same as startime.hour, I would like to split times
like this
StartTime EndTime
9:... |
Disable Cache/Buffer on Specific File (Linux)
Question: I am currently working in a Yocto Linux build and am trying to interface with
a hardware block on an FPGA. This block is imitating an SD card with a FAT16
file system on it; containing a single file (cam.raw). This file represents
the shared memory space between t... |
Calculating the averages for each KEY in a Pairwise (K,V) RDD in Spark with Python
Question: I want to share this particular Apache Spark with Python solution because
documentation for it is quite poor.
I wanted to calculate the average value of K/V pairs (stored in a Pairwise
RDD), by KEY. Here is what the sample dat... |
re.sub in python : verbose mode does not work with replacement pattern?
Question: Is there any way to get around this limitation of re.sub? It is not fully
functional for verbose mode (with back reference here) in the replace pattern;
it does not eliminate whitespace or comments (yet it does interpret
backreferences pr... |
mollview command not returning plot image
Question: I'm new to healpy and I'm trying to plot the following in iPython27:
import numpy as np
import healpy as hp
NSIDE = 32
m=np.arange(hp.nside2npix(NSIDE))
hp.mollview(m, title="Mollview image RING")
This does not return an image... |
Python crawler is not crawling all sites
Question: I'm trying to get links from websites through this code
import requests
from bs4 import BeautifulSoup
def get_links(max_pages):
page = 1
while page <= max_pages:
address = 'http://hamariweb.com/mobiles/nokia_mobile-pho... |
extracting entities of tweets using opencalais
Question: I have to extract entities from tweets using tool opencalais. My code is:
# this code is based on: http://www.flagonwiththedragon.com/2011/06/08/dead-simple-python-calls-to-open-calais-api/
import urllib, urllib2
##### set API key... |
List comprehension assignment/comparison fails after 256
Question: I tried to find the performance difference between slice assignment and
regular assignment for lists. Here is the code:
import time
N = 1000
a = list(range(N))
b = list(range(N))
time1 = time.time()
for i ... |
How to convert timezone to country code in Python?
Question: I used this
from pytz import country_timezones
But It doesn't include below timezones
> Africa/Asmera, Africa/Timbuktu, America/Argentina/ComodRivadavia,
> America/Atka, America/Buenos_Aires, America/Catamarca,
> America/Coral_Harbour, A... |
Reduce list of lists if entries match
Question: I have a list in python which looks like
[['boy','121','is a male child'],['boy','121','is male'],['boy','121','is a child'],['girl','122','is a female child'],['girl','122','is a child']]
I want to reduce the list based on the first 2 entries in each... |
How to apply a dict in python to a string as opposed to a single letter
Question: I am trying to output the alphabetical values of a user entered string, I have
created a dict and this process works, but only with one letter.
* If I try entering more than one letter, it returns a `KeyError: (string I entered)`
* I... |
How to use top-level arguments with subparsers in argparse
Question: In Python's argparse, how do you implement top-level arguments while still
using commands implemented as subparsers?
I'm trying to implement a `--version` argument to show the program's version
number, but argparse is giving me `error: too few argume... |
I cannot click the Admin button nested inside the iFrame
Question: I am automating our Web application using Python with Selenium Webdriver. I
log into the application and I want to click the Administration button. When i
run my code it cannot find the Administration button by my Xpath. I have tried
a few different way... |
Pygame: Colliding Rectangle on multiple other rectangles
Question: I am attempting to create a game in which a block moves back and forth until
the player presses space. Upon which, the block jumps to the next line up and
stops.
Currently i am having problems with the collision code.
The error being thrown up by the ... |
Why is this lxml.etree.HTMLPullParser leaking memory?
Question: I'm trying to use lxml's HTMLPullParser on Linux Mint but I'm finding that the
memory usage keeps increasing and I'm not sure why. Here's my test code:
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_funct... |
gammu receive sms message python fails
Question: I have found a script on this website
<http://wammu.eu/docs/manual/smsd/run.html>
#!/usr/bin/python
import os
import sys
numparts = int(os.environ['DECODED_PARTS'])
# Are there any decoded parts?
if numparts == 0:
print... |
Python tarfile and zipfile producing archives with different MD5 for 2 identical files
Question: I am trying to ensure that 2 archives with the same files inside produce the
same MD5 checksum.
For example, file1.txt and file2.txt have identical content, the only
difference between them is _creation time_. However, the... |
BeautifulSoup (bs4) parsing wrong
Question: Parsing this sample document with bs4, from python 2.7.6:
<html>
<body>
<p>HTML allows omitting P end-tags.
<p>Like that and this.
<p>And this, too.
<p>What happened?</p>
<p>And can we <p>nest a paragraph, too?</p></p... |
TypeError in dictionary
Question: I am trying to pull specific values from a dictionary but my program keeps
throwing a TypeError on some values from the dictionary. Can someone tell me
why?
**python program**
import csv,os,re,sys
input_dict = csv.DictReader(open("./MCPlayerData/AllPlayerData2.... |
how do you test private static method in module in python
Question: we have a module of static methods in our python app. these methods use a lot
of private (e.g: "__do_sub_task2(**args)") I would like to write unit tests
for these private static methods within this module, but I am getting refernce
errors.
is there a... |
Little assistance with my tic-tac-toe program
Question: I need some help with my tic-tac-toe game that I created in Python 3. Have a
look at my fun program and try it out. After that, please help me creating a
`while` statement in my program. **That is while the user choice of square if
filled, you should continue to a... |
How to use Matlab's imresize in python
Question: I'm transferring Matlab's `imresize` code into python. I found the scipy's
`imresize`, but I get a different results from Matlab.
How to get the same results as Matlab by python.
Python/scipy `imresize`
from scipy.misc import imresize
import numpy as... |
Using an instance on form "doesn't raise an HttpResponse object" even though the object exists in the database
Question: I'm trying to fetch forms for floorplans for individual property's. I can
check that the object exists in the database, but when I try to create a form
with an instance of it I receive this error:
... |
Facebook not consistently scraping information as per OG meta tags
Question: I automatically post adverts for people's jobs on member's facebook pages
using Python's facebook module. I have applied for and got Facebook's
authority to do this. Now when I post to most people's pages, the image and
description are not bei... |
Node.JS onoff not picking up GPIO correctly
Question: I'm building a simple infrared breakbeam circuit to plug into my RPi 2. I have
some working code in python that successfully picks up when my infrared beam
is broken, but I want to use node.js instead of python.
Here is my python code, nice and simple:
... |
separate a string 2 by 2 using Python3 macadress format
Question: i want to use a function like "{}".format (variable)
so i can transform a string like: "
> A1B345FS
" And i want to have something like: "
> A1:B3:45:FS
" i am not able to use a while or a for.
Can i use .join (variable) ????
Answer: I think the... |
Cannot import MySQLdb on Windows with Anaconda Python Stack
Question: I recently installed mysql-python with these methods but no one worked;
* conda install mysql-python
* pip install mysql-python
* easy_install mysql-python
* I followed [this](http://stackoverflow.com/questions/26705890/cannot-import-mysqldb... |
How to import module and use the methods in python
Question: I am trying to learn oops in python and I've created a class object. I am
trying to import the module and use the methods that I've defined in it. I am
learning from the book, Practical Programming. I've tried various things but
no success. Any help shall be ... |
Run pythons as .exe files without python installed
Question: I'm trying to run a python file on a system without python installed. I'm
using py2exe, which gives me a .pyc file which runs fine on my system, but
when I give it to a friend without python it tells him Windows can't run the
file.
My `setup.py` file contain... |
Python get value from input element with lxml xpath
Question: i want to make paypal cURL login, so i need auth value. i try to get auth
value from html source with this python code
import requests
import lxml.html
import StringIO
from xml.etree.ElementTree import ElementTree
r = requests.... |
Linear Regression in Python
Question: I am a brand new to programming and am taking a course in python. I was asked
to do linear regression on a data set that my professor gave out. Below is the
program I have written (it doesn't work).
from math import *
f=open("data_setshort.csv", "r")
dat... |
Python Flask SQL Register Login Page "hash must be unicode or bytes, not long"
Question: Im trying to create a login / register page. My register page works and I see
the information and hashed passwords added. When I try to login, I get "hash
must be unicode or bytes, not long" flashed. Please help!
... |
How to check if a date has Passed in Python (Simply)
Question: I have looked around to see if I can find a simple method in Python to find
out if a date has passed.
For example:- If the date is `01/05/2015`, and the date; `30/04/2015` was in-
putted into Python, it would return True, to say the date has passed.
This ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.