text stringlengths 226 34.5k |
|---|
C++ destructor calling of boost::python wrapped objects
Question: Does boost::python provide any guarantee when the C++ destructor of a wrapped
object is called considering the moment of reaching the zero reference count
of the corresponding python object?
I am concerned about a C++ object that opens a file for writin... |
How to scrape PHP Ajax using Python?
Question: I'm a beginner with python, I'm trying build a python program that will scrape
product descriptions from <http://turnpikeshoes.com/shop/TCF00003>. Python has
many libraries and I'm sure many approaches to achieving my goal. I've done a
few successful scrapes using requests... |
Transform list into dictonary with counter values
Question: I have a list, containing project names:
`my_list = ['a', 'b', 'c', 'a', 'd', 'a', 'a']`
I want to put the letters into a dictonary, with the key values containing the
number, for how many time a letter is in a list:
my_dict = {'a' : 4, 'b' : ... |
Generating a CSRF token manually with Flask WTF-Forms
Question: I'd like to create and fill out a Flask WTF-Form using only python code.
However, the form doesn't automatically generate a CSRF token when I create it
with python code. Is there any way to do this manually?
The form in question:
from flask... |
Xpath - obtaining 2 nodes with 1 node having default value if missing
Question: I am using xpath in Python 2.7 with lxml:
from lxml import html
...
tree = html.fromstring(source)
results = tree.xpath(...xpath string...)
Now the problem is the xpath string and am getting quite lost in th... |
Xpath following siblings until another sibling
Question: I'm new to using Xpath. I'm trying to parse some data in Python using Xpath.
Parsing the following HTML:
<table>
<tr>
<td class="DT">29-04-14</td>
<td class="Regio">Text</td>
<td class="Md">Text</td>
... |
Python3 test import error
Question: I am using python3 to try and get a test file for sample application working
yet it keeps throwing `ImportError: No module named 'calculate'`
my file structure is:
/calculate
__init__.py
calculate.py
test/
__init__.py
calculate_test.p... |
How to cast float to string with no decimal places
Question: I'm using `openpyxl` to read values from a spreadsheet. These values are being
read as floats, I am not entirely sure why.
import openpyxl as opx
wb = opx.load_workbook(SKU_WORKBOOK_PATH, use_iterators=True, data_only=True)
ws = wb.work... |
Read text file into dictionary to be used later for adding/modifying/deleting
Question: Let me preface by saying I'm not 100% sure if using a dictionary is the best
course of action for this task but that is what I believe I need to use to
accomplish this.
I have a .txt file that is formatted like this:
... |
Python don't register in MySQL server
Question: there’s something wrong in my python script: when I try to put some data in my
database and print it, it looks like it’s working, but when I rerun the code,
or if I check the phpmyadmin, there’s no data saved in the db. Does anyone
have some idea on how to solve this prob... |
invalid syntax when using pymysql
Question: I'm learning using python with Mysql. Same query works differently between
Mysql and pymysql. For example:In mysql console I have a table named "pages"
INSERT INTO pages (title,content) VALUES ("test title","test content")
And It works. In python,I import... |
Django channels - Echo example not working
Question: I'm following the instructions in the [documentation
site](http://channels.readthedocs.io/en/latest/getting-started.html), but I
got stuck in the echo example, the websocket is created correctly and it's
connected to the server but when I send anything to the server ... |
SyntaxError in if/elif block
Question: So I tried making a basic Rock Paper Scissors game with Python 3 and random
AI.
import random
x=0
InvalidInput="Invalid Input, please use a capital letter at the start of your input"
while x==0:
AI=random.randint(1,3)
UserInput=input("Roc... |
Running bash in subprocess breaks stdout of tty if interrupted while waiting on `read -s`?
Question: As @Bakuriu points out in the comments this is basically the same problem as
in [BASH: Ctrl+C during input breaks current
terminal](http://stackoverflow.com/questions/31808863/bash-ctrlc-during-input-
breaks-current-ter... |
How can I take integer regex?
Question: I'm trying to use regex in Python for taking some parts of a text. From a text
I need to take this kind of substring '2016-049172'. So what's the equivalent
regex? Thank you very much.
Here's a piece of code:
import re
pattern = re.compile(r"\s-\s[0-9]+[0... |
Phoenix Channel sending messages from a client outside the project
Question: I wanted to send a message to my user channel of my Phoenix Application. I
have joined a user_token with the channel as `users:user_token` in the
`user_channel.ex` . I was successful doing it from another controller called
the `toy_controller`... |
formatting the return in python - print out different types of values
Question: I have the following code
$ipython
> import csv
> with open('q1_4.csv', 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter = ' ', quotechar = '|')
for row in reader:
print [tupl... |
Python Turtle mainloop() usage
Question: I have the following code from an [online
tutorial](http://openbookproject.net/thinkcs/python/english3e/events.html#an-
example-state-machines) to learn event-based programming by making a stop
light that changes state when the mouse is clicked. Here is the entirety of my
code:
... |
Scraping Edgar with Python regular expressions
Question: I am working on a personal project's initial stage of downloading 10-Q
statements from EDGAR. Quick disclaimer, I am very new to programming and
python so the code that I wrote is very basic, not even using custom functions
and classes, just a very long script th... |
REGEX in Python only matches exponent
Question: I was reading some lines from a file, which I want to match to be floats, here
is a minimal example:
import re
regex="[-+]?[0-9]+\.?[0-9]+([eE][-+]?[0-9]+)?"
string="0.00000000000000000E0 0.00000000000000000E0 0.00000000000000000E0"´
print(r... |
Uploading a file to a form using python requests
Question: Trying to write a script that fills in an online form at this
[website](http://www.formstack.com/forms/?1455656-XG7ryB28LE) and uploads a
zip file. I have looked at [the documentation](http://docs.python-
requests.org/en/latest/user/quickstart/#post-a-multipart... |
Are str() and int() time consuming in python?
Question: I face myself using a lot of this kind of structure:
for node in range(int(self.num_nodes)):
dists[str(node)] = -1
So, my questions is: what does python(3+) uses when `str()` or `int()`, for
example, are called? It just casts? It conve... |
complexity of set of nameduple lookup
Question: Hi in Python i have a namedtuple because i want to store a few values in the
same object.
A = namedtuple("A", "key1 key2 key3")
I store those A's in a registry class which holds a set()
class ARegistry(object):
def __init__... |
Python Zeep Client request throws error in xml exception
Question: When I run the following code, I keep getting the following error: `here is an
error in XML document (113, 25). ---> The string '' is not a valid Boolean
value.` I do not understand why this is happening.
[Here](http://resumeparsing.com/#ParseResume) is... |
(GPS & MySQL) No module error in python 2.7 with virtualenv running on Lubuntu
Question: I have installed the gps packages and the mysql packages using : sudo apt-get
install gpsd gpsd-clients sudo dpkg-reconfigure gpsd & sudo apt-get install
python2.7-mysqldb it shows that the packages have been successfully installed... |
Finding correct package versions using standalone Python 2.7 and Anaconda/Python 3.5 on same computer (Mac)
Question: I have been using Python 2.7 for some time on this machine; I needed to
install the Anaconda distribution with Python 3.5 for a team project.
I successfully installed Python 3.5, and now `python` point... |
Pool Multiprocessing Python
Question: Basically the issue is as follows: I have a bunch of workers that have a
function prescribed to each (the function is worker(alist) ) and am trying to
process 35 workers at the same time. Each worker reads their line from the
file (the modulo part) and should process the line using... |
Why won't it expand both tar.gz files?
Question: I have two tar.gz files, 2014_SRS.tar.gz and 2013_SRS.tar.gz. Each of the
files contains a folder called SRS, which is full of text files. I downloaded
these from an ftp server. I want to unzip them automatically in Python. This
is my code:
import re
i... |
Decoding NumPy int64 binary representation
Question: So I did a stupid thing, and forgot to explicitly type-convert some values I
was putting into an SQLite database (using Python's SQLalchemy). The column
was set up to store an `INT`, whereas the input was actually a `numpy.int64`
dtype.
The values I am getting back ... |
Error on Python serial import
Question: When I try to import the serial I get the following error:
Traceback (most recent call last):
File "C:\Documents and Settings\eduardo.pereira\workspace\thgspeak\tst.py", line 7, in <module>
import serial
File "C:\Python27\lib\site-packages\seria... |
Get tweets from local host, python, pymongo
Question: I am trying this code:
import pymongo
import json
import numpy as np
client = pymongo.MongoClient('localhost', 27017)
db = client.test
collection = db['tweets']
print ("Tweets Capturados: ", collection.count())
... |
Python - Let pip only search locally for extra packages
Question: Im trying to build an NSIS distributable, and this contains several packages.
One of them is `pyVISA-1.8` which needs the package `enum34` to work.
Now, I usually bundle all the wheels I need for the packages in the nsis
script, but when I do this for `... |
How to find an exact sequence of words in lists using Python 3?
Question: I am coding in Python 3 on a Windows platform.
I am making a function that will pass in a user's inputted sentence which my
function will then `.split()` and make it a list of each word that was in
their original sentence.
My function will also... |
Datetime format problems
Question: I'm having problems converting a dateTime from one format to another.
Mon 13 Jun 2016 10:00
should become
13/06/2016 10:00:00
However, I'm having problems with the hours minutes & seconds (Yes I realise
the seconds are not supplied - so that m... |
Can't transform image into polar. Python, OpenCV
Question: I'm trying to implement ring artefact reduction algorithm using python. The
first step is to transform image from cartesian to polar. I suppose that I can
use opencv to do that. In this topic [fast Cartesian to Polar to Cartesian in
Python](http://stackoverflow... |
Python Adding one hour to time.time()
Question: Hi i want to add one hour to Python time.time().
My current way of doing it is :
t = int(time.time())
expiration_time = t + 3600
Is this considered bad for any reasons? If so is there a better way of doing
this easily.
Answer: It's not consider... |
Python Ctypes register callback functions
Question: I ran into something very strange using Python and ctypes. I'm using Python
3.4.3. First, some background into the project:
I have compiled a custom dll from C code. I'm using ctypes to interface with
the dll. The C library is interfacing with some custom hardware. S... |
Python SQLite avoid overcrowding by deleting the last item
Question: I use sqlite with python, when insert a new row I want to delete one of the
end
conn.execute("INSERT INTO ORDERS (ORD_ID, TYPE) VALUES (?, ?)", [ord_id, type_n]);
conn.commit()
> ID ID_ORD TYPE
>
> * * *
>
> 3 136984714 0 **< ... |
Python tkinter wont display diagonal lines
Question: I recently started using Arch Linux, and after transferring a python file from
my mac to the Linux, and running it, it did not work. This is pretty common,
but, the way in which it didn't work was very strange. The program is one that
graphs equations of lines, but o... |
How to get pyPdf to work with os or glob
Question: My goal is to read a directory with several PDF files and return the number of
pages in each file using Python. I'm trying to use the pyPdf library but it
fails.
If I do this:
from pyPdf import PdfFileReader
testFile = "C:\\path\\file.pdf"
... |
Removing a row from CSV with python if data wasn't recorded in a column
Question: I'm trying to import a batch of CSV's into PostgreSQL and constantly run into
an issue with missing data:
> psycopg2.DataError: missing data for column "column_name" CONTEXT:
> COPY table_name, line _where ever in the CSV that data wa... |
Error while using w, h = template.shape[::-1]
Question: I am getting an error:
w, h = template.shape[::-1]
AttributeError: 'NoneType' object has no attribute 'shape'
My code:
import cv2
import numpy as np
img_rgb = cv2.imread('opencv-template-matching-python-tutorial... |
Python flask : No module named requests
Question: I'm having trouble using `requests` module in my flask app. I have two files
`rest_server.py` and `independent.py` at same directory level. The
`independent.py` uses `requests` module and it executes correctly if I
directly run it. But when I import `independent.py` in ... |
Tensorflow feed_dict with tensorflow.python.framework.errors.InvalidArgumentError
Question: my example is like the following:
import tensorflow as tf
import numpy as np
batch_size = 10
real_data = np.ndarray(shape=(batch_size, 1), dtype=np.int32)
for i in range(batch_size):
... |
Python loop through list and return "out of sequence" values
Question: Consider this list:
dates = [
('2015-02-03', 'name1'),
('2015-02-04', 'nameg'),
('2015-02-04', 'name5'),
('2015-02-05', 'nameh'),
('1929-03-12', 'name4'),
('2023-07-01', 'name7'),
... |
Custom Python module not importing
Question: I can't seem to get past this and do not quite understand what is happening. I
have a directory with two class files in it. Using the REPL from within that
directory I can import both files and execute their logic. From their parent
directory which main() is ran from however... |
python logging: multiple loggers error
Question: I have objects called Job which has it's own logger (each Job need to have a
log file which is represented by logging.getLogger())
The problem is I create thousands of Jobs (~4000) and they all want to create
a logger.
Traceback (most recent call last):
... |
Extracting required Variables from Event Log file using Python
Question: [](http://i.stack.imgur.com/zSGWk.png)
sample first row of event log file ,here i have successfully extracted
evrything apart from last key value pair which is attribute-
... |
Python - Remove duplicate pandas data frames from dictionary
Question: I have a dictionary containing pandas data frames that have the same column
names, and I'd like to remove duplicate data frames with identical values and
row ids.
Let's assume this is my dictionary of data frames:
>>> dd[0]
... |
OpenCV - VideoCapture(filename) works in Java but not in Python (Windows 7)
Question: I've been trying to open a video file using OpenCV and process its frames. I
have both avi file and mp4 file, the mp4 file works well in Java but in Python
(where I really need it...) it doesn't work (I keep getting None in
videocaptu... |
Python selenium drop down menu click
Question: i want to select option from a drop down menu, for this i use that :
br.find_element_by_xpath("//*[@id='adyen-encrypted-form']/fieldset/div[3]/div[2]/div/div/div/div/div[2]/div/ul/li[5]/span").click()
To select option month 4 but when i do that pyhton ... |
XLS with formula in more than one cells within a column with Python
Question: After a long day playing with lots of variants I was left with this code:
from xlrd import open_workbook
from xlwt import Workbook, Formula
from xlutils.copy import copy
rb = open_workbook("test.xls")
wb = ... |
How to count rows not values in python pandas?
Question: I would like to group DataFrame by some field like
student_data.groupby(['passed'])
and then count number of rows inside each group.
I know how to count values like
student_data.groupby(['passed'])['passed'].count()
or
... |
Cant stop the program repeating using "while" loop... Python
Question: Here's what i have so far... if you run the module and choose to play it
simply repeats the dice throw infinitely. Help?
answer=input("Would you like to play? Answer Y/N: ")
while answer == "Y" or answer == "y" or answer == "... |
Flask SqlAlchemy MySQL connection timed out due to QueuePool overflow limit
Question: Please I need help with the following error which I get on the 16th database
connection. None of the other answers on Stackoverflow seem to work:
QueuePool limit of size 5 overflow 10 reached, connection timed out, time... |
Python Multiprocessing outputting entire program
Question: I don't normally ask questions on the internet nor am i a very good
programmer, but i have been struggling with this problem for a while but i
cant fathom why it doesn't work. I'm trying to do some maths that i thought i
could do in multiple threads, the code b... |
Import tensorflow error on mac
Question: **Enviorment** :
Mac OSX 10.10
Pyhon: 2.7.10
I have following error when I was trying to `import tensorflow`
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "cred... |
Using requests function in python to submit data to a website and call back a response
Question: I am trying to use the requests function in python to post the text content of
a text file to a website, submit the text for analysis on said website, and
pull the results back in to python. I have read through a number of ... |
Creating sequence vector from text in Python
Question: I am now trying to prepare the input data for LSTM-based NN. I have some big
number of text documents and what i want is to make sequence vectors for each
document so i am able to feed them as train data to LSTM RNN.
My poor approach:
import re
... |
tkinter traceback error on python 3.5.1 windows 8.1
Question: I want to get an input data from user and put it into text file, but there's
an error as follows:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\dasom\AppData\Local\Programs\Python\Python35-32\Lib\tki... |
Tensorflow TypeError on session.run arguments/output
Question: I'm training a CNN quite similar to the one in
[this](http://stackoverflow.com/questions/37901882/tensorflow-reshaping-a-
tensor) example, for image segmentation. The images are 1500x1500x1, and
labels are of the same size.
After defining the CNN structure... |
pywinrm - running New-Mailbox powershell cmdlet remotely
Question: I've been trying to get the [pywinrm](https://pypi.python.org/pypi/pywinrm)
module to run the `New-Mailbox` Powershell cmdlet remotely. This is what I
have so far:
import winrm
ps_text = "$pass = ConvertTo-SecureString -String '%... |
Simple python script to get a libreoffice base field and play on vlc
Question: I've banged my head for hours on this one, and I don't understand the
LibreOffice macro api well enough to know how to make this work:
1) This script works in python:
#!/usr/bin/env python3
import subprocess
def play... |
Reading a serial port in python with unknown data length
Question: Hello I am trying to read data from a pic32 microcontroller configured as a
serial port.
The pic32 sends "binary" data variable in length (14 to 26 bytes long). I want
to read in the data and separate the bits then convert them to their decimal
equival... |
Spark Redshift with Python
Question: I'm trying to connect Spark with amazon Redshift but i'm getting this error :
[](http://i.stack.imgur.com/EV8RD.png)
My code is as follow :
from pyspark.sql import SQLContext
from pyspark import ... |
Unable to Process an image transformed in OpenCV via scikit-image
Question: I want to skeletonize an image using the scikit-image module for
skeletonization. This image is pre processed by OpenCV library. Given an Image
'Feb_16-0.jpg', I convert it to gray scale, perform the morphological
transformation of opening the ... |
How to use python requests with a server that has two IP addresses
Question: I have a Ubuntu server that has multiple IP addresses. As an example, how do I
set the correct IP address for outbound requests in a library like python
requests?
Answer: By default, this is not handled at application level, but by the opera... |
What is the best way to save the comments collected from Facebook using Python?
Question: I'm collecting all the comments from some Facebook pages using Python and
Facebook-SDK.
Since I want to do Sentiment Analysis on these comments, what's the best way
to save these texts, such that it's not needed any changing in t... |
grouping rows python pandas
Question: say I have the following dataframe and, the index represents ages, the column
names is some category, and the values in the frame are frequencies...
Now I would like to group ages in various ways (2 year bins, 5 year bins and
10 year bins)
>>> table_w
1 ... |
SublimeText3 cannot find Python modules (numpy) installed with MacPorts
Question: I installed Python 3.5 using MacPorts. I am trying to use SublimeText3 as an
editor. (Anything better and more integrated tan ST3 for python development??)
From the MacOSX terminal, I can 'import numpy' just fine, but SublimeText3
cannot... |
python regex preserve specified special characters only
Question: I've been looking for a way to isolate special characters in a regex
expression, but I only seem to find the exact opposite of what I'm looking
for. So basically I want to is something along the lines of this:
import re
str = "I only w... |
Exceptions using django standalone with python3
Question: Trying to use django templates in stand-alone mode. I get these exceptions
(below). New to python, wondering if anyone would be willing to help out.
Django is used for templating in a script which is not shown here. However the
exact same exceptions appear when... |
Python: Printing data only when number enters or leaves interval
Question: Currently I'm making a script that, given a set of celestial coordinates, will
tell you on the next days when that point will be visible for a specific
telescope. The criteria is simple, in the Horizontal Coordinate system,
altitude of the objec... |
ImportError: No module named spiders on mac OS using Homebrew installation package
Question: All,
I followed the following steps from scrapy.org to updated default system
packages and install scrapy, the open source framework for building spiders
found here: <http://doc.scrapy.org/en/1.1/intro/install.html>
1. I ra... |
How to save a dictionary of objects in Python?
Question: I have a Python 3.5 program that creates an inventory of objects. I created a
class of Trampolines (color, size, spring, etc.). I constantly will create new
instances of the class and I then save a dictionary of them. The dictionary
looks like this:
... |
Python 2.7 - Trying to work convert UTC string to local time taking into account DST
Question: I have a UTC time string like so
supplied_datetime = 20160711230000 -0500
This is the format
yyyyMMddhhmmss +/-hhmm
Now if I take that offset (-5hrs) from the original time it should ... |
Python Selenium - What are possible keys in FireFox webdriver profile preferences
Question: I couldn't really find this information anywhere, I am looking for a list of
possible keys that can be used in the `profile.set_preference()` API.
Here is some context:
from selenium import webdriver
from pyv... |
Installing beautifulsoup
Question: I have installed beautifulsoup for Python, but it gives me this error when I
import the library:
Traceback (most recent call last):
File "D:/Playroom/WebScraper_01.py", line 2, in <module>
from bs4 import BeautifulSoup
File "C:\Python\lib\site-packag... |
How can I make a python3 program not crash if it tries to add a string and a number together
Question: Source code
* * *
import sys
hi = input("Input a number ")
yo = input("Input a second number ")
total = int(hi) + int(yo)
def convertStr(s):
try:
... |
Check key, value of nested dictionary in python?
Question: I'm generating a nested dictionary in my program. After generating, I want to
iterate through that dictionary, and check for the dictionary key and value.
**Program-Code**
This is the dictionary I want to iterate whose value contains another
dictionary.
... |
Error was retrieving data from S3 using boto for python
Question: I'm trying to get data from Amazon S3 using boto for python.
from boto.s3.connection import S3Connection
AWS_KEY = 'MY_KEY'
AWS_SECRET = 'MY_SECRET'
aws_connection = S3Connection(AWS_KEY, AWS_SECRET)
bucket = aws_conne... |
how to get a full list from a function python
Question: I'm totally new about python. So here is my issue.
def visitdir(path):
result = []
for root,dirs,files in os.walk(path):
for filepath in files:
result = ''.join(os.path.join(root,filepath))
... |
Page doesn't redirect correctly
Question: I'm learning django with myself and when I was following the tutorial [Writing
your first Django app, part
4](https://docs.djangoproject.com/en/1.9/intro/tutorial04/) today, I met this
problem.(I'm using django 1.9.7 and Python 3.5.2 64-bit and PyCharm)
When I select a choice ... |
Does Python's logging.config.dictConfig() apply the logger's configuration settings?
Question: I've been trying to implement a basic logger that writes to a file in Python
3.5, loading the settings from a JSON config file. I'll show my code first;
`log_config.json`
{
"version": 1,
"disab... |
How to combine columns in a layout (colspan feature)
Question: I have this code:
#!/usr/bin/env python3
from PyQt5.QtWidgets import *
import sys
class Window(QWidget):
def __init__(self):
QWidget.__init__(self)
layout = QGridLayout()
... |
Creating an application with wxPython where I could navigate across several pages
Question: I would like to create an application built with wxPyhton where I could
navigate across several pages with two next and previous buttons.
Can you give me real codes examples?
Answer: What you are likely looking for is a wizar... |
Creating new matrix from dataframe and matrix in pandas
Question: I have a dataframe `df` which looks like this:
id1 id2 weights
0 a 2a 144.0
1 a 2b 52.5
2 a 2c 2.0
3 a 2d 1.0
4 a 2e 1.0
5 b 2a 2.0
6 b 2e 1.0
7 b ... |
Python - Run function with parameters in command line
Question: Is it possible to run a python script with parameters in command line like
this:
./hello(var=True)
or is it mandatory to do like this:
python -c "from hello import *;hello(var=True)"
The first way is shorter and si... |
Embedded Python does not work pointing to Python35.zip with NumPy - how to fix?
Question: Okay here's the basic example from the Python website for a simple `runpy.exe`
to run Python scripts below. It works fine using Visual Studio 2015 on x64
Windows after referencing the Python includes and linking to `python35.lib`
... |
RemovedInDjango110Warning: The context_instance argument of render_to_string is deprecated
Question: For one of the apps, I'm overloading the "delete selected objects" method in a
Django 1.9.x project which uses the Admin panel. For that, I have a code
similar to this:
from django.contrib.admin import he... |
Capitalization of filenames storing Python classes
Question: **C++**
I use a rigorous rule of capitalizing class names.
Over many years I tried to use the somewhat inconsistent rule of using
lowercase names for the files—when writing in C++.
For example, `class Stopwatch` would be in the files `stopwatch.hpp` and
`s... |
Why np.load() couldn't read my ndarray data in pickled file?
Question: I am trying to analyze a tensor data, but I could not read the data in picked
file by using np.load(). My python code is as follows:
import pickle
import numpy as np
import sktensor as skt
import numpy.random as rn
... |
Something strange happen with python multiprocess
Question: I've just tested python multiprocessing for reading file or a global variable,
but there is something strange happen.
for expample:
import multiprocessing
a = 0
def test(lock, name):
global a
with lock: ... |
If two variable values are identical then it is said to be sharing same memory
Question: If two variable values are identical then it is said to be sharing same
memory... so python follows shared memory concept ?....and if i change one
value will it change another?
Answer: See Python data model described
[here](https... |
"-bash: python2: command not found" on OS X
Question: I'm trying to use
[this](https://github.com/Tamriel/quod_libet_import_itunes_ratings) script to
import my iTunes library to another program.
At the step where I enter `python2 export_to_quod_libet.py`, I'm getting an
error message that says that the `python2` comma... |
Component not appearing in Tkinter Python interface
Question: I just start developping in Python to do some interface with Tkinter. There is
so many way to do an interface, so I would like to know if the structure of my
code is correct. Also, I can run my script without error. But, it didn't show
me the label ,Hello, w... |
Cannot find plot function in GPy library (python)
Question: I am using the [GPy](https://github.com/SheffieldML/GPy "GPy") library in
Python 2.7 to perform Gaussian Process regressions. I started by following the
tutorial notebooks provided in the GitHub page.
Sample code :
import numpy as np
import... |
convert em-dash to hyphen in python
Question: I'm converting csv files into python Dataframe. And in the original file, one
of the column has characters em-dash. I want it replaced by hyphen "-".
Partial original file from csv:
NoDemande NoUsager Sens IdVehicule NoConduteur HeureDebu... |
Python, Postgres, and integers with blank values?
Question: So I have some fairly sparse data columns where most of the values are blank
but sometimes have some integer value. In Python, if there is a blank then
that column is interpreted as a float and there is a .0 at the end of each
number.
I tried two things:
*... |
Can't access dropdown select using Selenium in Python
Question: I'm new to using Selenium in Python and I'm trying to access index data on
Barclays Live's website. Once I login and the page loads, I'm trying to select
'Custom1' from a dropdown in the page. The select object in the HTML code
associated with the list loo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.