text stringlengths 226 34.5k |
|---|
Attribute error in python won't go away
Question: Why do I keep getting
AttributeError: 'dict_keys' object has no attribute 'sort'
or my code? How can I fix this?
import string
infile = open('alice_in_wonderland.txt', 'r')
text = infile.readlines()
counts =... |
Python create save button that saves an edited version to the same file(not save as)
Question: This is a simple notepad program that i am currently writing. Most things are
working but cannot get the save to work. Where i have defined save i don't
know how to create the save function(not save as).
NOT THE FULL CODE
... |
Bigquery streaming API timeout error
Question: We're using bigquery streaming API. All went well until recently (no code
change) - In the last few hours we get many errors like:
> "The API call urlfetch.Fetch() took too long to respond and was cancelled.
> Traceback (most recent call last): File "/base/data/home/runti... |
python requests read from file status_code wrong
Question: trying to read a file with urls and extract the status_code with python
requests module.
this does not work, or gives me a wrong status code:
import requests
f = open('urls.txt','r')
for line in f:
r = requests.head(line... |
python maya - Select children 'nurbs' then hides key
Question: The script below selects all the child nurbCurves of the selected object. The
issue I'm having is that after running the script, none of the keys from the
children nodes appear in the timeline. Why is that? How can I correct this?
To test the script. Creat... |
Python: Reducing a List in a Dictionary
Question: I'm hoping this will be easy. I have a dictionary:
{
'key1': 'value1',
'key2': 'value2',
'key3': 'value3'
},
{
'key1': 'value4',
'key2': 'value5',
'key3': 'value6'
},
How ... |
np complete algorithm in python [solved]
Question: This question is closed.
All information about this question will be uploaded in a week. I am still
trying to figure out the full details. Still testing it as a module.
n is the number of elements and formula is a the clauses
this is an np complete algorithm.
the c... |
python telnet server crash
Question: Whenever my client connect to my server via telnet
telnet myip 43
When the client hits ctrl+c on his own machine continuously it causes the
telnet server to crash... how can this be stopped ? Also are there any chances
by which my server can be attacked by a buf... |
How retrieve from Python win32evtlog rest of info?
Question: Using win32evtlog I can get next info:
events = win32evtlog.ReadEventLog(loghandle, flags, 0)
while events:
for event in events:
print 'Event Category:', event.EventCategory
print 'Time Generated:', event.Tim... |
python web scraping of a dynamically loading page
Question: Let's say i want to scrape this page: <https://twitter.com/nfl>
from bs4 import BeautifulSoup
import requests
page = 'https://twitter.com/nfl'
r = requests.get(page)
soup = BeautifulSoup(r.text)
print soup
The mor... |
Sending RabbitMQ messages via websockets
Question: Looking for some code samples to solve this problem :-
Would like to write some code (Python or Javascript) that would act as a
subscriber to a RabbitMQ queue so that on receiving a message it would
broadcast the message via websockets to any connected client.
I've l... |
I'm receiving the error 'except MySQLdb.error, e' Syntax Error - invalid syntax when trying to write my scrapy spider to mysql,
Question: Here is my pipelines.py and I'm receiving an error on line 18.
import sys;sys.path.append("/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/si... |
Python Can't Find Modules
Question: I'm running a python script which resizes and converts images to JPG and an
RGB. This script worked perfectly until I upgraded my computers HD and moved
everything over from my Time Machine backup. Now when I try to run the script
it can't find any modules. Specifically the Image mod... |
Jython output formats, adding symbol at N:th character
Question: I have a problem that probably is very easy to solve. I have a script that
takes numbers from various places does math with them and then prints the
results as strings.
This is a sample
type("c", KEY_CTRL)
LeInput = Env.getClipboard().... |
Doctest and Decorators in Python
Question: I was trying to use Python decorator to catch exceptions and log the
exceptions.
import os.path
import shutil
class log(object):
def __init__(self, f):
print "Inside __init__()"
self.f = f
def __call__(se... |
convert a code from java into python
Question: Now I am trying to change a program from Java into Python, when I finally fix
three problems on my code and I run it. Then shows me this Error.
Traceback (most recent call last):
File "serial.py", line 4, in <module>
import serial
File "/... |
How to create a matrix? (Python)
Question: I want to create a 2x3 matrix. (2 rows, 3 columns) When I run my code, I get
the matrix in parentheses, which is incorrect.
def fill_matrix(numrows, numcols, val):
matrix = [[val for i in range(numrows)] for j in range(numcols)]
return (numrows... |
Converting data into dictionary of Dictionaries in python
Question: I am reading a file in python using a key value pair, for example
Mac:aaaa
IP:bbbbb
Name:dddd
Mac:wwwww
IP:fffff
Name:sssss
Mac:hhhh
IP:ddd
Name:fff
so, my query is, I need to build a dicti... |
How do I fix the deprecation warning that comes with pylab.pause?
Question: A short python program to demonstrate a bug I keep running into:
import pylab
pylab.ion()
pylab.title('doom')
pylab.pause(0)
If I run it, it works fine, but I get this warning:
/usr/lib/pymodules/... |
Is flush method missing in couchbase python client?
Question: I did not find the flush button for bucket in couchbase admin UI at port 8091
.May be because of this <http://www.couchbase.com/issues/browse/MB-5351> .
Then I saw this [How to delete all items in the
bucket?](http://stackoverflow.com/questions/15966769/how... |
display pdf with python using pdfviewer
Question: I'm trying to display a pdf using pdfviewer lib from wx but I can't find the
module. I already have the wxPython installed is it deprecated ?
I'm following this tutorial :
<http://wxpython.org/Phoenix/docs/html/lib.pdfviewer.html#module-
lib.pdfviewer>
And I'm gettin... |
How to retrieve an output of a Python script using a Java program
Question: I am having a problem with my code. I have a java class that calls a python
script that get gps data. The problem is that I can call the script but I want
to return the data to a string on the java side so I can use it in an array
later. So bas... |
Convert tsv file so i can use it for nodes and edges in python
Question: I have this tsv file i would like to read and somehow count the numbers of
nodes in a path
This is how the parts of tsv file looks like:
6a3701d319fc3754 1297740409 166 14th_century;15th_century;16th_century;Pacific_Ocean;Atla... |
Python clear the screen code?
Question: I am still trying to make my quiz, but I want to enter a clear the screen code
for my questions. So, after researching, I found a code that works, but it
puts my questions way to the bottom of the screen. Here is a screenshot I
took:
 as close as possible using PyQt5. When I run my
code, I get this error: `ReferenceError: pythonListModel is not defined`, and
the list shows up black with no items.... |
Formatting a string by word at a specific character length
Question: I don't see this question anywhere in the database - if it's a duplicate,
please let me know!
I'm trying to format a string to a certain length by word; I have a string of
arbitrary length and I would simply like to add newlines in every **n**
charac... |
How to output integer arrays to file in python?
Question: I have 3000000 ints' long array which I want to output to a file. How can I do
that? Also, is this
for i in range(1000):
for k in range(1000):
(r, g, b) = rgb_im.getpixel((i, k))
rr.append(r)
gg.append(g... |
How to pass a dict to a python thread that can be changed from outside of thread without using queue
Question: I would like to have a shared dict between my threads without using Queue. I
did it before by making thread with an object in python but now I want to make
thread with just one function of object not all of it... |
Python: Send IGMP packets with Scapy
Question: I would like to send IGMP packets using scapy, specifically IGMP Leave, IGMP
Membership report. Is it possible to do so?
**UPDATE:**
I was able to eventually generate them. Had to do the following:
1) Install scapy v.2.2.0 as it's described here (including minor alterat... |
In Ipython, does return statement works as Print?
Question: I have a Python code as follows, I wrote a function as the same name as the
Program name and gave an entry point for the function as follows:
import math
def Problem1():
total=0
for i in range(1000):
if i%3 == 0 o... |
Not able to access twitter after a lot of try
Question: I work on windows 7 and i am trying to access twitter using tweepy and even
twitter1.14.2-python.But i am not able crack it. Help needed.
_**TWEEPY_**
import tweepy
OAUTH_TOKEN = "defined here"
OAUTH_SECRET = "defined here"
CONSUME... |
Gunicorn is unable to find my wsgi file, not able to load python?
Question: So I am trying to run a gunicorn script, following a tutorial I found in the
Internet.
Here is my folder structure:
(today_project)[littlem@server1 today_project]$ tree . -L 2
.
├── bin
│ ├── activate
│ ├── a... |
How to import correctly my function from parent folder
Question: I have the following layout:
/project
/thomas
/users
/src
code_alpha.py
/tests
code_beta.py
I tried:
/project
/thomas
... |
ImportError: matplotlib requires dateutil; import matplotlib.pyplot as plt
Question: Am new to progamming and Python, i keep getting the error below when i run my
program. Someone advised i should use pip to solve it. But cant pip get
installed using the cmd. Though i suceeded using Powershell but still cant
make it wo... |
Trouble Installing Pillow: Why Am I Receiving Errors?
Question: I'm attempting to install pillow via pip (i.e. `sudo pip install pillow`) but
without much success.
Can anyone tell me what the problem is?
Here are the errors I receive:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command... |
Convert black and white array into an image in python?
Question: I have an array of 50x50 elements of which each is either True or False - this
represents a 50x50 black and white image.
I can't convert this into image? I've tried countless different functions and
none of them work.
import numpy as np
... |
Determining a functions output as print or write
Question: I need to determine the output of a function if whether the function is
printing a statement, or writing it out on a .txt file. Is there a way to do
this in Python? I thought perhaps the hasattr('myfunction', '**str** ') might
work, but it did not.
Examples of... |
How can I make itemgetter to take input from list variable?
Question: How can I use itemgetter with list variable instead of integers? For example:
from operator import itemgetter
z = ['foo', 'bar','qux','zoo']
id = [1,3]
I have no problem doing this:
In [5]: itemgetter(1,3)(... |
Get value from detect colour python opencv
Question: For my project, I want to control an RC car to avoid red obstacles using a
webcam camera running `Raspberry Pi`.
I can control my RC car, but I don't know much about `openCV`. I can also
detect selected colours using the webcam, but I do not know how to get the
colo... |
Why is module math called "built-in"?
Question: AFAIK, Python `builtins` refers to those exceptions and functions contained in
`__builtins__`:
>>> import builtins # import __builtin__ in Python 2
>>> dir(builtins) # dir(__builtin__) for Python 2
['ArithmeticError', 'AssertionError', 'AttributeE... |
how to take variable from different `def()` function to another - python
Question: I have two different functions like :
def messageWindow():
# all the necessary operations
feature_matrix_db = zip( B_mean , G_mean , R_mean, cont_list , ene_list , homo_list , cor_list, dis_list)
re... |
TemplateDoesNotExist at /
Question: Hej! Many threads here had the same caption, but none of them solved my
problem. I have a Django site an can access /admin (but it looks ugly). But on
/ there appears the following error page (`DEBUG = True` in `settings.py`):
TemplateDoesNotExist at /
index.h... |
How to fit parser in my python script
Question: Normally, if I have to perform an overlap between multiple files, I just
execute:
python -c 'import sys;print "".join(sorted(set.intersection(*[set(open(a).readlines()) for a in sys.argv[1:]])))' File1 File2 File3 File4 ....
But if I have to get this ... |
Strip HTML tags to get strings in python
Question: I tried to get some strings from an HTML file with BeautifulSoup and everytime
I work with it I get partial results.
I want to get the strings in every li element/tag. So far I've been able to
get everything in ul like this.
#!/usr/bin/python
from b... |
Partial fit multivariate SGDRegressor
Question: I am currently trying to use the SGDRegressor from scikits learn to solve a
multivariate target problem over a large dataset, X ~= (10^6,10^4). As such I
am generating the design matrix (X) in parts with the following code, where
each iteration produces a batch of size ro... |
Python: How to (not) keep a COM-object persistent in memory after closing the parent application?
Question: i am working on a (pretty big) Python/Tkinter-application (Python 2.7 under
Windows 7) which (among many other things) calls Matlab via the COM-interface.
The basic structure of the Matlab/COM-part is like this:
... |
python: how to use 'import' on character string variable?
Question: I want to create a function which uses import, like the following:
def test_module(module_name):
try:
import module_name
except ImportError:
print 'impor... |
Python 3.3 no module named MySQLdb, cymysql installed
Question: Working through the introductory Django project tutorial on the official site.
I have successfully installed the CyMySQL 0.5.5 connector through pip. The
server status is "Running". For the command `python manage.py syncdb` this is
what powershell returns.... |
Oauth using Birdy Python on Flask: Not able to figure out what to do with the Access Token
Question: This is my code to fetch the tweets based on keyword. Here I am trying to
Authenticate using Birdy Oauth API. But the problem is that I don't seem to
understand why does it say that my token is expired when I enter the ... |
using pygame to stream over sockets in python error
Question: i am working on with a webcam script i got of the internet in python and i am
using pygame module the code is
import socket
import pygame
import sys
port=5014
#create pygame screen
screen ... |
python csv replace listitem
Question: i have following output from a csv file:
word1|word2|word3|word4|word5|word6|01:12|word8
word1|word2|word3|word4|word5|word6|03:12|word8
word1|word2|word3|word4|word5|word6|01:12|word8
what i need to do is change the time string like this 00:01:12. my i... |
Nginx and Flask-socketio Websockets: Alive but not Messaging?
Question: I've been having a bit of trouble getting Nginx to play nicely with the Python
Flask-socketio library (which is based on gevent). Currently, since we're
actively developing, I'm trying to get Nginx to just work as a proxy. For
sending pages, I can ... |
Docusign: Python code not able to upload PDF formats
Question: I have implemented embedded signing using python(Have followed the code given
in `Docusign` samples). Everything works good with `.txt` files.
Just any other format gives me an encoding error.
UnicodeDecodeError: 'ascii' codec can't decode b... |
No Such Resource 404 error
Question: I want to run index.html. so when I type localhost:8080 then index.html should
be executed in browser. but its giving no such resource. I am specifying the
entire path of index.html. please help me out.??
from twisted.internet import reactor
from twisted.web.serve... |
How can i print columns in same rows with different 'codes' using csv python
Question: Here is my code.csv file:
one,two,three
1,2,3
2,3,4
3,4,5
and code2.csv file:
,two,three
,2,3
,3,4
,4,5
this is my code.py file:
import csv
wit... |
Sorting a list of dates in Python
Question: I have a list in python that is directories who's names are the date they were
created;
import os
ConfigDir = "C:/Config-Archive/"
for root, dirs, files in os.walk(ConfigDir):
if len(dirs) == 0: # This directory has no subfolder
Conf... |
convert python sqlite db to hdf5
Question: A Pandas DataFrame can be converted to a hdf5 file like this;
`df.to_hdf('test_store.hdf','test',mode='w')`
I have an sqlite db file which has to be converted to a hdf5 file and then I
would read the hdf5 file through pandas using `pd.read_hdf`.
But first how do I convert a... |
3D plot with an 2D array python matplotlib
Question: I have 2 1D arrays with the values of x and y, and also a 2D array with the
values of z for each point where the columns correspond to the x values and
the rows to the y values. Is there any way to get a plot_surface with this
data? when I try to do it it returns me ... |
How can I get a list like this [30,31,32,33,34,35] when i give "in between 30 and 35" to a python function
Question: As I am not good in regular expression, please help me to get the define the
method. I have a method which takes string as argument and returns a list
1. get_values("IN BETWEEN 30 AND 35"... |
Fast way to convert rgb to lab in python
Question: Is there a quick way to convert RGB to LAB in Python3 using D50 sRGB?
[Python-Colormath](https://github.com/gtaylor/python-colormath) too slow
[skimage](http://scikit-image.org/docs/0.9.x/api/skimage.color.html#xyz2lab)
use D65
Answer: For now, the white reference ... |
relative import from __init__.py file throws error
Question: So I'm using a template set by a co-worker and as a newbie to python I may be
missing something very obvious.
The main directory has the init file which has a module I need for the main
python file that generates the error.
Co-worker used:
fr... |
AttributeError: 'float' object has no attribute 'getLow' using Pyalgotrade in Python
Question: I trying to write a Stochastic Oscillator in python using the list function in
Pyalgotrade library.
Pyalgotrade library is a Python library for backtesting stock trading
strategies. Let’s say you have an idea for a trading s... |
Implementing Facebook FQL in Python
Question: It will probably be obvious soon enough, but I am new to coding and
StackOverflow -- apologies if I come off as a bit oblivious.
I have been trying to query Facebook with FQL out of a function on my views.py
page in a Django app. I did have a working solution utilizing the... |
I made a copy of a working Django poll, however i did something wrong, because my poll does not work
Question: I am trying to post a value to my database. I have been looking for a long
time now at a working poll app, but i cannot seem to get my poll working.
Hereunder the parts used by the poll app where somewhere the... |
How to obtain random access of a gzip compressed file
Question: According to [this FAQ on zlib.net](http://www.zlib.net/zlib_faq.html#faq28)
it is possible to:
> access data randomly in a compressed stream
I know about the module Bio.bgzf of [Biopyton 1.60](http://news.open-
bio.org/news/2012/06/biopython-1-60-releas... |
Python module equivalent to the unix command "fmt"?
Question: There is some module with similar functionality to the unix command
["fmt"](http://www.openbsd.org/cgi-
bin/man.cgi?query=fmt&apropos=0&sektion=0&manpath=OpenBSD%20Current&arch=i386&format=html)?.
`fmt` is pretty intelligent reflowing text and I would like t... |
Python Tkinter: obtain tree node information
Question: Python 2.7 Linux
I am only using idlelib.TreeWidget to create a tree in Tkinter.Canvas, nothing
else.
How do I go about getting the information of the selected tree node (eg.
name)? I need to access this information later.
I am able to call a function when the C... |
Pythonic way to extract first line of a tabular file to a list
Question: This is a function that takes the tabular file as input and return the first
row as list:
def firstline_to_list(fvar):
"""
Input tab separated file.
Output first row as list.
"""
import csv
... |
python types in list during comprehension
Question: I have a sql query string such as the following:
intro text,
id int,
description varchar(50)
I am trying to create a string of types, with the goal of finding pieces of
text that do not match the types defined in the sql schema. The way I ... |
python SIP log file processing
Question: i have a sniff/log file for VoIP/SIP generated by python scapy in format time | src | srcport | dst | dstport | payload the sniff python script looks like this:
## Import Scapy module
from scapy.all import *
import sys
sys.stdout = open('data.txt',... |
unable to post tweet on python 3.4 and twitter-1.14.2 api
Question:
from twitter.api import Api
Api = twitter.api(consumer_key='[gdgfdfhgfuff] ',
consumer_secret='[jhhjf] ',
access_token_key=' [jhvhvvhjvhvhvh]',
access_token_secret='... |
Strange poco reactor's notifications
Question: I have code that implements Poco SocketReactor, as described from Echo
example.
class TSPConnectionHandler
{
public:
TSPConnectionHandler(const StreamSocket& socket, SocketReactor& reactor) : _socket(socket),
... |
Why do I get "ImportError: Twisted requires zope.interface 3.6.0 or later." when running stratum mining proxy?
Question: The entire return when running "sudo python ./mining_proxy.py" is:
Traceback (most recent call last):
File "./mining_proxy.py", line 67, in <module>
from twisted.internet... |
Adding a text control window to a wxMessageDialog box/AboutDialogInfo in wxPython
Question: I am working with python v2.7 and wxPython v3.0 on Windows 7 OS.
In my app I have a about menu. Upon clicking the about menu I want to display
some information about my app. I am trying to create a dialog box/AboutBox
exactly a... |
Python CSV file reader : bad cells format for high numbers
Question: I'm using the csv file reader of python to read a csv file. My code is the
following :
with open(self.csv_file, 'rb') as csvfile:
data = list(csv.reader(csvfile, delimiter=';'))
Everything works fine except for one col... |
Split Integer List in Python
Question: I have a list of integers. I want to split the main list into multiple sub
lists of non-zero integers.
Example:
main_lists = [0,0,0,0,0,0,123,432,5,54,0,654,645,34,23,12,0,0,0,0,0,0,123,1,312,312,132,3,123,0,0,0,0,0,0,0]
output =
[123,432,5,54,0,... |
BeautifulSoup Specify table column by number?
Question: Using Python 2.7 and BeautifulSoup 4, I'm scraping song names from a table.
Right now the script finds links in the row of a table; how can I specify I
want the first column?
Ideally I'd be able to switch numbers around to change which ones got
selected.
Right ... |
How can I efficiently create a user graph based on transaction data using Python?
Question: I'm attempting to create a graph of users in Python using the networkx
package. My raw data is individual payment transactions, where the payment
data includes a user, a payment instrument, an IP address, etc. My nodes are
users... |
Is there some equivalent function in python for pack from php?
Question: I'm not familiar with binary operations in general, so for PHP i did it by
examples, but can't find anything for python... I need something in python
like in php `pack('H*'` and `pack('a*'`.
Answer: The python [`struct`](https://docs.python.org/... |
Multiplying array in python
Question: From [this](http://stackoverflow.com/questions/8194959/in-python-how-will-you-
multiply-individual-elements-of-an-array-with-a-floating) question I see how
to multiply a whole numpy array with the same number (second answer, by
JoshAdel). But when I change P into the maximum of a (... |
How to use a Matplotlib proxy artist with stackplot?
Question: Example (runs in `ipython --pylab`):
x = arange(25)
Y = maximum(0,2+randn(7,25))
stackplot(x,Y)
legend(('A','B','C','D','E','F','G'))
**The problem:** instead of a proper legend, I get an empty rectangle. This is
a [known is... |
Save utf-8 strings into sqlite table with python (sqlite3 module)
Question: I am using python 2.7.6 and sqlite3. Here the part of code which must create
the table named goods:
c.execute("""create table goods(
Art varchar(12) primary key,
Nam... |
Analyse frequency of mp3 files with python
Question: I am trying to write a Python script to read an MP3 file and perform some
analysis on the frequencies in it. In particular, I want a spectrogram
(frequency vs time) as output.
However, when I read the file using open() and piped the contents to a file, I
got somethi... |
Flask - Setting root directory
Question: I have a folder structure that looks like so:
myproject/
- flask_app/
- app.py
- templates/
- module1.py
- module2/
- db.py
- models/
I'm running into ImportErrors in my Flask applicatio... |
Crossplatform sound with Python standard library
Question: I have searched plenty to find an answer, I have seen winsound repeatedly but
that is just for windows and other modules seem to all be outside of the
standard library.
Is there a simple way to play a `.wav` or any sound file using something from
the standard ... |
Python openCV: I get an unchanged image when I use cvtColor
Question: I have an image as a numpy array with the shape (480,640) in grayscale.
I want to lay a colored mask over the image and need to get the image in the
same shape to do it, which is (480,640,3).
Here is what I tried:
print str(img.shape... |
PyGame: draw.rect() has invalid parameters
Question: I'm trying to learn mouse events with PyGame, and I'm trying to draw a box
wherever the user clicks. I'm setting a variable equal to
pygame.mouse.get_pos(), and calling individual tuple members according to the
mouse's x, y position. Here's the code:
i... |
How to find URL containing one word AND another using re in Python?
Question: Say I have two types of links in a html file. I want to filter out all links
with type 1. How would I do it in Python using the `re` module?
Type 1:
http://www.domain.com/firstlevel/02-02-13/secondlevel-slug.html
Type 2:... |
Why will my unit tests only run on a my apps, not my entire project?
Question: I've just started writing my first unit tests for a django project, but have
come across an issue when attempting to run all the projects tests.
If I run the tests for a specific module/app it works fine:
./manage.py test my_... |
wxPython thread that does not block the GUI?
Question: I am new to wxPython and threading. I am trying to move some code into a
thread so that it no longer blocks my GUI while executing, and I can push
another button to kill the thread. Having done this, however, the code still
blocks my GUI. How can I write this code ... |
Push rejected, failed to compile Python app
Question: I'm getting a rejected error when trying to deploy a Django app to Heroku. I
looked at possible solutions here:
1. [Heroku push rejected, failed to compile Python/django app (Python 2.7)](http://stackoverflow.com/questions/13896736/heroku-push-rejected-failed-to-... |
How to apply SVG Filter to Group using svgwrite with Python?
Question: Does anybody have an example of how to apply SVG filter to a SVG group using
svgwrite?
Here's what I'm trying to do:
import svgwrite
dwg = svgwrite.Drawing('test.svg', profile='full')
grp = dwg.g()
grp.add(dwg.rect(i... |
Python code not reading file, says file has no lines
Question: I had an assignment due that asked to read a file and display the top 10 lines
of the file, or all of the lines if the file is less than 10 lines long. When
I tried to run my code on my computer, it registered the file as having 0
lines (no matter what file... |
RegEx pattern returning all words except those in parenthesis
Question: I have a text of the form:
> können {konnte, gekonnt} Verb
And I want to get a match for all words in it that are not in parenthesis.
That means:
> können = 1st match, Verb = 2nd match
Unfortunately I still don't get the knock of regular expres... |
Biopython Large Sequence splitting
Question: I'm a newbie in the field of python programming. As I was trying to do some
analysis,(I've tried to find the answer on other posts, but nothing) I decided
to post my first and probably very foolish question. Why does this create only
one output file although in this example ... |
Max retries exceeded with URL
Question: I'm trying to get the content of this url
"<https://itunes.apple.com/in/genre/ios-business/id6000?mt=8>" and its showing
this error
Traceback (most recent call last):
File "/home/preetham/Desktop/eg.py", line 17, in <module>
page1 = requests.get(ap)
... |
how to read "\n\n" in python module pandas?
Question: There is a data file which has `\n\n` at the end of every line.
<http://pan.baidu.com/s/1o6jq5q6>
My system:win7+python3.3+R-3.0.3
In R
sessionInfo()
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=C... |
Check if string contains a certain amount of words of another string
Question: Say we have a string 1 `A B C D E F` and a string 2 `B D E` (The letters are
just for demo, in reality they are words). Now I would like to find out if
there are any `n` conscutive "words" from string 2 in string 1. To convert the
string to ... |
Access to ctypes **argv from binary file through Python
Question: I have the following struct output in a binary file from hashcat restore file:
typedef struct
{
uint32_t version_bin;
char cwd[256];
uint32_t argc;
char **argv;
uint32_t pid;
uint32... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.