text stringlengths 226 34.5k |
|---|
Issue including std::vector to cython
Question: I have a problem importing the vector class to cython using
from libcpp.vector cimport vector
when I add this and try to compile the pyx file I get
python setup.py build_ext --inplace
running build_ext
skipping 'kmc_cy.c' Cython... |
How can I send a Python program (including libraries) to a friend?
Question: I want to send a program that I made to my friend, but the problem is it's not
going to work on his computer, because he doesn't have all the libraries
installed. For example :
#! /usr/bin/env python2.7
from PyQt4.QtCor... |
Reference Before Assignment Error
Question: > **Possible Duplicate:**
> [referenced before assignment error in
> python](http://stackoverflow.com/questions/855493/referenced-before-
> assignment-error-in-python)
So I've started to try to teach myself a little Python, and I've come up
against my first error alrea... |
Getting User in django-socketio
Question: Once a message is sent through a Socket.IO connection from client (JS) to
server (django/python) using django-socketio, is it possible to figure out
which user was authenticated when the page was rendered?
In this case the view is being served up by django and it requires
auth... |
Make pivot tables in sql like in spss
Question: I have lots of data in PostgreSQL. But I need to do some pivot tables like it
does SPSS. For example i have table with cities and states.
create table cities
(
city integer,
state integer
);
insert into cities(city,state) values... |
Python - How to end function in a way that ends thread (i.e. decrease threading.activeCount() by 1)?
Question: I've just starting experimenting with threading as a way to download multiple
files at once. My implementation uses thread.start_new_thread().
I want to download 10 files at a time, then wait for all 10 files... |
Using grequests to send a pool of requests, how can I get the response time of each individual request?
Question: I am using the grequests python library to send GET requests asynchronously to
our server.
I cant figure out how to get the server response time for each individual
request within the pool of requests bein... |
find a alpha-numeric entry in tab delimited file with python
Question: I'm trying to perform a GOs annotation using the SIMAP database which is
Blast2GO annotated. Everything is fine, but I have problems when I try to find
the accession number in the file where entry numbers are associated with their
GOs. The problem i... |
Python summing itertools.count?
Question: I'm having some trouble with the itertools.count function, and I don't quite
understand what it does. I expect the code below to accomplish [Project Euler
problem 2](http://projecteuler.net/problem=2).
I know that I could write this with a simple while loop, but is there a way... |
Color a particular node in Networkx and Graphviz
Question: I am writing a program to plot a graph from a distance matrix. It is working
fine. Now I want a certain node and a certain edge to be of a particular color
of my choice. How do I do that?
The program is in Python and uses Networkx and Graphviz
i... |
Import from parent directory failed with ImportError
Question: I'm busy developing an application in python, my application is structured as
follows
main.py
pr/
core/
__init__.py
predictor.py
gui/
predictor/
__init__.py
... |
Understanding Python's backslash escape character
Question: My script creates files to export by concatenating a file path with a file
type suffix. For example,
int = 3
print r"C:\Test\\" + str(int) + ".jpg"
This returns `C:\Test\\3.jpg`
I thought that because I included the 'r' at the beginni... |
launching python script process from another script on Ubuntu: how to track status?
Question: I launch one Python script out of another one on an Amazon EC2 Ubuntu instance
using a command:
os.system(call)
where `call` has the form
"./script2.py arg1 arg2 arg3"
I've noticed th... |
What does this (matplotlib) error message mean?
Question: Display is the module:
import matplotlib
matplotlib.use('TkAgg') #TkAgg is quite slow but should work on all platforms.
import time
import numpy
import matplotlib.pyplot as plt
def display_2d_array(arr):
'... |
Using Python CGI and MySQL to save the user inputed from a form into MySQL table
Question: I have two .cgi scripts as of right now. I am trying to have a user input a
keyword on one website (the first cgi script) and then it will send that data
to the next cgi script. It currently sends it to the next page fine but I a... |
AttributeError: based on re.compile pattern
Question: I'm new at Python, and I'm pretty sure that the cause of this is simply a
blonde moment, but it's been driving me up the wall the past few days.
I keep getting "elif conName.search(line): AttributeError: 'list' object has
no attribute 'search'" on line 106
If I re... |
Saving data from MySQL table to a text file with Python
Question: So I have a mysql table and I am trying to take each element from one of the
fields of the table. The field and table are both called "keywords". In the
field there are many different random words and I am trying to take all of
those and save them to a t... |
Python user input in child process
Question: I'm trying to create a child process that can take input through raw_input()
or input(), but I'm getting an end of liner error _EOFError: EOF_ when asking
for input.
I'm doing this to experiment with multiprocessing in python, and I remember
this easily working in C. Is the... |
how to show txt on web, by gae,google app engine,python
Question: i want to upload txt file and show this txt.
i had the code of uploading txt to gae, but how to show it???
i want to upload txt file and show this txt.
i had the code of uploading txt to gae, but how to show it???
i want to upload txt file and show t... |
Creating dynamic objects with | separator python
Question: What I want is to solve is something like this
names = ['Aleister', 'Matovu']
args = (Q(name__contains=name[0])|Q(name__contains=name[1]))
queryset.complex_filter(args)
What the problem is I have a names as a dynamic object and its ... |
Python cannot import name if placed in module
Question: > **Possible Duplicate:**
> [How to do relative imports in
> Python?](http://stackoverflow.com/questions/72852/how-to-do-relative-
> imports-in-python)
I'm experiencing something that seems very random to me.
I have a folder structure much like this:
... |
Python: shorter syntax for slices with gaps?
Question: Suppose I want the first element, the 3rd through 200th elements, and the
201st element through the last element by step-size 3, from a list in Python.
One way to do it is with distinct indexing and concatenation:
new_list = old_list[0:1] + old_list... |
Extract Public Key in Python OpenSSL (pyOpenSSL) from certificate or other connection information
Question: I'm currently trying to write a python server script which should authenticate
the current client based on its public key. Since I'm using twisted, the
[example in the twisted
documenteation](http://twistedmatrix... |
Python 3.3 Mysql Connector
Question: > **Possible Duplicate:**
> [MySQL-db lib for Python
> 3.0?](http://stackoverflow.com/questions/384471/mysql-db-lib-for-python-3-0)
I use python3.3 and can't connect to MySQL, because I don't find module for
MySQL connector.
How do I connect to MySQL with python3.3?
Answer: T... |
Convert JSON to CSV using Python (Idle)
Question: I have a JSON file of Latitude/Longitude that I want to covert to a CSV file.
I want to do this using Python. I have read/tried all other stackoverflow and
google search results suggestions. I've managed to get as far as creating the
CSV and including headers, but beyon... |
How can I dynamically execute function in current scope and add it as property of the calling function?
Question: I have some code like this:
def f1():
<some stuff here>
.
.
.
@mylib.codegen
def f2(args):
f1()
<some more stuff here>
mylib.py :
... |
python: Create file but if name exists add number
Question: Does python have any built-in functionality for this? My idea is that it would
work the way certain OS's work if a file is outputted to a directory where a
file of that name already exists. I.e: if "file.pdf" exists it will create
"file2.pdf", and next time "f... |
Python Embedded in C++
Question: So I have a GUI program that has a great deal of "stuff" going on. I am adding
a python scripting interface so someone can interact problematically with this
environment. I am using boost python. So first thing I have is a new module I
want to create. For simplicity right now my module ... |
Python json dumps syntax error when appending list of dict
Question: I got two functions that return a list of dictionary and i'm trying to get
json to encode it, it works when i try doing it with my first function, but
now i'm appending second function with a syntax error of `": expected"`. I
will eventually be append... |
Progressbar and combinations in Python
Question: I am using itertools.combinations module to find a large number of
combinations. While my program finds all its combinations (a lot of them) it
checks for sum of every combination to be some number and then program store
that combination in list.
from iter... |
What do @ and lambda mean in Python?
Question: > **Possible Duplicate:**
> [Understanding Python
> decorators](http://stackoverflow.com/questions/739654/understanding-python-
> decorators)
Just trying to "port" some Python code to Java, I came then across the
following python code:
@fake(lambda s, t... |
shorten the weekdays from texts
Question: I am writing a python library that takes a paragrah that consists of different
types of hours format. Paragraph is actually taken from different restaurant
sites, they have hours of operation in various formats for each site. So, I
decided to write a library that takes any form... |
Legacy Zope dynamic loading error with MySQL
Question: I am in the process of moving an old installation of Zope 2 to a new Mac OS
10.8 Server. Unfortunately, our server requires Python 2.4 to run, so I have
installed the MacPorts version. The server loads fine until it tries to load
the MySQL-python module, at which p... |
How to design GUI sequence in Tkinter with Python 2.7
Question: I want to write a program that asks the user a series of questions in
different dialog boxes. Each box shows up one at a time, and goes to the next
box if the button next is clicked. My question is do I create a class for each
Dialog and just call the next... |
ImportError: cannot import name urandom
Question: I was building a new Linux environment and seeing following error on Python.
# python -c 'import random'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/random.py", line 47, in <module>
... |
Python smtplib sometimes fails sending
Question: I wrote a simple "POP3S to Secure SMTP over TLS" MRA script in Python (see
below).
It works fine, but sometimes it returns "Connection unexpectedly closed" while
trying to send via SMTP. Running the script again will deliver that message
successfully.
Please give me so... |
How to share data between processes in Python using MPI?
Question: I'm attempting to parallelize a script I wrote. Each process needs to do a
calculation and store the data to a specific part of an array (list of lists).
Each process is calculating and storing its data alright, but I can't figure
out how to get the dat... |
Unresolved import PyDev/IronPython
Question: I have both Aptana Studio 3 and Eclipse 4.2.1 (w/ PyDev & PyDev extensions)
installed on Windows XP (SP3) systems. I have been unsuccesful in loading
external .NET assemblies. Given the assembly myassembly.dll containing a
namespace `myNameSpace`, I set up a new project with... |
Run multiple find and replaces in Python (on every file in the folder and sub-folder)
Question: I have a folder (courses) with sub-folders and a random number of files. I
want to run multiple search and replaces on those random files. Is it possible
to do a wild card search for `.html` and have the replaces run on ever... |
call linux command within python
Question: > **Possible Duplicate:**
> [Equivalent of Backticks in
> Python](http://stackoverflow.com/questions/1410976/equivalent-of-backticks-
> in-python)
I am looking for the best way to run a terminal command (ls -l) within Python.
I have read about subprocess but I do not under... |
How to convert string date interval to number of days or seconds (ISO_8601)?
Question: Is there an easy way in python to transform a string representation of a date
interval:
P1M
To a timestamp or a datetime object?
Basically I need to work with date intervals according to this ISO:
<http://en.wik... |
Google app engine + python (django) deployment error: Error loading MySQLdb module
Question: I am creating an app on Google App Engine. I am using Django 1.4 and Python
2.7. Everything works fine on localhost. But after deployment it is not
running, I keep getting this on admin logs:
2012-12-15 15:02... |
sqrt function weird behaviour in Python
Question: In Python, I wrote a custom code sqrt(x, delta) to calculate the square root
of a given number with a delta-close approximation. It uses a while loop and a
binary-search-like algorithm.
The code:
from __future__ import division
def sqrt(x,... |
How to make a python decorator function in Flask with arguments (for authorization)
Question: I used a flask snippet for my flask-login that checks that a user is logged
in:
from functools import wraps
def logged_in(f):
@wraps(f)
def decorated_function(*args, **kwargs):
... |
what regex expression in python for this text
Question: I have a complicated text file, here is part of it:
& \multirow{2}{*}{52.7} & \multirow{2}{*}{3} & \multirow{2}{*}{$<$ 0.001}\\
I'm interested in the numbers after the `{*}`. Here is what I tried with no
luck:
import re
m = ... |
Python plugins like Minecraft Bukkit
Question: I've been reading this:
<http://lkubuntu.wordpress.com/2012/10/02/writing-a-python-plugin-api/>
I'm trying to do something like Minecraft help system.
Let's say I have my main module, and the help commands are:
> help
> test1
> test2
>
And then, after loa... |
Python NoneType error in some executions of a program
Question: I was testing a code found in a book about Genetic Algorithms and I came up
with an strange mistake. The code is the following:
import time
import random
import math
people = [('Seymour','BOS'),
('Franny','DAL'... |
Insert statement MySQL via python
Question: I am trying to make a python script that adds a video url and time to my
videopost table in DB. This is my 3rd script at python. I am still learning.
Also please tell me how to lower the execution time of this script.
Code:
#!/usr/bin/python
import MyS... |
How do I configure my system so that Windows Python 2.7 CGI scripts see user-defined packages?
Question: I have a Python script that uses some of my own packages in my own library
which is stored in a non-standard folder: k:\lib. When running the script from
the command-line the interpreter can find my packages because... |
How to select two elements from list and do math on them in Python?
Question: I have a file containing several start and end-positions of a sequence (MANY!)
and I want to select the start and end positions, subtract the end position
from the start to get the length of a particular sequence, and then randomly
place that... |
How do I upload a pdf from a Django HTTP object to google drive
Question: I use pisa to create pdf documents to render to the user:
response = HttpResponse()
pisa.CreatePDF(src=html, dest=response, show_error_as_pdf=True)
return response
response.content contains the pdf. I've used the drop... |
Separate a csv for processing
Question: I am new to Python and love it. However, I have a problem and hope someone can
help.
I have a string of values separated by commas and want to use a loop to
individually process each of the values in turn.
e.g.
string = '1,2,3,4,5,6,'
I want to take the first value '1' and pr... |
How to use a cython definition file (pxd) without making it an extension ?
Question: What is the simplest way to create a pxd definition file, which simply
collects cdefs replicated over pyx files, without creating new extensions?
My case is the following: I would like to gather some extern cdefs in a pxd
file (hp/src... |
Read a File 8 Lines at a Time Python
Question: Hello I am trying to read a file in Python 8 lines at a time and use the
current 8 lines as str variables
However I am unable to do this correctly and would appreciate any help
with open("test.txt", 'r') as infile:
lines_gen = islice(infile, 8)
... |
Progress of Python requests post
Question: I am uploading a large file using the Python requests package, and I can't
find any way to give data back about the progress of the upload. I have seen a
number of progress meters for downloading a file, but these will not work for
a file upload.
The ideal solution would be s... |
data stored by pylibmc cannot be uncompressed in php memcached
Question: We have an application where we are using python to store lots of data in
memcached.We are using pylibmc in python and on php side we are using php-
memcached library.As a summary
* pylibmc v.1.2.3
* php-memcached v.2.0.1
* libmemcached v... |
Writing Calculated Info to the front of a text file in Python
Question: So I found this crappy old laptop (my now moved out sister's from about '05)
in my basement and I've been messing around with it by running huge
calculations on it in Python and leaving it for hours. My newest project is
saving the first 1 billion ... |
Ip list from captured pcap python
Question: I'm trying to sort a previously-captured Pcap file, I want to build a list of
ip source and destinations, so I can run calculation against them.
I have attempted to search the pcap file using a search function but this
fails with ip addresses, any ideas?
Eventually I want t... |
Obtaining MD5 hash value from online image / movie using Python
Question: I'm currently looking to put together a quick script using Python 2.x to try
and obtain the MD5 hash value of a number of images and movies on specific
websites. I have noted on the w3.org website that the HTTP/1.1 protocol does
offer an option w... |
Python urllib2: Receive JSON response from url
Question: I am trying to GET a URL using Python and the response is JSON. However, when
I run
import urllib2
response = urllib2.urlopen('https://api.instagram.com/v1/tags/pizza/media/XXXXXX')
html=response.read()
print html
The html is of t... |
Displaying Pretty Python Code in Python (or Other) GUI
Question: I'm starting a simple little GUI for grading my student's python source code.
Is there an easy way to automatically format display of the python code within
a GUI? For example, pulling the color formatting from some editor?
I've started with Python tkk (... |
How to implement Semaphores in python 2.x when not using default RUN method
Question: The code flow is something as below.
result = []
def Discover(myList=[]):
for item in myList:
t = threading.Thread(target=myFunc, Args=[item])
t.start()
def myFunc(item):
... |
Inherit a parent class docstring as __doc__ attribute
Question: There is a question about [Inherit docstrings in Python class
inheritance](http://stackoverflow.com/questions/2025562/inherit-docstrings-in-
python-class-inheritance), but the answers there deal with method docstrings.
My question is how to inherit a docs... |
Cannot iterate VBA macros from Python
Question: I am using VBA in conjunction with Python.
I imported the module OS, and for working with excel - openpyxl. The problem
occurs when it iterates the function for running the VBA macro from Excel.
import random
from openpyxl import load_workbook
impo... |
Job scheduling with `at`. "EOF: not found"
Question: I am trying to schedule a job on a remote server. I want this job to be
scheduled either a minute from the current server time or a minute from the
server time of the last scheduled job to run on the server. This way, no two
jobs run at the same time (and thus race c... |
Manipulate string data
Question: I'm new to python and trying to create a script to modify the output of a JS
file to match what is required to send data to an API. The JS file is being
read via urllib2.
def getPage():
url = "http://url:port/min_day.js"
req = urllib2.Request(url)
... |
PyInstaller 2.0 bundle file as --onefile
Question: I'm trying to bundle my py script as an .exe using PyInstaller 2.0. I am able
to bundle the script, but in my script, I need to open a file that should be
bundled in the exe (so it's portable). I'm having trouble doing this..
In my .py, I have
filename ... |
python create jpg file from raw data
Question: I have this strange xml file which apparently contains jpeg image data:
<?xml version="1.0" encoding="UTF-8"?>
<AttachmentDocument xmlns="http://echa.europa.eu/schemas/iuclid5/20070330" documentReferencePK="ECB5-d18039fe-6fb0-44d6-be9e-d6ade38be543/0" en... |
AttributeError: 'module' object has no attribute 'Datefield'
Question: In the file models.py
from django.db import models
# Create your models here.
class Publisher(models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_length=50)
ci... |
Python - Scheduling with stop and resume running task feature
Question: I was developing a scheduling application, in the schedule there's many lamp
that turn on and off in specific time, say if I start the schedule at morning
all lamps will turn on then stop at night, but there is some lamp that need to
stop at random... |
Open multiple webpages with different parametrs. PyQt4
Question: I have followed the answer by
[X.Jacobs](http://stackoverflow.com/users/1006989/x-jacobs) on this
[Question](http://stackoverflow.com/questions/13943558/multiple-threads-of-
qwebview-in-pyqt4), and was trying to create an app that will open multiple
windo... |
Can I use Python requests with celery?
Question: I have the following defined in a celery module named tasks.py with the
requests library imported:
@celery.task
def geturl(url):
res = requests.get(url)
return res.content
Whenever I call the task (either from tasks.py or REPL) wi... |
Download a file using Python
Question: I have to download a number of files. I tried the following code in python.
import urllib2
ul = urllib2.urlopen('http://dds.cr.usgs.gov/emodis/Africa/historical/TERRA/2012/comp_056/AF_eMTH_NDVI.2012.047-056.QKM.COMPRES.005.2012059143841.zip.sum').read()
open... |
Converting Matlab's datenum format to Python
Question: I just started moving from Matlab to Python 2.7 and I have some trouble
reading my .mat-files. Time information is stored in Matlab's datenum format.
For those who are not familiar with it:
> A serial date number represents a calendar date as the number of days th... |
How can I get the name of the script calling the function in python?
Question: I know that `__file__` contains the filename containing the code, but is there
a way to get the name of the script/file that's calling the function?
If I have a file named `filenametest_b.py`:
def printFilename():
pri... |
What is a Pythonic way to count dictionary values in list of dictionaries
Question: For a list like this:
for i in range(100):
things.append({'count':1})
for i in range(100):
things.append({'count':2})
To count the number of `1` in list:
len([i['count'] for i... |
NZEC in python on spoj for AP2
Question: I wrote the following two codes
## FCTRL2.py
import sys;
def fact(x):
res = 1
for i in range (1,x+1):
res=res*i
return res;
t = int(raw_input());
for i in range (0,t):
print fact(int(raw_input()));
... |
How to converter std::string* in boost.python?
Question: How to converter std::string* in boost.python?I have to handle some data of
c++ in python.The data may be big.So I return a pointer to python. But there
are some errors.
# c++
#include <boost/python.hpp>
#include <string>
class A {
... |
Python unicode string operation in App Engine failing
Question: Python code that runs in Development/local machine, but fails after installing
to Appengine :
1st line in my File :
# -*- coding: utf8 -*-O
Lines later in the code :
s1 = u'Ismerőseid'
logging.info (s1)
s2 = s1 ... |
import error when I test scikit on ubuntu12.04
Question: I want to install scikit on ubuntu12.04 and I followed the instruction on [the
official installing documentation](http://scikit-
learn.org/stable/install.html)and type the following command in the bash: sudo
apt-get install python-sklearn
next I type the test in... |
No valid context when using glutMouseFunc in python
Question: I'm trying to write program in Python using PyOpenGL which I need to use
glutMouseFunc for some mouse functionality but when I run the program I get
the following error:
Traceback (most recent call last):
File "teapot.py", line 80, in <m... |
How to confirm only html files exist in a given folder and if not then how to prompt the user to specify a folder with only html files within
Question: I would like to create a python script that will do 3 things:
* 1) Take user input to navigate to a file directory
* 2) Confirm the file contents (a particular set of ... |
Tkinter and pyplot running out of memory
Question: I'm running a Tkinter script that updates a plot every 5 seconds. It calls the
function that plots it every 5 seconds. After not that long python starts
using a lot of memory, I checked in task manager. The memory usage keeps
increasing really fast. It starts a new fil... |
Is there a way to invoke a leftclick in python?
Question: I only have the python 2.6. Can I do this without using external libraries? I
just want to perform a left click wherever the cursor currently is.
Answer: OK, first you have to know how to open the user32 windll via `ctypes`, which
is [trivial](http://docs.pyth... |
Python extract data from file and write to another
Question: I'm new in python and need help. I have a file and want to extract text to
another file.
The input file looks like this:
<Datei Kennung="4bc78" Titel="Morgen 1" Bereich="I847YP"> Morgen 1
Here is text, contains numbers and text.
H... |
2D and 3D Scatter Histograms from arrays in Python
Question: have you any idea, how I can bin 3 arrays to a histogram. My arrays look like
Temperature = [4, 3, 1, 4, 6, 7, 8, 3, 1]
Radius = [0, 2, 3, 4, 0, 1, 2, 10, 7]
Density = [1, 10, 2, 24, 7, 10,... |
fft in python not showing peaks in right place
Question: I'm trying to understand the numpy fft function, because my data reduction is
acting weirdly. But now that I've transformed a simple sum of two sines, I get
weird results. The peaks I have is extremely high and several points wide
around zero, flattening the rest... |
How to use malt parser in python nltk
Question: As a part of my academic project I need to parse a bunch of arbitrary
sentences into a dependency graph. After a searching a lot I got the solution
that I can use Malt Parser for parsing text with its pre trained grammer.
I have downloaded pre-trained model (engmalt.line... |
installing theano package on windows
Question: I am trying to install the theano package on my windows machine. I seem to
have problem installing pip by typing : easy_install pip
The python shell complains: SyntaxError: invalid syntax on pip.
I am trying to install it on EPD and I have imported numpy before typing
ea... |
HTTP-browsing library with active feedback
Question: I have a webpage with a Flash object on it. I want to be able to click
multiple different buttons within in. Regarding this method I was wondering if
there is any library (preferable Python/Perl/JAVA) that can actually stream a
page-open session, emulate a resolution... |
Sorting a networkx graph object Python
Question: I want to sort a graph object that I have read through networkx library in
Python, in the increasing order of edgeweight. It seems that the `sort`
command of python won't apply to graph objects. I am sure there is a easy way
to sort this object, but I am not sure how. An... |
Making a variable cross module in Python - Within a class and function
Question: I'm trying to use a variable in other python modules, like this:
In `a.py`:
class Names:
def userNames(self):
self.name = 'Richard'
In `z.py`:
import a
d = a.Names.name
print... |
How to convert a number in Python to 8 binary bytes (64-bit long)?
Question: How do I convert a number in Python to 8 binary bytes (64-bit long)?
I have a blueprint of a network message, part of which is a number represented
with eight bytes.
Answer: Use [struct.pack](http://docs.python.org/2/library/struct.html#for... |
Making the leap from PhP to Python
Question: I am a fairly comfortable PHP programmer, and have very little Python
experience. I am trying to help a buddy with his project, the code is easy
enough to write in Php, I have most of it ported over, but need a bit of help
completing the translation if possible. The target i... |
Filter broken referer Django emails when switching servers
Question: We often change IP addresses on AWS when switching EC2 servers (yes, we use
Elastic IPs when applicable). Sometimes we get IP addresses that used to host
other applications (which is fine, of course). When end users click on stale
links they get to ou... |
Cheap mapping of string to small fixed-length string
Question: Just for _debugging_ purposes I would like to map a big string (a session_id,
which is difficult to visualize) to a, let's say, 6 character "hash". This
hash does not need to be secure in any way, just cheap to compute, and of
fixed and reduced length (md5 ... |
BYTE to python C-Type structure Conversion Issue
Question: I am facing a little problem on deserializing some bytes that have been
received from the POSIX Queue.
We are trying to develop a module where a Python application will post a POSIX
queue data to a C application and C will re-post data to Python Queue..
All d... |
Checking for some exact lines in each file in directory and subdirectories
Question: I am trying to do the following and running into errors,what is going wrong?
1.Open each file in the directory and subdirectories based on the argument
2.Check if each file has the copyright info exactly the 3 lines
C... |
Issues with script on 64bit Ubuntu
Question: I have used one script, `https://github.com/reddit/reddit/blob/master/install-
reddit.sh` on several machines and every time it worked perfectly. Now, one
one server which has Ubuntu 64bit, I encounter issues with one part of the
script.
######################... |
How do I allow opening of files that have Unicode characters in their filenames?
Question: I have this Python script here that opens a random video file in a directory
when run:
import glob,random,os
files = glob.glob("*.mkv")
files.extend(glob.glob("*.mp4"))
files.extend(glob.glob("*.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.