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
38,707,350
2016-08-01T20:14:00.000
1
0
0
1
python,subprocess,command-line-arguments
38,707,485
2
false
0
0
There are two things this needs to do: you need to handle command-line flags, and you need to send signals to another process. For the flags, you could use the argparse library, or simply sys.argv. For sending signals, you will need the Process ID (pid) of the already running process. Under Linux you can call ps, and c...
1
0
0
I'm trying to make a python script run in the background, and listen to commands. For example if I run my script: python my_script.py it will start running (and wait for commands). Then I wish to run: python my_script.py --do_something, open a different python process, and it will run a function do_something() in the p...
Send commands to running script by running it with flags
0.099668
0
0
1,144
38,708,645
2016-08-01T21:46:00.000
0
0
0
0
python,orm,sqlalchemy
38,882,242
2
false
0
0
Turns out I needed to use association tables and the joinedload() function. The documentation is a bit wonky but I got there after playing with it for a while.
1
0
0
I'm trying to serialize results from a SQLAlchemy query. I'm new to the ORM so I'm not sure how to filter a result set after I've retrieved it. The result set looks like this, if I were to flatten the objects: A1 B1 V1 A1 B1 V2 A2 B2 V3 I need to serialize these into a list of objects, 1 per unique value for A,...
How do I filter SQLAlchemy results based on a columns' value?
0
1
0
591
38,709,029
2016-08-01T22:24:00.000
4
0
1
0
python
38,709,062
1
true
0
0
Both usages invoke the built-in function float. In python, functions are just values, so (float) is the same function reference as float. There is no casting involved. I would prefer the first usage, because it's more clear.
1
0
0
If you just type float(44*2.2) on the interpreter and (float)(44*2.2) they return the same result. Is one explicitly casting the result, and one using it as a function? And what is the use of each case and any pro's/con's for each case? This is Python 3, I'm sure it'll work with Python 2 as well.
What is the difference between float(44*2.2) and (float)(44*2.2) in PYTHON 3?
1.2
0
0
51
38,709,439
2016-08-01T23:11:00.000
3
0
0
0
python,seaborn
38,718,933
1
true
0
0
Changes were made in 0.7.1 to clean up the top-level namespace a bit. axlabel was not used anywhere in the documentation, so it was moved to make the main functions more discoverable. You can still access it with sns.utils.axlabel. Sorry for the inconvenience. Note that it's usually just as easy to do ax.set(xlabel=".....
1
2
1
Having trouble with my upgrade to Seaborn 0.7.1. Conda only has 0.7.0 so I removed it and installed 0.7.1 with pip. I am now getting this error: AttributeError: module 'seaborn' has no attribute 'axlabel' from this line of code sns.axlabel(xlabel="SAMPLE GROUP", ylabel=y_label, fontsize=16) I removed and reinstalled 0....
Upgraded Seaborn 0.7.0 to 0.7.1, getting AttribueError for missing axlabel
1.2
0
0
853
38,711,658
2016-08-02T04:14:00.000
1
0
0
1
python,rest,nginx,docker
38,712,037
1
false
1
0
Consider doing a docker ps -a to get the stopped container's identifier. -a here just means listing all of the containers you got on your machine. Then do docker inspect and look for the LogPath attribute. Open up the container's log file and see if you could identify the root cause on why the process died inside the ...
1
0
0
I have deployed a rest service inside a docker container using uwsgi and nginx. When I run this python flask rest service inside docker container, for first one hour service works fine but after sometime somehow nginx and rest service stops for some reason. Has anyone faced similar issue? Is there any know fix for this...
Service inside docker container stops after some time
0.197375
0
0
1,799
38,711,966
2016-08-02T04:48:00.000
0
0
0
0
python,pandas,numbers,row
38,721,746
2
false
0
0
Sorry I couldnt add a code sample but Im on my phone. piRSquared confirmed my fears when he said the info is lost. I guess ill have to do a loop everytime or add a column with numbers ( that will get scrambled if i sort them : / ). Thanks everyone.
1
2
1
In pandas, is it possible to reference the row number for a function. I am not talking about .iloc. iloc takes a location i.e. a row number and returns a dataframe value. I want to access the location number in the dataframe. For instance, if the function is in the cell that is 3 rows down and 2 columns across, I wa...
Function that depends on the row number
0
0
0
118
38,723,681
2016-08-02T14:46:00.000
0
0
0
1
python,google-app-engine
38,742,762
2
false
1
0
The main question will be how to ensure it only runs once for a particular version. Here is an outline on how you might approach it. You create a HasRun module, which you use store each the version of the deployed app and this indicates if the one time code has been run. Then make sure you increment your version, when...
2
1
0
I have been looking for a solution for my app that does not seem to be directly discussed anywhere. My goal is to publish an app and have it reach out, automatically, to a server I am working with. This just needs to be a simple Post. I have everything working fine, and am currently solving this problem with a cron job...
Google App Engine - run task on publish
0
0
0
66
38,723,681
2016-08-02T14:46:00.000
2
0
0
1
python,google-app-engine
38,794,445
2
false
1
0
Personally, this makes more sense to me as a responsibility of your deploy process, rather than of the app itself. If you have your own deploy script, add the post request there (after a successful deploy). If you use google's command line tools, you could wrap that in a script. If you use a 3rd party tool for somethin...
2
1
0
I have been looking for a solution for my app that does not seem to be directly discussed anywhere. My goal is to publish an app and have it reach out, automatically, to a server I am working with. This just needs to be a simple Post. I have everything working fine, and am currently solving this problem with a cron job...
Google App Engine - run task on publish
0.197375
0
0
66
38,724,255
2016-08-02T15:10:00.000
0
0
0
0
java,python,pandas,numpy,jython
38,724,313
2
false
1
0
Have you tried using xml to transfer the data between the two applications ? My next suggestion would be to output the data in JSON format in a txt file and then call the java application which will read the JSON from the text file.
2
2
1
I have created a python script for predictive analytics using pandas,numpy etc. I want to send my result set to java application . Is their simple way to do it. I found we can use Jython for java python integration but it doesn't use many data analysis libraries. Any help will be great . Thank you .
Sending pandas dataframe to java application
0
0
0
2,769
38,724,255
2016-08-02T15:10:00.000
0
0
0
0
java,python,pandas,numpy,jython
57,166,461
2
false
1
0
Better approach here is to use java pipe input like python pythonApp.py | java read. Output of python application can be used as an input for java application till the format of data is consitent and known. Above soultions of creating a file and then reading also works but is prone to more errors.
2
2
1
I have created a python script for predictive analytics using pandas,numpy etc. I want to send my result set to java application . Is their simple way to do it. I found we can use Jython for java python integration but it doesn't use many data analysis libraries. Any help will be great . Thank you .
Sending pandas dataframe to java application
0
0
0
2,769
38,727,035
2016-08-02T17:35:00.000
0
0
1
0
python,matplotlib,ipython
38,729,045
1
false
0
0
You need to install pyGTK. How to do so depends on what you're using to run Python. You could also not use '%matplotlib inline' and then it'll default to whatever is installed on your system.
1
0
1
I got two questions when I was plotting graph in ipython. once, i implement %matplotlib inline, I don't know how to switch back to use floating windows. when I search for the method to switch back, people told me to implement %matplotlib osx or %matplotlib, however, I finally get an error, which is Gtk* backend re...
How to turn off matplotlib inline function and install pygtk?
0
0
0
336
38,728,501
2016-08-02T19:00:00.000
4
0
0
0
python,neural-network,tensorflow,recurrent-neural-network
38,740,100
1
false
0
0
I think when you use the tf.nn.rnn function it is expecting a list of tensors and not just a single tensor. You should unpack input in the time direction so that it is a list of tensors of shape [?, 22501]. You could also use tf.nn.dynamic_rnn which I think can handle this unpack for you.
1
1
1
I have some very basic lstm code with tensorflow and python, where my code is output = tf.nn.rnn(tf.nn.rnn_cell.BasicLSTMCell(10), input_flattened, initial_state=tf.placeholder("float", [None, 20])) where my input flattened is shape [?, 5, 22501] I'm getting the error TypeError: inputs must be a sequence on the state ...
Inputs not a sequence wth RNNs and TensorFlow
0.664037
0
0
3,118
38,730,867
2016-08-02T21:35:00.000
0
0
1
0
python,windows,pip
38,767,497
2
false
0
0
Seems I found the reason: the Windows computer is within a state agency behind a hefty firewall. I tried the same install with Python 3.4.3 from my laptop connected through my phone and had no problem at all. So, I think the firewall was in the way. Thanks for looking into this, @froost1999 and @Rockse .
1
0
0
I am struggling with adding to my Python 34 installation: C:> pip install --upgrade pip Could not find any downloads that satisfy the requirement pip in c:\python34\lib \site-packages Collecting pip No distributions at all found for pip in c:\python34\lib\site-packages What am I doing wrong? Please help.
Python 3.4 windows, pip install fails
0
0
0
816
38,733,220
2016-08-03T02:07:00.000
59
0
0
0
python,python-2.7,scikit-learn
38,733,854
2
true
0
0
You might need to reinstall numpy. It doesn't seem to have installed correctly. sklearn is how you type the scikit-learn name in python. Also, try running the standard tests in scikit-learn and check the output. You will have detailed error information there. Do you have nosetests installed? Try: nosetests -v sklearn. ...
1
57
1
On OS X 10.11.6 and python 2.7.10 I need to import from sklearn manifold. I have numpy 1.8 Orc1, scipy .13 Ob1 and scikit-learn 0.17.1 installed. I used pip to install sklearn(0.0), but when I try to import from sklearn manifold I get the following: Traceback (most recent call last): File "", line 1, in File...
Difference between scikit-learn and sklearn
1.2
0
0
81,337
38,734,521
2016-08-03T04:37:00.000
6
0
1
0
python,windows,command-prompt
38,734,522
2
false
0
0
Searching did not yield good results, so I thought I should share the process I took with anyone looking for this in the future. Make sure the Python 3 folder is present in the PATH environment variable. Locate the "python.exe" file in the Python 3 folder. Copy and Paste the "python.exe" file within the Python 3 fold...
2
7
0
Having various projects in both Python 2 and Python 3 (with both python versions installed), I was looking for a more intuitive way to run scripts via Command Prompt than py -3 script.py. Python 2 already took python script.py, so ideally python3 script.py should invoke Python 3. My question: How can I add python3 as a...
Python 2 and Python 3 - Running in Command Prompt
1
0
0
25,378
38,734,521
2016-08-03T04:37:00.000
7
0
1
0
python,windows,command-prompt
55,441,142
2
false
0
0
If Python 2 and 3 are both installed and in the PATH variable, you can do: py -2 or py -3
2
7
0
Having various projects in both Python 2 and Python 3 (with both python versions installed), I was looking for a more intuitive way to run scripts via Command Prompt than py -3 script.py. Python 2 already took python script.py, so ideally python3 script.py should invoke Python 3. My question: How can I add python3 as a...
Python 2 and Python 3 - Running in Command Prompt
1
0
0
25,378
38,737,144
2016-08-03T07:31:00.000
1
1
1
0
python,excel,python-3.5,execution-time,miniconda
38,737,237
2
false
0
0
It runs on single core, the computer1 has higher clock rate = faster single threaded processing.
1
0
0
I was faced with the following problem: on a computer (number 2) script execution time is significantly greater than on another computer (computer 1). Computer 1 - i3 - 4170 CPU @ 3.7 GHz (4 core), 4GB RAM (Execution time 9.5 minutes) Computer 2 - i7 - 3.07GHz (8 core), 8GB RAM (Execution time 15-17 minutes) I use Py...
Script execution time on different computers (python 3.5, miniconda)
0.099668
0
0
61
38,738,706
2016-08-03T08:46:00.000
0
0
0
0
python,xlsxwriter
38,740,317
1
false
0
0
is it possible? Unfortunately not. Shapes aren't supported in XlsxWriter, apart from Textbox.
1
2
0
I wana draw some simple shapes in excel file like as "arrow, line, rectangle, oval" using XLSXWriter, but i can find any example to do it. Is it possible ? If not, what library of python can do that ? Thanks!
How to drawing shapes using XLSXWriter
0
1
0
1,339
38,741,327
2016-08-03T10:43:00.000
1
0
0
1
python,google-app-engine
38,788,820
1
true
1
0
You have multiple layers of caches beyond memcache, Googles edge cache will definitely cache static content especially if you app is referenced by your domain and not appspot.com . You will probably need to use some cache busting techniques. You can test this by requesting the url that is presenting old content wi...
1
0
0
I've deployed a new version which contains just one image replacement. After migrating traffic (100%) to the new version I can see that only this version now has active instances. However 2 days later and App engine is still intermittently serving the old image. So I assume the previous version. When I ping the domain ...
App Engine serving old version intermittently
1.2
0
0
190
38,742,893
2016-08-03T11:54:00.000
9
0
0
1
python,curl,urllib2,http-upload,seafile-server
38,743,242
2
false
1
0
needed 2 hours to find a solution with curl, it needs two steps: make a get-request to the public uplink url with the repo-id as query parameter as follows: curl 'https://cloud.seafile.com/ajax/u/d/98233edf89/upload/?r=f3e30b25-aad7-4e92-b6fd-4665760dd6f5' -H 'Accept: application/json' -H 'X-Requested-With: XMLHttpRe...
1
5
0
With Seafile one is able to create a public upload link (e.g. https://cloud.seafile.com/u/d/98233edf89/) to upload files via Browser w/o authentication. Seafile webapi does not support any upload w/o authentication token. How can I use such kind of link from command line with curl or from python script?
How to use a Seafile generated upload-link w/o authentication token from command line
1
0
1
2,271
38,745,067
2016-08-03T13:29:00.000
1
0
0
0
python,django,django-rest-framework
38,746,370
3
false
1
0
you don't need to use models, but you really should. django's ORM (the way it handles reading/writing to databases) functionality is fantastic and really useful. if you're executing raw sql statements all the time, you either have a highly specific case where django's functions fail you, or you're using django ineffic...
1
0
0
I am new to Django-Rest Framework and I wanted to develop API calls. I am currently using Mysql database so if I have to make changes in the database, do I have to write models in my project or Can I execute the raw data operation onto my database. Like: This is my urls.py file which contains a list of URLs and if any ...
Using Models in Django-Rest Framework
0.066568
0
0
911
38,747,073
2016-08-03T14:54:00.000
0
0
1
0
python
38,747,336
2
false
0
0
If your third party lib does not have any dependencies you can get the source files (.py) put into your project folder and use it as package by using import, else it has dependencies your project size grow more better create exe for your script.
1
0
0
I have a Python script which uses open source third party libraries for geoprocessing (OGR and Shapely). My plan is to execute this script on a computer without having to install the required libraries. I know that there are tools such as py2exe available for this purpose. However, compiling an executable file is not m...
Portable python script: Is it possible to include third party libraries in script?
0
0
0
1,524
38,751,024
2016-08-03T18:22:00.000
-1
0
0
0
python,macos,os.system
38,751,112
3
true
1
0
You can try writing the data you want to share to a file and have the other script read and interpret it. Have the other script run in a loop to check if there is a new file or the file has been changed.
2
0
0
i am scraping data through multiple websites. To do that i have written multiple web scrapers with using selenium and PhantomJs. Those scrapers return values. My question is: is there a way i can feed those values to a single python program that will sort through that data in real time. What i want to do is not save th...
Sharing data with multiple python programms
1.2
0
1
87
38,751,024
2016-08-03T18:22:00.000
-1
0
0
0
python,macos,os.system
38,751,162
3
false
1
0
Simply use files for data exchange and a trivial locking mechanism. Each writer or reader (only one reader, it seems) gets a unique number. If a writer or reader wants to write to the file, it renames it to its original name + the number and then writes or reads, renaming it back after that. The others wait until the f...
2
0
0
i am scraping data through multiple websites. To do that i have written multiple web scrapers with using selenium and PhantomJs. Those scrapers return values. My question is: is there a way i can feed those values to a single python program that will sort through that data in real time. What i want to do is not save th...
Sharing data with multiple python programms
-0.066568
0
1
87
38,751,240
2016-08-03T18:35:00.000
0
0
1
0
python,py2exe
38,751,432
1
true
0
0
It can if you exec () the contents of the .py file.
1
0
0
I want to distribute a python program as an executable file. I use py2exe with options = {"py2exe":{"bundle_files": 1}}. But I want to keep a py file as configure script ( including not just variables but also functions and classes ). Can py2exe do this? Or any other way to do it?
Can py2exe keep a py file as configure script?
1.2
0
0
23
38,751,364
2016-08-03T18:42:00.000
1
0
0
0
python,statistics,scikit-learn,cluster-analysis,k-means
38,751,473
2
false
0
0
The behavior you are experiencing probably has to do with the under the hood implementation of k-means clustering that you are using. k-means clustering is an NP-hard problem, so all the implementations out there are heuristic methods. What this means practically is that for a given seed, it will converge toward a loca...
2
1
1
I am using the MiniBatchKMeans model from the sklearn.cluster module in anaconda. I am clustering a data-set that contains approximately 75,000 points. It looks something like this: data = np.array([8,3,1,17,5,21,1,7,1,26,323,16,2334,4,2,67,30,2936,2,16,12,28,1,4,190...]) I fit the data using the process below. from sk...
MiniBatchKMeans gives different centroids after subsequent iterations
0.099668
0
0
1,020
38,751,364
2016-08-03T18:42:00.000
1
0
0
0
python,statistics,scikit-learn,cluster-analysis,k-means
38,754,035
2
false
0
0
Read up on what mini-batch k-means is. It will never even converge. Do one more iteration, the result will change again. It is design for data sets so huge you cannot load them into memory at once. So you load a batch, pretend this were the full data set, do one iterarion. Repeat woth the next batch. If your batches ar...
2
1
1
I am using the MiniBatchKMeans model from the sklearn.cluster module in anaconda. I am clustering a data-set that contains approximately 75,000 points. It looks something like this: data = np.array([8,3,1,17,5,21,1,7,1,26,323,16,2334,4,2,67,30,2936,2,16,12,28,1,4,190...]) I fit the data using the process below. from sk...
MiniBatchKMeans gives different centroids after subsequent iterations
0.099668
0
0
1,020
38,751,800
2016-08-03T19:08:00.000
4
0
0
1
python,python-2.7,hashlib,frozenset
38,767,427
2
true
0
0
Removal of this package have helped me: sudo rm -rf /Library/Python/2.7/site-packages/hashlib-20081119-py2.7-macosx-10.11-intel.egg
1
2
0
I have this error on each my command with Python: ➜ /tmp sudo easy_install pip Traceback (most recent call last): File "/usr/bin/easy_install-2.7", line 11, in load_entry_point('setuptools==1.1.6', 'console_scripts', 'easy_install')() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/...
Python 2.7 on OS X: TypeError: 'frozenset' object is not callable on each command
1.2
0
0
8,871
38,755,220
2016-08-03T23:29:00.000
2
1
1
0
python,windows,git,raspberry-pi
38,760,276
3
true
0
0
You can run a SAMBA server on your Raspberry Pi, set your python project folder as a network disk. Then you can use any windows IDE you like, just open the file which is on the network disk. Currently I am using VS2015 + Python Tools for Visual Studio for remote debugging purpose.
1
1
0
Is it possible to open files from a Raspberry pi in windows for editing (using for example notepad++)? I am currently using the built in python IDE in Raspbian but i feel that it would speed up the development process if i could use a windows IDE for development. I have also tried using a git repo to share files betwee...
Develop Raspberry apps from windows
1.2
0
0
606
38,757,611
2016-08-04T02:34:00.000
1
0
1
0
python,visual-studio-2015
43,836,514
1
false
0
0
I know this is probably far too late, but I had this problem as well. I found the solution and that is to right click the "Python Environments" in the solution explorer of the project and add/remove python environments and then choose the one you're attempting to go to.
1
0
0
I am trying to modify the default Python compilation environment options in Visual Studio. The option directory is at Options -> Python Tools -> Environment Options. However, after I added a new custom environment, changed the default environment to the custom one, and clicked "OK" to save, I found that the settings go...
How can I change the default python enviroment in VS2015?
0.197375
0
0
475
38,758,342
2016-08-04T04:09:00.000
0
0
0
0
python,facebook,wit.ai
42,297,616
2
false
0
0
You could also use api.ai , which by default provides a default fallback intent. In default fallback event, if api.ai does not understand the input or does not have an answer , it would reply with "I did not understand what you just said"
1
3
0
I'm working on a chatbot project based on Facebook's Wit.ai and was wondering if it is possible to set a default intent? For example, my bot currently supports only a handful of questions, such as "Where are you located?" or "What is your phone number?", each of these questions has an intent and story associated with ...
Is it possible to set a default intent in Wit.ai?
0
0
0
1,233
38,759,647
2016-08-04T06:08:00.000
2
0
0
0
python-2.7,machine-learning,neural-network
38,763,173
3
true
0
0
Yes - this is a really important issue. Basically there are two ways to do that: Try different topologies and choose best: due to the fact that number of neurons and layers are a discrete parameters you cannot differentiate your loss function with respect to this parameters in order to use a gradient descent methods. ...
2
0
1
In neural network theory - setting up the size of hidden layers seems to be a really important issue. Is there any criteria how to choose the number of neurons in a hidden layer?
How should we set the number of the neurons in the hidden layer in neural network?
1.2
0
0
638
38,759,647
2016-08-04T06:08:00.000
1
0
0
0
python-2.7,machine-learning,neural-network
38,776,068
3
false
0
0
You have to set the number of neurons in hidden layer in such a way that it shouldn't be more than # of your training example. There are no thumb rule for number of neurons. Ex: If you are using MINIST Dataset then you might have ~ 78K training example. So make sure that combination of Neural Network (784-30-10) = 784*...
2
0
1
In neural network theory - setting up the size of hidden layers seems to be a really important issue. Is there any criteria how to choose the number of neurons in a hidden layer?
How should we set the number of the neurons in the hidden layer in neural network?
0.066568
0
0
638
38,766,962
2016-08-04T12:10:00.000
0
0
0
0
python,mysql,analytics
38,770,424
1
false
1
0
You have to put a date on your data and instead of using now() use it.
1
0
0
I have two separate programs; one counts the daily view stats and another calculates earning based on the stats. Counter runs first and followed by Earning Calculator a few seconds later. Earning Calculator works by getting stats from counter table using date(created_at) > date(now()). The problem I'm facing is that le...
How to solve mysql daily analytics that happens when date changes
0
1
0
53
38,767,481
2016-08-04T12:34:00.000
1
0
0
0
python,scikit-learn,text-classification
38,788,040
1
false
0
0
In the supervised learning approach as it is, you cannot add extra category. Therefore I would use some heuristics. Try to predict probability for each category. Then, if all 4 or at least 3 probabilities are approximately equal, you can say that the sample is "unknown". For this approach LinearSVC or other type of Su...
1
3
1
I am using Scikit-Learn to classify texts (in my case tweets) using LinearSVC. Is there a way to classify texts as unclassified when they are a poor fit with any of the categories defined in the training set? For example if I have categories for sport, politics and cinema and attempt to predict the classification on a ...
Scikit-Learn- How to add an 'unclassified' category?
0.197375
0
0
198
38,767,532
2016-08-04T12:36:00.000
0
0
1
0
python,pip,virtualenv
66,693,644
1
false
0
0
When you try to install a package using pip (or even uninstall one), try to run your comand prompt opr powershell as administrator
1
5
0
By necessity I have a number of python 3.4 distributions on my system some of which are installed in non-user writable locations and some I have built myself using different compilers and 3rd party libraries (such as MKL). I need to be able to reliably isolate each of these for use but can't use virtualenv / pyenv ... ...
Stop python looking in AppData\Roaming\Python
0
0
0
1,827
38,767,584
2016-08-04T12:39:00.000
0
0
0
1
python,linux,archive,7zip,rar
38,768,586
2
false
0
0
I can't give you a native python answer, but, if you need to fall back on os.system, the command-line utilities for handling all four formats have switches which can be used to list the contents of the archive including the size of each file and possibly a total size: rar: unrar l FILENAME.rar lists information on eac...
1
0
0
I need to validate result size of unpacked archive without unpacking it, so that to prevent huge archives to store on my server. Or start unpacking and when size is exceeded certain size, then stop unpacking. I have already tried lib pyunpack, but it allows only unpacking archives. Need to validate such archive extens...
Find out result size of unpacked archive without unpacking it. Or stop unpacking when certain size is exceed
0
0
0
1,601
38,767,616
2016-08-04T12:40:00.000
4
1
0
0
python,django,multithreading,webserver,pyramid
38,782,897
2
false
1
0
There's no magic in pyramid or django that gets you past process boundaries. The answers depend entirely on the particular server you've selected and the settings you've selected. For example, uwsgi has the ability to run multiple threads and multiple processes. If uwsig spins up multiple processes then they will each ...
2
7
0
I am having a hard time trying to figure out the big picture of the handling of multiple requests by the uwsgi server with django or pyramid application. My understanding at the moment is this: When multiple http requests are sent to uwsgi server concurrently, the server creates a separate processes or threads (copie...
What exactly happens on the computer when multiple requests came to the webserver serving django or pyramid application?
0.379949
0
0
1,964
38,767,616
2016-08-04T12:40:00.000
3
1
0
0
python,django,multithreading,webserver,pyramid
38,767,725
2
false
1
0
The power and weakness of webservers is that they are in principle stateless. This enables them to be massively parallel. So indeed for each page request a different thread may be spawned. Wether or not this indeed happens depends on the configuration settings of you webserver. There's also a cost to spawning many thre...
2
7
0
I am having a hard time trying to figure out the big picture of the handling of multiple requests by the uwsgi server with django or pyramid application. My understanding at the moment is this: When multiple http requests are sent to uwsgi server concurrently, the server creates a separate processes or threads (copie...
What exactly happens on the computer when multiple requests came to the webserver serving django or pyramid application?
0.291313
0
0
1,964
38,772,455
2016-08-04T16:10:00.000
1
0
1
1
python,dask
38,772,791
1
true
0
0
The workers themselves are just Python processes, so you could do tricks with globals(). However, it is probably cleaner to emit values and pass these between tasks. Dask retains the right to rerun functions and run them on different machines, so depending on global state or worker-specific state can easily get you ...
1
2
0
Is there a way with dask to have a variable that can be retrieved from one task to another. I mean a variable that I could lock in the worker and then retrieve in the same worker when i execute another task.
Dask worker persistent variables
1.2
0
0
340
38,774,748
2016-08-04T18:23:00.000
0
0
0
0
python,opencv,camera,kivy,motion-detection
38,774,932
1
false
0
1
opencv is a computer vision framework (hence the c-v) which can interact with device cameras. Kivy is a cross-platform development tool which can interact with device cameras. It makes sense that there are good motion detection tutorials for opencv but not kivy camera, since this isnt really what kivy is for.
1
0
1
What is the difference between Kivy Camera and opencv ? I am asking this because in Kivy Camera the image gets adjusted according to frame size but in opencv this does not happen. Also I am not able to do motion detection in kivy camera whereas I found a great tutorial for motion detection on opencv. If someone can cla...
Difference between Kivy camera and opencv camera
0
0
0
386
38,776,447
2016-08-04T20:02:00.000
5
0
1
0
python,git
38,776,587
2
true
0
0
Don't do that! Suppose that git stash save saves nothing, but there are already some items in the stash. Then, when you're all done, you pop the most recent stash, which is not one you created. What did you just do to the user? One way to do this in shell script code is to check the result of git rev-parse refs/stash ...
2
2
0
I am creating a post-commit script in Python and calling git commands using subprocess. In my script I want to stash all changes before I run some commands and then pop them back. The problem is that if there was nothing to stash, stash pop returns a none-zero error code resulting in an exception in subprocess.check_ou...
Only call 'git stash pop' if there is anything to pop
1.2
0
0
441
38,776,447
2016-08-04T20:02:00.000
2
0
1
0
python,git
38,776,533
2
false
0
0
You can simply try calling git stash show stash@{0}. If this returns successfully, there is something stashed.
2
2
0
I am creating a post-commit script in Python and calling git commands using subprocess. In my script I want to stash all changes before I run some commands and then pop them back. The problem is that if there was nothing to stash, stash pop returns a none-zero error code resulting in an exception in subprocess.check_ou...
Only call 'git stash pop' if there is anything to pop
0.197375
0
0
441
38,778,079
2016-08-04T21:57:00.000
0
0
0
1
python,linux,shell,cmd
38,778,425
1
false
0
0
You cant but the default command prompt dimensions are 677, 343. The height being 677 and the width being 343, hope this helps.
1
2
0
I'm working on a Python shell script that is supposed to fill a percentage of the user's screen. The shell's width, however, is calculated in characters instead of pixels, and I find it difficult to compare them to the screen resolution (which is obviously in pixels). How can I effectively calculate the width in charac...
How to calculate the width of the Windows CMD shell in pixels?
0
0
0
206
38,780,223
2016-08-05T02:33:00.000
0
0
1
1
python,linux,windows,matlab,gurobi
38,780,526
2
false
0
0
Yes, you can write Gurobi Python code on one system, then copy it and run it on another. You can go from Windows to Linux, Mac to Windows, etc. Alternately, if you have Gurobi Compute Server, your Windows computer can be a client of your Linux server.
1
1
0
I have a huge MILP in Matlab, which I want to re-program in Gurobi using python language, on a Windows desktop. But after that I want to run it on a super computer which has a Linux os. I know python is cross-platform. Does this mean anything I create in Gurobi on Windows will run on Linux too? If this question is dumb...
Can a LP created on a Windows platform be run on a Linux platform?
0
0
0
51
38,782,969
2016-08-05T06:53:00.000
1
0
1
0
python,linux,matplotlib,build,fedora
38,783,475
1
false
0
0
I strongly recommend to use virtualenv and build your package inside. Is it really necessary to install via setup.py? If not, you can consider using pip to install your package inside virtualenv.
1
1
0
I need to build a python module from source. It is just my second build and I'm a bit confused regarding the interaction between built packages and binaries installed through package manager. Do I need to uninstall the binary first? If I don't need to Will it overwrite the installed version or will both be available? I...
building a package from source whose binary is already installed
0.197375
0
0
64
38,787,989
2016-08-05T11:20:00.000
2
0
1
0
python,python-3.x,concurrency,python-asyncio,shared-resource
38,791,950
2
false
0
0
There is lots of info that is missing in your question. Is your app threaded? If yes, then you have to wrap your list in a threading.Lock. Do you switch context (e.g. use await) between writes (to the list) in the request handler? If yes, then you have to wrap your list in a asyncio.Lock. Do you do multiprocessing? If...
1
7
0
I've got a network application written in Python3.5 which takes advantage of pythons Asyncio which concurrently handles each incoming connection. On every concurrent connection, I want to store the connected clients data in a list. I'm worried that if two clients connect at the same time (which is a possibility) then ...
Python3 Asyncio shared resources between concurrent tasks
0.197375
0
1
7,818
38,788,955
2016-08-05T12:11:00.000
1
0
1
0
python
38,789,203
2
false
0
0
block if necessary until an item is available This simply means Queue is empty when you make the request and it will be blocked until you add an item to the Queue, unless you pass the argument block = False or set some Timeout. immediately available This means, there is some item on Queue when you make the request a...
2
0
0
That is the Official Docs about multiprocessing.Queue.get get([block[, timeout]]) Remove and return an item from the queue. If optional args block is True (the default) and timeout is None (the default), block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout sec...
python multiprocessing.Queue.put/get's block parameter
0.099668
0
0
2,240
38,788,955
2016-08-05T12:11:00.000
1
0
1
0
python
38,789,231
2
false
0
0
In the first case where block=True is set, "available" means when an item is present on the queue and ready to be removed by Queue.get(). The point is that the thread/process will block until there is an item ready to be removed from the queue. In the second case, block=False so the calling thread will not block if the...
2
0
0
That is the Official Docs about multiprocessing.Queue.get get([block[, timeout]]) Remove and return an item from the queue. If optional args block is True (the default) and timeout is None (the default), block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout sec...
python multiprocessing.Queue.put/get's block parameter
0.099668
0
0
2,240
38,789,873
2016-08-05T12:58:00.000
2
0
1
0
python
38,790,377
8
false
0
0
The first requirement is to decide exactly what you mean by "number of digits." For example, -2.1352 contains ... how many digits? One? Five? Six? Seven? An argument could be made in favor of each of these. Then, in the case of floating point numbers, there's the question of rounding. Float-binary is base-two which m...
1
2
0
For example If the list contains numbers 3 , 14 , 24 , 6 , 157 , 132 ,12 It should give the maximum no of digits as 3
How to find the maximum no of digits in the list in python
0.049958
0
0
776
38,793,001
2016-08-05T15:35:00.000
0
0
1
0
python,algorithm,list,iterator,traversal
38,793,437
2
false
0
0
I would just create a dictionary for each list (could be dict1 and dict2), and when you iterate through the first list, you set both dict1[e] = e' and dict2[e'] = e. Then, when iterating through L2, you just check first that the current e isn't in dict2. Could also add this check to the first iteration in L1 if there a...
1
0
0
Ok, not sure if that was the best title, but I have two python lists. L1 and L2 which both have elements of type T and do not have the same length. I have a function p(T,T) which is a predicate checking a property about two elements of type T. I would like to check that for all elements e in L1, p(e,e') holds, where e'...
For two lists, l1 and l2, how to check that for all e1 ∈ l1, ∃p(e1,e2) where e2 is some element in l2, efficiently in python?
0
0
0
211
38,794,622
2016-08-05T17:14:00.000
0
0
0
0
python,numpy,array-broadcasting
38,794,707
3
false
0
0
Use x.fill(1). Make sure to return it properly as fill doesn't return a new variable, it modifies x
1
0
1
I have a NumPy array A with shape (m,n) and want to run all the elements through some function f. For a non-constant function such as for example f(x) = x or f(x) = x**2 broadcasting works perfectly fine and returns the expected result. For f(x) = 1, applying the function to my array A however just returns the scalar 1...
How to get constant function to keep shape in NumPy
0
0
0
1,182
38,794,937
2016-08-05T17:35:00.000
0
0
1
1
python,windows,bash,windows-subsystem-for-linux
38,797,912
3
false
0
0
You have at least four options: Specify the complete absolute path to the python executable you want to use. Define an alias in your .bashrc file Modify the PATH variable in your .bashrc file to include the location of the python version you wish to use. Create a symlink in a directory which is already in your PATH.
2
11
0
I am using Windows 10 and have Python installed. The new update brought bash to windows, but when I call python from inside bash, it refers to the Python installation which came with the bash, not to my Python installed on Windows. So, for example, I can't use the modules which I have already installed on Windows and w...
Pointing bash to a python installed on windows
0
0
0
7,716
38,794,937
2016-08-05T17:35:00.000
5
0
1
1
python,windows,bash,windows-subsystem-for-linux
40,900,477
3
true
0
0
As of Windows 10 Insider build #14951, you can now invoke Windows executables from within Bash. You can do this by explicitly calling the absolute path to an executable (e.g. c:\Windows\System32\notepad.exe), or by adding the executable's path to the bash path (if it isn't already), and just calling, for example, notep...
2
11
0
I am using Windows 10 and have Python installed. The new update brought bash to windows, but when I call python from inside bash, it refers to the Python installation which came with the bash, not to my Python installed on Windows. So, for example, I can't use the modules which I have already installed on Windows and w...
Pointing bash to a python installed on windows
1.2
0
0
7,716
38,795,545
2016-08-05T18:15:00.000
0
0
0
0
java,python,performance,orientdb
38,802,276
1
false
1
0
AFAIK on remote connection (with a standalone OrientDB server) performance would be the same. The great advantage of using the Java native driver is the option to go embedded. If your deployment scenario allows it, you can avoid the standalone server and use OrientDB embedded into your Java application, avoiding netwo...
1
0
0
I want to develop a project that need a noSQL database. After searching a lot, I chose OrientDB. I want to make an API Rest that can connect to OrientDB. Firstly, I wanted to use Flask to develop but I don't know if it's better to use Java native driver between Python binary driver to connect with database. Anyone hav...
Performance between Python and Java drivers with OrientDB
0
1
0
127
38,795,912
2016-08-05T18:43:00.000
2
0
0
0
python,scikit-learn,cluster-analysis,k-means
38,803,263
1
false
0
0
It is not a good idea to do this during optimization, because it changes the optimization procedure substantially. It will essentially reset the whole optimization. There are strategies such as bisecting k-means that try to learn the value of k during clustering, but they are a bit more tricky than increasing k by one ...
1
0
1
I am attempting to use MiniBatchKMeans to stream NLP data in and cluster it, but have no way of determining how many clusters I need. What I would like to do is periodically take the silhouette score and if it drops below a certain threshold, increase the number of centroids. But as far as I can tell, n_clusters is set...
Is it possible to increase the number of centroids in KMeans during fitting?
0.379949
0
0
77
38,796,252
2016-08-05T19:08:00.000
0
0
0
0
python,sockets,networking,tun
38,833,280
1
false
0
0
If I am understanding your problem, you should be able to write an application that connects to the tun device and also maintains another network socket. You will need some sort of multiplexing such as epoll or select. But, basically, whenever you see data on the tun interface, you can receive the data into a buffer an...
1
0
0
I want to connect a Tun to a socket so that whatever data is stored in the Tun file will then end up being pushed out to a socket which will receive the data. I am struggling with the higher level conceptual understanding of how I am supposed to connect the socket and the Tun. Does the Tun get a dedicated socket that t...
Connecting a Tun to a socket
0
0
1
420
38,796,441
2016-08-05T19:20:00.000
1
0
1
1
python,wing-ide,python-packaging
38,796,484
2
false
0
0
pip install hypothesis Assuming you have pip. If you want to install it from the downloaded package just open command prompt and cd to the directory where you downloaded it and do python setup.py install
1
0
0
I'm using Wing IDE, how do I install hypothesis Python package to my computer? I have already download the zip file, do I use command prompt to install it or there is an option in Wing IDE to do it?
how to install hypothesis Python package?
0.099668
0
0
1,175
38,803,437
2016-08-06T10:51:00.000
0
0
0
0
python,user-interface,tkinter,py2app
39,405,027
3
false
0
1
I actually figured out: a bit of a stupid mistake, but since I'm using python 3.x I have to type in python3 before doing it.
1
0
0
I am building a GUI tkinter python3 application and attempting to compile it with py2app. For some reason when I try to launch the .app bundle in the dist folder it gives me this error: A main script could not be located in the Resources folder I was wondering why it is doing this, as it is rather frustrating, and I ca...
Py2app: A main script could not be located in the Resources folder
0
0
0
1,292
38,803,824
2016-08-06T11:34:00.000
0
0
1
0
java,python,string,challenge-response
38,963,429
1
false
0
0
I am not sure. But i will avoid matching first and last character of chunk. Should replace all other.
1
0
0
I am currently passing 4 of the 5 hidden test cases for this challenge and would like some input Quick problem description: You are given two input strings, String chunk and String word The string "word" has been inserted into "chunk" some number of times The task is to find the shortest string possible when all insta...
Google Challenge Dilemma, Insights into possible errors?
0
0
0
47
38,807,068
2016-08-06T17:41:00.000
0
0
1
0
python,qt,python-3.x,pyqt5
40,221,119
1
false
0
1
Had the exact same issue. Looks like Eric wants pyuic5.bat (somewhere in the path) I created such a batch file with the following contents, and it worked @"pyuic5.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9 PS: In my setup these files are both located in a folder: C:\Python35-32\Scripts
1
0
0
I will compile form designed by qt designer in eric6, but show "Could not start pyuic5, Ensure that it is in the search path." But actually the PATH of pyuic5.exe has been in the system PATH, and also the pyuic5.exe can be run by typing pyuic5 in the cmd of window7 . The envirement is python3.5+qt5.7+pyqt5.7+eric6. Wh...
Compile form in eric6, but show "Could not start pyuic5, Ensure that it is in the search path."
0
0
0
974
38,807,772
2016-08-06T18:59:00.000
2
1
1
0
windows,python-2.7,python-module
38,808,033
2
false
0
0
I suppose you mean "copy the python installation from one system to another" (else the answer is: put your modules on a USB key and copy them to the other system). the best way The best way of course would be to install Python properly on the other system using setup. But as you said, all dependencies/external librarie...
2
13
0
Is it possibe to copy all of the python modules from one Windows computer to another computer? They are both running the same version of Python 2.7.12. The reason for doing so is that I have internet access on one of them, and manual installing modules on the other requires to much time because of dependencies.
Copy python modules from one system to another
0.197375
0
0
25,254
38,807,772
2016-08-06T18:59:00.000
0
1
1
0
windows,python-2.7,python-module
59,914,406
2
false
0
0
In my case, copy-pasting python installation didn't do the job. You need to check the "C:\Users\\AppData\Roaming\Python*" folder. You may find installed python modules there. Copy and paste these into your source folder will add these modules to your python.
2
13
0
Is it possibe to copy all of the python modules from one Windows computer to another computer? They are both running the same version of Python 2.7.12. The reason for doing so is that I have internet access on one of them, and manual installing modules on the other requires to much time because of dependencies.
Copy python modules from one system to another
0
0
0
25,254
38,808,229
2016-08-06T19:58:00.000
0
0
1
0
python,python-3.x,dictionary
38,808,423
2
false
0
0
Assuming the value is not in the dictionary when passed to the callback, dict.setdefault is not really the problem - this operation is one of many available for changing a python dictionary. Specifically, it ensures SOMETHING is stored for the given key, which can be done directly anyway with an indexed assignment. As ...
1
2
0
I currently have an object passed to my callback which is a dictionary and which I have to return. The invoker called obj.setdefault("Server", "Something") on the dictionary so that it has a default value even if the key/value pair does not exist. How can I revert/remove that setdefault (remove the default value)? I me...
Dictionary: Revert/remove setdefault
0
0
0
304
38,808,690
2016-08-06T21:03:00.000
4
0
1
1
python,debugging,intellij-idea,pycharm,remote-debugging
55,854,571
4
false
0
0
I just contacted JetBrains and was informed that their documentation is out of date and that it's now located in /Users/<user>/Library/Application Support/<product_version>/python.
1
9
0
I can't find pycharm-debug.egg in IntelliJ Idea (2016.2) installation directory, where can I get it?
Where can I get pycharm-debug.egg for Idea?
0.197375
0
0
6,168
38,814,666
2016-08-07T13:35:00.000
4
0
0
1
python,google-app-engine,null,google-cloud-datastore,app-engine-ndb
38,815,611
1
true
1
0
You have to specifically set the value to NULL, otherwise it will not be stored in the Datastore and you see it as missing in the Datastore viewer. This is an important distinction. NULL values can be indexed, so you can retrieve a list of entities where date of birth, for example, is null. On the other hand, if you do...
1
1
0
I recently updated an entity model to include some extra properties, and noticed something odd. For properties that have never been written, the Datastore query page shows a "—", but for ones that I've explicitly set to None in Python, it shows "null". In SQL, both of those cases would be null. When I query an entity t...
Why does the Google App Engine NDB datastore have both "—" and "null" for unkown data?
1.2
1
0
184
38,818,981
2016-08-07T22:03:00.000
0
1
0
0
python,twitter,tweepy
38,819,049
1
false
0
0
I don't know much about the limits with Tweepy, but you can always write a basic web scraper with urllib and BeautifulSoup to do so. You could take a website such as www.doesfollow.com which accomplishes what you are trying to do. (not sure about request limits with this page, but there are dozens of other websites tha...
1
3
1
I'm facing problem like this. I used tweepy to collect +10000 tweets, i use nltk naive-bayes classification and filtered the tweets into +5000. I want to generate a graph of user friendship from that classified 5000 tweet. The problem is that I am able to check it with tweepy.api.show_frienship(), but it takes so much...
Most efficient way to check twitter friendship? (over 5000 check)
0
0
1
592
38,819,322
2016-08-07T22:58:00.000
28
0
1
0
ipython-notebook,jupyter-notebook,recovery
44,044,643
12
false
0
0
This is bit of additional info on the answer by Thuener, I did the following to recover my deleted .ipynb file. The cache is in ~/.cache/chromium/Default/Cache/ (I use chromium) used grep in binary search mode, grep -a 'import math' (replace search string by a keyword specific in your code) Edit the binary file in v...
4
23
0
I have iPython Notebook through Anaconda. I accidentally deleted an important notebook, and I can't seem to find it in trash (I don't think iPy Notebooks go to the trash). Does anyone know how I can recover the notebook? I am using Mac OS X. Thanks!
How to recover deleted iPython Notebooks
1
0
0
68,420
38,819,322
2016-08-07T22:58:00.000
11
0
1
0
ipython-notebook,jupyter-notebook,recovery
59,777,233
12
false
0
0
On linux: I did the same error and I finally found the deleted file in the trash /home/$USER/.local/share/Trash/files
4
23
0
I have iPython Notebook through Anaconda. I accidentally deleted an important notebook, and I can't seem to find it in trash (I don't think iPy Notebooks go to the trash). Does anyone know how I can recover the notebook? I am using Mac OS X. Thanks!
How to recover deleted iPython Notebooks
1
0
0
68,420
38,819,322
2016-08-07T22:58:00.000
0
0
1
0
ipython-notebook,jupyter-notebook,recovery
52,046,886
12
false
0
0
Sadly my file was neither in the checkpoints directory, nor chromium's cache. Fortunately, I had an ext4 formatted file system and was able to recover my file using extundelete: Figure out the drive your missing deleted file was stored on: df /your/deleted/file/diretory/ Switch to a folder located on another you have...
4
23
0
I have iPython Notebook through Anaconda. I accidentally deleted an important notebook, and I can't seem to find it in trash (I don't think iPy Notebooks go to the trash). Does anyone know how I can recover the notebook? I am using Mac OS X. Thanks!
How to recover deleted iPython Notebooks
0
0
0
68,420
38,819,322
2016-08-07T22:58:00.000
1
0
1
0
ipython-notebook,jupyter-notebook,recovery
53,780,758
12
false
0
0
If you're using windows, it sends it to the recycle bin, thankfully. Clearly, it's a good idea to make checkpoints.
4
23
0
I have iPython Notebook through Anaconda. I accidentally deleted an important notebook, and I can't seem to find it in trash (I don't think iPy Notebooks go to the trash). Does anyone know how I can recover the notebook? I am using Mac OS X. Thanks!
How to recover deleted iPython Notebooks
0.016665
0
0
68,420
38,825,512
2016-08-08T09:24:00.000
0
0
1
0
python,unit-testing,pycharm,nose
41,159,526
1
true
0
0
Pycharm do support nose-testconfig. It has to be configured in Run->Edit configurations->Defaults->Python tests->Nosetests, check Params check box and set required info there "--tc-file=deafault.ini "
1
0
0
I have most of my test cases programmed using nose-testconfig, I'm trying to configure PyCharm in order to have a better IDE to improve my productivity but after investigating a lot an even ask to JetBrains I discovered PyCharm does not support the nose-testconfig plugin then my ini file cannot be loaded before startin...
PyCharm does not support nose-testconfig and I need an alternative
1.2
0
0
128
38,827,889
2016-08-08T11:19:00.000
89
0
1
1
python-3.x,window
38,842,351
3
true
0
0
Hey just right click on exe file and run as a administrator.It worked for me :)
2
25
0
I have Python 2.7 on my Window 7. Problem is with python 3.5 and 3.6 version only.
Getting the targetdir variable must be provided when invoking this installer while installing python 3.5
1.2
0
0
28,893
38,827,889
2016-08-08T11:19:00.000
2
0
1
1
python-3.x,window
52,044,332
3
false
0
0
There are 2-3 ways to solve the issue: As suggested above, Right-click on exe file and run as administrator. Open command prompt in administrator mode. Just take a note of where your setup file location is present. Use cd C:\Users\ABC\Downloads Type C:\>python-3.7.0.exe TargetDir=C:\Python37 Note: my setup file wa...
2
25
0
I have Python 2.7 on my Window 7. Problem is with python 3.5 and 3.6 version only.
Getting the targetdir variable must be provided when invoking this installer while installing python 3.5
0.132549
0
0
28,893
38,828,829
2016-08-08T12:08:00.000
1
0
1
0
python,pycharm,tensorflow,anaconda,ubuntu-16.04
39,021,770
3
true
0
0
Anaconda defaults doesn't provide tensorflow yet, but conda-forge do, conda install -c conda-forge tensorflow should see you right, though (for others reading!) the installed tensorflow will not work on CentOS < 7 (or other Linux Distros of a similar vintage).
1
2
1
I am using Ubuntu 16.04 . I tried to install Tensorflow using Anaconda 2 . But it installed a Environment inside ubuntu . So i had to create a virtual environment and then use Tensorflow . Now how can i use both Tensorflow and Sci-kit learn together in a single environment .
How to use Tensorflow and Sci-Kit Learn together in one environment in PyCharm?
1.2
0
0
2,492
38,830,610
2016-08-08T13:33:00.000
85
0
0
1
python,docker,jupyter-notebook
38,936,551
11
false
0
0
You need to run your notebook on 0.0.0.0: jupyter notebook -i 0.0.0.0. Running on localhost make it available only from inside the container.
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
1
0
0
99,109
38,830,610
2016-08-08T13:33:00.000
0
0
0
1
python,docker,jupyter-notebook
48,486,958
11
false
0
0
In the container you can run the following to make it available on your local machine (using your docker machine's ip address). jupyter notebook --ip 0.0.0.0 --allow-root You may not need to provide the --allow-root flag depending on your container's setup.
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
0
0
0
99,109
38,830,610
2016-08-08T13:33:00.000
2
0
0
1
python,docker,jupyter-notebook
51,117,257
11
false
0
0
You can use the command jupyter notebook --allow-root --ip[of your container] or give access to all ip using option --ip0.0.0.0.
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
0.036348
0
0
99,109
38,830,610
2016-08-08T13:33:00.000
0
0
0
1
python,docker,jupyter-notebook
62,352,225
11
false
0
0
docker run -i -t -p 8888:8888 continuumio/anaconda3 /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root" i had to add --allow-root to the command and now its running
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
0
0
0
99,109
38,830,610
2016-08-08T13:33:00.000
0
0
0
1
python,docker,jupyter-notebook
71,815,877
11
false
0
0
Go in the Docker and check cat /etc/jupyter/jupyter_notebook_config.py : You should see / add this line : c.NotebookApp.allow_origin = 'https://colab.research.google.com'
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
0
0
0
99,109
38,830,610
2016-08-08T13:33:00.000
65
0
0
1
python,docker,jupyter-notebook
48,986,548
11
false
0
0
Host machine: docker run -it -p 8888:8888 image:version Inside the Container : jupyter notebook --ip 0.0.0.0 --no-browser --allow-root Host machine access this url : localhost:8888/tree‌​ When you are logging in for the first time there will be a link displayed on the terminal to log on with a token.
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
1
0
0
99,109
38,830,610
2016-08-08T13:33:00.000
12
0
0
1
python,docker,jupyter-notebook
46,086,088
11
false
0
0
To get the link to your Jupyter notebook server: After your docker run command, a hyperlink should be automatically generated. It looks something like this: http://localhost:8888/?token=f3a8354eb82c92f5a12399fe1835bf8f31275f917928c8d2 :: /home/jovyan/work If you want to get the link again later down the line, you can t...
7
96
0
I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I launch a Jupyter kernel inside the container, it is running on localhost:8888 (and does not find a browser). I used the command jupyter notebook But from my ...
Access Jupyter notebook running on Docker container
1
0
0
99,109
38,832,347
2016-08-08T14:50:00.000
0
0
0
1
python,scapy,pcap
38,832,386
1
true
0
0
If you're running on linux or OS X try running as root or with sudo, otherwise if you're on windows try running as administrator.
1
0
0
I am trying to run pcapy_sniffer.py but i get this pcapy.PcapError: eth1: You don't have permission to capture on that device (socket: Operation not permitted)
pcapy.PcapError: eth1: You don't have permission to capture on that device
1.2
0
1
1,739
38,833,309
2016-08-08T15:36:00.000
0
1
0
0
python,rabbitmq,amqp,pika
38,833,846
1
true
0
0
RabbitMQ can do this. You only want to read from the queue when you're ready - so spin up a thread that can spawn the external process and watch it, then fetch the next message from the queue when the process is done. You can then have mulitiple threads running in parallel to manage multiple queues. I'm not sure what y...
1
1
0
I'm trying to stay connected to multiple queues in RabbitMQ. Each time I pop a new message from one of these queue, I'd like to spawn an external process. This process will take some time to process the message, and I don't want to start processing another message from that specific queue until the one I popped earlier...
RabbitMQ: Consuming only one message at a time from multiple queues
1.2
0
0
1,536
38,834,104
2016-08-08T16:19:00.000
0
0
0
0
python,python-3.x,url
38,834,146
1
false
0
0
Find out what the source code of the Proxy Block page is. Use urllib and BeautifulSoup to try and scrape the page and parse the page's source code to see if you can find something unique that can tell you if the site is accessible or not. For example, in my office, when a page is blocked by our proxy the title tag of t...
1
0
0
If our network has a proxy , then some sites can not be opened. I want to check iteratively , how many sites can be accessed through our network.
Python : How to check if a given site is accessible through a proxy network?
0
0
1
243
38,836,411
2016-08-08T18:46:00.000
1
1
0
0
python,robotframework
38,837,243
1
false
0
0
No, it is not possible to dynamically create tests via an argument file. It is, however, possible to write a script that reads a data file and generates a suite of tests before running pybot.
1
0
0
I am learning robot and creating a testframework. I want to give people an easy way to add more tests. Is it possible to dynamically create tests based on arguments passed in argument file? I have all my tests in a .rst file and right now users have to populate the test table , but I want to make it simpler so other p...
RobotFramework adding tests through argument file
0.197375
0
0
71
38,836,898
2016-08-08T19:15:00.000
1
0
0
0
python,linux,sockets,unix
38,838,673
1
false
0
0
At the TCP level, the only control you have is how many bytes you pass off to send(), and how often you call it. Once send() has handed over some bytes to the networking stack, it's entirely up to the networking stack how fast (or slow) it wants to send them. Given the above, you can roughly limit your transmission ra...
1
0
0
TCP flows by their own nature will grow until they fill the maximum capacity of the links used from src to dst (if all those links are empty). Is there an easy way to limit that ? I want to be able to send TCP flows with a maximum X mbps rate. I thought about just sending X bytes per second using the socket.send() fun...
Limiting TCP sending rate
0.197375
0
1
1,845
38,838,772
2016-08-08T21:26:00.000
0
0
1
0
python,user-interface,exe,pyinstaller
67,105,487
2
false
0
1
The error is very generic and at this point, it may not be possible to find the actual error what preventing the execution. In order to get actual error please exclude '--windowed' or '--noconsole' parameters during installation and then execute with 'pyinstaller -filename.py --onefile'. Then on execution it will show ...
1
0
0
I'm trying to make my python program run on other systems without python installation. I made use of tkinter to create a gui, after creating an exe file with pyinstaller it throws a fatal error "Failed to run script". I've checked my code several times and it works well. I don't know what's wrong.
Fatal error! failed to execute script when creating executable file
0
0
0
6,275
38,839,215
2016-08-08T22:04:00.000
0
1
0
1
python,command-line,emacs
38,909,330
1
true
0
0
People use different tools for different purposes. An important question about the interface into any program is who is the user? You, as a programmer, will use the interpreter to test a program and check for errors. Often times, the user doesn't really need to access the variables inside because they are not interact...
1
0
0
I am beginner to python and programming in general. As I am learning python, I am tying to develop a good habit or follow a good practice. So let me first explain what I am currently doing. I use Emacs (prelude) to execute python scripts. The keybinding C-c C-c evaluates the buffer which contains the python script. The...
What is the advantage of running python script using command line?
1.2
0
0
1,721
38,839,269
2016-08-08T22:10:00.000
1
1
0
0
php,python,json,laravel
38,839,396
2
false
0
0
Use python to extract data from the serial ports of rasberry pi and json encode it and store it in the web directory of your laravel project files. Later json decode and present the data on the web end via laravel php. This is all good . Beind said that another way is to get data from python and then make a curl Post r...
2
1
0
I have a Raspberry PI collecting data from a break beam sensor I wish to use as part of an already developed Laravel application. I was just wondering what would the best way to transfer the data be. I was thinking of creating an JSON file uploading it to a directory then running a cron job hourly to pick up on new fil...
What is the best way to send Python generated data to PHP?
0.099668
0
0
93
38,839,269
2016-08-08T22:10:00.000
2
1
0
0
php,python,json,laravel
38,839,403
2
true
0
0
Your approach sounds fine - the only caveat would be that you will not have "real time" data. You rely on the schedule of your cron jobs to sync the data around - of course you could do this every minute if you wanted to, which would minimize most of the effect of that delay. The other option is to expose an API in you...
2
1
0
I have a Raspberry PI collecting data from a break beam sensor I wish to use as part of an already developed Laravel application. I was just wondering what would the best way to transfer the data be. I was thinking of creating an JSON file uploading it to a directory then running a cron job hourly to pick up on new fil...
What is the best way to send Python generated data to PHP?
1.2
0
0
93
38,840,728
2016-08-09T01:34:00.000
2
0
1
0
python,pickle,python-2.x,python-module
38,840,848
1
true
0
0
Because they didn't code support for it. C level types (and even modules written in Python are implemented with a C level type) require pickle support to be coded explicitly. It's not very easy to determine what should be pickled if a module is allowed to be pickled; importing the same name on the other side would seem...
1
0
0
I noticed that when my object contains an explicit reference to a module, pickling it will fail because of this. However, if I stick a reference to a function from that module into my object instead, it can be picked and unpickled successfully. How come Python can pickle functions, but not modules?
Why can functions be pickled, but not modules?
1.2
0
0
112
38,841,720
2016-08-09T03:49:00.000
16
0
0
0
python,django,django-admin,python-3.5
38,841,784
1
true
1
0
While it does not show you what you are typing, it is still taking the input. So just type in the password both times, press enter and it will work even though it does not show up.
1
3
0
I am doing python manage.py createsuperuser in PowerShell and CMD, and I can type when it prompts me for the Username and Email, but when it gets to Password it just won't let me type. It is not freezing though, because when I press enter it re-prompts me for the password... Using Django 1.10 and Windows 10.
Cannot type password. (creating a Django admin superuser)
1.2
0
0
4,366
38,841,865
2016-08-09T04:07:00.000
2
0
1
0
python
38,842,389
3
false
0
0
You can use logging with debug level and once the debugging is completed, change the level to info. So any statements with logger.debug() will not be printed.
2
2
0
To python experts: I put lots of print() to check the value of my variables. Once I'm done, I need to delete the print(). It quite time-consuming and prompt to human errors. Would like to learn how do you guys deal with print(). Do you delete it while coding or delete it at the end? Or there is a method to delete it au...
How do you deal with print() once you done with debugging/coding
0.132549
0
0
306
38,841,865
2016-08-09T04:07:00.000
0
0
1
0
python
38,843,280
3
false
0
0
What I do is put print statements in with with a special text marker in the string. I usually use print("XXX", thething). Then I just search for and delete the line with that string. It's also easier to spot in the output.
2
2
0
To python experts: I put lots of print() to check the value of my variables. Once I'm done, I need to delete the print(). It quite time-consuming and prompt to human errors. Would like to learn how do you guys deal with print(). Do you delete it while coding or delete it at the end? Or there is a method to delete it au...
How do you deal with print() once you done with debugging/coding
0
0
0
306
38,841,875
2016-08-09T04:08:00.000
1
0
1
0
python,python-3.x
38,841,951
4
false
0
0
Then modifying the contents of list "b" won't change list "a" as per what I've read. So, this means its a deep copy. No, it does not. A shallow copy differs from a deep copy in whether contained values are copied or not. In your case, the list is copied, but the two resulting lists will contain the same objects. Add...
1
7
0
Say I have a list a with some values, and I did a b = a[:]. Then modifying the contents of list b won't change list a as per what I've read. So, this means its a deep copy. But python documentation still refers to this as shallow copy. Can someone clear this for me?
Copying a list using a[:] or copy() in python is shallow?
0.049958
0
0
2,887
38,842,666
2016-08-09T05:23:00.000
1
1
1
0
python,postgresql,internationalization,datetime-format,datetimeoffset
38,843,085
1
true
1
0
Keep as much in UTC as possible. Do your timezone conversion at your edges (client display and input processing), but keep anything stored server side in UTC.
1
1
0
I am building a mobile app and would like to follow best practice for datetime. Initially, we launched it in India and made our server, database and app time to IST. Now we are launching the app to other countries(timezones), how should I store the datetime? Should the server time be set to UTC and app should display t...
Internationalization for datetime
1.2
0
0
224
38,843,404
2016-08-09T06:17:00.000
1
1
0
0
python,pyramid,pylons
38,886,655
2
false
1
0
Here's how I managed my last Pyramid app: I had both a development.ini and a production.ini. I actually had a development.local.ini in addition to the other two - one for local development, one for our "test" system, and one for production. I used git for version control, and had a main branch for production deploymen...
1
2
0
So I have this Python pyramid-based application, and my development workflow has basically just been to upload changed files directly to the production area. Coming close to launch, and obviously that's not going to work anymore. I managed to edit the connection strings and development.ini and point the development ins...
Trying to make a development instance for a Python pyramid project
0.099668
1
0
166
38,844,651
2016-08-09T07:31:00.000
1
0
1
0
python,json,openerp,odoo-8,odoo-10
38,847,214
1
false
1
0
maybe this will help you: Step 1: Create js that runs reqiest to /example_link Step 2: Create controller who listens that link @http.route('/example_link', type="json") Step 3: return from that function json return json.dumps(res) where res is python dictionary and also dont forget to import json. Thats all, it's not v...
1
3
0
I'm trying to integrate reactjs with Odoo, and successfully created components. Now my problem is that I cant get the JSON via odoo. The odoo programmer has to write special api request to make this happen. This is taking more time and code repetitions are plenty. I tried may suggestions and none worked. Is there a be...
Can I convert an Odoo browse object to JSON
0.197375
0
1
3,015
38,846,395
2016-08-09T09:03:00.000
2
0
1
0
python,installation
38,846,673
1
true
0
0
You can put your example data in the repository in examples folder next to your project sources and exclude it from package with prune examples in your manifest file. There is actually no universal and standard advice for that. Do whatever suits your needs.
1
1
0
I'm setting up my first Python package, and I want to install it with some example data so that users can run the code straight off. In case it's relevant my package is on github and I'm using pip. At the moment my example data is being installed with the rest of the package into site_packages/, by setting include_pack...
Where to place example data in python package?
1.2
0
0
191