text stringlengths 226 34.5k |
|---|
Can I add arguments to python code when I submit spark job?
Question: I'm trying to use `spark-submit` to execute my python code in spark cluster.
Generally we run `spar-submit` with python code like below.
# Run a Python application on a cluster
./bin/spark-submit \
--master spark://207.184.1... |
Python regular expression to change date formatting
Question: I have an array of strings representing dates like '2015-6-03' and I want to
convert these to the format '2015-06-03'.
Instead of doing the replacement with an ugly loop, I'd like to use a regular
expression. Something along the lines of:
str... |
Attribute error python tkinter
Question: I am trying to make a calculator using a class and (Im quite new to this) this
code keeps telling me AttributeError: 'Calculator' object has no attribute
'clear'and when I run my code, everything inside the class doesn't work. What
can I do to fix my code?
class C... |
Methods of creating a structured array
Question: I have the following information and I can produce a numpy array of the
desired structure. Note that the values x and y have to be determined
separately since their ranges may differ so I cannot use:
xy = np.random.random_integers(0,10,size=(N,2))
Th... |
Conditional average in Python
Question: I am having a problem manipulating my excel file in python. I have a large
excel file with data arranged by date/time. I would like to be able to average
the data for a specific time of day, over all the different days; ie. to
create an average profile of the _gas_concentrations_... |
Python 2.7 & ANTLR4 : Make ANTLR throw exceptions on invalid input
Question: I want to catch errors like
line 1:1 extraneous input '\r\n' expecting {':', '/',}
line 1:1 mismatched input 'Vaasje' expecting 'Tafel'
I tried wrapping my functions in try-catch but, as expected, these errors are... |
Add a list of regions to Vimeo using PyVimeo in django
Question: I have a django app in which i am using
[`PyVimeo`](https://pypi.python.org/pypi/PyVimeo/0.3.0) module to connect and
upload videos etc., to `Vimeo`
The actual vimeo api to post the region data was
[here](https://developer.vimeo.com/api/playground/ondema... |
Apache Thrift Python 3 support
Question: I compiled my test.thrift file using:
thrift -gen py test.thrift
Then i tried to import the created files:
from test.ttypes import *
When I use Python 2.7 the import works but with Python 3.4 it raises
Traceback (mos... |
How to exchange one-time authorization code for access token with flask_oauthlib?
Question: I'm building an API with the [Python Flask framework](http://flask.pocoo.org/)
in which I now receive a "one-time authorization code" from an app which I
supposedly can exchange for an access and refresh token with the Gmail API... |
Django ImportError: No module named middleware
Question: I am using Django version 1.8 and python 2.7. I am getting the following error
after running my project.
Traceback (most recent call last):
File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run
self.result = application(self.env... |
hello world in wxPython gets no reaction at all, no frame, no return **SOLVED**
Question: First foray into python GUI and I'm using thenewboston tutorial. First lesson
with a basic frame, I get an error that wx.PySimpleApp() is depreciated and I
follow the instructions here to change it to wx.App(False). No errors come... |
Sklearn joblib load function IO error from AWS S3
Question: I am trying to load a pkl dump of my classifier from sklearn-learn.
The joblib dump does a much better compression than the cPickle dump for my
object so I would like to stick with it. However, I am getting an error when
trying to read the object from AWS S3.... |
Making a post request in python for scraping
Question: My goal is to be able to access the data from a website after inputting
information in a field and hitting submit. I'm using Httpfox to grab which
values are needed to "post". I included a screenshot of that below the code.
#SECTION 1: import modules... |
Google Datastore API Authentication in Python
Question: Authenticating requests, especially with Google's API's is so incredibly
confusing!
I'd like to make authorized HTTP POST requests through python in order to
query data from the datastore. I've got a service account and p12 file all
ready to go. I've looked at th... |
Using python to find specific pattern contained in a paragraph
Question: I'm trying to use python to go through a file, find a specific piece of
information and then print it to the terminal. The information I'm looking for
is contained in a block that looks something like this:
\\Version=EM64L-G09RevD.0... |
List files on device
Question: I'm learning Python and I'm trying to list a directory on a USB device from
Windows
import os
#dirname = "C:\\temp\\" # works fine
dirname = "\\mycomputer\\WALKMAN NWZ-B133 \\Storage Media\\Music\\"
x = os.listdir(dirname)
print x
There IS a space af... |
Python: Displaying an object's implementation source
Question: I've been tasked with something a bit unusual and unexpectedly puzzling -
Display the source code of a particular class's implementation of a method.
In [1]: class Demonstration:
...: def cost():
...: return 42
... |
python how to serve multiple tcp clients with input from single udp port?
Question: I have a python TCP server that listens for incoming data requests. As soon as
someone connects to it, the server starts serving data to that client. The
data it serves comes in via UDP on some port.
The question is, how can I serve th... |
Reading an image with OpenCV, altering the pixels and returning the new image
Question: I'm using Python, OpenCV and Numpy to read a black and white image. I then
iterate over each pixel using numpy.nditer and either change the pixel to 255
(if it is greater than 128), or change it to 0. Through some testing, I think
I... |
Finding the corresponding sample fraction for a predicted response in classification trees Python 2.7
Question: I know how to fit a tree using `sklearn`. I also know how to use it for
prediction using either `predict` or `predict_proba`. However, for prediction
I want to get the (raw) sample fractions rather than the p... |
ffmpeg in Python subprocess - Unable to find a suitable output format for 'pipe:'
Question: Trying to burn subs into video with ffmpeg via Python. Works fine in the
command line, but when calling from Python subprocess with:
p = subprocess.Popen('cd ~/Downloads/yt/; ffmpeg -i ./{video} -vf subtitles=./{s... |
re.findall printing the full text on a line of tekst
Question: I got the following code:
import urllib
import re
html = urllib.urlopen("http://jshawl.com/python-playground/").read()
lines = [html]
for line in lines:
if re.findall("jesseshawl", line):
print li... |
'module' object has no attribute '_strptime' with several threads Python
Question: I'm getting this error `'module' object has no attribute '_strptime'` but only
when I use several threads. When I only use one it works fine. Im using python
2.7 x64. Here there us the reduced function i'm calling
import d... |
Error on deploying Flask application using wsgi on apache2
Question: I am having a problem deploying a flask application on apache2 using mod_wsgi.
Error log and config files follow. I always get internal server error. This is
very similar to [How to solve import errors while trying to deploy Flask using
WSGI on Apache... |
Use OrderedDict or ordered list?(novice)
Question: (Using Python 3.4.3) Here's what I want to do: I have a dictionary where the
keys are strings and the values are the number of times that string occurs in
file. I need to output which string(s) occur with the greatest frequency,
along with their frequencies (if there's... |
Python pandas concatenate: join="inner" works on toy data, not on real data
Question: I'm working on topic modeling data where I have one data frame with a small
selection of topics and their scores for each document or author (called
"scores"), and another data frame with the top three words for all 250 topics
(called... |
Write to csv python Horizontally append Each time
Question: I Wrote this Piece of code which scrapes Amazon for some elements using page
URL, Now i want to add a csv function which enables me to append horizontally
CSV columns With Following varibles :- ( Date_time, price, Merchant,
Sellers_count ) Each time i run the ... |
Python, url parsing
Question: I have url e.g: "<http://www.nicepage.com/nicecat/something>" And I need parse
it, I use:
from urlparse import urlparse
url=urlparse("http://www.nicepage.com/nicecat/something")
#then I have:
#url.netloc() -- www.nicepage.com
#url.path() -- /nicecat/something... |
Improve reCaptcha 2.0 solving automation script (Selenium)
Question: I've written a python with selenium code to solve [new behaviour
captcha](http://scraping.pro/no-captcha-recaptcha-challenge/). But something
is lacking as to fully imitate user behaviour: the code works to locate and
click on a captcha, yet after tha... |
Python:requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
Question: I encounter this error when I'm trying to download a lot of pages from a
website. The script is pieced up and modified from several other scripts and
it seems that I am rather unfamiliar with Python and programming.
The... |
py.test to test Cython C API modules
Question: I'm trying to set up unit tests for a Cython module to test some functions
that do not have python interface. The first idea was to check if `.pyx` files
could directly be used by `py.test`'s test runner, but apparently it only
scans for `.py` files.
Second idea was to wr... |
How to make Python go back to asking for input
Question: So I want the program to go back to asking for the input once it has
completed.
I've asked this in reddit and gone through quite a many similar threads here
and so far the answer seems to be loops if true perform x. But what is the
command for the program to go ... |
Scrapy 4xx/5xx error handling
Question: We're building a distributed system that uses Amazon's SQS to dispatch
messages to workers that run scrapy spiders based on the messages' contents.
We (obviously) only want to remove a message from the queue if its
corresponding spider has been run successfully, i.e. without enc... |
Python Cursor to Csv using csv.writer.writerows
Question: I'm currently trying to write the results of a MySQL select statement to a
csv.
I'm using MySQLdb to select data, which returns a cursor.
I'm then passing that cursor into a function that writes it to a csv:
def write_cursor_to_file(cursor, path... |
Patch a method outside python class
Question: I am interested in patching a method which is called by another method in one
file. Example - original.py file contains -
def A():
a = 10
b = 5
return a*b;
def B():
c = A()
return c* 10
I want to write unit test... |
Allen Brain Institute - Mouse Connectivity API and Mouse Connectivity Cache examples
Question: I'm trying to follow the [Mouse Connectivity
sdk](http://alleninstitute.github.io/AllenSDK/connectivity.html) and get their
two examples working.
`pd` returns None or all projection signal density experiments. Why might this... |
How can I process data after a specific line in python 2.6?
Question: I have a script that basically reads a text file and creates 8 lists. It works
perfectly if it reads the file from line 1. I need it to start reading the
text file from line 177 to line 352 (that is the last line).
This is my script and the change. ... |
How to know a group of dates are daily, weekly or monthly in Pandas Python?
Question: I have a dataframe in Pandas with the date as index. "YYYY-MM-DD" format. I
have a lot of rows in this dataframe which means a lot of date indexes.
For all of these dates, most of them are daily continuous, some of them are
weekly da... |
Comparing two variables with 'is' operator which are declared in one line in Python
Question: According to the [Documentation](https://docs.python.org/2/c-api/int.html):
> The current implementation keeps an array of integer objects for all
> integers between `-5` and `256`, when you create an int in that range you
> ... |
webbrowser.open_new_tab or webbrowser.open not working in ubuntu 14.04
Question: New tab with provided url is not opening in Ubuntu 14.04 Same code works in
Mac OS X Yosemite
I have flask installed on both Ubuntu 14.04 and Mac Yosemite Both have python
2.7.6 installed
Below is the source code:
import w... |
How to use change desktop wallpaper using Python in Ubuntu 14.04 (with Unity)
Question: I tried this code:
import os
os.system("gsettings set org.gnome.desktop.background picture-uri file:///home/user/Pictures/wallpapers/X")
where `user` is my name and `X` is the picture.
But instead of changi... |
Regex/Python - why is non capturing group captured in this case?
Question: Each element of this raw data array is parsed by regex
['\r\n\t\t\t\t\t\t',
'Monday, Tuesday, Wednesday, Thursday, Friday, Saturday:',
' 12:00 pm to 03:30 pm & 07:00 pm to 12:00 am\t\t\t\t\t',
'\r\n\t\t\t\t\... |
Tests in subdirectory
Question: In Django 1.8, I have an app with this setting:
app
|- tests/
| |- test_ook.py
| |- __init__.py
|- models.py
|- __init__.py
...
When I run `python manage.py test -v 2 app`, I get this error:
ImportError: 'tests' module... |
Untangle re.findall capturing groups: 'list' object has no attribute 'join'
Question: This function highlights certain keywords in a string with color. `Fore.CYAN`
and `Fore.RESET` are from the
[Colorama](https://pypi.python.org/pypi/colorama) module.
Is there a way to insert `regex` instead of the list `["This", "wor... |
Increment Alphabet Python
Question: I have a list like this
['AX95', 'BD95']
I need to expand the list starting from `AX95` to `BD95` like this
['AX95', 'AY95', 'AZ95', 'BA95','BB95','BC95','BD95']
My current code works fine for single alphabets like
['A95', 'D95... |
UnicodeEncodeError in Django Project
Question: Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/djan... |
Curve fitting with broken power law in Python
Question: Im trying to follow and re-use a piece of code (with my own data) suggested by
someone named @ThePredator (I couldn't comment on that thread since I don't
currently have the required reputation of 50). The full code is as follows:
import numpy as np... |
python how to know which tag exactly is not closed in xml
Question: I have an xml, and I validate if it is really a good formatted xml like this:
try:
self.doc=etree.parse(attributesXMLFilePath)
except IOError:
error_message = "Error: Couldn't find attribute XM... |
How does one retrieve a c# byte array (Byte[]) from IronPython?
Question: I have a c# function that I can call from IronPython. The function returns a
byte array that I'd like to convert to a string for display and compare.
Python is telling me to pass the input parameter - (out Byte[] DataOut), below
- as type "Stron... |
Midrule in LaTeX output of Python Pandas
Question: I'm using Python Pandas.
I'm trying to automate the creation of LaTeX tables from excel workbooks. I so
far have the script complete to create the following dataframe:
Date Factor A Factor B Total
Person A 01/01/2015 A ... |
cx_Freeze exe results in sqlalchemy.exc.NoSuchmoduleError with psycopg2 at run time
Question: Edit: What tools can I use to see what packages/file the executable is trying
to find when it tries to access the psycopg2 package? Perhaps that can help
profile where things are going wrong.
I have a python script that runs ... |
Python Tkinter Error
Question: I have tried to work with the Tkinter library, however, I keep getting this
message, and I don't know how to solve it.. I looked over the net but found
nothing to this specific error - I call the library like this:
from Tkinter import *
and I get this error -
... |
Python re.findall fails at UTF-8 while rest of script succeeds
Question: I have this script that reads a large ammount of text files written in Swedish
(frequently with the åäö letters). It prints everything just fine from the
dictionary if I loop over `d` and `dictionary[]`. However, the regular
expression (from the r... |
How do I append multiple CSV files using Pandas data structures in Python
Question: I have about 10 CSV files that I'd like to append into one file. My thought
was to assign the file names to numbered data_files, and then append them in a
while loop, but I'm having trouble updating the file to the next numbered
date_fi... |
Am I using pickle correctly?-Python
Question: I am a beginner in Python and therefore am not sure why I am receiving the
following error:
> TypeError: invalid file: []
for this line of code:
> usernamelist=open(user_names,'w')
I am trying to get an input of a username and password, write them to files,
and then rea... |
how to make multiple bar plots one within another using matplotlib.pyplot
Question: With reference to the bar chart shown as answer in this link
[python matplotlib multiple
bars](http://stackoverflow.com/questions/14270391/python-matplotlib-multiple-
bars)
I would like to have green bar inside blue bar and both these... |
Displaying live scorecard on linux desktop
Question: I have written a python script which displays all the live matches scores. I
wish to display the score on my desktop rather than in terminal. I also wish
to update the score card every 5 minutes or so. Here is the python script:
import xml.etree.cEleme... |
Updating Attributes of Class as Parameters Changes: How to Keep Brokerage Account Class up-to-date?
Question: How does one keep the attributes of an instance of a class up-to-date if the
are changing moment to moment?
For example, I have defined a class describing my stock trading brokerage
account balances. I have de... |
Can't install jpeg because conflicting ports are active: libjpeg-turbo
Question: I am running into an issue with libjpeg-turbo trying to install vsftpd with
Mac Ports. I'm running on OS X 10.10.5.
David-Laxers-MacBook-Pro:phoenix_pipeline davidlaxer$ conda -V
conda 3.16.0
David-Laxers-MacBoo... |
Python/Selenium: Not able to find dynamically-generated element (button), Error: "Element could not be found"
Question: I'm trying to post text and hyperlink combinations on multiple Facebook groups
for my online business promotion.
The problem with my code is: when I pass a hyperlink and some text to
`send_keys` and ... |
Checking number is prime in python, why check up to int(sqrt(n)-1)) not int(sqrt(n))
Question: new to Python here. I am trying to understand how this function works to check
prime numbers:
from itertools import count, islice
from math import sqrt
def is_prime(n):
if n < 2: return False
... |
Create Matrix from a csv file - Python
Question: I am trying to read some numbers from a .csv file and store them into a matrix
using Python. The input file looks like this
> Input File
>
>
> B,1
> A,1
> A,1
> B,1
> A,3
> A,2
> B,1
> B,2
> B,2
>
The input is to be manipulated... |
Python bit list to byte list
Question: I have a long 1-dimensional list of integer 1's and 0's, representing 8-bit
binary bytes. What is a _neat_ way to create a new list from that, containing
the integer bytes.
Being familiar with C, but new to Python, I've coded it in the way I'd do it
with C: an elaborate structure... |
Error while dumping out data from sqlite3
Question: I have used **sqlite3_connection.iterdump()** method to dump the sqlite3 the
database.
I have written a module in python that dumps out the sqlite3 tables. The
module works fine if I run it locally in my machine.
And, After creating a python package of the module us... |
Ipython notebook on 2 columns
Question: I'd like to have to have cells of a python notebook on 2 columns, for writng
annotations next to code (for example, instead of inserting 2 cells below, I
would insert I insert a cell on the right and a cell below on the left) I know
that it's possible to use custom css for changi... |
Best data structure to use in python to store a 3 dimensional cube of named data
Question: I would like some feedback on my choice of data structure. I have a 2D X-Y
grid of current values for a specific voltage value. I have several voltage
steps and have organized the data into a cube of X-Y-Voltage. I illustrated
th... |
Pymongo threading error while connecting to remote server from google app engine
Question: I have deployed a Flask application on Google App Engine. I am connecting to
MongoDB hosted at google compute engine using pymongo.
Here is my snippet:
from pymongo import MongoClient, ASCENDING, DESCENDING
... |
Python smtplib Name or service not known
Question: i was making a simple daemon in python which takes a mail queue and delivers
them to the recipients. Everything is working pretty good except from the
`smtplib` which is actually the most important part.
# What happens?
When im running the script im getting the follo... |
Separate get request and database hit for each post to get like status
Question: So I am trying to make a social network on Django. Like any other social
network users get the option to like a post, and each of these likes are
stored in a model that is different from the model used for posts that show up
in the news fe... |
Plotting a graph in python
Question: I'm new to python and want to plot a point on graph in python..
X_cord=int(raw_input("Enter the x-coordinate"))
Y_cord=int(raw_input("Enter the y-coordinate"))
I could just figure out this much.
Answer: Have a look at [matplotlib](http://matplotlib.org), a... |
What can axis names be used for in python pandas?
Question: I was excited when I learned that it is possible name the axes of pandas data
structures (panels, in particular). I named my axes now some plots are
labelled and the axis names show up in `mypanel.axes`.
So then I thought, hm, seems like I should be able to u... |
Debugging error 500 issues in Python EVE
Question: What is the best way to debug error 500 issues in Python EVE on the resources?
I'm having a problem with my PATCH method in one of my item end points. Is
there an options to get more verbose error or catching the exceptions with the
proper info before we get the error ... |
Why does Django Queryset say: TypeError: Complex aggregates require an alias?
Question: I have a Django class as follows:
class MyModel(models.Model):
my_int = models.IntegerField(null=True, blank=True,)
created_ts = models.DateTimeField(default=datetime.utcnow, editable=False)
When... |
Find the superblock on disk
Question: i have to write python script in my work. My script must print all devices
which meet some conditions. One of this conditions is superblock. Device must
have superblock.
other conditions:
1. any partitions is not mounted - DONE
2. any partition is not in raid - DONE
3. uuid... |
python filter and sort list of orderedict from xml2dict
Question: i have a question on sorting xml2dict outcome. i have a xml like this:
Python 2.7
<schedule>
<layout file="12" fromdt="2015-07-25 00:42:35" todt="2015-09-02 02:54:14" scheduleid="34" priority="0" dependents="30.jpg,38.mp4,39.mp4"/> ... |
Broken python after Mac OS X update
Question: After an update of OS X Yosemite 10.10.5 my Python install has blown up. I am
not using brew, macports, conda or EPD, here, but a native Python build. While
it was perfectly functional before, now it seems to have lost track of the
installed packages. I try to start an ipyt... |
How can I mock/patch an associative array in python
Question: I have a module with a dictionary as associative array to implement a kind-of
switch statement.
def my_method1():
return "method 1"
def my_method2():
return "method 2"
map_func = {
'0': my_me... |
Transpose multiple variables in rows to columns depending on a groupby using pandas
Question: This is referred to a questions answered before using SAS. [SAS - transpose
multiple variables in rows to
columns](http://stackoverflow.com/questions/25384634/sas-transpose-multiple-
variables-in-rows-to-columns)
The new thin... |
__pycache__ folder executes each time i run any other file in the folder
Question: I am learning python and I have a tutorial folder with 5 or 6 python files.
One of them contained regex functions say `file_regex.py`. The problem is when
I execute any other file in the folder, always `file_regex.py` is executed
thus gi... |
Bokeh: pass vars to CustomJS for Widgets
Question: A nice thing about Bokeh is that callbacks can be specified from the Python
layer that result actions on the javascript level without the need of bokeh-
server. So one can create interactive widgets that run in a browser without an
Ipython or Bokeh server running.
The... |
Returning columns conditionally in pandas
Question: I've read quite a few questions and answers on using indexing with pandas in
python, but I can't work out how to return columns conditionally. For
instance, consider the following:
import pandas as pd
df = pd.DataFrame([[0,1,1],[0,0,1],[0,0,0]], col... |
Combine key and mouse button events in wxpython panel using matplotlib
Question: In a `wxPython` panel I want to use `matplotlib's`
[Lasso](http://matplotlib.org/api/widgets_api.html?highlight=lasso#matplotlib.widgets.Lasso)
widget. In my implementation `Lasso` is used in three different
functionalities. Nevertheless, ... |
May I use groupby to solve this case in python?
Question: I have a redis database that it's receiving data from Arduino every ten
seconds.
Now, I want to make six ten-second data calculate one sixty-second data and
then get avg, max, min of six ten-second data as follow.
import json
a = [u'{"id... |
Grab 2 items in 1 string?
Question: I'm not smart with this as u can tell. I'm looking to grab 2 things with 1
line.
eg
<a href="(URL TO GRAB)">(TITLE TO GRAB)</a>
<a href="(URL TO GRAB)" rel="nofollow">(TITLE TO GRAB)</a>
The Urls and Titles always begin with http or https
<a h... |
Arbitrary host name resolution in Ansible
Question: Is there a way to resolve an arbitrary string as a host name in Ansible
`group_vars` file or in a Jinja2 template used by Ansible? Let's say, I want
to define a variable in `global_vars/all` that would contain one of the
several IP addresses that `www.google.com` reso... |
Userena raising RemovedInDjango19Warning
Question: I'm using userena app in my django project, when running `python manage.py
migrate`, it just raise below warning:
> /usr/local/lib/python2.7/dist-packages/userena/utils.py:133:
> RemovedInDjango19Warning: django.db.models.get_model is deprecated.
> profile_mod = ge... |
Python is saying that a variable has not been asigned when it has
Question:
import random
import time
name=input("Wecome to the game what is your name")
print(("This is a numbers game"),(name),("you will be playing against the computer."))
print("The idea of the game is to get closer to 21 to the c... |
How do I prevent python from freezing to work on a large number equation?
Question: Because it takes too much time to calculate for A, I'll want the calculation
to stop and have the program continue on to calculate for B. It would also be
helpful to know what error this is called.
A = 999999999999999999*... |
Edit python global variable defined in different file
Question: I am using Python 2.7. I want to store a variable so that I can run a script
without defining the variable in that script. I think global variables are the
way to do this although I am open to correction.
I have defined a global variable in `file1.py`:
... |
Wrong pip in conda env
Question: I have a conda env called birdid.
While working in the env (i.e. I did `source activate bird_dev`), showing the
list of the packages give
(bird_dev)...$ conda list
# packages in environment at /home/jul/Development/miniconda/envs/bird_dev:
#
...
pep8 ... |
How to count numbers in a list from a csv file filtering out words and commas
Question: So im fairly new to python and im looking to do a few things:
1. Display the number of numbers in the row
2. Display the average of the numbers in the row
3. Display the name of the row
4. No use of libraries such as import... |
swig python interfacing to function using void **
Question: BACKGROUND. I have an API (third party provided) consisting of C header files
and a shared library. I have managed to create a shell script for the build
environment, along with a simple interface file for swig. I am trying to make
this API accessible to an IP... |
Python Get/POST http request
Question: my knowledge of Python is very limited however i know my question is a bit
simple on how to send a GET/Post request. i'm trying to create a simple
program for the (to be released LaMatric). it displays info coming from a GET
request on a dot matrix like screen. I would like to con... |
Regex doesnt match the groups (Python)
Question: On my administration page I have a list of accounts with various values that I
wanna to capture, like id, name, type, etc. On Regex101 its capturing
perfectly all the values with "g" and "s" modifiers active. This what I trying
to do:
def extract_accounts(... |
dbus-send version in python
Question: I have a working dbus-send invocation:
# OBJECT INTERFACE .MEMBER CONTENT
dbus-send --system --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter.SetMode string:discoverable
Now I am trying to do the same in ... |
Python socket security
Question: I plan to use socket (<https://docs.python.org/2/library/socket.html#example>)
to allow a simple software i'm writing to be clustered across multiple
computers, and i'm wondering what security risks there are with using Socket.
I know that open ports CAN be vulnerable depending on the s... |
What is the Matlab install directory on 64bit or how to get it in Python?
Question: I have Matlab2013b on my system at :
> C:\Program Files\MATLAB\R2013b\bin
I am writing Python script that searches for Matlab.exe first at this location
and then at location for 64 bit. The Python script will be run on a server
which ... |
label.configure works sometimes why?
Question: Part of my code is as follows:
def get_songs():
label6.configure(text='Wait')
os.system('/home/norman/my-startups/grabsongs')
label6.configure(text='Done')
The label is not updated at the first `.configure()` but is at the secon... |
Python-Returning to a specific point in the code
Question: So I'm writing a little bit of code as a fun project that will randomly
generate a subject for me to study each day. But once a subject has appeared
once I don't want it to appear for the rest of the week. To do this I'm using
a list. Basically, when it picks t... |
Reverse each iterable in a list using functional Python
Question: I have a list of strings and lists. I want to reverse each iterable in my list
using `map`. My current setup is as follows:
forwards_list = [
'abc',
'def',
[1, 2, 3, 4, 5],
]
def reverse(item):
object_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.