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
41,524,979
2017-01-07T18:29:00.000
1
0
0
0
python,django,python-2.7
41,525,185
2
false
1
0
Django doesn't say any such thing. Put the static folder wherever you want, as long as you include it in STATICFILES_DIRS so that collectstatic will find it.
1
1
0
For example, if I want to use the same style.css for all my apps, where should I put the static folder? I'm pretty sure Django site says to put it in the application folder? But what if I have multiple apps?
Can you put static folder in project root, rather than app root?
0.099668
0
0
70
41,526,677
2017-01-07T21:19:00.000
3
0
0
0
python,python-2.7,opencv,image-processing
41,527,710
2
true
0
0
To determin if an image is dark, simply calculate the average intensity and judge it. The problem for the recognition although is not that the image is dark, but that it has a low contrast. A bright image with the same contrast would yield the same bad results. Histogram equalization is a method that is used to improve...
1
1
1
I have some images i'm using for face recognition. Some of the images are very dark. I don't want to use Histogram equalisation on all the images only on the dark ones. How can i determine if an image is dark? I'm using opencv in python. I would like to understand the theory and the implementation. Thanks
How to determine if an image is dark?
1.2
0
0
2,224
41,528,141
2017-01-08T00:26:00.000
1
1
0
0
python,html,python-3.x,web
44,302,397
1
true
0
0
So after some good answers and further research, I have found that selenium is the thing that best suits my needs. It works not only with python, but supports other languages as well. If anyone else is looking for something that I had been when I asked the my question, a quick Google search for "selenium" should giv...
1
0
0
Ok, so I've looked around on how to do this and haven't really found an answer that showed me examples that I could work from. What I'm trying to do is have a script that can do things like: -Log into website -Fill out forms or boxes etc. Something simple that might help me in that I though of would be for example if...
How to have python interact automatically with a web site
1.2
0
1
58
41,528,570
2017-01-08T01:40:00.000
0
0
0
0
oracle-cloud-infrastructure,oci-python-sdk
41,528,571
1
true
0
0
Bare Metal Cloud Services requires TLS 1.2 connections. Your version of OpenSSL is probably too old and does not support TLS 1.2. Please upgrade your version of OpenSSL and try again.
1
0
0
When trying to use the BMCS Python SDK, I get an SSL/TLS exception. Why? Exception: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
Bare Metal Cloud - Python SDK SSL/TLS exception
1.2
0
1
177
41,529,910
2017-01-08T05:50:00.000
-1
0
0
0
python,mysql,sqlalchemy
41,530,033
1
false
0
0
Yes, you should always have a separate rowid (either int based one-up or UUID). Especially when you get into other aspects of mysql or database DevOps, having that ID field is a lifesaver (e.g., replication or galera clustering). It also makes working with frameworks like django much easier.
1
1
0
I currently have a database setup where there are 5 columns set as the composite primary key which could uniquely identify a row. Should I still have an ID column to identify each row? It seems redundant, although I am not sure of what is standard. I am using SQLAlchemy. I noticed that when I had the 5 columns as the c...
Can I composite primary key be used in place of an ID primary key?
-0.197375
1
0
199
41,532,668
2017-01-08T12:26:00.000
0
0
1
0
python,django,virtualenv
41,533,415
1
true
1
0
Because of the way virtualenvs work, Django was not 'installed' in said env. The reason ./manage.py startapp firstapp worked is because the ./ indicated that it was an executable file, and hence handled by the system as such. That way, modules are accessible, as the program is ran outside of the env Hope this helped!
1
2
0
Before asking, I should mention that this is NOT a problem or a bug, this is just a question to widen my knowledge. When I was working on a Django project (I'm quite new to all these things so don't beat, please) I activated my virtualenv, installed django module and started a new Django project by using django-admin.p...
Why doesn't "python" command work in virtualenv?
1.2
0
0
99
41,532,714
2017-01-08T12:31:00.000
0
0
0
0
python,django,rest
41,542,658
1
false
1
0
By creating dedicated API's will help you in future if you decide to build mobile application, that case no need to write new API's as you can consume your existing API's. By doing this your are not repeating your server side codes. Only have to write the client side code. And coming to performance only load time will ...
1
2
0
Let's assume that I want to create a simple todo list web application. I am thinking about creating RESTful web services which will be used my the web application and which will be providing all functionalities concerning managing todo list and tasks. I have two concerns: Is there a sense in creating dedicated web ser...
Dedicated web service for web app (Python/Django)
0
0
0
347
41,533,444
2017-01-08T13:55:00.000
2
0
1
0
python,security,python-requests,virus
41,533,461
1
true
0
0
No, merely downloading HTTP data won't install a virus. A virus needs to be activated too, and requests doesn't do anything with the downloaded data for that to happen. Normally, a virus uses bugs in the browser (or more commonly, a plugin in the browser) to trigger code execution, or by tricking the user into executin...
1
4
0
I'm visiting an unknown and possibly malicious website. Lots of them. Python's requests do not run javascript. Can I get infected? Should I consider using a virtual machine?
Can I get a virus by visiting an unknown website using python's requests package?
1.2
0
1
1,043
41,534,489
2017-01-08T15:45:00.000
1
0
0
0
python,numpy
41,543,451
4
false
0
0
If you really really want to catch errors that way, initialize your indices with NaN. IXS=np.full((r,c),np.nan, dtype=int) That will always raise an IndexError.
1
1
1
I want to preallocate an integer matrix to store indices generated in iterations. In MATLAB this can be obtained by IXS = zeros(r,c) before for loops, where r and c are number of rows and columns. Thus all indices in subsequent for loops can be assigned into IXS to avoid dynamic assignment. If I accidentally select a 0...
How do I safely preallocate an integer matrix as an index matrix in numpy
0.049958
0
0
620
41,536,257
2017-01-08T18:29:00.000
0
0
0
1
python,mainframe,ftplib
59,443,599
1
false
0
0
ftplib ccommand ftp.cwd("'CY01'") works fine. Have been using it for over a year now.
1
0
0
I want to download a dataset from mainframe using Python ftplib. I am able to login to mainframe and I get default working directory as "CY$$." I want to change the working directory to "CY01." I tried using ftp.cwd('CY01.') but it changes the directory to "CY$$.CY01." instead of just "CY01." While using command prompt...
Accessing Mainframe datasets using FTP form Python
0
0
0
1,617
41,538,435
2017-01-08T22:08:00.000
0
0
0
0
python,smartsheet-api
41,707,000
2
false
0
1
The GUI indicator will eventually alert you to a change regardless of where the update came from. Sometimes, that change can be a little delayed in the UI itself though.
1
0
0
When Smartsheet is updated by another used using the GUI, another user viewing the sheet will get visual notification that the sheet has been updated - requiring a save and/or refresh. Is there a way to trigger this functionality from the API. I'm using the Python SDK 2.0 and Python 3.5 Thanks. Craig
Is there a way to show the sheet has been updated remotely via the API?
0
0
0
164
41,538,808
2017-01-08T22:58:00.000
6
0
0
0
java,python,performance,libgdx,jython-2.7
41,544,716
1
true
0
1
You might have a hard time finding examples of Jython + LibGDX. I would guess it would also be hard to find many people here on SO that have any experience with Jython + LibGDX. Another issue is cross platform development. Jython might use JVM, but android does not give you JVM. I don't know how well Jython works with ...
1
6
0
I've been developing games in Python & Pygame for a while now, Though one thing that's been in mind is my dislike to pygame's performance and lack of tools and libraries. I've always known LibGDX for it's popularity and how much I've seen it on this site. Though recently I found out that it supports JVM Languages so th...
Is LIBGDX Slower in python than Java
1.2
0
0
1,107
41,543,237
2017-01-09T07:49:00.000
0
0
1
0
python,inheritance,global-variables
41,543,332
2
false
0
0
"Global" variables are only global to the module (i.e., the file) in which they are defined. If you have a function (including a method) in a given file, and that function refers to a global variable gvar, it will always refer to a global variable gvar within that module, not in any other module. You can, however, mod...
2
0
0
How does Python resolve global variables in calls between packages, especially in cases there are global variables with the same name present? For example. Let there ba a package P1 containing BaseClass. Let there be two packages P2 and P3, containing classes Derived1 and Derived2 that inherit BaseClass correspondingly...
How does Python global variables resolution between packages work?
0
0
0
70
41,543,237
2017-01-09T07:49:00.000
1
0
1
0
python,inheritance,global-variables
41,543,360
2
true
0
0
Globals are per module. Globals in P1, P2 and P3 are all independent. Python functions also store a pointer to the globals mapping of their module, so even when imported, globals are still looked up in the module they were defined in. For your example ,that means that a global referenced from P2.Derived1.__init__ is lo...
2
0
0
How does Python resolve global variables in calls between packages, especially in cases there are global variables with the same name present? For example. Let there ba a package P1 containing BaseClass. Let there be two packages P2 and P3, containing classes Derived1 and Derived2 that inherit BaseClass correspondingly...
How does Python global variables resolution between packages work?
1.2
0
0
70
41,544,873
2017-01-09T09:35:00.000
2
0
0
0
python,django,git,heroku,git-push
41,545,127
1
true
1
0
/media is for user-uploaded files. These must not be stored in the Heroku filesystem. Heroku creates a new dyno each time you deploy your code, as well as whenever you run a management command and at irregular times otherwise. Each new dyno has its own filesystem which is not shared with other ones and only contains th...
1
0
0
Help me please. I have django app on Heroku. I want that after $ git push heroku master folder /media/ on Heroku don't change. Thank you.
How don't change '/media/' on heroku after "git push ..."
1.2
0
0
125
41,545,979
2017-01-09T10:32:00.000
2
0
0
0
python,web-scraping
41,546,162
1
false
0
0
I think what you could do instead is to wrap requests or urllib modules with a wrapper that logs URLs your app is connecting and then just call real urllib or requests modules functions. So whenever you call import requests you actually import your wrapper.
1
0
0
I have an interesting problem where we need to document all the URLs that our massive Python project calls. It's not feasible to manually go through the code because it's too large and changes often. Ideally, what I'd like is a piece of script that given a Python project folder can go through all the files in it and fi...
List all urls called by requests/urllib in python project
0.379949
0
1
42
41,550,060
2017-01-09T14:21:00.000
0
0
0
0
python,excel
60,421,964
5
false
0
0
I am not sure if this is what the OP was looking for,but if you have to manipulate data in python without installing any modules (just standard library), you can try the sqlite3 module, which of course allows you to interact with sqlite files (a Relational Database Management System). These databases are conceptually s...
1
4
0
I am new to Python. I use putty to manage some servers. I want to use Python to create a Excel file on each server, for that I think if I can use some orders like ssh ip "python abc.py" to create the file. It is possible to write a bash script to manage all servers. This is the trouble I meet: The servers can't use in...
how to create a excel file only with python standard library?
0
1
0
15,636
41,555,224
2017-01-09T19:12:00.000
2
0
0
1
python,macos,shell,automator
41,555,296
4
false
0
0
Since you have the shebang line, you can do ./my_script.py and it should run with Python 3.
3
5
0
I am trying to use Automator on macOS 10.12 to launch a Python 3 script. The script works just fine when I run it from the terminal with the command: python3 my_script.py. Automator has a "Run Shell Script" function that uses the /bin/bash shell. The shell will run scripts with the command: python my_script.py, but thi...
python3 won't run from mac shell script
0.099668
0
0
7,111
41,555,224
2017-01-09T19:12:00.000
1
0
0
1
python,macos,shell,automator
54,734,617
4
false
0
0
You can install Python 3 via Homebrew with brew install python3 and use #!/usr/local/bin/python3 as your shebang. Not a perfect solution but still better than using the full path of the interpreter.
3
5
0
I am trying to use Automator on macOS 10.12 to launch a Python 3 script. The script works just fine when I run it from the terminal with the command: python3 my_script.py. Automator has a "Run Shell Script" function that uses the /bin/bash shell. The shell will run scripts with the command: python my_script.py, but thi...
python3 won't run from mac shell script
0.049958
0
0
7,111
41,555,224
2017-01-09T19:12:00.000
-1
0
0
1
python,macos,shell,automator
54,741,833
4
false
0
0
If python refers to Python 2 then that*s what you should expect. Use python3 in the command line, or defer to the script itself to define its interpreter. In some more detail, make sure the file's first line contains a valid shebang (you seem to have this sorted); but the shebang doesn't affect what interpreter will be...
3
5
0
I am trying to use Automator on macOS 10.12 to launch a Python 3 script. The script works just fine when I run it from the terminal with the command: python3 my_script.py. Automator has a "Run Shell Script" function that uses the /bin/bash shell. The shell will run scripts with the command: python my_script.py, but thi...
python3 won't run from mac shell script
-0.049958
0
0
7,111
41,556,981
2017-01-09T21:09:00.000
-1
1
1
0
python,python-3.x,pip,ubuntu-14.04,setup.py
41,557,048
1
false
0
0
Any time I have problems like this, I find that writing the explicit path to the executable helps a great deal, no matter the level I place the executable. So instead of running pip ~do something~ try /etc/pip ~do something~.
1
1
0
can't find anyone posting a similar situation so thought I'd ask and see. Currently trying to automate unit tests within our continuous deployment environment. We do the typical python setup.py test command from our virtualenv. However, we have our own internal pypi server for some of our internal libraries. pip.co...
running python setup.py test pip not finding pip.conf to install internal requirements
-0.197375
0
0
766
41,557,022
2017-01-09T21:12:00.000
0
0
1
0
python-3.x,math,matrix
41,564,872
1
true
0
0
I'd use Sage if this were a quick hack, and maybe consider using something optimized for GF(2) if the matrices are really big, to ensure that only one bit is used for each entry and that addition of several elements can be accomplished using a single XOR operation. One benefit of working over a finite field is that you...
1
2
1
I'm practicing programming and I would like to know what is the easiest way to solve linear system of equations over the field Z/2Z? I found a problem where I managed to reduce the problem to solve a system of about 2200 linear equations over Z/2Z but I'm not sure what is the easiest way to write a solver for the equat...
Is there an easy way to solve a system of linear equations over Z/2Z in Python?
1.2
0
0
612
41,558,204
2017-01-09T22:40:00.000
0
0
1
0
python,import,path,anaconda,environment
47,405,214
2
false
0
0
Dunno if you still need it, but for future users, once a new environment is created, once must install the specific libraries and modules one wants accessible in that environment. In this case, once the gl-env is activated, do a conda install wget again.
1
0
0
I have Anaconda 2 with Python 2.7 running on Windows 8. I have installed GraphLab and GraphLab has created a separate environment in Anaconda -- the gl-env environment. I am facing problems in importing libraries that I have installed successfully via conda through the Windows Commander from the Scripts subdirectory. ...
Can not import library installed in Anaconda 2 while operating with different environments
0
0
0
480
41,558,258
2017-01-09T22:45:00.000
31
0
0
0
python,django,git,django-admin
41,558,803
1
true
1
0
While you can absolutely check these files in, I typically recommend not checking in the collected static files into git (we use .gitignore to ignore them). Instead, we call collectstatic during our build/deploy steps so that if anyone ever adds new static files, they are collected and copied to the proper output dire...
1
24
0
I ran manage.py collectstatic on my webapp and now I have a new static folder with only Django admin files (so far I've been using just CDNs for my project CSS and JS files). Should I track these admin static files on my git repo? What's the best practise?
Should I add Django admin static files to my git repo?
1.2
0
0
7,555
41,558,760
2017-01-09T23:32:00.000
3
0
1
0
python,anaconda,python-idle
41,565,041
2
false
0
0
You cannot switch versions of Python from within Python. IDLE runs on top of whatever version of Python, and cannot switch the version running it. You can simultaneously run IDLE 2.7 on Python 2.7 and IDLE 3.5 on Python 3.5. When you run code from any IDLE editor, it is added your File => Recent files list, which is...
2
0
0
I installed python 2.7 and I have the IDLE version of it. I also created two environments using the terminal of Python 3 and Python 2 with conda. When I type python it shows me that I'm using Python 3.5.2. Now: How can I switch between two versions in the IDLE or the terminal? What's the difference between coding in t...
What's the difference between coding in the IDLE and the terminal?
0.291313
0
0
4,327
41,558,760
2017-01-09T23:32:00.000
0
0
1
0
python,anaconda,python-idle
62,862,693
2
false
0
0
IDLE has this feature where it suggests operations on a variable automatically or by using ctrl+space. But in terminal no such suggestion prompts appear in any case. Not sure how you can switch versions in terminal.
2
0
0
I installed python 2.7 and I have the IDLE version of it. I also created two environments using the terminal of Python 3 and Python 2 with conda. When I type python it shows me that I'm using Python 3.5.2. Now: How can I switch between two versions in the IDLE or the terminal? What's the difference between coding in t...
What's the difference between coding in the IDLE and the terminal?
0
0
0
4,327
41,559,294
2017-01-10T00:25:00.000
1
0
1
0
python,selenium,pycharm,selenium-chromedriver
56,002,173
4
false
0
0
You can specific custom PATH variable for chromedriver to PyCharm debug configuration environment variables.
1
1
0
I install chromedriver through my package.json file and it gets installed in my npm_modules folder. Then I add it to the PATH of executables, when running through terminal tests are passing. When running the same command in pycharm, says that it cannot find the executable: WebDriverException: Message: 'chromedriver' ex...
Pycharm not finding executable for chromedriver for selenium
0.049958
0
1
8,419
41,559,470
2017-01-10T00:47:00.000
2
1
0
0
python,django,nginx,wsgi,gunicorn
41,559,760
1
true
1
0
Gunicorn has a preforking worker model -- meaning that it launches several independent subprocesses, each of which is responsible for handling a subset of the load. If you're relying on internal application state being consistent across all threads involved in offering your service, you'll want to turn the number of wo...
1
1
0
This is really troublesome for me. I have a telegram bot that runs in django and python 2.7. During development I used django sslserver and everything worked fine. Today I deployed it using gunicorn in nginx and the code works very different than it did on my localhost. I tried everything I could since I already starte...
Python objects lose state after every request in nginx
1.2
0
0
210
41,560,614
2017-01-10T03:21:00.000
3
0
0
1
python,airflow,workflow
64,042,837
5
false
0
0
This error can be misleading. If hitting refresh button or restarting airflow webserver doesn't fix this issue, check the DAG (python script) for errors. Running airflow list_dags can display the DAG errors (in addition to listing out the dags) or even try running/testing your dag as a normal python script. After fixin...
2
51
0
when I put a new DAG python script in the dags folder, I can view a new entry of DAG in the DAG UI but it was not enabled automatically. On top of that, it seems does not loaded properly as well. I can only click on the Refresh button few times on the right side of the list and toggle the on/off button on the left side...
Airflow "This DAG isnt available in the webserver DagBag object "
0.119427
0
0
25,022
41,560,614
2017-01-10T03:21:00.000
16
0
0
1
python,airflow,workflow
51,391,238
5
false
0
0
Restart the airflow webserver solves my issue.
2
51
0
when I put a new DAG python script in the dags folder, I can view a new entry of DAG in the DAG UI but it was not enabled automatically. On top of that, it seems does not loaded properly as well. I can only click on the Refresh button few times on the right side of the list and toggle the on/off button on the left side...
Airflow "This DAG isnt available in the webserver DagBag object "
1
0
0
25,022
41,560,796
2017-01-10T03:46:00.000
0
0
1
0
python,numpy,python-3.5
41,577,386
3
false
0
0
Winpython has two size, and the smallest "Zero" size doesn't include numpy
1
1
1
I just installed numpy on my PC (running windows 10, running python 3.5.2) using WinPython, but when i try to import it in IDLE with: import numpy I get the ImportError: Traceback (most recent call last): File "C:\Users\MY_USERNAME\Desktop\DATA\dataScience1.py", line 1, in <module> import numpy ImportError: No ...
Numpy not found after installation
0
0
0
3,858
41,563,696
2017-01-10T07:49:00.000
0
0
0
0
python,django,django-class-based-views
41,565,380
1
false
1
0
As I said, get is an instance method. But you are confusing responsibilities here. A class should have one responsibility only. The view class has the responsibility of responding to the request and returning a response; this is quite separate from the connection to the instrument. That should be a separate class, whic...
1
0
0
I'm currently building a Django app which uses a singleton object. I want to save this object as a CBV variable because I dont want to initialize it for every 'get' call. My question in short - can you make a CBV's get function an instance method instead of a classmethod? And if so, can I save a variable as an instance...
Making Django's CBV's get an instance method
0
0
0
65
41,566,222
2017-01-10T10:08:00.000
1
0
0
0
python,web.py
41,726,066
1
false
1
0
Headers aren't part of web.input(), they're part of the "environment". You can add headers, to be sent to your client using web.header('My-Header', 'header-value'). You can read headers sent by your client using: web.ctx.env.get('MY_HEADER') (Note all-caps, and use of underline rather than dash).
1
1
0
I look after many links to find how can I define my proprietary header in webpy. Can you help me, please. I need to define my own http header like ("X-UploadedFile") and then use it with web.input()
Define own header in webpy
0.197375
0
1
253
41,568,395
2017-01-10T12:01:00.000
1
0
0
1
macos,python-3.x,terminal,subprocess
41,615,003
1
false
0
0
Thanks for the comments guys but I managed to figure it out. In the end I used a combination of subprocess.Popen() and os.chdir() and it seems to work using Jupyter Notebook.
1
0
0
I have recently started using a program which has command line interfaces accessed through the Mac Terminal. I am trying to automate the process whereby a series of commands are passed through the terminal using Python. So far I have found a way to open the Terminal using the subprocess.Popen command but how do I then...
Manipulating the Terminal Using a Python Script
0.197375
0
0
379
41,569,406
2017-01-10T12:58:00.000
5
1
0
0
python-2.7,lasagne
41,593,958
1
false
0
0
this can be solved by first import lasagne then import theano.. if exchange the import order,then the error arise... this is very strange.i am not sure what happens,but it does work
1
5
0
there is some really strange problem. Traceback (most recent call last): File "mnist.py", line 17, in import lasagne.nonlinearities as nonlinearities File "/usr/local/lib/python2.7/dist-packages/lasagne/init.py", line 17, in from . import nonlinearities ImportError: cannot import name nonlinear...
from . import nonlinearities cannot import name nonlinearities
0.761594
0
0
2,149
41,570,318
2017-01-10T13:43:00.000
5
0
0
0
python,bokeh
44,185,703
6
false
1
0
bokeh can also be run via python -m bokeh given that, you could open up the Run/Debug Configuration dialog and set your interpreter options to -m bokeh serve --show and your script will run as-is
1
11
0
Bokeh serve allows to write fast web apps with plots and widgets. How can I debug the python code when I use bokeh serve --show code.py?
Debugging Bokeh serve application using PyCharm
0.16514
0
0
4,506
41,570,359
2017-01-10T13:44:00.000
10
0
1
0
python,python-3.x,exe,py2exe,python-3.6
52,402,056
8
false
0
0
Now you can convert it by using PyInstaller. It works with even Python 3. Steps: Fire up your PC Open command prompt Enter command pip install pyinstaller When it is installed, use the command 'cd' to go to the working directory. Run command pyinstaller <filename>
1
176
0
I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, so I have a few questions (I'm running Python 3.6): The methods of doing this that I have found so far are as follows downloading an old version of Python and using pyinstaller/py2exe setting up a virtual en...
How can I convert a .py to .exe for Python?
1
0
0
507,870
41,570,818
2017-01-10T14:09:00.000
4
0
1
0
python,python-2.7
41,570,861
4
false
0
0
The keys in a dictionary are, because of the dictionary's underlying structure (hash map), unordered. You have to order the keys yourself when you iterate the keys (i.e. by doing sorted(dict.keys()) or some other sorting method - if you want to sort by value, you still have to do that manually).
1
0
0
I have a dictionary, say {'name4': 380, 'name2': 349, 'name3': 290, 'name1': 294} I have sorted the dictionary based on the values using the sorted method and the result is a list of tuples [('name3', 290), ('name1', 294), ('name2', 349), ('name4', 380)] But, when I try to convert this list of tuples back to dictionary...
Converting a sorted list into dictionary in Python
0.197375
0
0
4,483
41,571,973
2017-01-10T15:07:00.000
2
0
1
0
bash,server,ipython-notebook
41,572,158
1
true
0
0
Preface your ipython command with nohup. Then when the login session terminates that child process will not see the logout or "hang-up" signal that gets sent to all child processes on logout. See man nohup for details.
1
1
0
Is it possible to run ipython notebook server and close terminal? If I run ipython notebook server like ipython notebook --no-browser --port=8888 --ip 0.0.0.0 or ipython notebook --no-browser --port=8888 --ip 0.0.0.0 & and then close terminal, server also stopped. Is there any way to avoid it (to run ipython notebook s...
Run ipython notebook server and close terminal
1.2
0
0
461
41,573,587
2017-01-10T16:27:00.000
56
0
1
0
python,virtualenv,virtualenvwrapper,pyenv,python-venv
65,854,168
8
false
0
0
Let's start with the problems these tools want to solve: My system package manager don't have the Python versions I wanted or I want to install multiple Python versions side by side, Python 3.9.0 and Python 3.9.1, Python 3.5.3, etc Then use pyenv. I want to install and run multiple applications with different, conflict...
1
1,722
0
Python 3.3 includes in its standard library the new package venv. What does it do, and how does it differ from all the other packages that seem to match the regex (py)?(v|virtual|pip)?env?
What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?
1
0
0
438,843
41,573,669
2017-01-10T16:31:00.000
1
0
0
0
python-2.7,rally,code-rally,pyral
41,579,286
1
false
0
0
Most of the reports on the Reports tab are rendered by a separate Analytics 1 service outside of the standard WSAPI you've been communicating with. Some of that data is available in WSAPI -IterationCumulativeFlowData, ReleaseCumulativeFlowData. What data specifically are you looking for?
1
2
0
I have been working on developing a Rally API using python with the help of links pointed by Rally help (Pyral). My code connects well with the Rally server and pulls specific user story I want, but not the columns I am interested in. I am aiming to pull [full] specific reports with fields such as project, tags, etc. u...
How to connect Rally API (python) to the specific reports under 'Report' section
0.197375
0
1
346
41,575,620
2017-01-10T18:15:00.000
0
0
0
0
python,hadoop,graph,random-walk,bigdata
44,357,542
1
false
0
0
My understanding is, you need to process large graphs which are stored on file systems. There are various distributed graph processing frameworks like Pregel, Pregel+, GraphX, GPS(Stanford), Mizan, PowerGraph etc. It is worth taking a look at these frameworks. I will suggest coding in C, C++ using openMPI like which c...
1
0
1
I am working on a project that involves a RandomWalk on a large graph(too big to fit in memory). I coded it in Python using networkx but soon, the graph became too big to fit in memory, and so I realised that I needed to switch to a distributed system. So, I understand the following: I will need to use a graph databas...
Large graph processing on Hadoop
0
0
0
480
41,577,756
2017-01-10T20:25:00.000
3
0
0
0
python,django
41,578,308
1
true
1
0
Just don't give them superuser rights. Superuser means they have all rights automatically, which isn't what you want. Then add edit, add, delete rights for the models they are allowed to edit, add and delete. You can create a group that you give these rights to, then add the users to that group. If a user doesn't have ...
1
0
0
TL;DR I'd like to be able to disable certain models per-user in /admin view. Specifically: I'm looking to make admin models invisible to some staff users, so that they can have a sort of customized dashboard. There's all sorts of fields that change how to present, search, query, etc. models based on whatever you want, ...
Django - make admin fields invisible to some users
1.2
0
0
248
41,578,978
2017-01-10T21:44:00.000
-1
0
1
0
python-3.x,module
41,579,312
1
true
1
0
You are getting the error because you used pip. pip basically is for version 2 of python. for using it for pip3, you should first install pip3 package. Then copy all your dependencies to python3 libraries. Hope that answers the question.
1
0
0
Using the Mac Os Terminal, I downloaded the Jupyter lightning module using "pip install lightning-python" in the /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages directory. However, when I try to import it, I get the error, No module named 'lightning' and when I list out the files in the si...
Python module installed in site-packages folder, but getting error "No module ..."
1.2
0
0
443
41,586,429
2017-01-11T08:55:00.000
6
0
1
0
python,opencv,image-processing
41,626,482
7
false
0
0
Thank you everyone. Your ways are perfect. I would like to share another way I used to fix the problem. I used the function os.chdir(path) to change local directory to path. After which I saved image normally.
1
29
1
I'm learning OpenCV and Python. I captured some images from my webcam and saved them. But they are being saved by default into the local folder. I want to save them to another folder from direct path. How do I fix it?
OpenCV - Saving images to a particular folder of choice
1
0
0
137,529
41,588,925
2017-01-11T10:53:00.000
1
0
1
0
python,django,python-3.x,pip,python-3.6
41,588,975
5
false
1
0
As is common with these sort of pip issues, before you install, check where pip is pointing to with pip -V. If that points to Python 2, you can then try pip3 -V; if that points to an older version of Python 3, go for pip3.6. As a final approach, you can always go through python itself with python3.6 -m pip install ...
2
12
0
If I run pip install Django I get Requirement already satisfied: Django in /usr/local/lib/python2.7/dist-packages I'd like to use python3.6 instead (which is already installed in /usr/bin/python3.6). What's the correct pip syntax to install the last version of Django on python 3.6?
pip install Django on python3.6
0.039979
0
0
22,964
41,588,925
2017-01-11T10:53:00.000
4
0
1
0
python,django,python-3.x,pip,python-3.6
41,588,953
5
false
1
0
If you have pip3 then directly use pip3 install Django Else try to use virtualenv for your python version as : pip -p python3.6 virtualenv name then you can install any version of Django on it.
2
12
0
If I run pip install Django I get Requirement already satisfied: Django in /usr/local/lib/python2.7/dist-packages I'd like to use python3.6 instead (which is already installed in /usr/bin/python3.6). What's the correct pip syntax to install the last version of Django on python 3.6?
pip install Django on python3.6
0.158649
0
0
22,964
41,589,611
2017-01-11T11:23:00.000
2
0
1
0
python-2.7,image-processing,raspberry-pi,phantom-types
41,591,155
1
false
0
0
I would be surprised if a off-the-shelf multicopter would comprise enough processing power to do any reasonable image processing on-board. It wouldn't make sense for the manufacturer. But I guess it has some video or streaming capabilties or can be equipped with such. Then you can process the data on a remote computer,...
1
0
1
I have a project to detect ripeness of specific fruit, I will use phantom 2 with autopilot feature to fly through fruit trees and capture images then I want to make real time image processing. I was searching a lot but didn't find the answers for the following questions. can I use phantom 2 for real time image proce...
use Phantom 2 for real time image processing
0.379949
0
0
91
41,589,655
2017-01-11T11:25:00.000
66
0
1
0
python,python-3.x,python-3.6
41,589,841
1
true
0
0
What does the m stand for in python3.6m? It signifies that Python was configured --with-pymalloc which enables a specialized implementation for allocating memory that's faster than the system malloc. How does it differ to non m version? The non m version is, obviously, not configured with it. In which case would I ...
1
60
0
What does the m stand for in python3.6m ? How does it differ to non m version? In which case would I prefer to use python3.6m rather than python3.6?
What's the difference between python3. and python3.m
1.2
0
0
24,349
41,590,884
2017-01-11T12:23:00.000
2
0
0
0
python,pandas
56,167,288
4
false
0
0
To simply change one column, here is what you can do: df.column_name.apply(int) you can replace int with the desired datatype you want e.g (np.int64), str, category. For multiple datatype changes, I would recommend the following: df = pd.read_csv(data, dtype={'Col_A': str,'Col_B':int64})
2
15
1
I want to sort a dataframe with many columns by a specific column, but first I need to change type from object to int. How to change the data type of this specific column while keeping the original column positions?
Change data type of a specific column of a pandas dataframe
0.099668
0
0
77,099
41,590,884
2017-01-11T12:23:00.000
26
0
0
0
python,pandas
41,591,077
4
false
0
0
df['colname'] = df['colname'].astype(int) works when changing from float values to int atleast.
2
15
1
I want to sort a dataframe with many columns by a specific column, but first I need to change type from object to int. How to change the data type of this specific column while keeping the original column positions?
Change data type of a specific column of a pandas dataframe
1
0
0
77,099
41,591,079
2017-01-11T12:32:00.000
0
0
0
0
python,django,django-1.10
41,592,978
1
false
1
0
Django's ORM might not be the right tool for you if you need to change your schema (or db) online - the schema is defined in python modules and loaded once when Django's web server starts. You can still use Django's templates, forms and other libraries and write your own custom DB access layer that manipulates a DB dyn...
1
0
0
I am developing a Cloud based data analysis tool, and I am using Django(1.10) for that. I have to add columns to the existing tables, create new tables, change data-type of columns(part of data-cleaning activity) at the run time and can't figure out a way to update/reflect those changes, in run time, in the Django mode...
Changing Database in run time and making the changes reflect in Django in run time
0
1
0
43
41,592,506
2017-01-11T13:40:00.000
1
0
0
0
python,django,date,datetime
41,604,291
3
true
1
0
Django seems to be putting its timezone in the TZ environment variable. Try del os.environ['TZ'] then using tzlocal.
1
3
0
As long as I'm using plain ol' Python shell, the datetime.datetime.now() command works fine to get system's local (non-UTC) time. But I'm working on a Django project where the time zone is changed in settings.py with TIME_ZONE = 'UTC'. I've tried many solutions from django.utils timezone to tzlocal module, but none of ...
Get system time w/timezone in Django bypassing default timezone
1.2
0
0
772
41,595,193
2017-01-11T15:51:00.000
2
0
1
0
python,python-imaging-library,fractals
41,595,337
1
true
0
1
Use matplotlib, wxPython, PyQt, PyGame, Tk/TCL or some other lib to display the image. Draw as many images as you need, whenever you need, using any lib you need, and then display it on a screen using one of above mentioned or some other GUI libs. If you are working with plots and math functions, matplotlib will help y...
1
0
0
I have a python funtion that draws a Fractal to a PIL.Image, but i want to vary the parameters of the function in realtime and to plot it to the screen. How can i plot the image and keep updating the ploted image each time the parametes of the function vary
Draw multiple PIL.Image in python
1.2
0
0
382
41,596,658
2017-01-11T17:05:00.000
1
0
0
0
python,pyqt,qaction
41,606,857
2
true
0
1
What you are looking for is a toggle button. This is implemented in Qt via the checkable property: if an action is checkable, then when the action is in a button the button is a toggle button; when the action is in a menu item you see a checkmark; etc.
1
0
0
Is there a way to make QAction stay down after it is clicked. Ideally it could toggle between two states: On (down) and Off (up)?
How to make toggle-able QAction
1.2
0
0
1,747
41,599,283
2017-01-11T19:34:00.000
0
1
0
0
python,opencv,coordinates,robotics,coordinate-transformation
41,604,196
1
false
0
0
Define your 2D coordinate on the board, create a mapping from the image coordinate (2D) to the 2D board, and also create a mapping from the board to robot coordinate (3D). Usually, robot controller has a function to define your own coordinate (the board).
1
0
1
I am new in robotics and I am working on a project where I need to pass the coordinates from the camera to the robot. So the robot is just an arm, it is then stable in a fixed position. I do not even need the 'z' axis because the board or the table where everything is going on have always the same 'z' coordinates. The ...
Translation from Camera Coordinates System to Robotic-Arm Coordinates System
0
0
0
1,200
41,599,285
2017-01-11T19:35:00.000
-1
0
0
0
python,sql,security,hash
41,599,436
3
false
0
0
Your question doesn't make it clear if you need to display those SSNs. I'm going to assume you do not. Store the SSN in a SHA2 hash. You can then do a SQL query to search against those hashed values. Store only the last 4 digits encrypted for display.
2
2
0
My main problem is that I would like to check if someone with the same SSN has multiple accounts with us. Currently all personally identifiable info is encrypted and decryption takes a non-trivial amount of time. My initial idea was to add a ssn column to the user column in the database. Then I could simply do a query ...
How to securely and efficiently store SSN in a database?
-0.066568
1
0
2,477
41,599,285
2017-01-11T19:35:00.000
4
0
0
0
python,sql,security,hash
41,600,634
3
true
0
0
Do not encrypt SSNs, when the attacker gets the DB he will also get the encryption key. Just using a hash function is not sufficient and just adding a salt does little to improve the security. Basically handle the SSNs inthe same mannor as passwords. Instead iIterate over an HMAC with a random salt for about a 100ms du...
2
2
0
My main problem is that I would like to check if someone with the same SSN has multiple accounts with us. Currently all personally identifiable info is encrypted and decryption takes a non-trivial amount of time. My initial idea was to add a ssn column to the user column in the database. Then I could simply do a query ...
How to securely and efficiently store SSN in a database?
1.2
1
0
2,477
41,601,083
2017-01-11T21:34:00.000
0
0
1
0
python
41,601,325
2
false
0
0
You would be able to use a dynamic programming solution to solve this problem, but if you are new to programming in general this would be difficult. You can assume that you would start by placing a tile aligned with a corner of the floor (with two possible orientations), and once this tile is placed it creates two sub-...
1
0
0
I'm starting to learn how to program in python and I came across this problem that I can only use these functions: Basic mathematical and logical operators (+.-, *, /, //, %, **, <. <=, >, >=, ==, !=, and, or, not) Any functions and constants available in the Math module min, max, abs, type len (for length of strings)...
Min number of tiles required for a floor
0
0
0
815
41,603,416
2017-01-12T00:54:00.000
0
0
1
1
python,dependencies,virtualenv
41,748,115
2
false
0
0
Surely the easiest way is simply to modify your Python environment to search another directory where it will find your modified distlib before it picks it up from the stdlib? The classic way to do this is by setting your PYTHONPATH environment variable. No changes required to your Python installation!
1
0
0
I want to do some development on Python's distlib, and in the process run the code via virtualenv which has distlib as a dependency. That is, not run the process inside a virtualenv, but run virtualenv's code using a custom dependency. What are the steps I need to go through to achieve this? It seems to me that normal ...
Running Virtualenv with a custom distlib?
0
0
0
42
41,603,576
2017-01-12T01:15:00.000
1
1
0
0
python,unit-testing,selenium,selenium-webdriver,selenium-ide
41,607,809
1
true
1
0
If you are recording scripts in Python formatting, those are already converted to unit test cases. Save each scripts and run them in batch mode.
1
0
0
I have recorded some Selenium Scripts using the Selenium IDE Firefox add-on. I'd like to add these to the unit test cases for my Django project. Is it possible to somehow turn these into a Python unit test case?
Using Selenium Scripts in a Python unit test
1.2
0
1
81
41,605,355
2017-01-12T04:53:00.000
0
0
0
0
python,python-3.x,tensorflow,pip
42,087,865
2
false
0
0
I have the same error when I run this command. I found error that the installed version of python was x86 and TensorFlow is for x64 versions. I reinstalled the python with x64 version and it works now! I hope this works for you too!
1
4
1
I'm trying to install Tensorflow, and received the following error. tensorflow-0.12.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform. By reading through other questions, I think I've traced the issue to the cp35 tag not being supported by the version of pip I have installed. What's odd is that I b...
Updating the supported tags for pip
0
0
0
2,301
41,616,099
2017-01-12T14:50:00.000
2
0
1
0
python
41,616,154
3
false
0
0
Each python installation has a separate set of libraries. Your python 3 does not know about Python 2 and its libraries. It seems the default pip command calls the python2 pip script. Run again the pip install, but with the python3 pip (look for it in your python3 folder, it is probably named pip3)
1
0
0
I have been using PyCharm on Ubuntu to run some Python code, where in Edit Configurations I specified the interpreter path as /usr/bin/python2.7. The code uses the pygame module, and so to install this, I also ran sudo pip install pygame. Then I used import pygame in my Python script, and the file ran ok. However, I no...
ImportError when changing Python interpreter
0.132549
0
0
52
41,616,426
2017-01-12T15:03:00.000
1
0
0
0
python,python-3.x,lmdb
42,486,747
2
false
0
0
You can open as many named databases within the same write transaction as you like. So: Open write transaction Open named databases as required and write to them Commit your transaction As long as you take into account that you can only ever have one write-transaction at a time (read-only transactions are no problem)...
1
0
0
I want to write a lot of data to a lmdb data base with several named (sub) data bases. I run into the following problem: To write to one named data base, I need to open a transaction for this named data base. This implies: To write to another named data base, I need to open a different transaction. Two write transact...
lmdb: Can I access different named databases in the same transaction?
0.099668
1
0
1,421
41,616,827
2017-01-12T15:22:00.000
3
1
0
0
python,linux,class,protocol-buffers,meta
41,629,972
1
true
0
0
Mostly, because it's easier to read. The code generators for C++ and Java are really hard to understand and edit, because you have to follow both the generator code and the code being generated at the same time. The Python code generator could have been done the same way. However, because Python is a dynamic language, ...
1
2
0
protobuf generates C++/Java classes, and these are static typed class, enough for encoding/decoding. Why it generates python classes with metaclass attribute: I would suppose ordinary class will be enough to do rpc, like C++/Java generated classes. Why python should use dynamic class? Thanks.
Why protobuf generates python class with __metaclass__ attribute?
1.2
0
0
357
41,618,369
2017-01-12T16:33:00.000
0
0
1
0
python,c++,data-structures
41,618,419
1
true
0
0
List, set and map (called dictionary), are built-in in python. For others see the collections module (especially the collections.deque is suitable for queues)
1
0
0
What are the equivalent data structures in Python of those in C++? As a contestant I have always used C++ STL in programming contests. So, vector,set,map,queue,priority queue,pair all of these came in handy. Recently, I tried to solve a few problems using python. But could not find same structures. So, what are the sim...
Python Data Structures for programming contest
1.2
0
0
150
41,619,431
2017-01-12T17:28:00.000
1
0
0
0
python,scikit-learn,linear-regression
41,620,561
1
true
0
0
Yes, using cross validation will give you a better estimate of your model performance. Splitting randomly(cross validation) will however not work for time-series and/or all distributions of data. The "final model" will not be better only your estimate on model performance.
1
1
1
I have a dataset with a total of 58 samples. The dataset has two columns "measured signals" and "people_in_area". Due to it, I am trying to train a Linear Regression model using Scikit-learn. For the moment, I splited 75% of my dataset for training and 25% for testing. However, depending on the order in which the data ...
Can I apply Cross Validation in a Linear Regression model?
1.2
0
0
1,054
41,620,292
2017-01-12T18:21:00.000
1
1
0
0
python,amazon-web-services,amazon-ec2
41,620,629
2
false
0
0
You can check it from that instance and execute below command curl http://169.254.169.254/latest/meta-data/security-groups or from aws-cli also aws ec2 describe-security-groups
1
1
0
EDIT Removed BOTO from question title as it's not needed. Is there a way to find the security groups of an EC2 instance using Python and possible Boto? I can only find docs about creating or removing security groups, but I want to trace which security groups have been added to my current EC2 instance.
How do I list Security Groups of current Instance in AWS EC2?
0.099668
0
1
842
41,620,621
2017-01-12T18:41:00.000
4
0
0
0
python,anaconda
41,620,776
2
true
0
1
Try libraries traitsUI and Enaml. These are both supported in anaconda and both open-source projects from the company Enthought (many anaconda employees/founders are closely tied to Enthought). These libraries make use of underlying backends (wx, qt, tk) and facilitate much faster GUI dev than does working with those...
1
1
0
I have been studying python and looking for ways to install and use some GUI framework I can use. I have read of native tkinter, and QtPy, Kivy, wxPython etc, but getting problems installing them. Recently I read about Anaconda, and want to give it a try. But is it going to solve my issue for GUI framework ? I am seein...
Is there a GUI framework available in anaconda (python )?
1.2
0
0
25,141
41,621,209
2017-01-12T19:18:00.000
1
1
0
0
python,apache,cgi
41,621,284
1
false
0
0
One thing you could try: Return a proper HTML header Print a dot . every few seconds, just to keep the connection alive disable mod_deflate in your Apache server to prevent HTTP compression add SetEnv no-gzip to your .htaccess file
1
1
0
i run a cgi script on an apache server (xampp). The script basically runs in an infinte loop. After like 3 minutes i get the error message "script timed out before returning headers". I've searched through the internet and found stuff like: change MAX_EXECUTION_TIME to 0 -> didn't work set_time_limit(0) -> didn't work...
script timed out before returning headers cgi
0.197375
0
0
2,514
41,621,666
2017-01-12T19:45:00.000
2
0
0
0
python,django,apache
41,621,883
2
true
1
0
Neither of these things. Depending on how your server is configured, it will start up multiple processes and/or threads to handle multiple requests. Each of those will handle a single request at a time; however each process stays alive at the end of a request and continues to run in order to handle subsequent requests.
2
1
0
I'm a little confused as to how Apache manages separate "instances" of a Django application. Let's say I do the following: Go to the URL of my Django application Open up a new browser tab In the new tab, also go to the URL of my Django application Are two Python instances started, one for each browser tab? The applic...
Is a separate Python instance started for each instance of a Django application via Apache?
1.2
0
0
57
41,621,666
2017-01-12T19:45:00.000
0
0
0
0
python,django,apache
41,621,708
2
false
1
0
In the scenario you outlined there should be one instance of Django running on the server. It just happens to be managing two sessions.
2
1
0
I'm a little confused as to how Apache manages separate "instances" of a Django application. Let's say I do the following: Go to the URL of my Django application Open up a new browser tab In the new tab, also go to the URL of my Django application Are two Python instances started, one for each browser tab? The applic...
Is a separate Python instance started for each instance of a Django application via Apache?
0
0
0
57
41,624,151
2017-01-12T22:27:00.000
3
0
0
0
python,kivy
41,625,421
1
true
0
1
I'm not sure if it's causing your problem, but your Rotate instructions aren't bounded by the widget rule and will affect any later widgets - so the Rotate of each Critter is applied to every later one. To avoid this, add PushMatrix: at the top of the canvas rule and PopMatrix: at the bottom. These instructions effecti...
1
2
0
I have been playing around with the Kivy Pong tutorial, getting up to speed with the framework, seeing if I could implement a few ideas. I have removed most of the Pong functionality, so I could have only bouncing ball on the screen and added some code to generate multiple bouncing balls on the screen, generated on tou...
Kivy widgets behaving erratically
1.2
0
0
706
41,627,247
2017-01-13T04:08:00.000
7
0
0
0
python,download,ipython,jupyter-notebook,jupyter
46,266,094
4
false
0
0
The download option did not appear for me. The solution was to open the file (which could not be correctly read as it was a binary file), and to download it from the notebook's notepad.
1
24
1
I'm using ipython notebook by connecting to a server I don't know how to download a thing (data frame, .csv file,... for example) programatically to my local computer. Because I can't specific declare the path like C://user//... It will be downloaded to their machine not mine
Download data from a jupyter server
1
0
0
45,980
41,633,039
2017-01-13T10:59:00.000
6
1
1
0
python,debugging,assembly,reverse-engineering,obfuscation
41,637,182
3
false
0
0
There's no way to make anything digital safe nowadays. What you CAN do is making it hard to a point where it's frustrating to do it, but I admit I don't know python specific ways to achieve that. The amount of security of your program is not actually a function of programsecurity, but of psychology. Yes, psychology. Gi...
2
4
0
I'm creating a program in python (2.7) and I want to protect it from reverse engineering. I compiled it using cx_freeze (supplies basic security- obfuscation and anti-debugging) How can I add more protections such as obfuscation, packing, anti-debugging, encrypt the code recognize VM. I thought maybe to encrypt to pay...
protect python code from reverse engineering
1
0
0
12,365
41,633,039
2017-01-13T10:59:00.000
3
1
1
0
python,debugging,assembly,reverse-engineering,obfuscation
41,635,003
3
false
0
0
Story time: I was a Python programmer for a long time. Recently I joined in a company as a Python programmer. My manager was a Java programmer for a decade I guess. He gave me a project and at the initial review, he asked me that are we obfuscating the code? and I said, we don't do that kind of thing in Python. He said...
2
4
0
I'm creating a program in python (2.7) and I want to protect it from reverse engineering. I compiled it using cx_freeze (supplies basic security- obfuscation and anti-debugging) How can I add more protections such as obfuscation, packing, anti-debugging, encrypt the code recognize VM. I thought maybe to encrypt to pay...
protect python code from reverse engineering
0.197375
0
0
12,365
41,634,436
2017-01-13T12:14:00.000
0
0
0
0
python,json,python-requests
41,634,715
1
true
0
0
You could answer your question quite simpply by reading the source code. But anyway: response.json() does read the response's content, obviously - it's just a convenient shortcut for json.loads(response.content).
1
0
0
I read the following on python-requests website: Note that connections are only released back to the pool for reuse once all body data has been read; be sure to either set stream to False or read the content property of the Response object. But as I use the object returned by req.json() and doesn't use req thereafte...
In requests-python, when is connection released when using req_json = req.json()?
1.2
0
1
59
41,634,658
2017-01-13T12:27:00.000
0
0
1
1
osx-mountain-lion,python-idle,python-3.6
41,644,807
1
false
0
0
I am not exactly sure what you are asking, and whether it has anything to do with OSX, but I can explain IDLE. IDLE has two types of main window: a single Shell and multiple Editor windows. Shell simulates python running in the interactive REPL mode that you get when you enter 'python' (or 'python3') in a console or t...
1
0
0
Probably a very simple question. I just thought, after someone suggested it here, of trying (and installing) Python 3.6 on a Mac - I've been happily using 2.7 since now. I've never used the IDLE before having done everything via the command line + ATOM to write the program. I see that 'normally' you should be able to ...
Run mode not there (IDLE Python 3.6)
0
0
0
3,646
41,635,899
2017-01-13T13:37:00.000
0
0
0
0
python-2.7,pygame
41,636,016
1
false
0
1
Strange! I've fixed the issue by giving my platform game script a new name and deleting the *.pyc file that was generated. Good now I can get on with making the game! Ant
1
0
0
I've got an issue with Python2.7 and PyGame. It has only just started happening so not sure what's going on. I've been coding a simple platform game and upon running the script it would immediately print out "160 20" (without quotes) and then start the PyGame script. On exiting the script using the "esc" key it crashed...
Python2.7 PyGame set_mode issue and crash on script termination
0
0
0
34
41,639,740
2017-01-13T16:58:00.000
7
0
1
0
python,batch-file,python-idle
53,207,276
5
false
0
0
right click on the file->open with->choose default program->more options->select python.exe file and click on.
4
16
0
I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file.
Running Python file by double-click
1
0
0
67,480
41,639,740
2017-01-13T16:58:00.000
0
0
1
0
python,batch-file,python-idle
68,357,043
5
false
0
0
You can also start a Django app this way. Once the Django server starts it enters a "wait" kind of mode so a batch file only requires two lines: ECHO ON python manage.py runserver Manage.py can be in any directory, just keep the full folder path in the command within the batch file: ECHO ON python C:\temp\manage.py...
4
16
0
I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file.
Running Python file by double-click
0
0
0
67,480
41,639,740
2017-01-13T16:58:00.000
5
0
1
0
python,batch-file,python-idle
41,639,878
5
false
0
0
Right click the file, select open with. If you want to simply run the script, find python.exe and select it. If you want to debug with IDLE, find that executable and select it.
4
16
0
I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file.
Running Python file by double-click
0.197375
0
0
67,480
41,639,740
2017-01-13T16:58:00.000
1
0
1
0
python,batch-file,python-idle
56,283,517
5
false
0
0
When I had both Py2 and Py3, and then removed the former, my script wouldn't run by double-clicking it either (but fine from console.) I realized my __pycache__ folder (same directory as the script) was the issue. Problem solved when deleted.
4
16
0
I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file.
Running Python file by double-click
0.039979
0
0
67,480
41,639,782
2017-01-13T17:01:00.000
1
1
0
0
python,r,snakemake
41,672,695
1
true
0
0
I'm afraid not. This has performance reasons on (a) local systems (circumventing the Python GIL) and (b) cluster systems (scheduling to separate nodes). Even if there was a solution on local machines, it would need to take care that no sessions are shared between parallel jobs. If you really need to safe that time, I s...
1
1
1
I'm currently building my NGS pipeline using Snakemake and have an issue regarding the loading of R libraries. Several of the scripts, that my rules call, require the loading of R libraries. As I found no way of globally loading them, they are loaded inside of the R scripts, which of course is redundant computing time ...
Globally load R libraries in Snakemake
1.2
0
0
239
41,640,308
2017-01-13T17:34:00.000
0
1
1
0
python,token,primitive
41,640,398
1
true
0
0
It depends on the context, but usually: primitives refers to built in data types of a language, that is, types that you can represent without creating an object. In python (and most other languages) such types are booleans, strings, floats, integers tokens refers to a "word" (anything between spaces): identifiers, str...
1
2
0
I am doing MIT6.00.1x course from edX and in it, Professor Grimson talks about primitives of a programming language. What does it actually mean and secondly, how it is different from the tokens of a programming language? Please answer with reference to Python language.
Primitive operations provided by a programming language?
1.2
0
0
1,225
41,640,348
2017-01-13T17:36:00.000
0
0
1
0
python-3.x,sony-camera-api
41,675,249
1
false
0
0
I noticed that when I call the method "actTakePicture", the response returns the URL of postview image within result but I can't find any stored picture in the memory card (blank card as it was!). So I changed this card with another, then everything backs to normal. I also realized that once I formatted the first memo...
1
0
0
I'm getting shooting fail error (code error: 40400) each time I try to start movie recording. I checked "getShootMode" returns movie and the "cameraStatus" is IDLE. What can cause this error? All the other APIs works just fine!
"Shooting fail" error as response to "startMovieRec" request from Sony DSC QX10 camera?
0
0
0
86
41,642,612
2017-01-13T20:03:00.000
2
0
0
0
python,amazon-web-services,cassandra
43,731,632
2
false
0
0
Check if the query from your python driver is using upper case letters for the keyspace name - change it to lower case
1
1
0
I have a small Cassandra cluster hosted on AWS that I want to connect to using the python drivers. Unfortunately I get "Keyspace does not exist" when trying to connect to it from one specific pc. The strange thing is that keyspace exists and I can connect to itfrom other pcs. And I can find that keyspace on that server...
Cassandra cluster returns incorrect error "Keyspace does not exist" when connecting from one specific pc
0.197375
0
1
2,129
41,646,514
2017-01-14T03:29:00.000
8
0
0
0
python,windows,amazon-web-services,amazon-s3,boto3
41,682,857
2
false
0
0
The issue was actually being caused by the system time being incorrect. I fixed the system time and the problem is fixed.
1
6
0
I wrote a python script to download some files from an s3 bucket. The script works just fine on one machine, but breaks on another. Here is the exception I get: botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden. I am pretty sure it's related to some system config...
Trying to access a s3 bucket using boto3, but getting 403
1
1
1
8,191
41,652,978
2017-01-14T17:38:00.000
0
0
0
0
python,tkinter
41,653,041
2
false
0
1
You could create a couple of variables that hold the size of the screen. then replace (0,0) with (self.screenWidth-0, self.sceenHeight-0)
1
3
0
When I usually create a canvas, the (0, 0) coord is place on the top left corner of it. Now I want to set it on the bottom left corner. I think I have to set the "scrollbarregion" but I can't understand how to do it. Can someone explain?
Tkinter: Set 0, 0 coords on the bottom of a canvas
0
0
0
4,720
41,656,960
2017-01-15T01:40:00.000
2
0
1
0
python,keyword
41,656,994
1
true
0
0
For example you can use pass as placeholder for code, which you want to write later and syntactically you need some statement there.
1
0
0
What is the use of the "pass" keyword in Python? I don't know why or in what instance you would need to use it, since it literally does nothing. Can anyone give me a reason to use these other than for testing? It serves as a good placeholder, true, but does it have any other uses?
Use of "Pass" keyword in Python
1.2
0
0
3,105
41,661,599
2017-01-15T13:27:00.000
0
0
1
0
python,python-3.x,multiprocessing
41,663,040
1
true
0
0
There's no difference between starting processes in two terminals or using multiprocessing: when you open two python consoles you have two processes with their pid when you run two multiprocessing processes they are forked (on Linux) or started as separate python instance (Windows) and thus run as independent processe...
1
0
0
I have a more general beginners question about multiprocessing in Python (please forgive me if I'm utterly wrong in the following). Let's assume I launch two ore more Ipython consols in parallel and run some independent functions/scripts via those consols, does that meant these tasks are performed on multiple cores (on...
Python - Multiprocessing via Different IPython Consols
1.2
0
0
37
41,662,821
2017-01-15T15:27:00.000
0
1
1
1
python,linux,centos
41,662,958
3
false
0
0
There is no intrinsic reason why Python should be different from any other scripting language here. Here is someone else using python in init.d: blog.scphillips.com/posts/2013/07/… In fact, that deals with a lot that I don't deal with here, so I recommend just following that post.
1
2
0
I'm trying to make a Python script run as a service. It need to work and run automatically after a reboot. I have tried to copy it inside the init.d folder, But without any luck. Can anyone help?(if it demands a cronjob, i haven't configured one before, so i would be glad if you could write how to do it) (Running Cento...
How to run python script at startup
0
0
0
6,891
41,664,257
2017-01-15T17:43:00.000
3
0
1
0
python,string,algorithm,search,data-structures
41,664,342
6
false
0
0
If the strings are sorted then a binary search is reasonable. As a speedup, you could maintain a dictionary of all possible bigrams ("aa", "ab", etc.) where the corresponding values are the first and last index starting with that bigram (if any do) and so in O(1) time zero in on a much smaller sublist that contains the...
4
11
0
I have a list of 500 mil strings. The strings are alphanumeric, ASCII characters, of varying size (usually from 2-30 characters). Also, they're single words (or a combination of words without spaces like 'helloiamastring'). What I need is a fast way to check against a target, say 'hi'. The result should be all strings ...
Prefix search against half a billion strings
0.099668
0
0
2,126
41,664,257
2017-01-15T17:43:00.000
0
0
1
0
python,string,algorithm,search,data-structures
41,800,209
6
false
0
0
In this hypothetical, where the strings being indexed are not associated with any other information (e.g. other columns in the same row), there is relatively little difference between a complete index and keeping the strings sorted in the first place (as in, some difference, but not as much as you are hoping for). In ...
4
11
0
I have a list of 500 mil strings. The strings are alphanumeric, ASCII characters, of varying size (usually from 2-30 characters). Also, they're single words (or a combination of words without spaces like 'helloiamastring'). What I need is a fast way to check against a target, say 'hi'. The result should be all strings ...
Prefix search against half a billion strings
0
0
0
2,126
41,664,257
2017-01-15T17:43:00.000
0
0
1
0
python,string,algorithm,search,data-structures
41,790,945
6
false
0
0
If you doesn't want to use some database, you should create some data related routines pre-existing in all database engines: Doesn't try to load all data in memory. Use fixed length for all string. It increase storage memory consumption but significantly decrease seeking time (i-th string can be found at position L*i ...
4
11
0
I have a list of 500 mil strings. The strings are alphanumeric, ASCII characters, of varying size (usually from 2-30 characters). Also, they're single words (or a combination of words without spaces like 'helloiamastring'). What I need is a fast way to check against a target, say 'hi'. The result should be all strings ...
Prefix search against half a billion strings
0
0
0
2,126
41,664,257
2017-01-15T17:43:00.000
0
0
1
0
python,string,algorithm,search,data-structures
41,666,468
6
false
0
0
If you want to force the user to digit at least 4 letters, for example, you can keep a key-value map, memory or disk, where the keys are all combinations of 4 letters (they are not too many if it is case insensitive, otherwise you can limit to three), and the values are list of positions of all strings that begin with ...
4
11
0
I have a list of 500 mil strings. The strings are alphanumeric, ASCII characters, of varying size (usually from 2-30 characters). Also, they're single words (or a combination of words without spaces like 'helloiamastring'). What I need is a fast way to check against a target, say 'hi'. The result should be all strings ...
Prefix search against half a billion strings
0
0
0
2,126
41,664,810
2017-01-15T18:38:00.000
73
1
0
0
visual-studio-code,python,telegram,telegram-bot,python-telegram-bot
50,736,131
5
false
0
0
Post one message from User to the Bot. Open https://api.telegram.org/bot<Bot_token>/getUpdates page. Find this message and navigate to the result->message->chat->id key. Use this ID as the [chat_id] parameter to send personal messages to the User.
2
39
0
I am using the telepot python library, I know that you can send a message when you have someone's UserID(Which is a number). I wanna know if it is possible to send a message to someone without having their UserID but only with their username(The one which starts with '@'), Also if there is a way to convert a username t...
How can I send a message to someone with my telegram bot using their Username
1
0
1
131,355
41,664,810
2017-01-15T18:38:00.000
14
1
0
0
visual-studio-code,python,telegram,telegram-bot,python-telegram-bot
42,990,824
5
false
0
0
It is only possible to send messages to users whom have already used /start on your bot. When they start your bot, you can find update.message.from.user_id straight from the message they sent /start with, and you can find update.message.from.username using the same method. In order to send a message to "@Username", you...
2
39
0
I am using the telepot python library, I know that you can send a message when you have someone's UserID(Which is a number). I wanna know if it is possible to send a message to someone without having their UserID but only with their username(The one which starts with '@'), Also if there is a way to convert a username t...
How can I send a message to someone with my telegram bot using their Username
1
0
1
131,355
41,665,980
2017-01-15T20:32:00.000
2
0
1
0
python
41,666,000
3
false
0
0
The or operator short-circuits when the first value is truthy (i.e. evaluates to True). When that happens, that first value is returned. So, True or 5 short-circuits on the True, so it returns True. 5 or True short-circuits on the 5 (because 5 is truthy, which is nonzero for integers), so it returns 5.
1
0
0
I'm a beginner and this is a relatively simple question but I'm having trouble trying to figure it out. When you type "True or 5" into python, it returns True, and when you type "5 or True" it returns 5. Why is this? Why don't they return the same answer? Thanks!
Python: True or 5 vs 5 or True
0.132549
0
0
412
41,666,809
2017-01-15T22:01:00.000
2
0
0
0
python,video,video-streaming,httprequest,buffering
41,672,032
1
true
0
0
Before playing an MP4 file the client (e.g. browser) needs to read the header part of the file. An MP4 is broken into 'Atoms' and the Moov atom is the header or index atom for the file. For MP4 files that will be streamed, a common optimisation is to move this Moov atom to the front of the file. This allows the client ...
1
1
0
I have been breaking my head for the pass 2 weeks, and I still can't figure it out. I'm trying to build a Server-Client based streaming player on Python (Ironpython for the wpf GUI) that streams video files. My problem is when the client requests to seek on a part that he did not load yet. When I try to send him just t...
How does HTTP 206 Partial Content Request works
1.2
0
1
1,969