1 answer

Print new line in a file using Python

I used the following code. The genetarated_rtl.v file contains the text with \n character. It doesn't come up with a new line. But the new line character is printed. #!/usr/bin/python filePath ...

2 answers

more < operator in subprocess call Python

I have three csv file: 1.csv, 2.csv, 3.csv like these: ➜ ~ cat 1.csv 1,1,1,1,1,1 ➜ ~ cat 2.csv 2,2,2,2,2,2 ➜ ~ cat 3.csv 3,3,3,3,3,3 If I do: ➜ ~ cat < 1.csv < 2.csv < 3.csv ...

2 answers | 1 min ago by maxv15 on Stack Overflow stackoverflow.com
1 answer

selenium - python - identify suspected phishing sites

I'm trying running code (in Python) that can identify suspected phishing sites. I'm using Selenium's chromedriver. This is my code: import os, os.path, sys from selenium import webdriver from ...

0 answers

Advanced selecting using Pandas

Hello I am having trouble with missing data, According to the data that I should receive on a hourly bases. I should have for one year with 689 units (with random digits for their id) ---> ...

1 answer

Pip unable to open outgoing socket when inside virtualenv in cygwin

I'm getting a windows error when I try to use pip or easy_install inside virtualenvs. cygwin/python 2.7/windows 7 *** error: [Errno 10013] An attempt was made to access a socket in a way forbidden ...

2 answers

APScheduler run async function in Tornado Python

I am trying to develop a small app which will gather weather data from an API. I have used APScheduler to execute the function every x minutes. I use Python Tornado framework. The error I am getting ...

0 answers

import a module in current working directory

I have following directory structure, / __init__.py __meta__.py I tried to import __meta__ in a file but python complains about not finding a module named __meta__. I checked the current ...

0 answers

python 'ascii' codec can't encode characters

'ascii' codec can't encode characters in my script can you correct ? [ERR] Fatal error. (kenkaneki.py:801) 'ascii' codec can't encode characters in position 154-156: ordinal not in range(128) if ...

9 answers

Unresolved Import Issues with PyDev and Eclipse

I am very new to PyDev and Python, though I have used Eclipse for Java plenty. I am trying to work through some of the Dive Into Python examples and this feels like an extremely trivial problem that's ...

9 answers | 9 mins ago by Mr. F on Stack Overflow stackoverflow.com
1 answer

docker: is it possible to run containers from an other container?

I am running a dockerized python web application that has to run long tasks on certain requests (i.e. running some R scripts taking around 1 minute to complete). At the moment I put everything in one ...

2 answers

Send e-mail to Gmail with inline image using Python

My objective is to use Python to send an e-mail to a Gmail user that has an inline image. It is not possible to host this image online and then link to it through a href, due to the sensitive nature ...

0 answers

Python django module does not define attribute error, but the attribute is there in the code [SOLVED]

I get the following error when trying to build a migration in django 1.6.8: django.core.exceptions.ImproperlyConfigured: Module "django.template.loaders.app_directories" does not define a "Loader" ...

2 answers

Networkx shortest tree algorithm

I have a undirected weighted graph G with a set of nodes and weighted edges. I want to know if there is a method implemented in networkx to find a minimum spanning tree in a graph between given nodes ...

3 answers

Regex for repetitive part in string

I have strings as follows car.wheel car.wheel.mirror car.wheel.mirror.seats car.wheel.mirror.seats... I want to just extract car from this and avoid the properties of object that are appended such ...

3 answers | 15 mins ago by drt on Stack Overflow stackoverflow.com
1 answer

Python - pdsend datastream

First of all some context: Four MPR121 Breakout Boards (https://www.sparkfun.com/products/9695) connected via i2C to a Raspberry Pi 2. A python script reads the data from the four boards and sends it ...

2 answers

Python find out records in dataframe by column values greater than or equal to their median in each subgroup

suppose I have a dataframe which could be initiated by: df = pd.DataFrame({'group1': ['1','2','3','4','5','6'], 'group2': ['c','c','d','d','d','e'], 'value1': ...

3 answers

python - create dictionary of values from list with sub-lists

I want to create a json output that has the following output: [ {'data': [<val1>,<valn>], 'name': '<nameA>'}, {'data': [<val1>,<valn>], 'name': '<nameB>'} ] ...

3 answers | 19 mins ago by Algina on Stack Overflow stackoverflow.com
0 answers

Extract input address from a namecoin transaction given a 'name' operation

I have been trying to extract input addresses from Namecoin transactions using some python code. This code works for regular transactions (where some namecoins are transferred from one address to ...

0 answers

Trouble pickling and unpickling on OSX “non-string names in Numpy dtype unpickling”

I am trying to pickle and unpickle an instance of a data class that I am working with and it works all okay on Unix: import dataclass as dc data = dc.DataClass() f = open(filename, 'wb') ...

4 answers

Python, remove all non-alphabet chars from string

I am writing a python MapReduce word count program. Problem is that there are many non-alphabet chars strewn about in the data, I have found this post Stripping everything but alphanumeric chars from ...

4 answers | 22 mins ago by KDecker on Stack Overflow stackoverflow.com
0 answers

Is there anyway to get sample data from NEST thermostat or SMOKE CO devices ?

I am trying to some analysis on NEST based thermostat and SMOKE CO detectors. How to get the sample data of temparture recordings, humidity etc without purchasing the device, looking for sample ...

1 answer

User defined validators in Django fields

Django lets you define validators of a model field like this: field = models.CharField(..,validators=[],..) If I were to allow users to attach validators to a field, what would be the best way? ...

1 answers | 22 mins ago by user730936 on Stack Overflow stackoverflow.com
0 answers

app engine: ImportError: No module named Crypto.Hash

I have a script that uses Crypto.Hash but import fails with error: ImportError: No module named Crypto.Hash in my sys.path if I print the sys.path list, there is this entry (among others): ...

0 answers

How to find true positives, true negatives, false positives, false negatives in Python

I have trained a classifier in Python and i want to find the true positives, true negatives, false positives, false negatives when i am doing a new classification. The thing is that every time, my ...

1 answer

pymssql windows authentication

The pymssql module used to support windows authentication. Now it seems it does not. Though in some places it still shows that it should work. I have been unable to find a definitive answer to this ...

1 answer

Python zipfile dosen't release zip file

I'm trying to use zipfile library on windows 8.1 and python 2.7.9. I just want to remove library.zip after zipfile.open() but os.remove() throws "WindowsError [Error 32]" and it seems zipfile doesn't ...

0 answers

Saving excel work book not working in python

for sheet_name in book.sheet_names(): for index in range(len(tabs)): tab = tabs[index] if sheet_name == tab: dump_file_name = dump_files[index] ...

1 answer

Install taiga on local server error

I'm trying to install Taiga on my local server via this tutorial (http://taigaio.github.io/taiga-doc/dist/setup-production.html) I get stuck at the part where i have to input this code python ...

1 answers | 28 mins ago by fox on Stack Overflow stackoverflow.com
6 answers

How to find pg_config path

Complete newbie here, trying to set up Django to work with ProstgreSQL. I'm using mac osx 10.6.8. I have also installed PostgreSQL 9.3 When I run pip install psycopg2 in terminal I get the ...

6 answers | 29 mins ago by Ben on Stack Overflow stackoverflow.com
1 answer

Using break in Python if statement

I am having a beginner mistake and i can't see where I have gone wrong. I am trying to break the program if commandline argument[0] is empty. I'm running python on macports. import sys script = ...

1 answers | 33 mins ago by PooT on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3