Q_CreationDate
stringlengths
23
23
Title
stringlengths
11
149
Question
stringlengths
25
6.53k
Answer
stringlengths
15
5.1k
Score
float64
-1
1.2
Is_accepted
bool
2 classes
N_answers
int64
1
17
Q_Id
int64
0
6.76k
2016-07-28 03:00:06.023
Python pip installation not working how to do?
I keep trying to install Pip using get-pip.py and only get the wheel file in the scripts folder. Try running "pip" in the command prompt and it just comes out with an error. Running windows 8 incase you need. edit error is 'pip' is not recognized as an internal or external command...
If you are using latest version of Python. In computer properties, Go to Advanced System Settings -> Advanced tab -> Environmental Variables In System variables section, there is variable called PATH. Append c:\Python27\Scripts (Note append, not replace) Then open a new command prompt, try "pip"
0.135221
false
2
4,424
2016-07-28 03:00:06.023
Python pip installation not working how to do?
I keep trying to install Pip using get-pip.py and only get the wheel file in the scripts folder. Try running "pip" in the command prompt and it just comes out with an error. Running windows 8 incase you need. edit error is 'pip' is not recognized as an internal or external command...
Try navigating to ~/Python[version]/Scripts in cmd, then use pip[version] [command] [module] (ie. pip3 install themodulename or pip2 install themodulename)
0
false
2
4,424
2016-07-29 10:55:20.490
how to save jupyter output into a pdf file
I am doing some data science analysis on jupyter and I wonder how to get all the output of my cell saved into a pdf file ? thanks
When I want to save a Jupyter Notebook I right click the mouse, select print, then change Destination to Save as PDF. This does not save the analysis outputs though. So if I want to save a regression output, for example, I highlight the output in Jupyter Notebook, right click, print, Save as PDF. This process creates f...
0.545705
false
1
4,425
2016-07-30 10:15:26.823
Syntax error while installing seaborn using conda
I've recently tried to install seaborn on ipython, which the latter was installed using anaconda. However, when I ran conda install seaborn, i was returned with a syntax error. I tried again with conda install -c anaconda seaborn=0.7.0 this time but syntax error was returned again. Apologies for my limited programming...
conda is a command line tool, not a Python function. You should be typing these commands in a bash (or tcsh, etc.) shell, not in the IPython interpreter.
1.2
true
1
4,426
2016-07-31 21:54:39.590
Sublime Text3 creates Scripts inside Scripts folder inside virtualenv
I'm trying to run Python scripts inside virtualenv from Sublime Text 3. When I activate the virtualenv in ST3 and choose the .py, ST3 creates a Scripts folder inside the preexisting Scripts folder (for a new `.py'). What is causing this problem and how I do stop this from happening? Following are the detailed steps I f...
Solved. In ST3, use Virtualenv: Add Directory instead of Virtualenv: New. The latter creates a new virtualenv (hence the new Scripts folder).
0
false
1
4,427
2016-08-01 10:30:34.620
Writing to particular address in memory in python
I know python is a high level language and manages the memory allocation etc. on its own user/developer doesn't need to worry much unlike other languages like c, c++ etc. but is there a way through will we can write some value in a particular memory address in python i know about id() which if hex type casted can give ...
I can't advise how but I do know (one) why. Direct writing to registers allows one to set up a particular microcontroller. For example, configuring ports or peripherals. This is normally done in C (closer to hardware) but it would be a nice feature if you wanted to use Python for other reasons.
0
false
2
4,428
2016-08-01 10:30:34.620
Writing to particular address in memory in python
I know python is a high level language and manages the memory allocation etc. on its own user/developer doesn't need to worry much unlike other languages like c, c++ etc. but is there a way through will we can write some value in a particular memory address in python i know about id() which if hex type casted can give ...
Python itself does not include any facilities to allow the programmer direct access to memory. This means that sadly (or happily, depending on your outlook) the answer to your question is "no".
0.101688
false
2
4,428
2016-08-01 16:37:02.753
Using Google Forms to write to multiple tables?
I am creating a web project where I take in Form data and write to a SQL database. The forms will be a questionnaire with logic branching. Due to the nature of the form, and the fact that this is an MVP project, I've opted to use an existing form service (e.g Google Forms/Typeform). I was wondering if it's feasible to...
You can add a script in the Google spreadsheet with an onsubmit trigger. Then you can do whatever you want with the submitted data.
0
false
1
4,429
2016-08-01 20:14:22.077
Send commands to running script by running it with flags
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...
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...
0.201295
false
1
4,430
2016-08-02 17:35:34.290
How to turn off matplotlib inline function and install pygtk?
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...
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.
0
false
1
4,431
2016-08-03 10:43:17.607
App Engine serving old version intermittently
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 ...
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.2
true
1
4,432
2016-08-04 06:08:58.867
How should we set the number of the neurons in the hidden layer in neural network?
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?
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*...
0.135221
false
2
4,433
2016-08-04 06:08:58.867
How should we set the number of the neurons in the hidden layer in neural network?
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?
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. ...
1.2
true
2
4,433
2016-08-04 20:02:17.877
Only call 'git stash pop' if there is anything to pop
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...
You can simply try calling git stash show stash@{0}. If this returns successfully, there is something stashed.
0.386912
false
2
4,434
2016-08-04 20:02:17.877
Only call 'git stash pop' if there is anything to pop
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...
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 ...
1.2
true
2
4,434
2016-08-05 19:20:58.477
how to install hypothesis Python package?
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?
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
0.201295
false
1
4,435
2016-08-06 17:41:11.033
Compile form in eric6, but show "Could not start pyuic5, Ensure that it is in the search path."
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...
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
0
false
1
4,436
2016-08-07 22:58:43.137
How to recover deleted iPython Notebooks
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!
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...
0
false
4
4,437
2016-08-07 22:58:43.137
How to recover deleted iPython Notebooks
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!
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...
0.740859
false
4
4,437
2016-08-07 22:58:43.137
How to recover deleted iPython Notebooks
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!
If you're using windows, it sends it to the recycle bin, thankfully. Clearly, it's a good idea to make checkpoints.
0.034
false
4
4,437
2016-08-07 22:58:43.137
How to recover deleted iPython Notebooks
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!
On linux: I did the same error and I finally found the deleted file in the trash /home/$USER/.local/share/Trash/files
0.357616
false
4
4,437
2016-08-08 12:08:33.633
How to use Tensorflow and Sci-Kit Learn together in one environment in PyCharm?
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 .
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
true
1
4,438
2016-08-09 04:07:00.267
How do you deal with print() once you done with debugging/coding
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...
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.
0.265586
false
2
4,439
2016-08-09 04:07:00.267
How do you deal with print() once you done with debugging/coding
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...
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.
0
false
2
4,439
2016-08-09 16:42:05.797
Running an R script from command line (to execute from python)
I'm currently trying to run an R script from the command line (my end goal is to execute it as the last line of a python script). I'm not sure what a batch file is, or how to make my R script 'executable'. Currently it is saved as a .R file. It works when I run it from R. How do I execute this from the windows comman...
You probably already have R, since you can already run your script. All you have to do is find its binaries (the Rscript.exe file). Then open windows command line ([cmd] + [R] > type in : "cmd" > [enter]) Enter the full path to R.exe, followed by the full path to your script.
1.2
true
2
4,440
2016-08-09 16:42:05.797
Running an R script from command line (to execute from python)
I'm currently trying to run an R script from the command line (my end goal is to execute it as the last line of a python script). I'm not sure what a batch file is, or how to make my R script 'executable'. Currently it is saved as a .R file. It works when I run it from R. How do I execute this from the windows comman...
You already have Rscript, it came with your version of R. If R.exe, Rgui.exe, ... are in your path, then so is Rscript.exe. Your call from Python could just be Rscript myFile.R. Rscript is much better than R BATCH CMD ... and other very old and outdated usage patterns.
0.386912
false
2
4,440
2016-08-09 23:38:56.460
How do I add more python modules to my yocto/openembedded project?
I wish to add more python modules to my yocto/openembedded project but I am unsure how to? I wish to add flask and its dependencies.
The OE layer index at layers.openembedded.org lists all known layers and the recipes they contain, so searching that should bring up the meta-python layer that you can add to your build and use recipes from.
0.296905
false
1
4,441
2016-08-10 06:23:27.897
How can I run python scikit-learn on Raspberry Pi?
I'm new in embedded programming, and would like to understand what I need to do to run python scikit-learn on a capable embedded processor. See Raspberry Pi as an example.
scikit-learn will run on a Raspberry Pi just as well as any other Linux machine. To install it, make sure you have pip3 (sudo apt-get install python3-pip), and use sudo pip3 install scikit-learn. All Python scripts utilizing scikit-learn will now run as normal.
0
false
1
4,442
2016-08-10 20:22:05.040
How to get Python 3.5 and Anaconda 3.5 running on ubuntu 16.04?
Anaconda for python 3.5 and python 2.7 seems to install just as a drop in folder inside my home folder on Ubuntu. Is there an installed version of Anaconda for Ubuntu 16? I'm not sure how to ask this but do I need python 3.5 that comes by default if I am also using Anaconda 3.5? It seems like the best solution is d...
Use anaconda version Anaconda3-4.2.0-Linux-x86_64.sh from the anaconda installer archive.This comes with python 3.5. This worked for me.
0
false
1
4,443
2016-08-11 04:02:31.683
Troubleshooting Amazon's Alexa Skill Kit (ASK) Lambda interaction
I'm starting with ASK development. I'm a little confused by some behavior and I would like to know how to debug errors from the "service simulator" console. How can I get more information on the The remote endpoint could not be called, or the response it returned was invalid. errors? Here's my situation: I have a skill...
tl;dr: The remote endpoint could not be called, or the response it returned was invalid. also means there may have been a timeout waiting for the endpoint. I was able to narrow it down to a timeout. Seems like the Alexa service simulator (and the Alexa itself) is less tolerant to long responses than the lambda testin...
1.2
true
3
4,444
2016-08-11 04:02:31.683
Troubleshooting Amazon's Alexa Skill Kit (ASK) Lambda interaction
I'm starting with ASK development. I'm a little confused by some behavior and I would like to know how to debug errors from the "service simulator" console. How can I get more information on the The remote endpoint could not be called, or the response it returned was invalid. errors? Here's my situation: I have a skill...
My guess would be that you missed a step on setup. There's one where you have to set the "event source". IF you don't do that, I think you get that message. But the debug options are limited. I wrote EchoSim (the original one on GitHub) before the service simulator was written and, although it is a bit out of date, it ...
0
false
3
4,444
2016-08-11 04:02:31.683
Troubleshooting Amazon's Alexa Skill Kit (ASK) Lambda interaction
I'm starting with ASK development. I'm a little confused by some behavior and I would like to know how to debug errors from the "service simulator" console. How can I get more information on the The remote endpoint could not be called, or the response it returned was invalid. errors? Here's my situation: I have a skill...
I think the problem you having for ARN:1 is you probably didn't set a trigger to alexa skill in your lambda function. Or it can be the alexa session timeout which is by default set to 8 seconds.
0.101688
false
3
4,444
2016-08-13 09:00:23.817
How to make a port forward rule in Python 3 in windows?
Purpose: I'm making a program that will set up a dedicated server (software made by game devs) for a game with minimal effort. One common step in making the server functional is port forwarding by making a port forward rule on a router. Me and my friends have been port forwarding through conventional means for many yea...
You should read first some sort of informations about UPnP (Router Port-Forwarding) and that it's normally disabled. Dependent of your needs, you could also try a look at ssh reverse tunnels and at ssh at all, as it can solve many problems. But you will see that working with windows and things like adavanced network ...
0
false
2
4,445
2016-08-13 09:00:23.817
How to make a port forward rule in Python 3 in windows?
Purpose: I'm making a program that will set up a dedicated server (software made by game devs) for a game with minimal effort. One common step in making the server functional is port forwarding by making a port forward rule on a router. Me and my friends have been port forwarding through conventional means for many yea...
I'm not sure if that's possible, as much as I know, ports aren't actually a thing their just some abstraction convention made by protocols today and supported by your operating system that allows you to have multiple connections per one machine, now sockets are basically some object provided to you by the operating sys...
0
false
2
4,445
2016-08-13 20:12:07.240
How to find good documentation for Python modules
I can't seem to find a good explanation of how to use Python modules. Take for example the urllib module. It has commands such as req = urllib.request.Request(). How would I find out what specific commands, like this one, are in certain Python modules? For all the examples I've seen of people using specific Python modu...
My flow chart looks something like this: Reading the published documentation (or use help(moduleName) which gives you the same information without an internet connection in a harder to read format). This can be overly verbose if you're only looking for one tidbit of information, in which case I move on to... Finding t...
0.386912
false
1
4,446
2016-08-14 16:27:37.613
jupyter custom.css removal
By mistake, I updated this file to customize css. D:\Continuum\Anaconda2\Lib\site-packages\notebook\static\custom\custom.css To rollback the above change, 1) I put back the original file that I saved before. still the new css shows up in jupyter. 2) I removed all .ipython and .jupyter dir and it didn't work either. 3)...
Reposting as an answer: When your changes don't seem to be taking effect in an HTML interface, browser caching is often a culprit. The browser saves time by not asking for files again. You can: Try force-refreshing with Ctrl-F5. It may get some things from the cache anyway, though sometimes mashing it several times is...
0.999909
false
1
4,447
2016-08-15 02:12:34.403
Using shift operator for LFSR in python
Let's say I want to write a 16bit linear feedback shift register LFSR in Python using its native shift operator. Does the operator itself have a feature to specify the bit to shifted into the new MSB position? Does the operator have a carry flag or the like to catch the LSB falling out of the register? Has to setup t...
Python does not have registers and you cannot declare the type of anything. The shift operators operate on unlimited-precision integers. If you shift left, the number will continue to get larger indefinitely (or until out of memory). If you shift right, the least-significant bit is dropped as you would expect. There i...
0.386912
false
1
4,448
2016-08-15 11:48:47.577
Cache busting with Django
I'm working on a website built with Django. When I'm doing updates on the static files, the users have to hard refresh the website to get the latest version. I'm using a CDN server to deliver my static files so using the built-in static storage from Django. I don't know about the best practices but my idea is to genera...
Here's my work around : On deployment (from a bash script), I get the shasum of my css style. I put this variable inside the environment. I have a context processor for the template engine that will read from the environment.
1.2
true
1
4,449
2016-08-16 03:16:30.193
Pycharm edu terminal plugin missing
First time posting, let me know how I can improve my questions. I have installed PyCharm Edu 3.0 and Anaconda 3 on an older laptop. I am attempting to access the embedded terminal in the IDE and I am unable to launch it. I have searched through similar questions here and the JetBrains docs, and the common knowledge see...
Go to File > Settings > Plugins > Browse repositories > Search and Install Native Terminal This will install a terminal which will use the Windows Native terminal. A small black button will appear on the tool bar. If you did not enable the tool bar, here is the trick: View | toolbar check this toolbar option and the cm...
0
false
2
4,450
2016-08-16 03:16:30.193
Pycharm edu terminal plugin missing
First time posting, let me know how I can improve my questions. I have installed PyCharm Edu 3.0 and Anaconda 3 on an older laptop. I am attempting to access the embedded terminal in the IDE and I am unable to launch it. I have searched through similar questions here and the JetBrains docs, and the common knowledge see...
Click preferences and choose plugin. Next click install Jetbrains plugin and choose Command line Tool Support. I hope this will help you
-0.201295
false
2
4,450
2016-08-16 04:09:26.390
Python3 Running atexit only on the main process
I have a program that spawns multiple child processes, how would I make the program only call atexit.register(function) on the main process and not on the child processes as well? Thanks
The functions registered via atexit are inherited by the children processes. The simplest way to prevent that, is via calling atexit after you have spawned the children processes.
0
false
1
4,451
2016-08-16 13:35:32.543
Initializing a very large pandas dataframe
Background: I have a sequence of images. In each image, I map a single pixel to a number. Then I want to create a pandas dataframe where each pixel is in its own column and images are rows. The reason I want to do that is so that I can use things like forward fill. Challenge: I have transformed each image into a one di...
Out of curiosity, is there a reason you want to use Pandas for this? Image analysis is typically handled in matrices making NumPy a clear favorite. If I'm not mistaken, both sk-learn and PIL/IMAGE use NumPy arrays to do their analysis and operations. Another option: avoid the in-memory step! Do you need to access a...
0
false
1
4,452
2016-08-16 16:57:42.340
What does Random Forest do with unseen data?
When I built my random forest model using scikit learn in python, I set a condition (where clause in sql query) so that the training data only contain values whose value is greater than 0. I am curious to know how random forest handles test data whose value is less than 0, which the random forest model has never seen b...
They will be treated in the same manner as the minimal value already encountered in the training set. RF is just a bunch of voting decision trees, and (basic) DTs can only form decisions in form of "if feature X is > then T go left, otherwise go right". Consequently, if you fit it to data which, for a given feature, ha...
1.2
true
1
4,453
2016-08-16 20:59:44.347
Drive issue with python NLTK
I am trying to use nltk in python, but am receiving a pop up error (windows) describing that I am missing a drive at the moment I call import nltk Does anyone know why or how to fix this? The error is below: "There is no disk in the drive. Please insert a disk into drive \Device\Harddisk4\DR4."
While i am not sure exactly where the problem arises, I had this same error happen to me (it started 'overnight' - the code had been working, i hand not re-installed nltk, so i have no idea what caused it to start happening). I still had the problem after upgrading to the latest version of nltk (3.2.1), and re-download...
0.135221
false
1
4,454
2016-08-17 06:49:29.810
How to install scikit-learn
I know how to install external modules using the pip command but for Scikit-learn I need to install NumPy and Matplotlib as well. How can I install these modules using the pip command?
Old post, but right answer is, 'sudo pip install -U numpy matplotlib --upgrade' for python2 or 'sudo pip3 install -U numpy matplotlib --upgrade' for python3
0
false
2
4,455
2016-08-17 06:49:29.810
How to install scikit-learn
I know how to install external modules using the pip command but for Scikit-learn I need to install NumPy and Matplotlib as well. How can I install these modules using the pip command?
Using Python 3.4, I run the following from the command line: c:\python34\python.exe -m pip install package_name So you would substitute "numpy" and "matplotlib" for 'package_name'
-0.201295
false
2
4,455
2016-08-17 18:30:17.467
Can't find TF_MIN_GPU_MULTIPROCESSOR_COUNT
I get a message that says my GPU Device is ignored because its multiprocessor count is lower than the minimum set. However, it gives me the environment variable TF_MIN_GPU_MULTIPROCESSOR_COUNT but it doesn't seem to exist because I keep getting command not found. When I look at the environment variables using set or pr...
Do something like this before running your main script export TF_MIN_GPU_MULTIPROCESSOR_COUNT=4 Note though that the default is set for a reason -- if you enable slower GPU by changing that variable, your program may run slower than it would without any GPU available, because TensorFlow will try to put run everything ...
1.2
true
2
4,456
2016-08-17 18:30:17.467
Can't find TF_MIN_GPU_MULTIPROCESSOR_COUNT
I get a message that says my GPU Device is ignored because its multiprocessor count is lower than the minimum set. However, it gives me the environment variable TF_MIN_GPU_MULTIPROCESSOR_COUNT but it doesn't seem to exist because I keep getting command not found. When I look at the environment variables using set or pr...
In windows, create a new environmental variable with this name and assign its value. You can do that by right clicking on the This PC in File Explorer, select Properties at bottom, then select Advanced system settings on left. That will get you to the System Properties dialog. Also you can type "environmental prop...
0
false
2
4,456
2016-08-17 23:37:01.227
jpype accessing java mehtod/variable whose name is reserved name in python
Any idea how this can be done? ie, if we have a variable defined in java as below public Class Foo { String pass = "foo"; } how can I access this via jpype since pass is a reserved keyword? I tried getattr(Jpype.JClass(Foo)(), "pass") but it fails to find the attribute named pass
unfortunally Fields or methods conflicting with a python keyword can’t be accessed
0
false
2
4,457
2016-08-17 23:37:01.227
jpype accessing java mehtod/variable whose name is reserved name in python
Any idea how this can be done? ie, if we have a variable defined in java as below public Class Foo { String pass = "foo"; } how can I access this via jpype since pass is a reserved keyword? I tried getattr(Jpype.JClass(Foo)(), "pass") but it fails to find the attribute named pass
Figured out that jpype appends an "_" at the end for those methods/fields in its source code. So you can access it by Jpype.JClass("Foo").pass_ Wish it's documented somewhere
0.201295
false
2
4,457
2016-08-18 11:59:32.230
Django and celery on different servers and celery being able to send a callback to django once a task gets completed
I have a django project where I am using celery with rabbitmq to perform a set of async. tasks. So the setup i have planned goes like this. Django app running on one server. Celery workers and rabbitmq running from another server. My initial issue being, how to do i access django models from the celery tasks resting ...
I've used the following set up on my application: Task is initiated from Django - information is extracted from the model instance and passed to the task as a dictionary. NB - this will be more future proof as Celery 4 will default to JSON encoding Remote server runs task and creates a dictionary of results Remote ser...
0
false
1
4,458
2016-08-18 15:53:07.243
Provide temporary PYTHONPATH on the commandline?
I'm thinking of something like python3 my_script.py --pythonpath /path/to/some/necessary/modules Is there something like this? I know (I think) that Pycharm temporarily modifies PYTHONPATH when you use it to execute scripts; how does Pycharm do it? Reasons I want to do this (you don't really need to read the following)...
Not sure how much effort you want to put into this temporary python path thing but you could always use a python virtual environment for running scripts or whatever you need.
0
false
1
4,459
2016-08-18 16:30:01.223
How to load a code source modified package in Python?
I have downloaded from github a package (scikit-lean) and put the code source in repository folder (Windows 7 64-bit). After modifying the code source, how can I load the package into the IPython notebook for testing ? Should I copy paste the modified in sites-packages folder ? (what about the current original scikit-...
If the code is in a file called file.py, you should just be able to do import file (if you're not in the right folder, just run cd folder in IPython first.)
0
false
1
4,460
2016-08-21 09:08:16.717
changing s3 storages with django-storages
I have a Django application where I use django-storages and amazon s3 to store images. I need to move those images to a different account: different user different bucket. I wanted to know how do I migrate those pictures? my main concern is the links in my database to all those images, how do I update it?
The URL is relative to the amazon storage address you provide in your settings. so you only need to move the images to a new bucket and update your settings.
0
false
1
4,461
2016-08-21 13:36:05.157
Giving input to terminal in python
I'm writing a code to read serial input. Once the serial input has been read, I have to add a time stamp below it and then the output from a certain software. To get the output from the software, I want python to write a certain command to the terminal, and then read the output that comes on the terminal. Could you sug...
You would need to have python implemented into the software. Also, I believe this is a task for GCSE Computing this year as I was privileged enough to choose what test we are doing and there was a question about serial numbers.
0
false
1
4,462
2016-08-22 18:32:39.097
Using requests package to make request
I have an application (spark based service), which when starts..works like following. At localhost:9000 if I do nc -lk localhost 9000 and then start entering the text.. it takes the text entered in terminal as an input and do a simple wordcount computation on it. how do i use the requests library to programmatically s...
requests is a HTTP request library, while Spark's wordcount example provides a raw socket server, so no, requests is not the right package to communicate with your Spark app.
1.2
true
1
4,463
2016-08-24 16:03:19.630
How do I structure a database cache (memcached/Redis) for a Python web app with many different variables for querying?
For my app, I am using Flask, however the question I am asking is more general and can be applied to any Python web framework. I am building a comparison website where I can update details about products in the database. I want to structure my app so that 99% of users who visit my website will never need to query the d...
I had this exact question myself, with a PHP project, though. My solution was to use ElasticSearch as an intermediate cache between the application and database. The trick to this is the ORM. I designed it so that when Entity.save() is called it is first stored in the database, then the complete object (with all refere...
0
false
1
4,464
2016-08-25 20:57:19.470
How can I use "e" (Euler's number) and power operation in python 2.7
How can i write x.append(1-e^(-value1^2/2*value2^2)) in python 2.7? I don't know how to use power operator and e.
Just to add, numpy also has np.e
0
false
1
4,465
2016-08-26 07:34:22.913
How to get the flag/state of current operation in Odoo 9?
I am new in odoo, I want to know how we get the current flag/state of every operation. For example: when we create a new record how do we know the current flag/state is "add"? or when we view a record how do we know the current flag/state is "view"? It something like current user id that stored in session named "uid",...
There is no such thing as 'flag/state'. What you are probably trying to say is that you want to know which operations are taking place on a record. The easiest method is to take a look at your log. There will be statements there in the form /web/dataset/call_kw/model/operation where model is your ORM model and operati...
0
false
1
4,466
2016-08-26 13:54:13.457
Tensorflow: show or save forget gate values in LSTM
I am using the LSTM model that comes by default in tensorflow. I would like to check or to know how to save or show the values of the forget gate in each step, has anyone done this before or at least something similar to this? Till now I have tried with tf.print but many values appear (even more than the ones I was exp...
If you are using tf.rnn_cell.BasicLSTMCell , the variable you are looking for will have the following suffix in its name : <parent_variable_scope>/BasicLSTMCell/Linear/Matrix . This is a concatenated matrix for all the four gates. Its first dimension matches the sum of the second dimensions of the input matrix and the ...
0.673066
false
1
4,467
2016-08-26 18:23:45.180
Python: How to interpolate errors using scipy interpolate.interp1d
I have a number of data sets, each containing x, y, and y_error values, and I'm simply trying to calculate the average value of y at each x across these data sets. However the data sets are not quite the same length. I thought the best way to get them to an equal length would be to use scipy's interoplate.interp1d for ...
As long as you can assume that your errors represent one-sigma intervals of normal distributions, you can always generate synthetic datasets, resample and interpolate those, and compute the 1-sigma errors of the results. Or just interpolate values+err and values-err, if all you need is a quick and dirty rough estimate.
0
false
1
4,468
2016-08-27 20:42:38.590
How to force application version on AWS Elastic Beanstalk
I'm trying to deploy a new version of my Python/Django application using eb deploy. It unfortunately fails due to unexpected version of the application. The problem is that somehow eb deploy screwed up the version and I don't know how to override it. The application I upload is working fine, only the version number is ...
I've realised that the problem was that Elastic Beanstalk, for some reasons, kept the unsuccessfully deployed versions under .elasticbeanstalk. The solution, at least in my case, was to remove those temporal (or whatever you call them) versions of the application.
1.2
true
1
4,469
2016-08-30 01:50:27.790
How to convert a list by mapping an element into multiple elements in python?
For example, how to convert [1, 5, 7] into [1,2,5,6,7,8] into python? [x, x+1 for x in [1,5,7]] can't work for sure...
You can do your list comprehension logic with tuples and then flatten the resulting list: [n for pair in [(x, x+1) for x in [1,5,7]] for n in pair]
0.058243
false
2
4,470
2016-08-30 01:50:27.790
How to convert a list by mapping an element into multiple elements in python?
For example, how to convert [1, 5, 7] into [1,2,5,6,7,8] into python? [x, x+1 for x in [1,5,7]] can't work for sure...
If you just want to fill the list with the numbers between the min and max+1 values you can use [i for i in range (min(x),max(x)+2)] assuming x is your list.
0
false
2
4,470
2016-08-30 19:53:33.110
how to install libhdf5-dev? (without yum, rpm nor apt-get)
I want to use h5py which needs libhdf5-dev to be installed. I installed hdf5 from the source, and thought that any options with compiling that one would offer me the developer headers, but doesn't look like it. Anyone know how I can do this? Is there some other source i need to download? (I cant find any though) I am o...
For Centos 8, I got the below warning message : Warning: Couldn't find any HDF5 C++ libraries. Disabling HDF5 support. and I solved it using the command : sudo yum -y install hdf5-devel
0
false
1
4,471
2016-08-31 07:45:50.643
Executing script when SQL query is executed
I want to execute script(probably written in python), when update query is executed on MySQL database. The query is going to be executed from external system written in PHP to which I don't have access, so I can't edit the source code. The MySQL server is installed on our machine. Any ideas how I can accomplish this, o...
No, it is not possible to call external scripts from MySQL. The only thing you can do is adding an ON UPDATE trigger that will write into some queue. Then you will have the python script POLLING the queue and doing whatever it's supposed to do with the rows it finds.
1.2
true
1
4,472
2016-08-31 18:13:46.743
How to Import compiled libs (pyd) in python
I could not get a working example of importing a compiled library (pyd file) in Python. I compiled the blender source code, result is a bpy.pyd file. This file is placed in the python\lib folder. In the source code I have import bpy The file is found at runtime, but I get a runtime error that the module could not be i...
Found the error: the pyd file was compiled with a 32 bit Python, was called with a 64 bit Python
0
false
1
4,473
2016-08-31 19:42:23.270
Regular Expression with letter
I need to match things that format something along the lines of 657432-76, 54678-01, 54364A-12 I got (r'^\d{6}-\d{2}$') and (r'^\d{5}-\d{2}$') but how do you get the letter? thanks!!
it seems the pattern generically is 6 characters with possible letter or number at last char max then - then 2 numbers? so then you'd use this pattern pattern = r'^d{5}.+-\d{2}$'
0
false
2
4,474
2016-08-31 19:42:23.270
Regular Expression with letter
I need to match things that format something along the lines of 657432-76, 54678-01, 54364A-12 I got (r'^\d{6}-\d{2}$') and (r'^\d{5}-\d{2}$') but how do you get the letter? thanks!!
For the letter use [a-zA-Z], and if it's only upper case then [A-Z] is sufficient.
0
false
2
4,474
2016-09-01 14:54:31.790
How to test RPC of SOAP web services?
I am currently learning building a SOAP web services with django and spyne. I have successfully tested my model using unit test. However, when I tried to test all those @rpc functions, I have no luck there at all. What I have tried in testing those @rpc functions: 1. Get dummy data in model database 2. Start a server a...
I believe if you are using a service inside a test, that test should not be a unit test. you might want to consider use factory_boy or mock, both of them are python modules to mock or fake a object, for instance, to fake a object to give a response to your rpc call.
0.386912
false
1
4,475
2016-09-01 20:21:42.533
Pandas - how to remove spaces in each column in a dataframe?
I'm trying to remove spaces, apostrophes, and double quote in each column data using this for loop for c in data.columns: data[c] = data[c].str.strip().replace(',', '').replace('\'', '').replace('\"', '').strip() but I keep getting this error: AttributeError: 'Series' object has no attribute 'strip' data is the dat...
data[c] does not return a value, it returns a series (a whole column of data). You can apply the strip operation to an entire column df.apply. You can apply the strip function this way.
0
false
1
4,476
2016-09-03 05:48:54.760
Python and Appium
I got the following error while executing a python script on appium ImportError: No module named appium I am running appium in one terminal and tried executing the test on another terminal. Does anyone know what is the reason for this error? and how to resolve it?
Try to use nosetest. Install: pip install nose Run: nosetests (name of the file containing test)
0.386912
false
1
4,477
2016-09-04 11:31:28.393
Should functions take extra arguments for the sake of testing?
I am writing tests for a program I intend to write that checks for certain lines in configuration files. For example, the program might check that the line: AllowConnections- is contained in the file SomeFile.conf. My function stub does not take any arguments because I know the file that I am going to be checking. I a...
The code you test, and the code you run should be same. I do not recommend using a filename, because now you are dealing with (in one function) opening the file - and the errors associated with that part, and then confirming the file format (the actual purpose of the function). It sounds to me that your function's job ...
1.2
true
1
4,478
2016-09-04 16:49:27.640
how to build an deep learning image processing server
I am building am application to process user's photo on server. Basically, user upload a photo to the server and do some filtering processing using deep learning model. Once it's done filter, user can download the new photo. The filter program is based on the deep learning algorithm, using torch framework, it runs on p...
It does make sense to look at the whole task and how it fits to your actual server, Nginx or Lighttpd or Apache since you are serving static content. If you are going to call a library to create the static content, the integration of your library to your web framework would be simpler if you use Flask but it might be ...
0
false
1
4,479
2016-09-05 05:04:42.057
How do I build a cx_oracle app using pyinstaller to use multiple Oracle client versions?
I am building an application in Python using cx_Oracle (v5) and Pyinstaller to package up and distribute the application. When I built and packaged the application, I had the Oracle 12c client installed. However, when I deployed it to a machine with the 11g client installed, it seems not to work. I get the message "...
The error "Unable to acquire Oracle environment handle" means there is something wrong with your Oracle configuration. Check to see what libclntsh.so file you are using. The simplest way to do that is by using the ldd command on the cx_Oracle module that PyInstaller has bundled with the executable. Then check to see if...
1.2
true
1
4,480
2016-09-05 14:36:30.400
Failure to import sknn.mlp / Theano
I'm trying to use scikit-learn's neural network module in iPython... running Python 3.5 on a Win10, 64-bit machine. When I try to import from sknn.mlp import Classifier, Layer , I get back the following AttributeError: module 'theano' has no attribute 'gof' ... The command line highlighted for the error is class Discon...
Apparently it was caused by some issue with Visual Studio. The import worked when I reinstalled VS and restarted the computer. Thanks @super_cr7 for the prompt reply!
0
false
1
4,481
2016-09-05 20:48:26.700
How to get 2 or more LinearRegionItem to overlap each other
I have added 2 LinearRegionItems to a pyqtgraph plot. When I move the boundary of 1 over the other, the boundary never overlaps the other. I would like to know how to allow overlapping. This is a functionality that I need, where I am selecting different regions of the data plot to be used later on.
Sorry, there was a bug in my code which was handling the case where a part of one LinearRegionItem overlapped with another LinearRegionItem. Now I see that one linearRegionItem can lie on top of another one. Consider this solved
0
false
1
4,482
2016-09-06 09:22:48.187
How to create python conda 64 bit environment in existing 32bit install?
I have a 32 bit installation of the Anaconda Python distribution. I know how to create environments for different python versions. What I need is to have a 64 bit version of python. Is it possible to create a conda env with the 64 bit version? Or do I have to reinstall anaconda or install a different version of anacond...
As I understand, Anaconda installs into a self-contained directory (<pwd>/anaconda3). Since 64-bit and 32-bit builds of Python can not be mixed or converted into each other (in terms of the compiled Python binaries and libraries in site-packages or other PYTHONPATH location), you have to go with a second (64-bit) Anaco...
1.2
true
1
4,483
2016-09-07 04:29:01.350
Python detect character surrounded by spaces
Anyone know how I can find the character in the center that is surrounded by spaces? 1 + 1 I'd like to be able to separate the + in the middle to use in a if/else statement. Sorry if I'm not too clear, I'm a Python beginner.
This regular expression will detect a single character surrounded by spaces, if the character is a plus or minus or mult or div sign: r' ([+-*/]) '. Note the spaces inside the apostrophes. The parentheses "capture" the character in the middle. If you need to recognize a different set of characters, change the set insid...
0.081452
false
1
4,484
2016-09-07 11:33:03.207
How to install package via pip requirements.txt from VCS into current directory?
For example, we have project Foo with dependency Bar (that in private Git repo) and we want install Bar into Foo directory via pip from requirements.txt. We can manually install Bar with console command: pip install --target=. git+ssh://git.repo/some_pkg.git#egg=SomePackage But how to install Bar into current director...
The best way to do this would be to clone the repository, or just donwload the requirements.txt file, and then run pip install -r requirements.txt to install all the modules dependencies.
0
false
1
4,485
2016-09-07 23:40:12.000
Pygame: how to blit an image that follows another image
I'm trying reproduce the game "Snake" in pygame, using the pygame.blit function, instead of pygame.draw. My question is how to make an image follow another image. I mean, make the snake's body photo follow your head. In the current state of my program the head moves on its own.
Keep positions of snake segments on list (first segment is head). Later new position of head insert before first segment (and remove last segment). Use this list to blit snake segments.
1.2
true
1
4,486
2016-09-08 04:42:15.993
Saving Python list containing Tensorflow Sparsetensors to file for later access?
I'm creating a list of Sparsetensors in Tensorflow. I want to access them in later sessions of my program. I've read online that you can store Python lists as json files but how do I save a list of Sparsetensors to a json file and then use that later on? Thanks in advance
A Tensor in TensorFlow is a node in the graph which, when run, will produce a tensor. So you can't save the SparseTensor directly because it's not a value (you can serialize the graph). If you do evaluate the sparsetensor, you get a SparseTensorValue object back which can be serialized as it's just a tuple.
0.386912
false
1
4,487
2016-09-08 06:03:42.833
Show distinct column values in pyspark dataframe
With pyspark dataframe, how do you do the equivalent of Pandas df['col'].unique(). I want to list out all the unique values in a pyspark dataframe column. Not the SQL type way (registertemplate then SQL query for distinct values). Also I don't need groupby then countDistinct, instead I want to check distinct VALUES in ...
You can use df.dropDuplicates(['col1','col2']) to get only distinct rows based on colX in the array.
0.694783
false
2
4,488
2016-09-08 06:03:42.833
Show distinct column values in pyspark dataframe
With pyspark dataframe, how do you do the equivalent of Pandas df['col'].unique(). I want to list out all the unique values in a pyspark dataframe column. Not the SQL type way (registertemplate then SQL query for distinct values). Also I don't need groupby then countDistinct, instead I want to check distinct VALUES in ...
If you want to select ALL(columns) data as distinct frrom a DataFrame (df), then df.select('*').distinct().show(10,truncate=False)
0.040794
false
2
4,488
2016-09-08 10:01:02.473
How do I get Django to log why an sql transaction failed?
I am trying to debug a Pootle (pootle is build on django) installation which fails with a django transaction error whenever I try to add a template to an existing language. Using the python debugger I can see that it fails when pootle tries to save a model as well as all the queries that have been made in that session....
Install django debug toolbar, you can easily check all of the queries that have been executed
1.2
true
1
4,489
2016-09-08 15:02:13.857
Comparing the contents of very large files efficiently
I need to compare two files of differing formats quickly and I'm not sure how to do it. I would very much appreciate it if someone could point me in the right direction. I am working on CentOS 6 and I am most comfortable with Python (both Python 2 and Python 3 are available). The problem I am looking to compare the co...
If you can find a way to take advantage of hash tables your task will change from O(N^2) to O(N). The implementation will depend on exactly how large your files are and whether or not you have duplicate job IDs in file 2. I'll assume you don't have any duplicates. If you can fit file 2 in memory, just load the thing in...
0.081452
false
2
4,490
2016-09-08 15:02:13.857
Comparing the contents of very large files efficiently
I need to compare two files of differing formats quickly and I'm not sure how to do it. I would very much appreciate it if someone could point me in the right direction. I am working on CentOS 6 and I am most comfortable with Python (both Python 2 and Python 3 are available). The problem I am looking to compare the co...
I was trying to develop something where you'd split one of the files into smaller files (say 100,000 records each) and keep a pickled dictionary of each file that contains all Job_id as a key and its line as a value. In a sense, an index for each database and you could use a hash lookup on each subfile to determine whe...
0.081452
false
2
4,490
2016-09-09 11:34:02.707
Providing 'default' User when not logged in instead of AnonymousUser
Is there a way to globally provide a custom instance of User class instead of AnonymousUser? It is not possible to assign AnonymousUser instances when User is expected (for example in forms, there is need to check for authentication and so on), and therefore having an ordinary User class with name 'anonymous' (so that ...
You could create a custom middleware (called after AuthenticationMiddleware), that checks if the user if logged in or not, and if not, replaces the current user object attached to request, with the the user of your choice.
1.2
true
1
4,491
2016-09-09 20:15:58.933
How to remove clutter from PyInstaller one-folder build?
Alright, so I managed to use PyInstaller to build a homework assignment I made with Pygame. Cool. The executable works fine and everything. Problem is, alongside the executable, there is so much clutter. So many files, like pyds and dlls accompany the exe in the same directory, making it look so ugly. Now, I know that ...
Not trying to dig up this old question, but this was at the top of my Google search so it may be for others as well. If you intend to distribute the program in some kind of folder, you can always just mark everything unnecessary as hidden in Windows, and it will remain hidden even if you compress or extract it. For a p...
0.386912
false
1
4,492
2016-09-11 12:20:52.930
How to find in a list what thats number python3
Im trying to find out the number of where X is in the list e.g: if i had a list like: ['a','b','c','d'] and i have 'c' how would i find where it is in the list, so that it would print '2' (as thats where it is in the list) thanks
Use the built-in method list.index If you wanna know where is 'c': l = ['a','b','c'] l.index('c')
1.2
true
1
4,493
2016-09-11 16:01:29.907
what anti-ddos security systems python use for socket TCP connections?
More in detail, would like to know: what is the default SYN_RECEIVED timer, how do i get to change it, are SYN cookies or SYN caches implemented. I'm about to create a simple special-purpose publically accessible server. i must choose whether using built-in TCP sockets or RAW sockets and re-implement the TCP handshak...
What you describe are internals of the TCP stack of the operating system. Python just uses this stack via the socket interface. I doubt that any of these settings can be changed specific to the application at all, i.e. these are system wide settings which can only be changed with administrator privileges.
1.2
true
1
4,494
2016-09-11 17:36:14.603
Python Regex matching word inside words
I've been reading the documentation but can't find what I'm looking for. I'm simply trying to match foo inside foobar but can't seem to see how to do it. Any guidance would be helpful!
Use parenthesis Like re.findall("(foo)bar","foobar foogy woogy")
1.2
true
1
4,495
2016-09-14 04:30:16.713
Why does pyinstaller generated cx_oracle application work on fresh CentOS machine but not on one with Oracle client installed?
I wrote a python application that uses cx_Oracle and then generates a pyinstaller bundle (folder/single executable). I should note it is on 64 bit linux. I have a custom spec file that includes the Oracle client libraries so everything that is needed is in the bundle. When I run the bundled executable on a freshly ...
One thing that you may be running into is the fact that if you used the instant client RPMs when you built cx_Oracle an RPATH would have been burned into the shared library. You can examine its contents and change it using the chrpath command. You can use the special path $ORIGIN in the modified RPATH to specify a path...
1.2
true
1
4,496
2016-09-14 22:18:49.413
Django Migration Process for Elasticbeanstalk / Multiple Databases
I am developing a small web application using Django and Elasticbeanstalk. I created a EB application with two environments (staging and production), created a RDS instance and assigned it to my EB environments. For development I use a local database, because deploying to AWS takes quite some time. However, I am havin...
Seems that you might have deleted the table or migrations at some point of time. When you run makemigrations, django create migratins and when you run migrate, it creates database whichever is specified in settings file. One thing is if you keep on creating migrations and do not run it in a particular database, it will...
0.386912
false
1
4,497
2016-09-16 06:41:49.320
Configurate Spark by given Cluster
I have to send some applications in python to a Apache Spark cluster. There is given a Clustermanager and some worker nodes with the addresses to send the Application to. My question is, how to setup and to configure Spark on my local computer to send those requests with the data to be worked out to the cluster? I am w...
your question is unclear. If the data are on your local machine, you should first copy your data to the cluster on HDFS filesystem. Spark can works in 3 modes with YARN (are u using YARN or MESOS ?): cluster, client and standalone. What you are looking for is client-mode or cluster mode. But if you want to start the ap...
0
false
1
4,498
2016-09-16 18:10:14.790
How to fix python console error in pycharm?
Exception in XML-RPC listener loop (java.net.SocketException: Socket closed). When I run PyCharm from bash , I get this error..As result: I cant't use python-console in pycharm Anybody know how to fix it ? OS: ubuntu 16.04
Hi I had the same problem as you. I solved the problem by making the line 127.0.0.1 localhost as the first line in /etc/hosts. The reason python console does not run is that python console tries to connect to localhost:pycharm-port, but localhost was resolved to the IPv6 addess of ::1, and the connection is refused.
-0.386912
false
1
4,499
2016-09-19 11:05:05.500
Post data from html to another html
I want to post data from html to another html I know how to post data html->python and python-> html I have dictionary in the html (I get it from python - return render_to_response('page.html', locals()) how can I use with the dictionary in the second html file?
If you are not gonna use any sensitive data like password you can use localStorage or Url Hash .
0
false
1
4,500
2016-09-20 15:49:10.007
Python threading queue is very slow
I acquire samples (integers) at a very high rate (several kilo samples per seconds) in a thread and put() them in a threading.Queue. The main thread get()s the samples one by one into a list of length 4096, then msgpacks them and finally sends them via ZeroMQ to a client. The client shows the chunks on the screen (prin...
Q : "Is there a better approach?" A : Well, my ultimate performance-candidate would be this : the sampler will operate two or more, separate, statically preallocated "circular"-buffers, one for storing in phase one, the other thus free-to get sent and vice-verse once the sampler's filling reaches the end of the first...
0.386912
false
1
4,501
2016-09-22 18:11:26.080
How to read a .py file after I install Anaconda?
I have installed Anaconda, but I do not know how to open a .py file.. If it is possible, please explain plainly, I browsed several threads, but I understood none of them.. Thanks a lot for your helps.. Best,
In the menu structure of your operating system, you should see a folder for Anaconda. In that folder is an icon for Spyder. Click that icon. After a while (Spyder loads slowly) you will see the Spyder integrated environment. You can choose File then Open from the menu, or just click the Open icon that looks like an ope...
1.2
true
2
4,502
2016-09-22 18:11:26.080
How to read a .py file after I install Anaconda?
I have installed Anaconda, but I do not know how to open a .py file.. If it is possible, please explain plainly, I browsed several threads, but I understood none of them.. Thanks a lot for your helps.. Best,
You can use any text editor to open a .py file, e.g. TextMate, TextWrangler, TextEdit, PyCharm, AquaMacs, etc.
0
false
2
4,502