text stringlengths 226 34.5k |
|---|
Customize operation/function on Theano
Question: I am new to the Theano library, which is used for deep learning on GPU device.
I have noticed that there are several build-in operations which can support
gpu computation (I guess they are specially written in a way to support GPU):
import theano.tensor a... |
Passing arguments to a embedded python script in bash
Question: I'm having difficulties passing arguments to a embedded bash script.
#!/bin/bash/
function my_function() {
MYPARSER="$1" python - <<END
<<Some Python Code>>
class MyParser(OptionParser):
def format_epilog(self,... |
Post image retrieved from urlopen
Question: I would to send a file to the Telegram Bot
[API](https://core.telegram.org/bots/api#sendphoto) in order to post a
picture. I am using python on Google App Engine and I would like to download a
picture from a URL and send it in a Telegram message, without creating any
intermed... |
Ubuntu 14.04, gcc 4.8.4: gdb pretty printing doesn't work because of Python issue
Question: I'm getting this error when launching a program in gdb:
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/... |
Determine where a class is imported from in python
Question: Is there any way to determine where a class is coming from in python
(especially sklearn)? I want to determine if a class is from
sklearn.linear_models or sklearn.ensemble.
As an example, I would like to be able to determine if Ridge() is a member of
sklearn... |
Python os.listdir and path with escape character
Question: I have a string variable that I have read from a file which is a path that
contains an escape character i.e.
dir="...Google\\ Drive"
I would like to then list all the files and directories in that path with
os.listdir i.e.
os... |
OverflowError: signed integer is greater than maximum when parsing date in python
Question: When attempting to parse a numerically formatted date:
s ="2506181306"
using the appropriate date format:
DateFormat = '%d%m%H%M%S'
dateutil.parser.parse(s).strftime(DateFormat)
We e... |
Is it feasible to unpickle large amounts of data in a Python web app that needs to be scalable?
Question: I am working on my first _web_ application. I am doing it in Python with
Flask, and I want to run a piece of Python code that takes an object, with
Pickle, from a (binary) file of several MB which contains all the ... |
Python paramiko error "TypeError: 'NoneType' object is not iterable" only for a particular computer
Question: While trying to connect to a remote Unix server using `paramiko` I am getting
the error:
> TypeError: 'NoneType' object is not iterable"
Surprisingly, when I try to run the same script, from a different lapto... |
Using Biopython SeqIO.convert over an entire directory
Question: I have 51 files with metagenomic sequence data that I would like to convert
from fastq to fasta using a Biopython script in Windows. The module
SeqIO.convert easily converts an individually specified file, but I can't
figure out how to convert the entire ... |
Python Module issues
Question: Im pretty new to python, and have been having a rough time learning it. I have
a main file
import Tests
from Tests import CashAMDSale
CashAMDSale.AMDSale()
and CashAMDSale
import pyodbc
import DataFunctions
import automa
from Da... |
how to use SystemJS to bundle angular TypeScript with internal modules
Question: We are considering moving some of our angular projects over to typescript and
having some trouble with internal module/namespaces.
We posted this working example on github:
<https://github.com/hikirsch/TypeScriptSystemJSAngularSampleApp>
... |
Python Division Many Decimal Places
Question: Hi I'm wondering how to get python to output an answer to many more decimal
places than the default value.
For example: Currently print(1/7) outputs: 0.14285714285
I want to be able to output:0.142857142857142857142857142857142857142857142857
Answer: If you want complet... |
ImportError: no module named guardian
Question: I'm new to Django, so generally I am the cause of most of my problems, but I
can't figure out why the django-guardian 1.3 app won't install. I'm using
Django 1.7 in a virtual environment, my OS is Windows 8.1.
I followed the installation directions at [pythonhosted.org/d... |
ImportError: No module named concurrent.futures.process
Question: I have followed the procedure given in [How to use valgrind with
python?](http://stackoverflow.com/questions/20112989/how-to-use-valgrind-with-
python) for checking memory leaks in my python code.
I have my python source under the path
/r... |
Some Decoding Issue With String in Python
Question: I'm trying to write the HTML Code string from Google into file in Python 3.4
#coding=utf-8
try:
from urllib.request import Request, urlopen # Python 3
except:
from urllib2 import Request, urlopen # Python 2
useragent =... |
Python functional closures without performance hit
Question: In my python program, I have a ton of functions that are really wrappers for
more complicated functions (the more complicated functions take more
arguments, so the simple functions calculate the extra arguments and pass them
along with the original arguments ... |
Passing data for Curl Function to a Python program on Bash
Question: So I'm trying to extract data from the curl function as listed on this Asana
API. <https://asana.com/developers/api-reference/projects>. The problem is
that the data I receive looks like this
{"data":[{"id":"1000","name","first thing"},{"id":"1001","... |
Inca Open Experiment Python
Question: I am working on python and i need to use a Tool named "Inca". Now i am able to
run remotely this tool but i can't to open an experiment located in a specific
workspace.
import sys,clr
sys.path.append("*path*")
clr.AddReference("incacom")
from de.etas... |
Python scrapy spider
Question: I want to scrape data from a website http://www.quoka.de/immobilien/bueros-
gewerbeflaechen with this filter:
<a class="t-bld" rel="nofollow" href="javascript:qsn.set('classtype','of',1);">nur Angebote</a>
How to set this filter using scrapy?
Answer: You can parse a... |
Changing GET to POST in Python (Flask)
Question: I am trying to create a simple app where an array of integers is generated on
the server and sent to the client. Here is some sample (working) code in
app.py:
from flask import Flask, render_template, request, url_for
import random
a... |
how to pass value from output to a string in python
Question: I've been trying to make an application in python and I'm new to python. Well,
what I actually want to do is that . I want the feedparser to read the values
from an RSS of a website... say reddit... and then I want to make that output
as a stringand pass the... |
share a global variable in multi threading doesn't work in python
Question: I am trying to share a global variable between two function in `python`. They
are working at the same time whith multitreading. the problem is that its like
the global variable is not global at all here is my code:
import threadi... |
Getting started with Python OCR on windows?
Question: I have never used python before, and I am not sure where to start. My goal is
to take image data, of numbers and multicolored background, and reliably get
the correct characters identified. I looked into the tools necessary for this
and I found the Anaconda python d... |
Python reading from stdin hangs when interacting with ruby code
Question: I was trying to put python and ruby codes into conversation, and I found the
methods from this link (<http://www.decalage.info/python/ruby_bridge>)
I tried the last method, using stdin and stdout to pass information. I made
some changes to the o... |
How do I use cx_Freeze on mac?
Question: I used python 3.4 and cx_Freeze on my mac. I was trying to convert my python
script into a stand alone application here is the code I got in my setup.py
file:
application_title = "Death Dodger 1.0"
main_python_file = "DeathDodger-1.0.py"
import sys
... |
Remove HTML child inside its parent
Question: I have some HTML like this:
<ul>
<li>Item 1</li><br>
<li>Item 2</li><br>
<li>Item 3</li><br>
</ul>
<img src="someImage.png"><br>
And I would like to remove the `<br>` tags from after the `<li>` tags and the
`<img>` tags us... |
scapy sniff function not catching any packets
Question: I've been following Seitz's black hat python book and he gives an example of
capturing network traffic using the scapy library.
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
def pa... |
Python requests module : Post and go to next page
Question: I'm filling a form on a web page using python's request module. I'm submitting
the form as a POST request, which works fine. I get the expected response from
the POST. However, it's a multistep form; after the first "submit" the site
loads another form on the ... |
Properly handling exceptions in Python and exit class execution
Question: How to handle inside class execution errors? return something so an outside
function knows that and call the class with other data. What will be the
proper way to do this in Python?
I understand we can handle all exceptions by doing the followin... |
How do I do a jointplot in R the same way as I do it python (seaborn package)
Question: How do I do a jointplot in R the same way as I do it python (seaborn package)
In python
import seaborn as sns
sns.jointplot(bigdiamonds["price"], bigdiamonds["carat"])
<seaborn.axisgrid.JointGrid at 0x20... |
DNS resolving in C/C++
Question: In python I can work with DNS like this:
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dns.resolver
>>> answer = dns.resolver.query('www.e... |
Error while running the sample display image program in python OpenCV
Question: I am getting an error when I run the following sample display image program in
my Dell Inspiron 15R windows 8.1 64 bit system
import numpy as np
import cv2
img = cv2.imread('G:/space.jpg',0)
cv2.imshow('image... |
GMail API returns unspeficied error at random moments
Question: I'm running a Python app on Google App Engine which regularly checks the
latest emails for multiple users. I've noticed that at random moments, the API
returns the following error:
error: An error occured while connecting to the server: Unab... |
Reading a file and using a loop to output the integers while displaying the largest number python
Question: The program should output all of the integers, one per line, with no blank
lines between each line. This program should also output the largest random
number that was on file.
myfile = open('mynumb... |
How to use the login session for another http request in python?
Question: We have an application which does not support basic authentication yet. So I
wrote a python script which sends a post request to login and then another
request to a web service url. When I make the second call, my server is asking
me to login ag... |
Tkinter entry widget lags while typing. How to update typed text in real time?
Question: Using python3. I'm new to tkinter writing a program with a GUI that takes some
input parameters and does some data processing, so it needs entry boxes where
I can type numbers in.
I cannot for the life of me figure out how to get ... |
Find.Execute not working with package Win32com
Question: I got a problem that I really can't understand with a Python script I found on
Stackoverflow 2 weeks ago and which worked perfectly until yesterday (with no
changes at all !)
I got a document where I want to find a list of words and replace them with
other words... |
Print lines with constraint in Python
Question: Suppose we have the following text file with column `a` and column `b`:
D000001 T109
D000001 T195
D000002 T115
D000002 T131
D000003 T073
D000004 T170
I wonder how to produce the following structure:
D000001 T109 T195... |
Python datetime.strptime - parse complicated string
Question: I want to make datetime from following string '2015-06-29T11:55:30.000000Z'.
I tried:
import datetime
print datetime.datetime.strptime("2015-06-29T11:55:30.000000Z", "%y-%m-%dT%H:%M:%S.000000Z")
and I obtained following error:
... |
UnicodeEncodeError with nginx and django
Question: I've tried [this SO
answer](http://stackoverflow.com/questions/3715865/unicodeencodeerror-ascii-
codec-cant-encode-character), [this doc is
inapplicable](https://docs.djangoproject.com/en/1.4/howto/deployment/modpython/#if-
you-get-a-unicodeencodeerror) as I'm running ... |
Python Regex split text file into sentences and append to a list
Question: I've been trying to solve this problem without using any external modules, but
only inbuilt python Regex. I've got this so far. The file i'm reading is a
.txt file
import re
def GetText(filename):
print('Opening file...')
... |
py2exe and Tableau Python API
Question: First of all, please excuse me if I'm using some of the terminology
incorrectly (accountant by trade ...)
I'm writing a piece of code that I was planning to pack as .exe product.
I've already included number of standard libraries (xlrd, csv, math, operator,
os, shutil, time, da... |
Django Admin panel not working with https
Question: I have a Django project which I just deployed using Apache and mod_wsgi, which
seemed to be working perfectly. I then changed the Apache config file to allow
HTTPS and now my admin site is not working (though the regular site does work
with both http and https).
Firs... |
SublimeREPL on Sublime Text 3 not importing Python 2.7 modules
Question: I have been trying to configure SublimeText 3 to run SublimeREPL, setting
everything so it runs as IDLE, or PyCharm IDE, but, after trying different
options I checked in SO, it keeps returning:
>>> import pandas
Traceback (most... |
Conditional passing of arguments to methods in python
Question: I have many possible arguments from argparse that I want to pass to a
function. If the variable hasn't been set, I want the method to use its
default variable. However, handling which arguments have been set and which
haven't is tedious:
imp... |
Making a successful Bluetooth Connection to RPi
Question: I have a RPi and a normal Debian on my pc, both using the Bluetooth Python
module to communicate. Both have some Bluetooth USB dongle in them. I can use
the pc as server and the RPi as client, this connection works very well.
However I'm not able to do it vice v... |
Python to Javascript JSON objects (Flask)
Question: I am trying to create a simple Flask app where an array of integers is
generated on the server and sent to the client. I want to view the array of
integers in the console. Here is some sample (working) code in app.py:
from flask import Flask, render_tem... |
How to programmatically count the number of files in an archive using python
Question: In the program I maintain it is done as in:
# count the files in the archive
length = 0
command = ur'"%s" l -slt "%s"' % (u'path/to/7z.exe', srcFile)
ins, err = Popen(command, stdout=PIPE, stdin=PIPE,
... |
python - How to count and take averages on a tuple with Paired values
Question: I am new to python. Can you please help me with this? I have a tuple lets say
`(100, (10.0, 20.0, 30.0))`. I need to write a function which will take this
as an input and return `(100, (3, 20.0))` where `3` is the value count and
`20` is th... |
Python converting text file to all caps
Question: I'm new to python, and I'm trying to figure out how to write a program that
prompts the user for the name of a text file, converts the contents of the
text file to all caps, and then saves it as a new file.
Answer:
import os
def main():
fp =... |
Python Port Scanner says all ports are closed
Question: I'm decently skilled in python programming and i'm trying to make a port
scanner without using any third party libraries. Below is the code I've
written so far but the problem is that when i scan my laptop's IP address, it
says that all the ports are closed. Is th... |
Bad file descriptor error with flask-mail
Question: I'm using flask-mail to send the user an email with their new password. I keep
getting IOError bad file descriptor when I run the code
app.config.update(
DEBUG=True,
#EMAIL SETTINGS
MAIL_SERVER='smtp.gmail.com',
MAIL_PORT... |
Tkinter: How to make a button center itself?
Question: I'm making a program in Python and I want to go with a layout that is a bunch
of buttons in the center. How do I make a button center itself using pack()?
Answer: If this can't resolve your problem
button.pack(side=TOP)
You'll need to use the... |
Remove 1 version of Python in Ubuntu
Question: So apparently I have 2 Pythons (same version) installed in different
folders...one is in `/usr/bin/` and the other one is in `/usr/local/bin` but
the one the shell uses when I type in `python` is the one in `/usr/local/bin`.
I'd like to use the `/usr/bin/` version because ... |
Python unit test mock, get mocked function's input arguments
Question: I want a unit test to assert that a variable `action` within a function is
getting set to its expected value, the only time this variable is used is when
it is passed in a call to a library.
Class Monolith(object):
def foo(sel... |
how to use a variable in requests library of python
Question: I'm trying to make a script which reads crunchyroll's rss and visits the LINK
in the latest upload and downloads subs from it.. the process goes like : 1.)
Read The latest episode link from RSS. 2.) Go to the link 3.) In the source
code, look for text "ssid"... |
Stopping a timer with a specific code
Question: I'm trying to make a Bomb timer than can be stopped at any given moment using
a specific code. which is 7355608
I've tried doing this but I fail at it, also please keep in mind I'm
relatively new to python.
Also, thanks in advance.
import time
de... |
Why do I keep getting a syntax error message (in Python) when using append?
Question: The syntax error is at line 9.
# -*- coding: UTF-8 -*-
import math
x = []
y = []
n = raw_input('How many points: ')
number = n
while n > 0:
x.append(input('enter x: ')
y.append(input(... |
LSTM with 12 input and output nodes with no embedding
Question: all I need is a RNN LSTM with 12 input nodes, 12 output nodes and have ability
to tweak hidden layers (their number and size).
The elements of input and output vectors can be real numbers or integers (I
have integers on input). Is it necessary to use one ... |
HtmlResponse from Scrapy doesn't retrieve the data from URL
Question: These are the code run in Ipython.
from scrapy.selector import Selector
from scrapy.http import HtmlResponse
response = HtmlResponse(url='https://en.wikipedia.org/wiki/Pan_American_Games')
datas = Selector(response=res... |
Where does my embedded python stdout go?
Question: Consider the following
[MWE](https://en.wikipedia.org/wiki/Minimal_Working_Example):
#include <Python.h>
#include <stdio.h>
int main(void) {
printf("Test 1\n");
Py_Initialize();
printf("Test 2\n");
PyRun_SimpleString(... |
Create a graphic with xls using Pylab in Python
Question: I'm using Python 3.4.1. I want to create a graphic using xls files instead of
csv. How can I do ? Can I create a graphic using xls files without converting
them ?
from pylab import*
name = []
value = []
readFile = open('fichier_t... |
Using South migrations with IBM Bluemix
Question: For a new app using Django 1.6, I am trying to create a `run.sh` that will run
the initial commands on Bluemix.
I found an answer
[here](https://developer.ibm.com/answers/questions/165725/unable-to-deploy-a-
python-django-application.html) that gives a run.sh file for ... |
Parsing a complex JSON object with Python: search a specific key/value pair
Question: **General question** : how can I search a specific `key:value` pair in a JSON
using Python?
**Details for the specific case** : I'm reading ~ 45'000 JSON objects, each
one of them look [like this
one](http://opac.sbn.it/opacmobilegw/... |
PyZDDE (Python Zemax DDE)
Question: It's first time when I use this tool (pyzdde). When I run simple program error
has occurred!
#**************** Add PyZDDE to Python search path **********
import sys
PyZDDEPath = 'C:\PyZDDE' # Assuming PyZDDE was unzipped here!
if PyZDDEPath not in sy... |
MST Clustering using Python
Question: I want to make clusters of nodes based on edges of a minimum spanning tree. I
used scipy to create minimum spanning tree. The following code:
file = open('/home/deep/Desktop/Lalit_jee/spanning.txt', 'w')
import euc_dist
import stan_devia
from scipy.sparse... |
Python str.translate VS str.replace
Question: Why in **_Python_** `replace` is ~1.5x quicker than `translate`?
In [188]: s = '1 a 2'
In [189]: s.replace(' ','')
Out[189]: '1a2'
In [190]: s.translate(None,' ')
Out[190]: '1a2'
In [191]: %timeit s.replace(' ','')
1000... |
PermissionError [errno 13] when running openpyxl python script in Komodo
Question: I am having trouble using openpyxl scripts in Komodo edit 9 and python 3.4 on
Windows 7. I copied some openpyxl code to learn, but it won't execute from
Komodo. I receive a permission error 13. I checked my path and python34 is
present. ... |
ImportError: No module named 'selenium'
Question: I'm trying to write a script to check a website. It's the first time I'm using
selenium. I'm trying to run the script on a OSX system. Although I checked in
/Library/Python/2.7/site-packages and selenium-2.46.0-py2.7.egg is present,
when I run the script it keeps tellin... |
Python Dictionary Trouble: Grouping by elements in tuple key
Question: so I have a dictionary that looks something like this, with 4 element tuples
as keys, and a list of lists as corresponding values. (yay indexing)
{('A002', 'R051', '02-00-00', 'LEXINGTON AVE'): [[datetime.datetime(2015, 6, 20, 0, 0),
... |
How to give input to a batch file using Python script?
Question: Let's say I have a batch file, which asks me for my name as input. I put my
name enter. This is the manual way.
But I wanted to try something with Python. Is it possible that I make a
variable in Python script and put my name in the variable and pass tha... |
How to configure Apache 2 to run a Python script from a Ruby CGI app with %x{}
Question: My Ruby CGI app is very simple, I would like to call a Python script, for
example `youtube-dl`, or `youtube-upload` with `%x{youtube-dl --help}`
For the sake of simplicity, I would like to print only the help page of the
`youtube-... |
How can i both register blueprint and add that app to flask-admin
Question: my Code:
__init__.py
from flask import Flask
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from... |
Python mechanize download file with original filename
Question: Working on a python script to scraping multi files from a website.
The download form html is something like this:
<span>
<a class="tooltip" href="download.php?action=download&id=xxx&authkey=yyy&pass=zzz" title="Download"... |
Copying excel rows via python
Question: I basically have one excel file with has the following entries in a particular
sheet
row[0][0]=hello
row[1][0]=bye
row[2][0]=hi
I want to copy these three rows into the number of rows present in the
original sheet, so that the modified sheet... |
Overload python function depending on the execution path
Question: I have a `main.py` script in a folder A. Nowaday, I use a separate file
`test.py` in order to test the result depending on the tested element.
I wanna use the `test.py` in the execution folder and not the one in the
folder A.
`main.py` in folder somew... |
How to insert a character in a string considering a few conditions in python
Question: Say I will ask the user to input a string. How can I add a character at the
end of every word that ends in "a", "e" or "o"?
For example, from
f = "O, awesome people, help me if ya will"
I'd have
f... |
maya to fbx with custom attributes
Question: I have a maya scene where each mesh has a list of custom attributes on the
shape node that I add dynamically using python.
import maya.cmds as cmds
import maya.mel as mm
#get mesh objects.
meshes = maya.cmds.ls(type="mesh")
for mesh in mes... |
Django - Slugs - Key (slug)=() is duplicated
Question: just started fooling around with Django and came across a link
[here](http://www.tangowithdjango.com/book17/chapters/models_templates.html)
on how to create slugs. I was told to perform the following changes to an
existing model:
from django.template... |
Sequence of object cleanup and functions called by atexit in Python module
Question: I am integrating a legacy C++ library with Python using boost-python. The
legacy library has some global initialization and then the classes in it use
application wide data. I need to ensure that the shutdown function of the
legacy lib... |
Connect to SQLite3 server using PyODBC, Python
Question: I'm trying to test a class that loads data from an SQL server given a query.
To do this, I was instructed to use `sqlite3`. Now, the problem is that while
the class manages to connect to the real database with ease, I'm struggling to
connect with the temporary `s... |
Python Decoding with Errors=Replace
Question: Using Python 2.7, I'm grabbing some HTML from a website as strings and
immediately decoding it into unicode. Because I need to know later where any
decoding errors occurred, I thought it would be best to use errors="replace"
to prevent exceptions from non-ASCII characters:
... |
Need to reorder list and make a sentence in python
Question: I need help rearranging this list alphabetically
list= ['z', 'a', 'b', 'y', 'c', 'x', 'd', 'w', 'e', 'v', 'f', 'g', 'u', 'h', 'i', 'j', 't' ,'k', 'l', 's', 'm', 'n', 'r', 'o', 'p', 'q', ' ']
into "hello world" by indexing into the array. ... |
trying to print a group from a regex match in python
Question: am trying to print the group info from my regex match match. My script matches
my regex versus line in my file, so that's working.
I have based this on the python regex tutorial btw ... I'm a python newbie
(with some perl experience) :)
impo... |
Your WSGIPath refers to a file that does not exist
Question: I'm trying to upload my Flask application to AWS however I receive an error on
doing so:
> Your WSGIPath refers to a file that does not exist.
After doing some digging online I found that in the .ebextensions folder, I
should specify the path. There was not... |
python logging not saving to file
Question: I have been stuck on this for the past hour. I had plugged logging into my
tkinter gui, but could not get it to work. I then started removing parts until
I got at the bare bones example in the very python docs and it will not work.
At this point I have nothing else to remove.... |
Disable pagination on the command line
Question: I am trying to write a script using the python module `pexpect` that will
connect to a server and execute commands like you are typing at the command
line.
So for example, you can have something like:
`child = pexpect.spawn('/usr/bin/ssh [email protected]')`
`child.sen... |
python Tkinter bind 2.7.9 w-d
Question: Hello I am having problems binding w+d in my code. I see how to do it with
Ctrl+/ and stuff like that but is it different to use two letters? I have
tried to do it a few different way here is the line i use.
root.bind('w-d',lambda x: upleftc())
Answer: It's ... |
How can I get python3.4 to find the PySDL2 module I downloaded on win7?
Question: I downloaded pySDL2 (from <https://bitbucket.org/marcusva/py-sdl2/downloads>)
and unzipped the SDL2 package to my folder C:\Python34\Lib\site-
packages\PySDL2-0.9.3, which has a subfolder sdl2 which has a subfolder ext.
I also copied a '... |
gdal_merge.py not working after gdal and it python bindings have been installed
Question: I installed Python 3.4.0 64 bit and gdal file
release-1400-x64-gdal-1-11-1-mapserver-6-4-1.zip from
<http://www.gisinternals.com/release.php>. I found the binding from
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal> and the file... |
passing selenium response url to scrapy
Question: I am learning Python and am trying to scrape this
[page](http://www.cppcc.gov.cn/CMS/icms/project1/cppcc/wylibary/wjWeiYuanList.jsp)
for a specific value on the dropdown menu. After that I need to click each
item on the resulted table to retrieve the specific informatio... |
Python regex : detect a word with duplicated chars
Question: I wonder if i could detect the word '**hey** ' but in this form : '**heeeey**
' How would i do that in python ? I searched many times but i didn't find an
answer.
*I want the program to get it like 'hey' at last, i want it to understand that 'heeey' means 'h... |
Simple explanation of security issues related to input() vs raw_input()
Question: I was reading this Python 2.7 tutorial and they're going over `raw_input()`,
and it mentions that:
> The input() function will try to convert things you enter as if they were
> Python code, but it has security problems so you should avoi... |
How do I find duplicates within two columns in a csv file, then combine them in Python?
Question: I am working with a large dataset of protein-protein interactions, which I
have in a .csv file. The first two columns are the interacting proteins, and
the order does not matter (ie A/B is the same as B/A, so they are dupl... |
Deleting all files in a folder in Python
Question: I am trying to make a program in Python that will delete all files in the
`%temp%` path, also known as `C:\Users\User\AppData\Local\Temp`.
How can I do this? I am using Python 3.4.
Answer: In general, you could use
[`shutil.rmtree()`](https://docs.python.org/3/libra... |
Can we pass the captured packets as argument to Socket send() function
Question: I'm beginner to Networking. We have sender and receiver application. I have
captured the packets sent by sender to receiver using WinDump.
I'm writing a python sender application which will fuzz the packets sent by
sender to receiver.
I ... |
Why does the following mouse click code results in Windows error 997?
Question: I am doing a mini project where a switch press results in a mouse click or in
other words the switch acts as an alternative to my left mouse button.
My code is
import pyautogui , time , serial
port = serial.Serial('... |
Python Encoding Issues
Question: I have data that I would like to decode from and its in Windows-1252 basically
I send code to a socket and it sends it back and I have to decode the message
and use IEEE-754 to get a certain value from it but I can seem to figure out
all this encoding stuff. Here is my code.
... |
I am trying to import a set of lists in python and call a random item from one of the lists
Question:
#Set of lists I want to import into my python program called "setlist.txt"
---------------------------------------------------------------------------------------------
Tripolee = ('Saeed Younan', 'Matrixx... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.