Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
29,077,131
2015-03-16T12:43:00.000
3
0
1
0
python,python-2.7
29,077,205
1
false
0
0
What are the actual values of the strings you are comparing? If both are the same, this is because of the difference between the identity operator is and the equality operator ==. In short, is yields True when objects are identical. Because a new string is created in your example, it produces False. If you'd use == a d...
1
0
0
I was reading from the book How to Think Like A Computer Scientist: Learning with Python when I came across the following question: As an exercise, describe the relationship between string.join(string.split(song)) and song. Are they the same for all strings? When would they be different? (song had been defined as "The ...
string.split and string.join in Python 2.7
0.53705
0
0
540
29,077,291
2015-03-16T12:51:00.000
0
1
0
0
python,c,dll,cygwin,robotframework
29,102,050
1
true
0
0
Given our discussion in the comments. You can't mix and match like this. The format that Cygwin builds a DLL in is different that the format Windows expects a DLL in. You need to build and run all in one environment.
1
0
0
C program is compiled and converted into .dll using cygwin compiler.In python scripting it can be loaded using ctypes and call the functions successfully.But I import that python scripting as libraray into Robot Framework Automation tool,it cant load that .dll file and the test case also failed. is the cygwin created d...
Robot framework cant load .dll file created by cygwin into python script
1.2
0
0
406
29,079,698
2015-03-16T14:45:00.000
2
0
1
1
python,ansible,kvm,libvirt
29,079,838
1
false
0
0
Of course - if you have SSH access to it. Yes, you can run Ansible using its Python API or through command-line call. About passing YAML file - also - yes.
1
1
0
I have a specific requirement where I can use only Ansible in my host machine without vagrant. Two questions associated with it: Is it possible to spin up a VM over the host machine with libvirt/KVM as hypervisor using ansible ? I know there is a module called virt in ansible which is capable of doing this. But I c...
Spin up VM using Ansible without Vagrant
0.379949
0
0
561
29,079,923
2015-03-16T14:54:00.000
4
1
0
0
python,lambda,sympy
49,578,768
2
false
0
0
The above works well. In my case with Python 3.6, I needed to explicitly indicate that the saved and loaded files were binary. So modified the code above to: dill.dump(f, open("myfile", "wb")) and for reading: f_new=dill.load(open("myfile", "rb"))
1
8
0
Imagine the following three step process: I use sympy to build a large and somewhat complicated expression (this process costs a lot of time). That expression is then converted into a lambda function using sympy.lambdify (also slow). Said function is then evaluated (fast) Ideally, steps 1 and 2 are only done once, ...
Save/load sympy lambdifed expressions
0.379949
0
0
2,216
29,084,631
2015-03-16T18:46:00.000
0
0
0
0
python,linux,shared-libraries
29,085,462
1
false
0
0
Did you link in libglib when building libtest? That is, you need to have -lglib-2.0 in your link command line.
1
0
0
when i try to open (dlopen() in python) I get an error as above. libtest.so has some functions which use g_tree_new g_tree_new is defined in libglib-2.0.so.0 I tried setting the LD_LIBRARY_PATH to where libglib-2.0.so.0 is, but that does not help! Thank you
OSError: libtest.so: undefined symbol: g_tree_new
0
0
0
177
29,085,298
2015-03-16T19:24:00.000
0
0
0
0
python,windows,matlab,file,shared
29,085,388
3
true
0
0
I am not sure about window's API for locking files Heres a possible solution: While matlab has the file open, you create an empty file called "data.lock" or something to that effect. When python tries to read the file, it will check for the lock file, and if it is there, then it will sleep for a given interval. When m...
1
2
1
I have a Matlab application that writes in to a .csv file and a Python script that reads from it. These operations happen concurrently and at their own respective periods (not necessarily the same). All of this runs on Windows 7. I wish to know : Would the OS inherently provide some sort of locking mechanism so that o...
Shared file access between Python and Matlab
1.2
0
0
212
29,088,095
2015-03-16T22:27:00.000
0
0
0
0
python,opencv
29,088,394
1
false
0
0
You could probably use Haar cascades in openCv to do this. You will need to train haar detectors with both positive and negative samples of the logo but there is already utilities in openCv to help you with this. Just read up about haar in openCv documentation
1
2
1
I am currently making an application with OpenCV and a web server that finds certain car brands as part of an ongoing game in my family. However, I don't know where to start. I googled it but all I found was a post on finding a yellow ball. I want to find a car logo from a picture (which could be angled or glaring) so ...
Logo recognition in OpenCV
0
0
0
1,164
29,088,344
2015-03-16T22:50:00.000
0
0
0
0
python,web-development-server
37,997,045
1
false
1
0
For that you would need a web framework like Bottle or Flask. Bottle is a simple WSGI based web framework for Python. Using either of these you may write simple REST based APIs, one for set and other for get. The "set" one could accept data from your client side and store it on your database where as your "get" api sh...
1
0
0
I am in the middle of my personal website development and I am using python to create a "Comment section" which my visitors could leave comments at there in public (which means, everybody can see it, so don't worry about the user name registration things). I already set up the sql database to store those data but only ...
How I can get user input from browser using python
0
0
1
754
29,088,972
2015-03-16T23:51:00.000
-1
0
1
1
python,anaconda
37,975,575
3
false
0
0
I had a similar problem - was able to use conda from an anaconda prompt (found in the anaconda folder) and install packages I needed
2
9
0
All seemed to be working fine in my anaconda distribution on Mac. Then I tried to install the postgres library psycopg2 with conda install psycopg2. That threw an error. Something about permissions. But now nothing works. Now it can't even find the conda executable or start ipython. -bash: conda: command not found Sho...
How do I fix my anaconda python distribution?
-0.066568
0
0
14,137
29,088,972
2015-03-16T23:51:00.000
5
0
1
1
python,anaconda
29,105,951
3
false
0
0
You're going to have to reinstall Anaconda to fix this. Without conda, there's not much you can do to clean up the broken install.
2
9
0
All seemed to be working fine in my anaconda distribution on Mac. Then I tried to install the postgres library psycopg2 with conda install psycopg2. That threw an error. Something about permissions. But now nothing works. Now it can't even find the conda executable or start ipython. -bash: conda: command not found Sho...
How do I fix my anaconda python distribution?
0.321513
0
0
14,137
29,089,753
2015-03-17T01:16:00.000
0
0
1
1
python,python-multiprocessing
39,339,970
2
false
0
0
You can just run your program and see if there is python processes alive after the main process terminated. The correct way to terminate your program is making all the subprocesses terminated before the main process end. (Try to use Process.terminate() and Process.join() methods for all subprocesses before the main pro...
1
1
0
I am working with the multiprocessing module on a Unix system. I have noticed memory leaks when I terminate one of my programs. I was thinking that this might be because the processes that were started in the main process kept running. Is this correct?
Python: What happens when main process is terminated.
0
0
0
780
29,090,187
2015-03-17T02:10:00.000
1
0
1
0
python,encoding,character-encoding,decode,decoding
29,090,694
2
true
0
0
check the first char, if it is 0xFA, then code = second * 256 + third + 376
1
1
0
I'm on the last part of a decoding Python exercise, and this is really confusing me. The encoding represents the 376th to 65912th word with three chars: the first char is always (0xFA), the second is ((code - 376) // 256), and third is ((code - 376) % 256). For example, if the code is 30...
How to Apply Reverse Logic for Decoding?
1.2
0
0
63
29,092,291
2015-03-17T06:01:00.000
0
0
0
0
python,python-2.7,web-crawler,scrapy
29,092,568
2
false
1
0
You can use a file to pass the urls from scrapy to your python script. Or you can print the urls with a mark in your scrapy, and use your python script to catch the stdout of your scrapy.Then parse it to list.
1
0
0
I am working with a script where i need to crawl websites, need to crawl only base_url site. Anyone who has pretty good idea how i can launch scarpy in custom python scripts and get urls link in list?
How we can get List of urls after crawling website from scrapy in costom python script?
0
0
1
343
29,092,778
2015-03-17T06:38:00.000
1
0
1
0
python,python-3.x
35,227,246
6
false
0
0
print raw_input().lower()[::-1]
2
0
0
I am working on a script that takes the user input and reverses the whole input. for example if the user inputs "London" it will be printed as "nodnol" . I am currently being able to reverse the order of a certain number of letters but not being able to reverse the entire string .
How to reverse user input in Python
0.033321
0
0
25,279
29,092,778
2015-03-17T06:38:00.000
-1
0
1
0
python,python-3.x
36,003,390
6
false
0
0
string=input('Enter String: ') print (string[::-1]) string: heaven output:nevaeh
2
0
0
I am working on a script that takes the user input and reverses the whole input. for example if the user inputs "London" it will be printed as "nodnol" . I am currently being able to reverse the order of a certain number of letters but not being able to reverse the entire string .
How to reverse user input in Python
-0.033321
0
0
25,279
29,095,769
2015-03-17T09:42:00.000
0
0
0
0
python,scikit-learn,bigdata,mixture-model
60,111,168
4
false
0
0
As Andreas Mueller mentioned, GMM doesn't have partial_fit yet which will allow you to train the model in an iterative fashion. But you can make use of warm_start by setting it's value to True when you create the GMM object. This allows you to iterate over batches of data and continue training the model from where you ...
3
3
1
I have a large data-set (I can't fit entire data on memory). I want to fit a GMM on this data set. Can I use GMM.fit() (sklearn.mixture.GMM) repeatedly on mini batch of data ??
Sklearn-GMM on large datasets
0
0
0
3,292
29,095,769
2015-03-17T09:42:00.000
0
0
0
0
python,scikit-learn,bigdata,mixture-model
36,488,496
4
false
0
0
I think you can set the init_para to empty string '' when you create the GMM object, then you might be able to train the whole data set.
3
3
1
I have a large data-set (I can't fit entire data on memory). I want to fit a GMM on this data set. Can I use GMM.fit() (sklearn.mixture.GMM) repeatedly on mini batch of data ??
Sklearn-GMM on large datasets
0
0
0
3,292
29,095,769
2015-03-17T09:42:00.000
2
0
0
0
python,scikit-learn,bigdata,mixture-model
29,109,730
4
false
0
0
fit will always forget previous data in scikit-learn. For incremental fitting, there is the partial_fit function. Unfortunately, GMM doesn't have a partial_fit (yet), so you can't do that.
3
3
1
I have a large data-set (I can't fit entire data on memory). I want to fit a GMM on this data set. Can I use GMM.fit() (sklearn.mixture.GMM) repeatedly on mini batch of data ??
Sklearn-GMM on large datasets
0.099668
0
0
3,292
29,095,949
2015-03-17T09:51:00.000
8
0
1
0
python,pydev
38,560,011
2
false
0
0
pip uninstall traitlets just worked for me.
1
6
0
I get the following error code when trying to run an interactive python console in pydev I can't figure out what is wrong. When I google about the Console already exited with value: 1 part of the error, nothing useful comes up. What is stranger is that this thing occurs in only one of my python workspace projects. O...
pydev console already ex
1
0
0
1,996
29,097,191
2015-03-17T10:50:00.000
3
0
1
0
python,enthought,canopy
29,098,226
3
true
0
0
This has nothing to do with Canopy per se. It is how Python works in general. Once a module is loaded, it is not reloaded/recompiled if you change it. This can be avoided with reload as suggested in one of the other answers. There were different attempts in the past at having auto-reload mechanism but none of them were...
2
0
0
I am using Canopy Version: 1.4.1 (64 bit) on a Windows 7. I have two files A.py and B.py. A.py contains some modules and B.py imports one of A.py's modules. When I change something on A.py and then run B.py a new compiled A.py (A.pyc) should be created but this is not the case when using the canopy IDE. However a A.py ...
Enthought Canopy does not create .pyc file
1.2
0
0
395
29,097,191
2015-03-17T10:50:00.000
0
0
1
0
python,enthought,canopy
29,097,892
3
false
0
0
Not sure if this will fit the question, but you also can use: python -m compileall . from a command line pointed to your modules dir.
2
0
0
I am using Canopy Version: 1.4.1 (64 bit) on a Windows 7. I have two files A.py and B.py. A.py contains some modules and B.py imports one of A.py's modules. When I change something on A.py and then run B.py a new compiled A.py (A.pyc) should be created but this is not the case when using the canopy IDE. However a A.py ...
Enthought Canopy does not create .pyc file
0
0
0
395
29,100,233
2015-03-17T13:23:00.000
1
0
0
0
wxpython
29,101,131
3
false
0
1
If your trouble is to pass an argument to the function, consider following: self.Bind(wx.EVT_BUTTON, lambda e: otherFunction(arg1, arg2), button_name)
1
1
0
I'm using wxpython. I'd like to solve a simple problem for a GUI that consists of a button "Add", which when pressed creates a new button called "Remove". You can press "Add" as many times as you like and many remove buttons are created and added to the panel. What I would like is for when you press one of the remove b...
A simple example for adding and removing buttons in wxpython
0.066568
0
0
2,124
29,102,422
2015-03-17T14:56:00.000
1
0
0
0
python,mysql,django,eclipse,pydev
29,493,720
1
true
1
0
I am a mac user. I have luckily overcome the issue with connecting Django to mysql workbench. I assume that you have already installed Django package created your project directory e.g. mysite. Initially after installation of MySQL workbench i have created a database : create database djo; Go to mysite/settings.py and...
1
0
0
I am new to this so a silly question I am trying to make a demo website using Django for that I need a database.. Have downloaded and installed MySQL Workbench for the same. But I don't know how to setup this. Thank you in advance :) I tried googling stuff but didn't find any exact solution for the same. Please help
Connect MySQL Workbench with Django in Eclipse in a mac
1.2
1
0
1,235
29,104,675
2015-03-17T16:34:00.000
3
0
0
1
python,logrotate,log-rotation
29,104,883
2
false
0
0
RotatingFileHandler allows a log file to grow up to size N, and then immediately and automatically rotates to a new file. logrotate.d runs once per day usually. If you want to limit a log file's size, logrotate.d is not the most helpful because it only runs periodically.
1
12
0
Python has its own RotatingFileHandler which is supposed to automatically rotate log files. As part of a linux application which would need to rotate it's log file every couple of weeks/months, I am wondering if it is any different than having a config file in logrotate.d and using a WatchedFileHandler instead. Is ther...
Is there a difference between RotatingFileHandler and logrotate.d + WatchedFileHandler for Python log rotation?
0.291313
0
0
4,420
29,105,684
2015-03-17T17:22:00.000
0
0
0
1
python,build,permissions,chromium
29,161,669
2
true
0
0
Actually the directory was not mounted with execution permission. So I remounted the directory with execution permission using mount -o exec /dev/sda5 /media/usrname and it worked fine.
1
0
0
I am getting the following error while running gclient runhooks for building chromium. running '/usr/bin/python src/tools/clang/scripts/update.py --if-needed' in '/media/usrname/!!ChiLL out!!' Traceback (most recent call last): File "src/tools/clang/scripts/update.py", line 283, in sys.exit(main()) File "src/to...
Chromium build gclient runhooks error number 13
1.2
0
1
769
29,106,586
2015-03-17T18:06:00.000
0
0
0
1
java,javascript,android,python,ios
29,106,853
1
false
0
0
Add #!/bin/bash or #!/usr/bin/env bash as the very first line of the script that you're executing.
1
0
0
i installed Docker in debian wheezy 64bit and when i try to run it these error are displayed: /usr/local/bin/docker: line 1: --2015-03-17: command not found /usr/local/bin/docker: line 2: syntax error near unexpected token (' /usr/local/bin/docker: line 2:Resolving get.docker.io (get.docker.io)...162.242.195.84' how to...
Docker not run in debian wheezy
0
0
0
72
29,107,842
2015-03-17T19:18:00.000
2
0
0
0
python,tkinter,tkinter-canvas
29,107,985
1
true
0
1
It is not possible to reset the id numbers generated by a canvas. Your solution of deleting and recreating the canvas is a reasonable alternative, though it may not be necessary. There are probably better ways to do whatever it is you think is solved by resetting canvas ids. For example, you could generate your own id...
1
2
0
I am coding a Tkinter GUI for a senior research project at school. I need to, at some point in the code, reset the counter used to create id values for new additions. Does anyone know if this is possible beside replacing the entire canvas? Basically, after adding a bunch of lines and ovals, I need to delete them all ...
Tkinter Canvas reset ID's
1.2
0
0
813
29,108,020
2015-03-17T19:28:00.000
0
0
0
1
python,hadoop,mapreduce,hadoop-streaming
34,297,373
1
false
0
0
This may be done by packaging the dependencies and the reducer script in a zip, and adding this zip as a resource in Hive. Let's say the Python reducer script depends on package D1, which in turn depends on D2 (thus resolving OP's query on transitive dependencies), and both D1 and D2 are not installed on any machine in...
1
0
0
I have a hive query with custom mapper and reducer written in python. The mapper and reducer modules depend on some 3rd party modules/packages which are not installed on my cluster (installing them on the cluster is not an option). I realized this problem only after running the hive query when it failed saying that the...
Python packaging for hive/hadoop streaming
0
0
0
496
29,111,073
2015-03-17T22:40:00.000
0
0
1
0
python,module,compilation
31,042,764
1
true
0
1
The problem seems to have been an issue with the version of python I had installed. A new installation is able to run long modules fine, without any noticeable delay even from pressing f5 to first print statement.
1
0
0
I have written a Python module designed to solve the Tetris cube tiling puzzle, and it contains a lot of code, but it doesn't want to run, when I press f5 to run the program, the shell restarts, but then stops working, even when I enable debugging nothing happens still. I put a print statement at the very start of the ...
Does python have a limitation on the amount of code in a module?
1.2
0
0
118
29,111,388
2015-03-17T23:06:00.000
0
1
0
0
python,twitter,bots,twitter-follow
29,111,422
1
false
0
0
In from twitter import Twitter, OAuth, TwitterHTTPError "Twitter" does not exists in "twitter". Try to re-download or double check if that file is even within "twitter".
1
0
0
Hy. So I installed python 2.7.9 and the twitter follow bot from github. I don't really know what I'm doing wrong but when I try to use a command I get an error. using this from twitter_follow_bot import auto_follow_followers_for_userresults in this Traceback (most recent call last): File "<pyshell#2>", line 1, in <mo...
twitter python script generates error
0
0
1
249
29,111,407
2015-03-17T23:09:00.000
1
0
1
1
python,multiprocessing
29,111,506
1
false
0
0
I/O goes to the system cache in RAM before hitting a hard drive. Fro writes, you may find the copies are fast until you exhaust RAM and then slows down and that multiple reads of the same data are fast. If you copy the same file to several places, there is an advantage to do the copies of that file before moving to the...
1
0
0
I would like to know if there is any benefit to using python2.7's multiprocessing module to asynchronously copy files from one folder to another. Is diskio always forced to be in serial? Does this change if you are copying from one hard disk to a different hard disk? Does this change depending on operating system (win...
Is there any benefit to using python2.7 multiprocessing to copy files
0.197375
0
0
53
29,111,443
2015-03-17T23:12:00.000
0
0
1
0
python,regex,whitespace,removing-whitespace
71,220,983
4
false
0
0
Input File: filea.txt (With many spaces) dragon dragonballs test.py filea = open('filea.txt','r') fileb = open('fileb.txt','a') for line in filea: for i in range(len(line)): if ' \n' in line: line = line.replace(' \n','\n') fileb.write(line) op: fileb.txt dragon dragonballs
1
3
0
How can I check if a Python string at any point has a single space before new line? And if it does, I have to remove that single space, but keep the new line symbol. Is this possible?
Remove Space at end of String but keep new line symbol
0
0
0
3,187
29,112,631
2015-03-18T01:20:00.000
0
0
0
0
python,user-interface,wxpython
29,130,791
1
false
0
1
You probably can't do that in a normal toolbar. However, you can easily just roll your own toolbar by using a horizontally oriented BoxSizer and adding the necessary widgets to it. Then you can add the text control with the correct proportion and the wx.EXPAND flag.
1
0
0
Is there any form to set a 100% of horizontal size for TextCtrl in Toolbar? Because I have been looking for about this in the documentation and I did not found anything.
Is there any form to set a 100% of horizontal size for TextCtrl in Toolbar?
0
0
0
20
29,114,480
2015-03-18T05:02:00.000
0
0
0
0
python-2.7,scrapy,virtualenv,virtualenvwrapper
29,121,164
1
false
1
0
You need to pip install all the set-up within the virtualenv.
1
0
0
I create a virtualenv name as ScrapyProject. when I use scrapy command or pip command it does not work but when I enter the python command it works. Here is how he shows me. (ScrapyProject) C:\Users\Jake\ScrapyProject>scrapy (ScrapyProject) C:\Users\Jake\ScrapyProject>pip (ScrapyProject) C:\Users\Jake\ScrapyProject>py...
Commands not working in ScrapyProject
0
0
0
40
29,116,195
2015-03-18T07:20:00.000
0
0
0
0
python-2.7,e-commerce,shopping-cart,turbogears2,satchless
29,133,585
1
true
0
1
Stroller is a pretty old project that is not maintained anymore. The reason why it was not working for you is that it was still pending some changes required to make it compatible with TG2.3+, it was compatible only with <=2.2. And so was looking for some Pylons imports. To solve your problem I just released stroller 0...
1
0
0
I'am trying to build an e-commerce website using turbogears. Initially I modified the tgapp-photos to make the items come on the page properly. But then I find it difficult to make cart from the scratch and hence thought to use stroller. However, when I'am plugging it in the config.py file, all of a sudden my app stops...
stroller (turbogears) not working
1.2
0
0
56
29,119,880
2015-03-18T10:43:00.000
0
0
0
0
python,numpy,matrix-inverse
29,120,093
3
false
0
0
linalg is right and you are wrong. The matrix it gave you is indeed the inverse. However, if you are using np.array instead of np.matrix then the multiplication operator doesn't work as expected, since it calculates the component-wise product. In that case you have to do mat.dot(inv(mat)). In any case, what you will ge...
1
1
1
I'm trying to generate the inverse matrix using numpy package in python. Unfortunately , I'm not getting the answers I expected. Original matrix: ([17 17 5] [21 18 21] [2 2 19]) Inverting the original matrix by Cramer's rule gives: ([4 9 15] [15 17 6] [24 0 17]) Apparently using numpy.linalg.inv() gives -3.1948881...
How to calculate inverse using cramer's rule in python?
0
0
0
2,359
29,122,343
2015-03-18T12:40:00.000
0
0
1
0
python,csv,xlsx,string-split
29,122,418
2
false
0
0
You can get rid of the newlines in the field by doing a string .replace('\n', ' ') on it.
1
1
0
I have an issue where I am reading a csv file as a file ( easier for me to get results that reading as csv) that is exported from an application. I have my code working to read that file and import it into a list. Then I iterate through the list and save to the appropriate fields. I am using the built in method .split(...
Python split string(',') issue on a csv field
0
0
0
123
29,124,446
2015-03-18T14:16:00.000
0
0
0
1
python,mongodb,tornado
29,156,089
1
false
0
0
You need to understand how Tornado works asynchronously. Everytime you yield a Future object, Tornado suspends current coroutine and jumps to the next coroutine. Doing queries synchronous or asynchronous depends on the situation. If your query is fast enough, you can use synchronous driver. Also, keep in mind, jumping ...
1
0
0
Basically, what is a Futures on Tornado's approach? I've read on some stackoverflow threads that a tornado coroutine must return a Future, but returning a Future how do my db queries work? Using Futures will my Tornado app be waiting for the query to return anything like a blocking i/o or it will just dispatch the requ...
Do I need to use Tornado Futures with Motorengine?
0
0
0
113
29,127,341
2015-03-18T16:22:00.000
4
0
0
1
python,linux,queue,pipe,fifo
30,587,524
8
false
0
0
There are several options 1) If the daemon should accept messages from other systems, make the daemon an RPC server - Use xmlrpc/jsonrpc. 2) If it is all local, you can use either TCP sockets or Named PIPEs. 3) If there will be a huge set of clients connecting concurrently, you can use select.epoll.
2
9
0
I have a Python daemon running on a Linux system. I would like to feed information such as "Bob", "Alice", etc. and have the daemon print "Hello Bob." and "Hello Alice" to a file. This has to be asynchronous. The Python daemon has to wait for information and print it whenever it receives something. What would be the be...
How to feed information to a Python daemon?
0.099668
0
0
2,615
29,127,341
2015-03-18T16:22:00.000
0
0
0
1
python,linux,queue,pipe,fifo
30,565,140
8
false
0
0
Why not use signals? I am not a python programmer but presumably you can register a signal handler within your daemon and then signal it from the terminal. Just use SIGUSR or SIGHUP or similar. This is the usual method you use to rotate logfiles or similar.
2
9
0
I have a Python daemon running on a Linux system. I would like to feed information such as "Bob", "Alice", etc. and have the daemon print "Hello Bob." and "Hello Alice" to a file. This has to be asynchronous. The Python daemon has to wait for information and print it whenever it receives something. What would be the be...
How to feed information to a Python daemon?
0
0
0
2,615
29,129,589
2015-03-18T18:10:00.000
0
0
1
0
python,mysql,linux,amazon-ec2,rds
29,169,114
1
false
0
0
I solved this by upping my instance type to a m3.Large instance without limited CPU credits. Everything works well now.
1
0
0
I have some very peculiar behavior happening when running a data importer using multiprocessor in python. I believe that this is a database issue, but I am not sure how to track it down. Below is a description of the process I am doing: 1) Multiprocessor file that runs XX number of processors doing parts two and thr...
Importing data to mysql RDS with python multiprocessor - RDS
0
1
0
260
29,132,741
2015-03-18T21:10:00.000
2
0
0
0
python,qt,pyqt,pyside
29,132,919
1
false
0
1
One way to do it is to use viewmodels. Have one QAbstractItemModel adapter to your underlying data model. All interaction must pass through that model. When you need to further adapt the data to a view, simply use a proxy view model class that refers to the adapter above and reformats/adapts the data for a view. All th...
1
2
0
I've been working really hard trying to find a solution to this for the past few weeks. I have committed to a direction now, but I am still not entirely satisfied with what I have come up with. Asking this now purely out of curiosity and for hope of a more proper solution for next time. How on earth do I keep multiple ...
How to keep multiple QAbstractItemModel classes in sync
0.379949
0
0
442
29,133,682
2015-03-18T22:12:00.000
1
0
1
1
python
29,135,637
2
false
0
0
If I were a beginner, I would have my remote script periodically check the value of the variable in a text file. When I needed to update the variable, I would just ssh to my remote machine and update the text file.
1
1
0
I have a python script running on a vps. Now i just want to change 1 variable in the running script using my desktop computer. What is the simplest way to that for a beginner?
simplest way to make two python scripts talk to each other?
0.099668
0
0
1,235
29,133,963
2015-03-18T22:33:00.000
3
0
0
0
python,nginx,flask,virtualenv,uwsgi
29,134,999
1
true
1
0
First of all, Nginx never goes in Virtualenv. It is a os service and has nothing to do with python. It only serves webrequests and knows how to pass them to a upstream service (like uwsgi). Second; don't put things in virtualenv that don't need seperate versions. Uwsgi is quite stable now, so you will almost never need...
1
2
0
Seems like a simple question but I cannot find it addressed anywhere. Every tutorial I look at does things slightly differently, and I'm pretty sure I've seen it done both ways. In my development environment, python, flask, and all other dependencies of my application go inside the Virtual Environment. When configuri...
nginx + uwsgi + virtual environment. What goes inside?
1.2
0
0
445
29,135,426
2015-03-19T00:55:00.000
1
0
0
0
python,gevent,greenlets
31,060,953
2
true
0
0
You are not leaking resources in the sense that all the used memory will be properly cleaned up when the greenlet dies (and the garbage collection happens, which is automatic). So I would not worry about that. Of course, your description of your architecture does not make it appear very robust. So while you do not leak...
1
1
0
We're using gevent in a long-lived Python process, and over time we spawn thousands upon thousands of Greenlets. We're not joining any of these Greenlets; we just spawn-and-forget. (The Greenlet tasks themselves are short-lived and do exit.) Is that all right? Are we leaking any resources by not joining the Greenlet...
Is It Okay Not to Join Any of My Greenlets?
1.2
0
0
520
29,137,043
2015-03-19T04:05:00.000
0
1
1
0
python,hash
29,137,224
1
true
0
0
Search on StackOverflow for code to recursively list full file names in Python Search on StackOverflow for code to return the hash checksum of a file Then list files using an iterator function. Inside the loop: Get the hash checksum of the current file in the loop Iterate through every hash. Inside the loop: Compare...
1
0
0
I have a text file of size 2.5 GB which contains hash values of some standard known files. My task is to find the hash of all files on my file system and compare it with the hashes stored in the text file. If a match is found I need to print Known on the screen and if no match is found then I need to print unknown on ...
Perform searching on very large file programatically in Python
1.2
0
0
62
29,138,054
2015-03-19T05:54:00.000
17
0
1
0
python
29,138,079
3
false
0
0
In python string literals, the '\t' pair represents the tab character. So you would use mystring.replace('\t', 'any other string that you want to replace the tab with').
1
15
0
I need to replace tabs in a string, but only the tabs, not the spaces. If I use the str.replace() function, what would go in the first set of quotes?
How to replace tabs in a string?
1
0
0
51,177
29,141,492
2015-03-19T09:57:00.000
2
0
0
0
python,django,caching
29,141,865
1
false
1
0
You can write a so called warm up script. This is just a script that opens the URLs you want to habe in the cache. Run this script as a periodic task. The simplest Version would be a shell script with curl statements in it tha is periodicly executed by cron. The intervall with which you call it depends on your cache se...
1
1
0
I have one problem when I using cache in Django. Is it possible to load the page and update cache auto? I don't want my first user wait when cache needs to be updated. Thank you.
Auto update cache in Django
0.379949
0
0
537
29,142,050
2015-03-19T10:24:00.000
1
0
1
0
python,python-3.x,virtualenv
29,143,675
1
true
0
0
I have fixed this by just installing a more recent version of Python 3 (Python 3.4.3 to be exact). My virtualenvs running Python 3.4.1 seemed to have upgraded by themselves.
1
1
0
Is there a way to upgrade e.g. python 3.4.1 to 3.4.3 on my virtualenv? I can't see and google results teaching to upgrade from pythong 3.x to 3.+x Thanks! EDIT: I have to emphasize that i am talking about upgrading my virtualenv's python 3 to a more recent version, not upgrading python 2.
upgrade virtualenv python 3 to 3.4.3
1.2
0
0
265
29,146,792
2015-03-19T14:08:00.000
21
0
1
1
python,docker,virtualenv
53,656,409
3
false
0
0
Here is my two cents, or rather comments on @gru 's answer and some of the comments. Neither docker nor virtual environments are virtual machines every line in your docker file produces overhead. But it's true that at runtime virtual environments have zero impact the idea of docker containers is that you have one proc...
2
27
0
You can build a container with Dockerfile in a few seconds. Then why do people need to install a virtual enviroment inside the docker container? It's like a "virtual machine" in a virtual machine ?
Why do people create virtualenv in a docker container?
1
0
0
11,721
29,146,792
2015-03-19T14:08:00.000
30
0
1
1
python,docker,virtualenv
33,150,800
3
true
0
0
I am working with virtualenvs in Docker and I think there are several reasons: you may want to isolate your app from system's python packages you may want to run a custom version of python but still keep the system's packages untouched you may need fine grain control on the packages installed for a specific app you ma...
2
27
0
You can build a container with Dockerfile in a few seconds. Then why do people need to install a virtual enviroment inside the docker container? It's like a "virtual machine" in a virtual machine ?
Why do people create virtualenv in a docker container?
1.2
0
0
11,721
29,148,746
2015-03-19T15:32:00.000
1
0
0
0
python,scikit-learn,cluster-analysis,mean-shift
29,149,537
1
true
0
0
The standard deviation of the clusters isn't 1. You have 8 dimensions, each of which has a stddev of 1, so you have a total standard deviation of sqrt(8) or something like that. Kernel density estimation does not work well in high-dimensional data because of bandwidth problems.
1
1
1
I am working with the Mean Shift clustering algorithm, which is based on the kernel density estimate of a dataset. I would like to generate a large, high dimensional dataset and I thought the Scikit-Learn function make_blobs would be suitable. But when I try to generate a 1 million point, 8 dimensional dataset, I end u...
Generating high dimensional datasets with Scikit-Learn
1.2
0
0
681
29,149,000
2015-03-19T15:42:00.000
0
0
0
0
python,sockets,server-side
29,149,290
1
true
0
0
If you are asking about function 'listen': 'backlog' argument is the maximum length to which the queue of pending connections for socket may grow. If a connection request arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol support...
1
0
0
I recently started searching for socket programming, and decided to use python for testing. I have the following question: As I read, you can only listen for a limited number of connections in a server-side socket, thus you can only have such a number of connections operating at a time. Is there a way to be able to hol...
Arbitrarily large number of sockets - Python
1.2
0
1
103
29,149,806
2015-03-19T16:17:00.000
0
1
0
0
python,azure,oauth-2.0,identity,app-secret
30,823,957
5
false
0
0
When Key Vault returns a 401 response, it includes a www-authenticate header containing authority and resource. You must use both to get a valid bearer token. Then you can redo your request with that token, and if you use the same token on subsequent requests against the same vault, it shouldn't return a 401 until the ...
1
2
0
I am very interested in using the new service recently released for secret management within Azure. I have found a few example guides walking through how to interact with key vault via powershell cmdlets and c#, however haven't found much at all in regards to getting started with using the rest API. The thing I am p...
Interacting with Azure Key Vault using python w/ rest api
0
0
0
5,475
29,149,900
2015-03-19T16:22:00.000
0
1
0
0
python,xml,matlab,xml-parsing
29,150,179
1
false
0
0
Matlab brings it's own perl installation located at fullfile(matlabroot, 'sys\perl\win32\bin\'). Probably here the additional resources are missing. Navigate to this folder and install the requirements using ppm
1
0
0
I have a program written in Perl, and I want to execute this program in MATLAB. In this program I am calling an XML file, but on execution, I am getting XML: DOM error as Error using perl (line 80) System error: Can't locate XML/DOM.pm in @INC, etc. How can I get out of this error? Program is executing in Perl very wel...
XML DOM ERROR when executing Python program in perl
0
0
1
56
29,155,374
2015-03-19T21:31:00.000
1
0
0
0
python,nls-lang
29,155,927
1
false
0
0
Apologies all, Further reading of the documentation says: The XXXX Server provides National Language Support (NLS) for all string values returned across the CORBA API. The client application specifies the locale of these strings by calling the setNLSLocale method. If the locale is not set the string values are retur...
1
1
0
I'm using a Corba library where the target returns error messages with NLS encoding. e.g: wideNlsText=u'$NLS[30822b0b\x01888\x01$NLS[30822ae5\x013\x01Subscriber NPA]NLS$]NLS$' Other than $NLS starts and NLS$ ends the string, what can I do to translate these into a more acessable text string?
Python: Decoding NLS encoded text
0.197375
0
0
175
29,157,039
2015-03-19T23:50:00.000
1
0
0
1
python,c,mpi,mpi4py
29,256,366
1
true
0
0
MPI_Recvreduce is what you're looking for. Unfortunately, it doesn't exist yet. It's something that the MPI Forum has been looking at adding to a future version of the standard, but hasn't yet been adopted and won't be in the upcoming MPI 3.1.
1
2
1
I use the MPI_Sendrecv MPI function to communicate arrays of data between processes. I do this in Python using mpi4py, but I'm pretty sure my question is independent of the language used. What I really want is to add an array residing on another process to an existing local array. This should be done for all processes,...
MPI_Sendrecv with operation on recvbuf?
1.2
0
0
127
29,163,495
2015-03-20T09:40:00.000
0
0
0
0
wcf,ironpython
29,182,774
1
true
1
0
Resolved like this : I have a Memory stream on the server which compiles and executes the code then reads the data from the stdout and sends it back to the client.
1
0
0
Is it possible to register the console output of a client through a server. I'm assuming this can be done through a NetworkStream? Right now, I register the output of a desktop app to stdout through the SetOutput method provided inside Runtime.IO of IronPython. This method accepts a Stream as an arugment but the proble...
Registering output to stdout through wcf in IronPython?
1.2
0
0
36
29,168,026
2015-03-20T13:45:00.000
1
0
1
0
python,tornado
29,173,394
1
true
0
0
r"/*.jpg" is a file glob pattern, not a regular expression. The equivalent regular expression would be r"/.*\.jpg".
1
0
0
I want to map "/aaa.jpg" and "/bbb.jpg".... with the same Handler I write the code as(r"/*.jpg", ImageHandler"), it that correct ? It doesn't work for me..
tornado, How to map URL and handler with a regular expression way
1.2
0
0
349
29,170,268
2015-03-20T15:33:00.000
0
0
0
0
python,sql
29,170,744
2
false
0
0
For the first question (how do I make sure I'm not duplicating ingredients?), if I understand well, is basically put your primary key as (i_id, name) in the table ingredients. This way you guarantee that is impossible insert an ingredient with the same key (i_id, name). Now for the second question (how do I insert the ...
1
0
0
I'm not sure what exactly the wording for the problem is so if I haven't been able to find any resource telling me how to do this, that's most likely why. The basic problem is that I have a webcrawler, coded in Python, that has a 'Recipe' object that stores certain data about a specific recipe such as 'Name', 'Instruct...
Inserting data into SQL database that needs to be linked
0
1
0
45
29,171,316
2015-03-20T16:23:00.000
0
0
1
0
python,json,geojson
35,938,076
2
false
0
0
Well the easiest way would be to loop through your feature collection and extract the geometry from there. I assume you have found the answer to your question by now, since there hasn't been another post since?
1
0
0
I currently have a GeoJSON FeatureCollection, but the function I need to execute on this file in Python only supports GeoJSON geometry objects such as Point or Polygon (without all of the attribute and coordinate data). Is there a way to simply convert a GeoJSON FeatureCollection to a GeoJSON geometry object in Python?
Converting GeoJSON FeatureCollection to GeoJSON geometry object
0
0
0
1,732
29,178,949
2015-03-21T03:37:00.000
1
0
1
0
python,git
29,179,099
1
true
0
0
Absolute paths that depend on your specific computer do not belong in version control. A good solution would be to have your program read an environment variable and use it as the path. Make sure to set a sensible default if the environment variable is unset.
1
1
0
I am using a python program on 2 different computers. On computer 1 some path (e.g., to an image or something), used by the program, is, say, a/b/ On computer 2, the equivalent path is different, say, b/a/ (the image, e.g., is in a different folder) When I want to run the script on computer 1 I pull the code and set ...
Ignore part of file in git when using on 2 different computers (python)
1.2
0
0
48
29,179,381
2015-03-21T04:55:00.000
4
0
1
0
python,python-2.7,python-3.x
29,179,603
2
false
0
0
The "right" way is to translate the Py2-only module to Py3 and offer the translation upstream with a pull request (or equivalent approach for non-git upstream repos). Seriously. Horrible hacks to make py2 and py3 packages work together are not worth the effort.
1
2
0
I wish to write a python script for that needs to do task 'A' and task 'B'. Luckily there are existing Python modules for both tasks, but unfortunately the library that can do task 'A' is Python 2 only, and the library that can do task 'B' is Python 3 only. In my case the libraries are small and permissively-licensed e...
What is the correct way (if any) to use Python 2 and 3 libraries in the same program?
0.379949
0
0
67
29,179,631
2015-03-21T05:35:00.000
17
0
1
0
python,contextmenu,edit,python-idle
45,523,858
11
false
0
0
As a newer update, for people that are having the "missing idle" issue with Windows 10 using Python 3.6 (64-bit). From my experience, this happens when you install other python editors, and you change your default app to open with that editor. The easiest way to fix this issue is to click the "start" button, then navig...
6
25
0
I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some o...
"Edit with IDLE" option missing from context menu
1
0
0
60,527
29,179,631
2015-03-21T05:35:00.000
3
0
1
0
python,contextmenu,edit,python-idle
52,921,669
11
false
0
0
I got the "Edit with IDLE" back with the option "Repair" of the deinstallation-menu.
6
25
0
I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some o...
"Edit with IDLE" option missing from context menu
0.054491
0
0
60,527
29,179,631
2015-03-21T05:35:00.000
0
0
1
0
python,contextmenu,edit,python-idle
45,709,793
11
false
0
0
I think the majority of cases are caused by the Py launcher that comes with Python 3. When you install Python 3 alongside Python 2.x, the *.py and *.pyw files are associated to run with the new Py launcher. Since *.py and *.pyw files are no longer associated with Python.exe, that breaks the "Edit with IDLE" and similar...
6
25
0
I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some o...
"Edit with IDLE" option missing from context menu
0
0
0
60,527
29,179,631
2015-03-21T05:35:00.000
-1
0
1
0
python,contextmenu,edit,python-idle
51,091,088
11
false
0
0
After uninstalling both 2.7 and 3.6, reinstalling 3.6, I ran the init.py ,main.py, and idle.pyw found in C:\Program Files\python\Lib\idlelib and the edit with menu reappeared
6
25
0
I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some o...
"Edit with IDLE" option missing from context menu
-0.01818
0
0
60,527
29,179,631
2015-03-21T05:35:00.000
-1
0
1
0
python,contextmenu,edit,python-idle
47,934,165
11
false
0
0
This issue is arising because of the problem in the registry of Python installation. While one may edit the registry and resolve the issue, the simple solution for this can be: DELETE ALL THE REGISTRIES pertaining to the py extensions and Re-install Python and let installation take its course of action. The problem ...
6
25
0
I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some o...
"Edit with IDLE" option missing from context menu
-0.01818
0
0
60,527
29,179,631
2015-03-21T05:35:00.000
0
0
1
0
python,contextmenu,edit,python-idle
41,958,627
11
false
0
0
As click to save button to save your python code there will be Two Extensions...1) .py and 2) .pyw. So for Python 2 you have to save python program using extension .pyw.
6
25
0
I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file. I have read numerous threads concerning this issue and attempted some o...
"Edit with IDLE" option missing from context menu
0
0
0
60,527
29,183,178
2015-03-21T13:18:00.000
1
0
0
0
python,statistics,scipy,scikit-learn,scikits
29,191,059
1
false
0
0
I think you can make use of a "naive Bayes" classifier here. In that case, the class (M or F) probability is a product of terms, one term for each available feature set, and you just ignore (exclude from the product) any feature set that is missing. Here is the justification. Let's say the feature sets are X1, X2, X3. ...
1
1
1
I have some data containing usernames and their respective genders. For example, an entry in my data list may look like: {User: 'abc123', Gender: 'M'} For each username, I am also given a bag of text, images, and locations attached to each of them, although it's not necessary that a user has at least one text, one imag...
Classifying users by demographic using incomplete data
0.197375
0
0
74
29,186,447
2015-03-21T18:30:00.000
0
0
1
0
python,audio
29,192,486
1
false
0
0
I dont't know how you recorded your text but if you call every word in an other line you can type import time at line 1 and and then after every audio file you could set time.sleep(0.3) (0.3 stands for 0.3 seconds). but that may take a while. it would be useful to see your code. so can you send it maybe?
1
0
0
I want to make a simple script that uses audio files to talk a user through a process. When the user has finished the current step, it should stop trying to explain that step and move into the next. This is easy to do, except that it sounds very ugly and unnatural when the audio stops mid-word. I've noticed in Grand Th...
python - stop audio between words
0
0
0
100
29,190,350
2015-03-22T02:39:00.000
0
0
1
0
python-2.7,pygame,importerror
29,221,166
1
false
0
1
There is only really only one way to do this: Create a folder Put the Python Interpreter you are using in that folder Put the PyGame module you are using in that same folder And your problem is now solved. I hope this helps you!
1
0
0
Okay, so I am brand new at this and I really need for this to be dumbed down for me. My python version is 2.7.9 and I downloaded pygame-1.9.1.win32-py2.7.msi and I am on a windows computer. I really need someone to explain why this is not working. I was reading on some of the other questions that you have to change the...
ImportError: No module named pygame and how to change the path of pygame?
0
0
0
3,786
29,190,427
2015-03-22T02:53:00.000
0
0
1
0
python,user-interface,tkinter
29,191,478
2
false
0
1
I would say that if your program is simply accessing data and not interacting with the data, then a GUI seems to be a bit of overkill. GUI's are guided user interfaces, as you know, and are made for guiding a user through an interface. If the interface is just a status, as you indicated, then I see nothing wrong with a...
1
1
0
I have written a monitoring program for the control system at our plant. It is basically a GUI which lets the operator see the current status of the lock of the closed loop system and aware the operator in case the lock/loop breaks. Now, the operation is heavily dependent on the responses of the GUI. My seniors told me...
Python TKinter for real time GUIs
0
0
0
1,676
29,193,127
2015-03-22T10:13:00.000
2
0
1
0
python,list,optimization,slice,micro-optimization
29,193,425
2
true
0
0
It'll depend entirely on how many elements you delete. In CPython, the list type uses a dynamic overallocation strategy to avoid having to resize the underlying C array too often. There is an array to hold the elements, and it is kept slightly too large at all times. Deletion then (using del TruncList[-n:]) could be a ...
1
4
0
Suppose I have a list TruncList with some number of elements greater than n. If I want to remove n elements from the end of that list, is it faster to redefine the list as a slice of itself preserving the desired elements, as by TruncList = TruncList[:-n], or to delete the slice of unwanted elements from the list, as b...
Is it faster to truncate a list by making it equal to a slice, or by using del?
1.2
0
0
2,584
29,196,096
2015-03-22T15:21:00.000
1
0
0
0
python,mysql,mysql-python
29,199,028
2
false
0
0
For this purpose you can use Persistence Connection or Connection Pool. Persistence Connection - very very very bad idea. Don't use use it! Just don't! Especially when you are talking about web programming. Connection Pool - Better then Persistence Connection, but with no deep understanding of how it works, you will en...
1
0
0
I have a MySQLdb installation for Python 2.7.6. I have created a MySQLdb cursor once and would like to reuse the cursor for every incoming request. If 100 users are simultaneously active and doing a db query, does the cursor serve each request one by one and block others? If that is the case, is there way to avoid that...
Is a MySQLdb cursor for Python blocking in nature by default?
0.099668
1
0
633
29,197,996
2015-03-22T18:11:00.000
0
0
1
0
c#,python,windows-8,windows-store-apps,ironpython
29,978,493
1
true
0
1
I don't think MS allows this functionality. As an alternative, you can have the user put their mouse over the window and press a keyboard shortcut (What I am doing). That is the best one can do.
1
0
0
Background I am working on a program that needs to find a list of open Metro apps. I originally tried using pure python with ctypes and using win32 api. Unfortunately, I couldn't get the names of Metro apps. So I moved on to IronPython thinking I could leverage a .net function or two to get what I want. No luck. Where ...
IronPython-List Open Metro Apps only
1.2
0
0
121
29,199,958
2015-03-22T21:16:00.000
0
0
1
0
python,validation,parameters
29,200,223
1
false
0
0
In general, I think it does not hurt to validate input parameters to a method every time it is called, even if it is unlikely that the parameters are wrong. The computational overhead is negligible in most cases (say checking type with if type(x) is not int: raise TypeError takes ~100 ns on my laptop, if the condition ...
1
2
0
I have a bit of a stylistic question about parameter validation. (Using Python) Say I have a method with a parameter a, which needs to be an int, and maybe needs to be in a certain range - i.e. a list index or something. I could use assertions/other validation to ensure this, but what if I only call the function from o...
Making assumptions about parameter types and values?
0
0
0
34
29,200,214
2015-03-22T21:43:00.000
0
0
1
0
python,widget
29,200,555
1
false
0
1
Now that I think about it, as long as I do a .place_forget() prior to any .place that should take care of any extra instances in memory. Can anyone confirm?
1
0
0
Up until now to move widgets I have been issuing another .place on it. I wonder if that is creating another instance of the widget in memory or not? If it is creating another copy in memory, what is the correct way to move a widget when using place? Do I need to keep destroying the widget and placing it perhaps ove...
Python: When using place what is the correct way to move widgets?
0
0
0
13
29,203,302
2015-03-23T04:31:00.000
-1
0
0
1
google-app-engine,google-cloud-storage,google-app-engine-python
29,222,762
1
false
1
0
I think it happens because when get_serving_url service resize the image, it always resize the image from the longest side of the Image, keeping the aspect ration same. If you have a image of 1600x2400, then the resize image is 106x160 to keep the aspect ratio is same. In your case one of the image is 306x408 (which is...
1
1
0
We are developing an image sharing service using GAE. Many users have reported since last week that "portrait images are oriented in landscape". We found out that from a specific timing, the specification of images uploaded and distributed through GAE has changed. So the specs seem to have changed around 3/18 03:25(UTC...
Orientation error for images uploaded to GAE (GCS + get_serving_url)
-0.197375
0
0
218
29,204,576
2015-03-23T06:44:00.000
2
0
0
0
python,windows,paramiko
29,214,110
1
false
0
0
It depends on the protocol you are using, if the file is big, use UDP, if the file is small use TCP, if the file is small use SSH. You don's necessarily need paramiko or fabric to communicate with another computer, since they are for ssh connections. If you know the protocol, then it is easier to communicate.
1
0
0
What would be the best way of downloading / uploading files / directory to / from remote windows server and local windows machine using python scripting language? Modules I heard of are paramiko and fabric... Apart from these any other good option/choice?
How to download files from remote windows server
0.379949
0
1
608
29,205,574
2015-03-23T08:07:00.000
0
0
0
0
python,bokeh
61,935,681
2
false
0
0
First you save your grid in an object, Let's say "a" the you confirms that "a" is a grid. Example grid = bly.gridplot(graficas,ncols=3) # Here you save your grid bpl.show(grid). # Here you show your grid from bokeh.io import export_png # You need this library to export Exportar grid export_png(grid, filename="your pat...
1
4
1
I am using bokeh (0.8.1) in combination with the ipython notebook to generate GridPlots. I would like to automatically store the generated GridPlots to a single png (hopefully pdf one day) on disk, but when using "Preview/Save" it cycles through all of the figures asking me to store them separately. Is there a more eff...
How to save a bokeh gridplot as single file
0
0
0
1,852
29,208,955
2015-03-23T11:20:00.000
0
1
0
0
oauth,openid,python-social-auth
30,144,643
1
false
1
0
You could simply use the yahoo site's favicon. It's already squared and gets as close to official as it can get.
1
0
0
I want my users to be able to login using all common OpenIds. But there seems to be a forest of clauses on how to use logos from google, facebook, yahoo and twitter. Actually I'd prefer a wider button with the text on it, but it seems that all these buttons don't have the aspect ratio. And some of them I am not allowed...
How to make most common OpenID logins look the same?
0
0
0
21
29,212,385
2015-03-23T14:08:00.000
1
0
0
0
python,numpy
29,212,482
2
false
0
0
Your p array is in the wrong order. You should start with the coefficient of the highest exponent. Try with p=[1,0,2,1].
1
1
1
I don't know much about Python and I'm trying to use it to do some simple polynomial interpolation, but there's something I'm not understanding about one of the built-in functions. I'm trying to use polyval(p,x) to evaluate a polynomial p at x. I made an example polynomial p(x) = 1 + 2x + x^3, I created an array p = ...
Polyval(p,x) to evaluate polynomials
0.099668
0
0
5,765
29,214,605
2015-03-23T15:51:00.000
1
1
0
0
python,openshift,flask-restful
29,459,242
1
false
0
0
In openshift, if you want your data to be persistent you have to save it in the 'OPENSHIFT_DATA_DIR'. I fixed the problem by placing the knowledge base file in this directory instead and referencing this location in my code.
1
1
0
I am working on a customer care chatbot based on aiml using flaskrestful and pyaiml. My problem is when I test it locally it is working, i.e. responding from the aiml knowledge base, when I put it on openshift the python script won't find the aiml file and I don't understand why.
openshift won't load aiml file
0.197375
0
0
59
29,215,850
2015-03-23T16:52:00.000
1
1
0
0
python-2.7,automated-tests,robotframework
29,216,521
1
false
0
0
In the "Run" Tab, put "--noncritical your_tags" in the "Arguments" box. That should do it.
1
0
0
Let's assume I want to set a test case status with (non critical) so that when the generated report which is displayed after execution excludes this test cases from its critical test cases... if i want to do that from the command line I would write ( pybot --noncritical ) but what if I want to do the same in RIDE tool ...
How to set the criticality of certain test case in RIDE?
0.197375
0
0
677
29,220,054
2015-03-23T20:47:00.000
0
0
0
0
python,graph,reportlab,pydot
29,267,352
2
false
0
0
After an endless search, I figured there is no way. So, in the end I exported the pydot as a pdf, imported the pdf via PyPDF2 and then merged it with the ReportLab document. Far from ideal, but it does the job.
2
0
0
I created a graph in pydot, e.g. the python graphviz interface. Now, I would like to enter this graph into my reportlab report. Is there any direct way of doing this?
How to insert a pydot chart into reportlab?
0
0
0
90
29,220,054
2015-03-23T20:47:00.000
0
0
0
0
python,graph,reportlab,pydot
31,353,473
2
false
0
0
You can use a similar (but perhaps slightly better) path with pdfrw -- you can run pdfrw in conjunction with reportlab, and import the PDF you exported from pydot, and use it as a form XObject (similar to an image) on the reportlab canvas. There are a few examples showing how to do this sort of thing in the pdfrw exam...
2
0
0
I created a graph in pydot, e.g. the python graphviz interface. Now, I would like to enter this graph into my reportlab report. Is there any direct way of doing this?
How to insert a pydot chart into reportlab?
0
0
0
90
29,220,747
2015-03-23T21:27:00.000
1
0
1
1
python,configuration,docker
29,226,897
1
true
0
0
I guess that will very much depend. It might be useful to distinguish between two types of configuration: the one which define the way the container (application code contained) functions and the one which defines infrastructure (db credentials, collaborators endpoints, etc.). The functional configuration would more n...
1
1
0
Much like data volumne, the configuration for a python app should persist across changes in the app container. A file in a separate data container? Database in a separate data container? I realize there are multiple ways to store the configuration information. But what patterns are being used in today's Dockerized ...
Where to store Dockerized python application configuration
1.2
0
0
58
29,221,836
2015-03-23T22:44:00.000
0
1
0
1
python,openshift
29,236,634
2
false
0
0
You can not use the "yum" command to install packages on OpenShift. What specific issue are you having? I am sure that at least some of those packages are already installed in OpenShift online already (such as wget). Have you tried running your project to see what specific errors you get about what is missing?
1
0
0
Hello i want to install these dependencies in OpenShift for my App yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libffi-devel libxslt libxslt-devel libxml2 libxml2-devel openldap-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel libyaml-d...
How to install dependencies in OpenShift?
0
0
0
461
29,222,699
2015-03-24T00:03:00.000
2
0
0
0
python,wxpython,wxwidgets
29,233,860
1
true
0
1
You might be able to steal focus by calling Raise on the frame. There is the wx.STAY_ON_TOP style flag that could also be applied. Then you might be able to just use the frame's Show and Hide methods to make it work. Depending on what exactly you want to do, you might take a look at the ToasterBox widget. I can't recal...
1
1
0
I want to make a heads-up display that pops up it's frame, taking focus from the previous application and then gives focus back to that application when it's done. wxPython frames have Hide and Show methods that work but don't focus the application. Also, there's SetFocus which you'd think would do it but doesn't. Upda...
How can a wxpython frame "steal" and "return" focus similar to the Dash app?
1.2
0
0
542
29,223,787
2015-03-24T02:04:00.000
1
0
0
0
python,text,input,io
29,223,811
2
false
0
0
Try putting input("Press Enter to continue") between printing each wall of text.
1
0
0
I am currently working on a game and I was wondering if there was any way to execute commands like a text file by user input? I would like to make it where the text doesn't pop up all at once, but where you could do something like "Press any key to continue" and when they do that, the next wall of text appears. Any hel...
Python: Execute a line by user input?
0.099668
0
0
196
29,226,186
2015-03-24T06:19:00.000
0
0
1
0
autocomplete,pycharm,ipython-notebook
29,228,795
1
true
0
0
OK by trial and error I got a fix. For some reason if you put %pylab inline or %matplolib inline in the same cell with your imports this will mess up the code autocompletion. Put %pylab in its own cell and it fixes the problem
1
0
0
Hi I've been trying out Pycharms integrated IPython and at first the code autocompletion was working just fine, but now it stopped working.. It still works in a .py file inside the IDE but not in .ipynb files. Any idea why this would be happening?
Pycharm 4 code autocompletion does not work in IPython
1.2
0
0
124
29,226,713
2015-03-24T07:03:00.000
4
0
1
0
python,dictionary
29,227,080
1
true
0
0
Python doesn't offer a hybrid dict natively. For the most part, it has no need for a blend between list-style storage and hashtable-style storage. The dict methods are thread-safe in the sense that they don't break the dict invariants when used in a multi-threaded environment (you won't segfault or break the dict). H...
1
1
0
I am new to Python. Currently I am developing a Python project. For it, there is a need for thread safe hybrid dictionary. Is there any thread safe dictionary for python like hybrid dictionary in C#? I would appreciate some good answers.
Can we have Dictionary that is concurrent and hybrid in Python?
1.2
0
0
230
29,228,969
2015-03-24T09:26:00.000
0
0
1
0
python,analytics,jython,spss,spss-modeler
29,246,574
1
false
0
0
Modeler scripting uses Jython, not standard Python, but you should be able to load any library that is compatible with Jython. SPSS Statistics uses standard Python 2.7
1
0
0
I'm trying to build an analytic model with SPSS Modeler 16.0 and there is some parts that are easy to do with Python. Now my question is what are the limits for using python or jython scripting in SPSS ? Can I import all the libraries that I want as well as in a classic python program ?
Can I add python script to SPSS Modeler 16?
0
0
0
805
29,229,273
2015-03-24T09:42:00.000
3
1
0
1
python,windows,python-2.7
36,078,931
5
false
0
0
Here is another check to make, which helped me figure out what was going on. I switched from the 32bit Anaconda to the 64bit version. I deinstalled, downloaded then reinstalled, but several things didn't get cleaned up properly (quick launch stuff, and some registry keys). The problem on my side was that the default in...
2
3
0
i've installed py 2.7 (64bit) on my PC with Win7 (64bit) without problem but I'm not able to run *.py scripts via DOS shell without declare python full path. Let me better explain : If I type D:\ myscript.py it doesn't work. The script is open with wordpad If I type D:\ C:\Python27 myscript.py it works and run correct...
Impossible to set python.exe to *.py scripts on Win7
0.119427
0
0
1,995
29,229,273
2015-03-24T09:42:00.000
0
1
0
1
python,windows,python-2.7
56,543,680
5
false
0
0
@slv 's answer is good and helped me a bit with solving this problem. Anyhow, since I had previous installations of Python before this error occured for me, I might have to add something to this. One of the main problems hereby was that the directory of my python-installation changed. So, I opened regedit.exe and follo...
2
3
0
i've installed py 2.7 (64bit) on my PC with Win7 (64bit) without problem but I'm not able to run *.py scripts via DOS shell without declare python full path. Let me better explain : If I type D:\ myscript.py it doesn't work. The script is open with wordpad If I type D:\ C:\Python27 myscript.py it works and run correct...
Impossible to set python.exe to *.py scripts on Win7
0
0
0
1,995
29,229,735
2015-03-24T10:08:00.000
0
0
0
0
python,django,internationalization,translation,gettext
33,277,961
3
false
1
0
I think the problem lies in your MIDDLEWARE_CLASSES. The thing is, there are some middlewares that might change your request, including a language prefix. Especially, when you use AJAX calls for querying extra template data, translated by ugettext, gettext, etc.
2
1
0
I try to translate my django site to another languages but translation in python doesn't work. But translation in templates using trans tag, works as expected. I have tried ugettext, gettext, gettext_lazy and ugettext_lazy, and every time I got original untranslated strings. My sources all in utf-8 encoding, original s...
django translation doesn't work but translation in templates works
0
0
0
3,112
29,229,735
2015-03-24T10:08:00.000
0
0
0
0
python,django,internationalization,translation,gettext
33,302,047
3
false
1
0
The ugettext_lazy will not work if string contains non Latin symbols. So in my case the original strings must be the Unicode objects.
2
1
0
I try to translate my django site to another languages but translation in python doesn't work. But translation in templates using trans tag, works as expected. I have tried ugettext, gettext, gettext_lazy and ugettext_lazy, and every time I got original untranslated strings. My sources all in utf-8 encoding, original s...
django translation doesn't work but translation in templates works
0
0
0
3,112
29,230,333
2015-03-24T10:36:00.000
0
0
0
1
python,django,web-applications,stress-testing,djcelery
29,233,194
1
false
1
0
I think there is no need to write your own stress testing script. I have used www.blitz.io for stress testing. It is set up in minutes, easy to use and it makes beautiful graphs. It has a 14 day trial so you just can test the heck out of your system for 14 days for free. This should be enough to find all your bottlen...
1
0
0
I have a web application running on django, wherein an end user can enter a URL to process. All the processing tasks are offloaded to a celery queue which sends notification to the user when the task is completed. I need to stress test this app with the goals. to determine breaking points or safe usage limits to confi...
How to write a stress test script for asynchronous processes in python
0
0
0
988
29,232,101
2015-03-24T11:58:00.000
0
0
1
0
python,windows,anaconda
43,085,233
3
false
0
0
Install newest version of Anaconda from their website. This will upgrade your Anaconda and python as well. Also, uninstall the previous version of Anaconda.
1
6
0
After successful installation of Anaconda on Windows 7 I realized the default Python version is 2.7.8. However I need 2.7.9. So how do I upgrade?
How do I upgrade python 2.7.8 to 2.7.9 in Anaconda without conflicting other components in its environment?
0
0
0
6,678