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
24,627,525
2014-07-08T08:51:00.000
0
0
1
1
python,pip
49,551,968
28
false
0
0
For me this problem appeared when I changed the environment path to point to v2.7 which was initially pointing to v3.6. After that, to run pip or virtualenv commands, I had to python -m pip install XXX as mentioned in the answers below. So, in order to get rid of this, I ran the v2.7 installer again, chose change opti...
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0
0
0
338,555
24,627,525
2014-07-08T08:51:00.000
1
0
1
1
python,pip
49,562,184
28
false
0
0
I have chosen to install Python for Windows (64bit) not for all users, but just for me. Reinstalling Python-x64 and checking the advanced option "for all users" solved the pip problem for me.
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0.007143
0
0
338,555
24,627,525
2014-07-08T08:51:00.000
3
0
1
1
python,pip
51,133,921
28
false
0
0
i had same issue and did a pip upgrade using following and now it works fine. python -m pip install --upgrade pip
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0.021425
0
0
338,555
24,627,525
2014-07-08T08:51:00.000
0
0
1
1
python,pip
51,287,625
28
false
0
0
I had this issue and the other fixes on this page didn't fully solve the problem. What did solve the problem was going in to my system environment variables and looking at the PATH - I had uninstalled Python 3 but the old path to the Python 3 folder was still there. I'm running only Python 2 on my PC and used Python 2...
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0
0
0
338,555
24,627,525
2014-07-08T08:51:00.000
0
0
1
1
python,pip
53,663,298
28
false
0
0
I had a simpler solution. Using @apple way but rename main.py to pip.py then put it in your python version scripts folder and add scripts folder to your path access it globally. if you don't want to add it to path you have to cd to scripts and then run pip command.
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0
0
0
338,555
24,627,525
2014-07-08T08:51:00.000
1
0
1
1
python,pip
38,163,927
28
false
0
0
My exact problem was (Fatal error in launcher: Unable to create process using '"') on windows 10. So I navigated to the "C:\Python33\Lib\site-packages" and deleted django folder and pip folders then reinstalled django using pip and my problem was solved.
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0.007143
0
0
338,555
24,627,525
2014-07-08T08:51:00.000
0
0
1
1
python,pip
58,481,723
28
false
0
0
I have similar problem when I reinstall my python, by uninstalling python3.7 and installing python3.8. But I solved it by removing the previous version of python directory. For me it was located here, C:\Users\your-username\AppData\Local\Programs\Python I deleted the folder named Python37 (for previous version) and k...
15
231
0
Searching the net this seems to be a problem caused by spaces in the Python installation path. How do I get pip to work without having to reinstall everything in a path without spaces ?
Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""
0
0
0
338,555
24,627,919
2014-07-08T09:10:00.000
0
0
0
0
python,django,django-models,import
24,628,844
3
false
1
0
You are not meant to put models directly on a project level in Django. Every model have to be associated with a particular app. On the other hand you can import models between apps. If you feel a need for a project level models it just means you haven't partitioned your functionality into apps properly. There shouldn't...
1
2
0
I would like to know if there is a way to include/import the models.py from the project directory to multiple apps without copying the model in each app. Thank you!
Django include models.py from project to multiple apps
0
0
0
2,218
24,629,867
2014-07-08T10:48:00.000
1
0
1
0
python,regex
24,629,914
4
false
0
0
Clarification: I'm assuming you want to parse the numbers, not just match them. Why use regexes when a simple split will work just fine? '1.3.4.*'.split('.') # => ['1', '3', '4', '*'] If you want to ensure that there is at least one dot in the string, check the array length to ensure it is larger than 1.
1
0
0
How can I write a regex for parsing version numbers. I want to match numbers like: 1.000, 1.0.00, 1.0.0.000 but not integers 1, 10,100
Regex for parsing version number
0.049958
0
0
2,778
24,635,660
2014-07-08T15:20:00.000
2
1
1
0
python,ironpython
24,636,635
1
true
0
1
You don't need to know any other languages - modulo a few implementation differences, Python is Python is Python. You will, however, need to know the Microsoft windowing library, with which I believe you will have to interface to build a GUI.
1
2
0
I am planning on using IronPython to develop a GUI interface for some python code. Do I need to know any other programming languages other than python. Also if not are there any other GUI packages/addon's to python that only use python to implement and get the final product working?
Does IronPython just use Python or to use IronPython do I need to know other programming languages other than python?
1.2
0
0
134
24,638,043
2014-07-08T17:26:00.000
2
0
1
0
python,matplotlib,pycharm
28,782,077
1
true
0
0
It doesn't look like you can do it: PyCharm does not use the 'qtconsole' of ipython, but either a plain text console (when you open the "Python console" tab in PyCharm) or ipython notebook (when you open a *.ipynb file). Moreover, PyCharm is done in Java, while to have an interactive plot Matplotlib needs to have a dir...
1
8
1
Is there a way to allow embedded Matplotlib charts in the IPython console that is activated within PyCharm? I'm looking for similar behavior to what can be done with the QT console version of IPython, i.e. ipython qtconsole --matplotlib inline
Embedded charts in PyCharm IPython console
1.2
0
0
2,490
24,639,577
2014-07-08T18:52:00.000
2
0
1
0
wxpython,pygame
24,644,067
1
false
0
1
The PyEmbeddedImage class has a GetData method (or Data property) that can be used to fetch the raw data of the embedded image, in PNG format.
1
1
0
I have used img2py to convert an image into a .py file. But how to use that converted file in pygame. Is there any specific code for it?
How to use/decompress the file made by img2py
0.379949
0
0
748
24,643,474
2014-07-09T00:08:00.000
13
0
1
0
python,spyder
42,282,994
4
false
0
0
This is a variation based on Jose's solution of creating a .bat file that eventually worked for me. Create a spyder.bat file with the following content: start C:\YourPath\Anaconda2\pythonw.exe C:\YourPath\Anaconda2\cwp.py C:\YourPath\Anaconda2 "C:/YourPath/Anaconda2/pythonw.exe" "C:/YourPath/Anaconda2/Scripts/spyder-sc...
2
21
0
I've recently installed Anaconda (using the default settings) on Windows 7. When I try to open a .py file by double-clicking it, I get the Open with... option. How can I set the default program as Spyder?
Set Spyder as default Python
1
0
0
30,052
24,643,474
2014-07-09T00:08:00.000
3
0
1
0
python,spyder
36,169,520
4
false
0
0
Use the "Default Programs" interface and select the executable for your Spyder,try the "Set Associations" menu and use browse to select your executable. The key is the executable path(set the path where the anaconda is installed): C:\path\Anaconda2\Scripts\spyder.exe just need to be patient, to wait for a few secon...
2
21
0
I've recently installed Anaconda (using the default settings) on Windows 7. When I try to open a .py file by double-clicking it, I get the Open with... option. How can I set the default program as Spyder?
Set Spyder as default Python
0.148885
0
0
30,052
24,647,400
2014-07-09T07:12:00.000
5
0
0
0
python,nltk,stemming
54,384,472
7
false
0
0
Stemming is all about removing suffixes(usually only suffixes, as far as I have tried none of the nltk stemmers could remove a prefix, forget about infixes). So we can clearly call stemming as a dumb/ not so intelligent program. It doesn't check if a word has a meaning before or after stemming. For eg. If u try to stem...
1
43
1
I tried all the nltk methods for stemming but it gives me weird results with some words. Examples It often cut end of words when it shouldn't do it : poodle => poodl article articl or doesn't stem very good : easily and easy are not stemmed in the same word leaves, grows, fairly are not stemmed Do you know other ...
What is the best stemming method in Python?
0.141893
0
0
74,285
24,649,084
2014-07-09T08:46:00.000
3
1
0
0
python,performance,raspberry-pi,floating-point-precision
24,649,933
2
false
0
0
You can force single precision floating point calculations using numpy. However, I would be very surprised if using single precision floating point worked out any faster than double precision: the raspberry pi has hardware floating point support so I would expect that all calculations are done at full 80 bit precision ...
2
2
0
I'm working with python on raspberry pi. I'm using complementary filter to get better values from gyroscope, but it eats too much raspberry's power - it's about 70%. I thought I could increase performance by reducing floating point precision. Now, results have about 12 decimal places, it's way more than I need. Is ther...
Lower the floating-point precision in python to increase performance
0.291313
0
0
2,081
24,649,084
2014-07-09T08:46:00.000
3
1
0
0
python,performance,raspberry-pi,floating-point-precision
24,650,318
2
false
0
0
It may be that you have the wrong end of the stick. The data flow form a gyroscope is rather slow, so you should have ample time to filter it with any reasonable filter. Even a Kalman filter should be usable (though probably unnecessary). How often do you sample the gyroscope and accelerometer data? Reasonable maximum...
2
2
0
I'm working with python on raspberry pi. I'm using complementary filter to get better values from gyroscope, but it eats too much raspberry's power - it's about 70%. I thought I could increase performance by reducing floating point precision. Now, results have about 12 decimal places, it's way more than I need. Is ther...
Lower the floating-point precision in python to increase performance
0.291313
0
0
2,081
24,650,785
2014-07-09T10:07:00.000
5
1
0
0
python,c++,dll,static-libraries
24,650,884
3
true
0
1
It depends on your desired deployment. If you use dynamic linking will need to carefully manage the libraries (.so, .dll) on your path and ensure that the correct version is loaded. This can be helped if you include the version number in the filename, but then that has its own problems (security... displaying version n...
1
3
0
I have a Python code that needs to be able to execute a C++ code. I'm new to the idea of creating libraries but from what I have learned so far I need to know whether I need to use static or dynamic linking. I have read up on the pros and cons of both but there is a lot of jargon thrown around that I do not understand ...
Advise needed for Static vs Dynamic linking
1.2
0
0
2,081
24,653,225
2014-07-09T12:05:00.000
0
1
0
0
python-2.7,twitter
24,654,111
1
true
0
0
If you want the latest tweets from specific users, Twitter offers the Streaming API. The Streaming API is the real-time sample of the Twitter Firehose. This API is for those developers with data intensive needs. If you're looking to build a data mining product or are interested in analytics research, the Streaming API ...
1
0
0
How can i get twitter information (number of followers, following, etc.) about a set of twitter handles using the Twitter API? i have already used Python-Twitter library but this only gives me information about my own twitter account, but i need the same for other twitter users (i have a list). Can you please guide me ...
Twitter API access using Python (newbie:Help Needed)
1.2
0
1
58
24,655,713
2014-07-09T13:58:00.000
0
0
0
0
python,gunicorn
24,656,069
2
false
1
0
Yes and no. Depends. Restarting workers eats resources. But the price is not too high. On the other hand if you have memory leaks then it will allow you to save memory. Thus effectively increasing performance.
2
8
0
Is there any effect on performance if I use gunicorn max_requests setting for production server?
Gunicorn max_requests for Production
0
0
0
3,830
24,655,713
2014-07-09T13:58:00.000
0
0
0
0
python,gunicorn
26,990,224
2
false
1
0
I've just found that this setting is the cause of a response time issue I have having. Baseline response time of one of my sites, measured locally, was about 20ms. This goes up to about 300ms on a worker restart, so yes, there is a performance impact. As a result of this, I've upped my setting from a super-safe 10 to 1...
2
8
0
Is there any effect on performance if I use gunicorn max_requests setting for production server?
Gunicorn max_requests for Production
0
0
0
3,830
24,655,877
2014-07-09T14:05:00.000
0
0
0
1
python,google-app-engine,cordova,google-cloud-storage
24,657,475
2
false
1
0
Yes, that is a fine use for GAE and GCS. You do not need an <input type=file>, per se. You can just set up POST parameters in your call to your GAE url. Make sure you send a hidden key as well, and work from SSL-secured urls, to prevent spammers from posting to your app.
1
1
0
Goal: Take/attach pictures in a PhoneGap application and send a public URL for each picture to a Google Cloud SQL database. Question 1: Is there a way to create a Google Cloud Storage object from a base64 encoded image (in Python), then upload that object to a bucket and return a public link? I'm looking to use PhoneGa...
Using PhoneGap + Google App Engine to Upload and Save Images
0
1
0
620
24,661,533
2014-07-09T18:46:00.000
3
0
0
1
python,apache-kafka,kafka-consumer-api,kafka-python
27,436,961
5
false
0
0
kafka-python stores offsets with the kafka server, not on a separate zookeeper connection. Unfortunately, the kafka server apis to support commit/fetching offsets were not fully functional until apache kafka 0.8.1.1. If you upgrade your kafka server, your setup should work. I'd also suggest upgrading kafka-python to...
1
8
0
I am using Kafka 0.8.1 and Kafka python-0.9.0. In my setup, I have 2 kafka brokers setup. When I run my kafka consumer, I can see it retrieving messages from the queue and keeping track of offsets for both the brokers. Everything works great! My issue is that when I restart the consumer, it starts consuming messages fr...
Kafka Consumer: How to start consuming from the last message in Python
0.119427
0
0
17,187
24,663,772
2014-07-09T21:03:00.000
0
0
1
1
python,input,command-line,command,command-prompt
24,663,846
2
false
0
0
if you pasted the code here that would help but the answer you are most likely looking for is commandline arguements. If I were to guess, in the command line the input would look something like: python name_of_script.py "c:\thefilepath\totheinputfile" {enter} {enter} being the actually key pressed on the keyboard and ...
2
0
0
I'm new to python and I'm attempting to run a script provided to me that requires to input the name of a text file to run. I changed my pathing to include the Python directory and my input in the command line - "python name_of_script.py" - is seemingly working. However, I'm getting the error: "the following arguments a...
Python script requires input in command line
0
0
0
352
24,663,772
2014-07-09T21:03:00.000
0
0
1
1
python,input,command-line,command,command-prompt
24,665,527
2
false
0
0
Without reading your code, I guess if I tried just adding it to the end of my command prompt line, but to no avail. it means that you need to make your code aware the command line argument. Unless you do some fancy command line processing, for which you need to import optparse or argparse, try: import sys # do someth...
2
0
0
I'm new to python and I'm attempting to run a script provided to me that requires to input the name of a text file to run. I changed my pathing to include the Python directory and my input in the command line - "python name_of_script.py" - is seemingly working. However, I'm getting the error: "the following arguments a...
Python script requires input in command line
0
0
0
352
24,663,825
2014-07-09T21:07:00.000
1
0
0
0
python,opencv,image-processing
24,663,901
1
false
0
0
filter out greyscale or filter in the allowed colors Idk if the range of colors or range of greyscale is larger but maybe whitelisting instead of blacklisting is helpful here
1
1
1
I am working on a project which involves using a thermal video camera to detect objects of a certain temperature. The output I am receiving from the camera is an image where the pixels of interest (within the specified temperature range) are colored yellow-orange depending on intensity, and all other pixels are graysc...
How to filter out all grayscale pixels in an image?
0.197375
0
0
1,335
24,664,072
2014-07-09T21:26:00.000
-3
0
1
0
python,conda
57,263,796
2
false
0
0
I tried this and had a lot of issues with plot.ly being updated to v. 4. My code was written on 3.10 and didn't feel like changing it. I had to copy the whole environment (every single file from \envs) from one machine to next, it works.
1
31
0
I have a python 2.7 conda environment and would like to create an equivalent environment with python 3.4. I am aware of the --clone option when creating environments, but it won't accept additional arguments, like python=3.4. Is there a way to do this automatically? I thought about trying to use the output from cond...
How do I clone a conda environment from one python release to another?
-0.291313
0
0
24,068
24,664,413
2014-07-09T21:55:00.000
0
0
0
0
python,mysql,sql
24,666,569
1
true
0
0
For anyone that cares, the ON DUPLICATE KEY UPDATE SQL command was what I ended up using.
1
0
0
So I have a string in Python that contains like 500 SQL INSERT queries, separated by ;. This is purely for performance reasons, otherwise I would execute individual queries and I wouldn't have this problem. When I run my SQL query, Python throws: IntegrityError: (1062, "Duplicate entry 'http://domain.com' for key 'PRIM...
Python Ignore MySQL IntegrityError when trying to add duplicate entry with a Primary key
1.2
1
0
828
24,665,515
2014-07-09T23:58:00.000
2
1
0
1
python,sonarqube,filenames,executable
24,698,064
1
false
0
0
It is not possible to do so. Empty string as value of property "sonar.python.file.suffixes" is ignored.
1
1
0
When I specify a Python executable script file that does not end in .py suffx, Sonar runs successfully but the report has no content. I have tried specifying -Dsonar.python.file.suffixes="" but that makes no difference. sonar-runner -Dsonar.sources=/users/av/bin -Dsonar.inclusions=gsave -Dsonar.issuesReport.html.locati...
Sonar python files without .py suffix
0.379949
0
0
561
24,665,738
2014-07-10T00:28:00.000
0
0
0
0
python,text,widget,undo
24,665,859
2
true
0
0
Monitor every keystroke in the text box and save the content of the text box after each change in a stack structure. When you encounter a word delimiting character replace the individual character changes for that word that are already on the stack with a new entry that is the whole word just typed. When the user press...
1
0
0
If the user clicks a menu button it would trigger a function that would undo what the user last typed. How would I go about doing this?
How to undo the last thing a user typed in a text field when he/she presses a button?
1.2
0
0
169
24,666,602
2014-07-10T02:33:00.000
3
0
1
0
python,performance,sorting,heap,complexity-theory
52,453,710
3
false
0
0
The nlargest() and nsmallest() functions of heapq are most appropriate if you are trying to find a relatively small number of items. If you want to find simply single smallest or largest number , min() and max() are most suitable, because it's faster and uses sorted and then slicing. If you are looking for the N small...
1
15
0
I'm relatively new to python (using v3.x syntax) and would appreciate notes regarding complexity and performance of heapq vs. sorted. I've already implemented a heapq based solution for a greedy 'find the best job schedule' algorithm. But then I've learned about the possibility of using 'sorted' together with operator....
Python heapq vs. sorted complexity and performance
0.197375
0
0
11,537
24,673,386
2014-07-10T09:49:00.000
0
1
0
1
python,ssh,fabric
24,673,514
1
false
0
0
You can call your functions with importing your fabfile.py. At the end, fabfile is just another python script you can import. I saw a case, where a django project has an api call to a function from fabfile. Just import and call, simple as python :)
1
0
0
I do not want to use the fab command and don't use the fabfile & command line arguments. I want to make automated remote ssh using fab api by writing a python script.Can I automated this by writig python script?
without using fab commandline argument can I use fabric api automated
0
0
0
74
24,673,772
2014-07-10T10:06:00.000
4
0
0
1
python,google-app-engine
35,254,560
3
false
1
0
You can store your keys in datastore. Later when you need them in the code, you can fetch them from datastore and cache them by memcache.
1
2
0
I deploy my project to GAE over Github. There is some foreign API-key which I don't want to save in repository and make them public. Is it possible to set an environment variable for a project in GAE control panel so I can catch it in my application?
Set environment variables in GAE control panel
0.26052
0
0
2,796
24,681,509
2014-07-10T16:14:00.000
0
0
1
0
python,ipython-notebook
30,565,768
1
true
0
0
Maybe some combination of cPickle and bash magic for scp?
1
3
1
I'm using an ipython notebook that is running on a remote server. I want to save data from the notebook (e.g. a pandas dataframe) locally. Currently I'm saving the data as a .csv file on the remote server and then move it over to my local machine via scp. Is there a more elegant way directly from the notebook?
Locally save data from remote iPython notebook
1.2
0
0
671
24,684,316
2014-07-10T19:00:00.000
1
1
0
0
python,pdf,export,latex,pdflatex
24,684,691
3
false
1
0
generate a Latex file.tex with a Python script f= open("file.tex", 'w') f.write('\documentclass[12pt]{article}\n') f.write('\usepackage{multicol}\n') f.write('\n\begin{document}\n\n') ... f.write('\end{document}') f.close() run pdflatex on the LaTex file from the Python script as a subprocess subprocess.call('latex fi...
1
0
0
I have a GUI program in Python which calculates graphs of certain functions. These functions are mathematical like say, cos(theta) etc. At present I save the graphs of these functions and compile them to PDF in Latex and write down the equation manually in Latex. But now I wish to simplify this process by creating a t...
Python Export Program to PDF using Latex format
0.066568
0
0
2,206
24,684,821
2014-07-10T19:32:00.000
0
0
0
0
python,django,rest,permissions,django-rest-framework
27,932,256
1
false
1
0
One of the arguments to has_permission is view, which has an attribute .action, which is one of the five "LCRUD" actions ("list"/"create"/"retrieve"/"update"/"destroy"). So I think you could use that to check, in has_permission, whether the action being performed is a list or a retrieve, and deny or allow it according...
1
1
0
I'm using Django Rest Framework and I'm having some trouble with permissions. I know how to use has_permission and has_object_permission, but I have a number of cases where someone needs to be able to access retrieve but not list--e.g., a user has access to their own profile, but not to the full list of them. The pro...
Django Rest Framework--deny access to list but not to retrieve
0
0
0
302
24,686,448
2014-07-10T21:16:00.000
1
0
0
1
python,c,caching
24,686,774
1
false
0
0
Since no one has really proposed anything I'll drop my idea here. If you need an example let me know and I'll include one. The easiest thing to do would be to serialize a dictionary that contains the system health and last time.time() it was checked. At the beginning of your program unpickle the dictionary, check the t...
1
0
0
I have a "healthchecker" program, that calls a "prober" every 10 seconds to check if a service is running. If the prober exits with return code 0, the healthchecker considers the tested service fine. Otherwise, it considers it's not working. I can't change the healthchecker (I can't make it check with a bigger interval...
exiting a program with a cached exit code
0.197375
0
0
56
24,687,248
2014-07-10T22:19:00.000
0
0
0
0
python,memory,local-storage,large-files
24,687,460
1
false
0
0
Copying a file is sequentially reading it and saving in another place. The performance of application might vary depending on the data access patterns, computation to I/O time, network latency and network bandwidth. If you execute your script once, and read through it sequentially it's the same as copying the file, exc...
1
0
1
Sorry if the topic was already approached, I didn't find it. I am trying to read with Python a bench of large csv files (>300 MB) that are not located in a local drive. I am not an expert in programming but I know that if you copy it into a local drive first it should take less time that reading it (or am I wrong?). T...
Reading Large File from non local disk in Python
0
0
0
214
24,687,736
2014-07-10T23:06:00.000
1
0
0
0
python,ajax,angularjs,flask
56,367,083
3
false
1
0
There isn't any way to be certain whether a request is made by ajax. What I found that worked for me, was to simply include a get parameter for xhr requests and simply omit the parameter on non-xhr requests. For example: XHR Request: example.com/search?q=Boots&api=1 Other Requests: example.com/search?q=Boots
1
15
0
I'd like to detect if the browser made a request via AJAX (AngularJS) so that I can return a JSON array, or if I have to render the template. How can I do this?
How can I identify requests made via AJAX in Python's Flask?
0.066568
0
1
5,005
24,688,388
2014-07-11T00:29:00.000
0
0
0
0
python,mysql,django,mongodb,database
24,690,665
2
false
1
0
In a Django project you've got 4 alternatives for this kind of problem, in no particular order: using PostgreSQL, you can use the hstore field type, that's basically a pickled python dictionary. It's not very helpful in terms of querying it, but does its job saving your data. using Django-NoRel with mongodb you get th...
1
0
0
I apologize if this has been asked already, or if this is answered somewhere else. Anyways, I'm working on a project that, in short, stores image metadata and then allows the user to search said metadata (which resembles a long list of key-value pairs). This wouldn't be too big of an issue if the metadata was standard...
Django: storing/querying a dictionary-like data set?
0
1
0
992
24,690,101
2014-07-11T04:26:00.000
0
0
0
0
c#,python,sql,tsql
24,690,183
1
true
0
0
You can run a trace in SQL Profiler to see the queries being executed on the server.
1
0
0
I faced with problem: There is a big old database on microsoft sql server (with triggers, functions etc.). I am writing C# app on top of this db. Most of work is a "experiments" like this: Write a part of functionality and see if it works in old Delphi app (i.e. inserted data in C# loaded correctly in Delphi). So I nee...
Analyse sql queries text
1.2
1
0
70
24,695,174
2014-07-11T10:03:00.000
48
0
0
0
python,r,scipy
42,065,440
2
false
0
0
The equivalent of the R pnorm() function is: scipy.stats.norm.cdf() with python The equivalent of the R qnorm() function is: scipy.stats.norm.ppf() with python
1
31
1
I need the quantile of some distributions in python. In r it is possible to compute these values using the qf, qnorm and qchi2 functions. Is there any python equivalent of these R functions? I have been looking on scipy but I did non find anything.
python equivalent of qnorm, qf and qchi2 of R
1
0
0
32,670
24,697,420
2014-07-11T12:11:00.000
0
0
0
0
python,django,postgresql,heroku
24,698,874
3
false
1
0
I presume that you have created a migration to add mainsite_message.spam to the schema. Have you made sure that this migration is in your git repository? If you type git status you should see untracked files. If the migration is untracked you need to git add path_to_migration and then push it to Heroku before you can r...
2
1
0
So, locally I've changed my models a few times and used South to get everything working. I have a postgres database to power my live site, and one model keeps triggering a column mainsite_message.spam does not exist error. But when I run heroku run python manage.py migrate mainsite from the terminal, I get Nothing to...
Add a column to heroku postgres database
0
1
0
1,178
24,697,420
2014-07-11T12:11:00.000
0
0
0
0
python,django,postgresql,heroku
24,697,852
3
false
1
0
Did you run schemamigration before? If yes, go to your database and take a look at your table "south_migrationhistory" there you can see what happened. If you already did the steps above you should try to open your migration file and take a look as well, there you can find if the creation column is specified or not!
2
1
0
So, locally I've changed my models a few times and used South to get everything working. I have a postgres database to power my live site, and one model keeps triggering a column mainsite_message.spam does not exist error. But when I run heroku run python manage.py migrate mainsite from the terminal, I get Nothing to...
Add a column to heroku postgres database
0
1
0
1,178
24,700,966
2014-07-11T15:10:00.000
0
1
0
1
python,bash,arduino
24,715,910
3
false
0
0
Just save the output from the arduino to a temporary variable and compare it to another that is the last value written to a file. If it is different, change the last value written to the new temperature and write it to the file.
1
0
0
I have the temperature coming from my arduino through the serial port on my mac. I need to write the data to a file, i don't want my script to write the data from /dev/tty.usbserial-A5025XZE (serial port) if the data is the same or if it is nothing. The temperature is the the format "12.32" and is sent every 5s.
Check to see if data is the same before writing over it
0
0
0
51
24,702,818
2014-07-11T16:53:00.000
1
0
0
0
python,boto
41,159,662
3
false
1
0
The simplest would be to use traffic shaping tools under linux, like tc. These tools let you control bandwidth and even simulate network packet loss or even long distance communication issues. Easy to write a python script to control the port behavior via a shell.
1
0
0
I'm using boto to upload and download files to S3 & Glacier. How can I ratelimit/throttle the uploading and downloading speeds?
How to throttle S3 & Glacier upload/download speeds with boto?
0.066568
0
1
1,618
24,706,850
2014-07-11T21:29:00.000
0
0
0
0
python,flask,soundcloud
24,741,514
1
true
0
0
This might be impossible to do portably. For example, if Firefox is already running on Linux, the second invocation of firefox http://url will find out that an instance using the same profile, will send a message to the other process to open that URL in a tab, then exits immediately. However, you could accomplish the ...
1
0
0
I want to implement a Python script to act as my OAuth2 endpoint, since I'm trying to write a Soundcloud app. Part of the authentication process involves visiting a Soundcloud page where you can sign in and grant access to the given Soundcloud application. I'd like to be able to open that webpage in a browser using Pyt...
How can I make Python's 'webbrowser' block execution?
1.2
0
1
225
24,707,471
2014-07-11T22:20:00.000
0
0
0
0
python,sqlite
24,707,793
3
false
0
0
If you explicitly need to commit multiple times throughout the code, and you are worried about the performance times of transactions, you could always build the database in memory db=sqlite3.connect(':memory:') and then dump it's contents to disk when all the time-critical aspects of the program have been completed. I....
1
1
0
I'm not sure how to best phrase this question: I would like to UPDATE, ADD, or DELETE information in an SQLite3 Table, but I don't want this data to be written to disk yet. I would still like to be able to SELECT the data, and get the updated information, but then I want to choose to either rollback or commit. Is th...
Can I Stage data to memory SELECT, then choose to rollback, or commit in sqlite3? python 2.7
0
1
0
91
24,707,635
2014-07-11T22:36:00.000
4
0
1
0
python,python-2.7,interpreter,running-other-programs
24,707,656
1
true
0
0
The processes know nothing about each other. It wouldn't matter if they were identical or not. Each process is allocated resources by the OS, so each process has its own resources, and they will not overlap. In fact, it is very common to use multiple similar Python processes to do multiprocessing when you have process...
1
4
0
I am running two python codes edited by two different text editors (Eclipse and Spyder), and from task manager I saw two python.exe processes. Will these two processes interfere with each other? I am worried because I used almost the same set of variable names across these two scripts and both codes are working on the ...
Running two python processes
1.2
0
0
267
24,707,836
2014-07-11T22:58:00.000
3
0
0
0
python,scikit-learn
24,708,214
1
true
0
0
This a known limitation of the current implementation of scikit-learn's SGD classifier, there is currently no automated convergence check on that model. You can set verbose=1 to get some feedback when running though.
1
1
1
Is there any automated way to evaluate convergence of the SGDClassifier? I'm trying to run an elastic net logit in python and am using scikit learn's SGDClassifier with log loss and elastic net penalty. When I fit the model in python, I get all zeros for my coefficients. When I run glmnet in R, I get significant non-ze...
Evaluating convergence of SGD classifier in scikit learn
1.2
0
0
822
24,708,697
2014-07-12T01:20:00.000
0
0
0
0
python-3.x,pyqt4
24,714,113
1
true
0
1
C have to be child of A than you can close B. B can call function in parent A to open C and then B can close itself.
1
0
0
Alright so this is a specific question about data transfer using different windows in pyqt4. Basically I have 3 windows, each with its own class definition, that I have designed for a project but I'm confused about how to properly arrange these windows. Ideal Functionality: Let's say I have 3 windows; A, B, and C. Win...
Controlling Windows/Information PYQT4
1.2
0
0
33
24,709,551
2014-07-12T04:08:00.000
1
0
0
0
python,django,django-templates
24,710,778
3
true
1
0
Unless you want to write your own template loader function that looks to your settings for the default and monkey-patch it in, then "no, there isn't a way to do that" is accurate. At least it's only one line per file. Plus, being a long-standing Django convention, other devs will immediately be able to see which base...
2
1
0
I'm 2 hours into Django and am wondering if there is a way to specify a default base template that will automatically be loaded for all templates so that you don't have to repeat yourself and specify {% extends "foo.html" %} at the top of every page template. For example, at the project or app level some metadata(setti...
Is there a way to specify a default base-template for all templates in django?
1.2
0
0
273
24,709,551
2014-07-12T04:08:00.000
1
0
0
0
python,django,django-templates
24,711,278
3
false
1
0
Don't forget, it's a guiding principle in Python - and therefore also in Django - that explicit is better than implicit. So whereas Rails, for example, emphasises convention over configuration and has all sorts of things happen automatically, this is very much alien to the Python way of doing things. So no, there is no...
2
1
0
I'm 2 hours into Django and am wondering if there is a way to specify a default base template that will automatically be loaded for all templates so that you don't have to repeat yourself and specify {% extends "foo.html" %} at the top of every page template. For example, at the project or app level some metadata(setti...
Is there a way to specify a default base-template for all templates in django?
0.066568
0
0
273
24,710,900
2014-07-12T07:53:00.000
2
0
0
1
python,linux,process
24,713,362
2
false
0
0
Just fork and before exec of the shell you call ptrace() with PTRACE_TRACEME so the exec doesn't start immediately, giving the parent all the time it needs to prepare before it tells the child to continue (PTRACE_CONT, PTRACE_SYSCALL, or PTRACE_SINGLESTEP). When using subprocess.Popen() you may use the preexec_fn argum...
2
0
0
My goal is to be able to start shell script in separate process and inspect it by linux ptrace syscall. The problem is that I need to get process PID before it even starts. Stuff like subprocess.Popen(['ls', '-l']) or python-sh runs command immediately, so in a time I am trying to inspect this process by its PID it is ...
python subprocess popen starts immediately
0.197375
0
0
524
24,710,900
2014-07-12T07:53:00.000
3
0
0
1
python,linux,process
24,711,374
2
true
0
0
If you're using Unix, I think that you can use the preexec_fn argument in the Popen constructor. According to the documentation of subprocess: If preexec_fn is set to a callable object, this object will be called in the child process just before the child is executed. (Unix only) As it runs in the child process, you...
2
0
0
My goal is to be able to start shell script in separate process and inspect it by linux ptrace syscall. The problem is that I need to get process PID before it even starts. Stuff like subprocess.Popen(['ls', '-l']) or python-sh runs command immediately, so in a time I am trying to inspect this process by its PID it is ...
python subprocess popen starts immediately
1.2
0
0
524
24,713,228
2014-07-12T13:04:00.000
1
0
0
0
python,tkinter
24,713,651
2
true
0
1
Use Pygame in place of Tkinter (eventually in place of Canvas) - there are functions to check collisions. To check collision you have to get position both elements and check distance between them: a2 + b2 = c2 a = x1 - x2 , b = y1 - y2 , c = distance between objects A(x1,y1) and B(x2,y2) If distance is smaller then so...
1
0
0
Hello I am developing easy space invaders clone game and i need to figure out a way how to detect collision of the bullet and the alien when i shoot. Any suggestions ? Thanks
How to detect collisions of two canvas object Tkinter
1.2
0
0
6,110
24,714,038
2014-07-12T14:44:00.000
0
0
0
0
python-2.7
24,714,152
1
false
0
0
Assign logger1 to some variable in module1 and let functions in that module use that variable to call correct logger. And remeber to check in functions whether variable is not None.
1
0
0
I have created two loggers in my logging module like logger1,logger2 and my application has two submodules module1 and module2.I want to configure/tell module1 should use logger1 and module2 should use logger2 only?
How to tell child modules to use specific logger
0
0
0
8
24,715,230
2014-07-12T16:54:00.000
1
0
0
0
python,scikit-learn,random-forest,one-hot-encoding
66,810,359
5
false
0
0
Maybe you can use 1~4 to replace these four color, that is, it is the number rather than the color name in that column. And then the column with number can be used in the models
2
71
1
Say I have a categorical feature, color, which takes the values ['red', 'blue', 'green', 'orange'], and I want to use it to predict something in a random forest. If I one-hot encode it (i.e. I change it to four dummy variables), how do I tell sklearn that the four dummy variables are really one variable? Specifically...
Can sklearn random forest directly handle categorical features?
0.039979
0
0
72,780
24,715,230
2014-07-12T16:54:00.000
16
0
0
0
python,scikit-learn,random-forest,one-hot-encoding
35,471,754
5
false
0
0
You have to make the categorical variable into a series of dummy variables. Yes I know its annoying and seems unnecessary but that is how sklearn works. if you are using pandas. use pd.get_dummies, it works really well.
2
71
1
Say I have a categorical feature, color, which takes the values ['red', 'blue', 'green', 'orange'], and I want to use it to predict something in a random forest. If I one-hot encode it (i.e. I change it to four dummy variables), how do I tell sklearn that the four dummy variables are really one variable? Specifically...
Can sklearn random forest directly handle categorical features?
1
0
0
72,780
24,717,307
2014-07-12T21:04:00.000
0
0
0
0
python,django,django-users,python-3.4
24,718,066
2
false
1
0
I was just talking to an advanced developer friend of mine about this. He said using djangos users is frowned upon and to build it out separately. I don't know much more on this but it's something I will be doing in the future.
1
0
0
I have a site that - other than the signup process - will be only used by logged in users. It's my first Django site, and I'm wondering whether I can use the Django user model (slightly extended) to work with all my users, or should it only be used for administrative users such as myself? Apologies if this is a stupid ...
Using Django Users for all logged in users, and registering them
0
0
0
48
24,717,941
2014-07-12T22:39:00.000
0
0
0
0
python,django,upgrade
24,718,048
2
false
1
0
You can always crate a dump of your database if you are afraid of losing data.
2
0
0
What is the best way of writing a unit test in Django that tests the validity of current database information when Django is upgraded? My unit tests create new information in the databases when they are run, but this isn't helpful for safely upgrading.
How do I test that Django upgrades don't break the current database?
0
0
0
50
24,717,941
2014-07-12T22:39:00.000
0
0
0
0
python,django,upgrade
24,731,271
2
false
1
0
What do you think could happen when you upgrade Django? Django updated your files not your database without permission from you. So you could upgrade your Django and run all your tests (local) to see if nothing is broken.
2
0
0
What is the best way of writing a unit test in Django that tests the validity of current database information when Django is upgraded? My unit tests create new information in the databases when they are run, but this isn't helpful for safely upgrading.
How do I test that Django upgrades don't break the current database?
0
0
0
50
24,718,142
2014-07-12T23:15:00.000
0
0
0
0
python,webkit,gtk,pygtk
24,722,441
1
false
1
1
why do you want sync those scrollbars? You can achieve this by using the same Gtk.Adjustment (number of pages sets to 0). I haven't use much of webkit but it essentialy a widget. so maybe a workaround would be disconnect a signal "value-changed" from Gtk.Adjustment until "load-status" signal from WebKitView reached We...
1
0
0
I've got a text view and a web view, each inside a scrolled window of their own and I'm trying to achieve synchronized scrolling between the two but I can't seem to get it to work. The web view is basically taking the text from the text view and rendering it as marked up HTML via webview.load_html_string(). I think the...
pygtk TextView and WebKit.WebView synchronized scrolling
0
0
0
221
24,718,274
2014-07-12T23:42:00.000
0
0
1
0
python
24,718,290
1
false
0
0
The only dangers are the typical concurrency issues you'd face in this situation. Be sure to either use Lock objects inside your logging method, or use them in bSoupProcessor before calling it.
1
0
0
In the main code, I have an instance of a class called "debugPrinterObject". After instantiating it, I pass one of it's functions as an argument to another class called "bSoupProcessor" which processes text. Any logging information is saved to a text file using the function passed into the constructor of the bSoupProc...
Python: What are the dangers of passing a specific object's function as an argument
0
0
0
42
24,718,697
2014-07-13T01:08:00.000
1
0
0
0
python,apache-spark,pyspark
24,736,966
6
false
0
0
Personally I think just using a filter to get rid of this stuff is the easiest way. But per your comment I have another approach. Glom the RDD so each partition is an array (I'm assuming you have 1 file per partition, and each file has the offending row on top) and then just skip the first element (this is with the sca...
1
28
1
how do you drop rows from an RDD in PySpark? Particularly the first row, since that tends to contain column names in my datasets. From perusing the API, I can't seem to find an easy way to do this. Of course I could do this via Bash / HDFS, but I just want to know if this can be done from within PySpark.
PySpark Drop Rows
0.033321
0
0
49,327
24,719,421
2014-07-13T03:59:00.000
1
0
1
1
python,windows,logging,logrotate,log-rotation
24,719,986
4
false
0
0
Firstly the issue is that, if you use a config file to initialise logging with file and console handlers, then it does not populate logging.handlers list, so you can not iterate over it and close+flush the streams prior to opening new one with a new logging file name. If you want to use TimeRotatingFileHandler or Rotat...
2
4
0
So I do logging.config.fileConfig to setup my logging from a file config that has console and file handler. Then I do logging.getLogger(name) to get my logger and log. At certain times I want the filehandler's filename to change i.e. log rotate (I can't use time rotator because of some issues with Windows platform) so ...
Logging Handlers Empty - Why Logging TimeRoatingFileHandler doesn't work
0.049958
0
0
3,512
24,719,421
2014-07-13T03:59:00.000
0
0
1
1
python,windows,logging,logrotate,log-rotation
54,827,449
4
false
0
0
Maybe there is no such name as 'TimeRoatingFileHandler' because you missed 'd' in word 'Timed'. So it must be: 'TimedRoatingFileHandler'
2
4
0
So I do logging.config.fileConfig to setup my logging from a file config that has console and file handler. Then I do logging.getLogger(name) to get my logger and log. At certain times I want the filehandler's filename to change i.e. log rotate (I can't use time rotator because of some issues with Windows platform) so ...
Logging Handlers Empty - Why Logging TimeRoatingFileHandler doesn't work
0
0
0
3,512
24,722,087
2014-07-13T11:16:00.000
0
0
0
0
python,django,forms,recursion,django-forms
25,321,619
4
false
1
0
In first glance, your idea seems to be complex. And the immediate question is - "Why do need such feature?". 99% - of tasks can be solved with built-in Django "bricks", another 1% - "Please hardcode". Also I may assume that the problem behind such an idea is complex too, and will be hard understandable by end user.
2
2
0
I like Django forms library, but it would be even better if a form could contain forms. My dream looks like this: I have a form which behaves like normal form: for example a class called SuperForm SuperForm can contain several normal forms, or even (recursive) SuperForms You can bind it to data (to make it bound), ca...
Django: Put a Form into a Form (recursive ...)
0
0
0
564
24,722,087
2014-07-13T11:16:00.000
-1
0
0
0
python,django,forms,recursion,django-forms
25,411,066
4
false
1
0
I think you are thinking about forms in a different way than what you should. Forms are simply there for input. How they are processed is up to you. Sure you can run is_valid on the form, and that would check against the modelform that you have assigned. The awesome thing is you can check multiple model forms on the ...
2
2
0
I like Django forms library, but it would be even better if a form could contain forms. My dream looks like this: I have a form which behaves like normal form: for example a class called SuperForm SuperForm can contain several normal forms, or even (recursive) SuperForms You can bind it to data (to make it bound), ca...
Django: Put a Form into a Form (recursive ...)
-0.049958
0
0
564
24,723,547
2014-07-13T14:10:00.000
4
0
1
1
python,python-2.7,command-line,packaging
61,834,365
4
false
0
0
Just change the name __init__.py file to __main__.py
2
19
0
I'm trying to release my first Python package in the wild and I was successful in setting it up on PyPi and able to do a pip install. When I try to run the package via the command line ($ python etlTest), I receive the following error: /usr/bin/python: can't find '__main__' module in 'etlTest' When I run the code dire...
Received 'can't find '__main__' module in '' with python package
0.197375
0
0
65,827
24,723,547
2014-07-13T14:10:00.000
1
0
1
1
python,python-2.7,command-line,packaging
67,251,553
4
false
0
0
I had the same problem and solved it by making sure I'm in the correct directory of the package you are trying to run. For Windows, type dir in the console, while on Linux/macOS - ls to see your current directory
2
19
0
I'm trying to release my first Python package in the wild and I was successful in setting it up on PyPi and able to do a pip install. When I try to run the package via the command line ($ python etlTest), I receive the following error: /usr/bin/python: can't find '__main__' module in 'etlTest' When I run the code dire...
Received 'can't find '__main__' module in '' with python package
0.049958
0
0
65,827
24,727,096
2014-07-13T21:21:00.000
1
0
0
0
python,web
24,727,209
4
false
0
0
Python comes bundled with sqlite3 module that gives access to SQLite databases. The only downside is that it is pretty much possible for just one thread can have write locks to it at any given moment.
2
0
0
I don't have access PHP server nor database like Mysql on machine I'll be working on. Would it be feasible to use Python instead of PHP and flat file database instead of Mysql? I'm not too concerned about performance or scalability. It's not like I'm going to create next facebook. I just want to load data from server ...
Using Python and flat file database for server-side
0.049958
1
0
1,786
24,727,096
2014-07-13T21:21:00.000
1
0
0
0
python,web
24,727,365
4
false
0
0
There are many ways to serve Python applications, but you should probably look at something that does this using the WSGI standard. Many frameworks will let you do this e.g: Pyramid, Pylons, Django, ..... If you haven't picked one then it would be worth looking at your long term requirements and also what you already k...
2
0
0
I don't have access PHP server nor database like Mysql on machine I'll be working on. Would it be feasible to use Python instead of PHP and flat file database instead of Mysql? I'm not too concerned about performance or scalability. It's not like I'm going to create next facebook. I just want to load data from server ...
Using Python and flat file database for server-side
0.049958
1
0
1,786
24,728,191
2014-07-14T00:41:00.000
0
0
1
0
python,mongodb
24,729,803
1
false
0
0
For me you have to store specific values you'll search on, and index them. For example, alongside with the date, you may store "year", "month", and "day", index on "month" and "day", and do your queries on it. You may want to store them as "y", "m", and "d" to gain some bytes (That's sad, I know).
1
0
0
I need to be able to query documents that have a date field between some range, but sometimes in my dataset the year doesn't matter (this is represented with a boolean flag in the mongo document). So, for example, I might have a document for Christmas (12/25-- year doesn't matter) and another document for 2014 World Cu...
Mongo query on custom date system
0
1
0
61
24,728,678
2014-07-14T02:08:00.000
1
1
0
0
python-2.7,ssid,wifi
24,738,477
1
false
0
0
aircrack-ng suite use airbase-ng to broadcast or hostapd (if you want to do more than just broadcast). In terms of python not really, you could use subprocess and execute airbase-ng through your script. If you want pure python, best to get Scapy and do it through there.
1
1
0
Hi all I am trying to write a python code to broadcast an SSID created by using Python. Is there a library Written for something like that which i could install? Is it really possible to write such a code to cause my wifi card broad cast an SSID i created?
Wireless SSID broadcast using Python
0.197375
0
0
633
24,729,427
2014-07-14T04:13:00.000
0
0
0
1
python,google-app-engine
24,765,014
1
false
1
0
I think I have found the answer to my own question. I have a small app I have written to backup my stuff to Google Drive, this app would appear to have an error in it that does not stop it from running but does cause it to make a file called C:\Usera\myname\Google Therefore GAE can not create a directory called C:\U...
1
1
0
Just installed Google Apps Engine and am getting "could not save" errors. Specifically if I go in to preferences I get Could not save into preference file C:\Usera\myname/Google\google_appengine_launcher.ini:No such file or directory. So some how I have a weird path, would like to know where and how to change this. I ...
could not save preference file google-apps-engine
0
0
0
53
24,729,475
2014-07-14T04:19:00.000
0
0
1
0
python
24,729,519
2
false
0
0
Dictionaries are fine if you have indices which are strings, and you don't have to make them up. So if you work by name, or something, a dictionary is easy to use. If you just use numbers, I'd make a list of lists. You can rapidly configure a list of N elements by doing eg. list_of_lists = N * []. You can the populate ...
1
1
0
My problem has to do with statistics and the creation of a dynamic number of variables in Python. I have a data set of values from 0-100. If the user enters 5 upper limits, 20, 40, 60, 80, 100, the program should sort the values into 5 classes, list1, list2, list3, list4, list5. If the user enters 4 upper limits, 25, ...
How can I create a dynamic number of variables?
0
0
0
77
24,729,658
2014-07-14T04:46:00.000
0
0
0
0
python,webkit,gtk,pygtk,webkitgtk
24,751,754
1
true
0
1
you have to put the Gtk.WebKitView inside a Gtk.ScrolledWindow. since it implement a Gtk.Scrollable you need not using a Gtk.Viewport. and put the window inside your Gtk.Box
1
0
0
When I open a site with the webkit webview, the entire window resizes to fit the page not allowing scrollbars. The window's height exceeds my screen height. Also, when a webview is in the window, I can resize the window outward, but I can't resize it inward. A webview won't show at all in a VBox if I do: MyVBox.pack_st...
PyWebkitGTK loads a website fully vertical into window and will not resize inward
1.2
0
0
118
24,732,112
2014-07-14T08:09:00.000
0
0
0
0
python,opencv,camera,detection,hsv
24,732,678
1
false
0
0
You can use a while loop and check if the blob region is not null and then find contours! it would be helpful if you posted your code. We can explain the answer in a better way then.
1
0
1
I recently started using Python and I've been working on an Open CV based project for over a month now. I am using Simple Thresholding to detect a coloured blob and I have thresholded the HSV values to detect the blob. All works well, but when the blob goes out of the FOV of the camera, the program gets stuck. I was wo...
Program gets stuck at finding the Contour while using Open CV
0
0
0
111
24,735,926
2014-07-14T11:49:00.000
0
0
1
0
python
24,736,026
4
false
0
0
You can split you string to a list using list1=s.split() And then check wether each of them is a integer or not.
1
0
0
for example if my input was "1 2 3", how do I check if each part is a integer and not anything else and if there was something else, be able to input the string again so its correct otherwise it wont move on
In Python, If I split a string up, how do i check if each part of it is an integer
0
0
0
917
24,736,316
2014-07-14T12:13:00.000
0
0
1
0
python,installation,pip,package
24,736,486
7
false
0
0
pip freeze gives you all the installed packages. Assuming you know the folder: time.ctime(os.path.getctime(file)) should give you the creation time of a file, i.e. date of when the package has been installed or updated.
1
41
0
I know how to see installed Python packages using pip, just use pip freeze. But is there any way to see the date and time when package is installed or updated with pip?
See when packages were installed / updated using pip
0
0
0
36,060
24,736,440
2014-07-14T12:21:00.000
0
0
1
0
c#,python,file,download,directory
24,736,474
2
false
0
0
When you download, you get file size. You can check file size before writing to file. If file size is same download size then allow writing.
2
0
0
I have a mix python-C# code that scans list of directories and manipulate it files in a loop. Sometime there is a download directly to the income directory and the program start manipulating the file before the download completed. Is there any way to detect if the file finish downloading?
How to detect if file is downloading in c# or python
0
0
0
400
24,736,440
2014-07-14T12:21:00.000
0
0
1
0
c#,python,file,download,directory
24,737,525
2
true
0
0
A simple way to detect if the file is done downloading is to compare file size. If you always keep a previous "snapshot" of the files in the current directory you will be able to see which files exist and which don't at a given moment in time. Once you see an new file you know that the file has started to download. Fro...
2
0
0
I have a mix python-C# code that scans list of directories and manipulate it files in a loop. Sometime there is a download directly to the income directory and the program start manipulating the file before the download completed. Is there any way to detect if the file finish downloading?
How to detect if file is downloading in c# or python
1.2
0
0
400
24,737,909
2014-07-14T13:43:00.000
-2
1
1
0
python
24,739,463
3
false
0
0
Don't. Python is not C++ and using patterns that worked before are silly in Python. In particular, Python is not a "Bondage and Domination" language where phrases like "thereby strictly controlling creation" don't apply. "If you didn't want to instantiate a UsefulClass then why did you?" — me. If you can't trust yourse...
1
0
0
C++ programmer here. In Python, how do you make sure that a particular class (e.g. UsefulClass) can only be created through its related factory class (e.g. FactoryClass)? But, at the same time the public methods of UsefulClass are callable directly? In C++ this can be easily achieved by making the relevant methods of ...
Only creating object through factory class in Python - factory class related
-0.132549
0
0
136
24,738,503
2014-07-14T14:10:00.000
0
0
0
1
python,gstreamer,playbin2
24,807,444
1
true
0
0
The best way to do it really synchronized with the video would be to use something like the cairooverlay element and do the rendering yourself directly inside the pipeline, based on the actual timestamps of the frames. Or alternatively write your own element for doing that. The easiest solution if timing is not needed ...
1
0
0
In my Python program I use GStreamer's playbin in combination with a textoverlay to play a video file and show some text on top of it. This works fine: If I change the text property of the textoverlay then the new text is shown. But now I want to set the text based on the video's current position/time (like subtitles)...
GStreamer timing in Python
1.2
0
0
739
24,739,390
2014-07-14T14:52:00.000
10
0
0
0
python,plot,bokeh
24,967,653
2
false
0
0
as of 0.5.1 there is now bokeh.plotting.reset_output that will clear all output_modes and state. This is especially useful in situations where a new interpreter is not started in between executions (e.g., Spyder and the notebook)
1
9
1
Before I updated, I would run my script and output the html file. There would be my one plot in the window. I would make changes to my script, run it, output the html file, look at the new plot. Then I installed the library again to update it using conda. I made some changes to my script, ran it again, and the output f...
Updated Bokeh to 0.5.0, now plots all previous versions of graph in one window
1
0
0
2,333
24,741,712
2014-07-14T16:54:00.000
0
0
0
0
python,django,rabbitmq,celery
24,742,679
2
false
1
0
I don't know why I didn't think of this sooner, I added in a unique_together clause which will prevent another like_object from being created.
1
0
0
I'm currently looking for a solution that will prevent a user from making multiple requests at the same time. I would like the first request to finish before the I process the second request from the user. For example, lets say user adam liked and un-liked suzy's photo. Both unliking and liking of the photo happens in ...
Django: Finish processing one request from a user before proceeding to the next
0
0
0
259
24,743,340
2014-07-14T18:31:00.000
0
1
1
0
python,performance,file,io
24,743,892
2
false
0
0
Such a question can be answered only by real measurement. You shall create simple test scenario, which will do reading and writing files of similar type and size without the actual calculation. You can do profiling and check, how much time you spend on I/O operations and how much on processing the content. It might tur...
1
0
0
I have a Python script that reads a line of data from a source file, performs a set of calculations on that data and writes the results of those calculations to the output file. The script is currently coded to read one line at a time from the source file until the end of the source file is reached. Can I improve the ...
Performance Tradeoff Reading From One File, Perfoming An Action and Writing To Another File
0
0
0
41
24,743,758
2014-07-14T18:57:00.000
2
0
0
0
python,graphics,pygame
24,744,048
2
false
0
1
I dont fully understand your question, but to attempt to answer it here is the following. No you should not fully draw to the screen then scale it. This is the wrong approach. You should tile very large surfaces and only draw the relevant tiles. If you need a very large view, you should use a scaled down image (pre-sca...
2
1
0
I'm drawing a map of a real world floor with dimensions roughly 100,000mm x 200,000mm. My initial code contained a function that converted any millimeter based position to screen positioning using the window size of my pygame map, but after digging through some of the pygame functions, I realized that the pygame transf...
Pygame Large Surfaces
0.197375
0
0
1,634
24,743,758
2014-07-14T18:57:00.000
0
0
0
0
python,graphics,pygame
24,744,442
2
false
0
1
If your map is not dynamic, I would suggest draw a map outside the game and load it in game. If you plan on converting the game environment into a map, It might be difficult for a large environment. 100,000mm x 200,000mm is a very large area when converting into a pixels. I would suggest you to scale it down before loa...
2
1
0
I'm drawing a map of a real world floor with dimensions roughly 100,000mm x 200,000mm. My initial code contained a function that converted any millimeter based position to screen positioning using the window size of my pygame map, but after digging through some of the pygame functions, I realized that the pygame transf...
Pygame Large Surfaces
0
0
0
1,634
24,744,409
2014-07-14T19:33:00.000
2
0
0
0
python,scikit-learn
24,757,540
1
true
0
0
Use the partial_fit method on the naive Bayes estimator.
1
0
1
I'm building a NaiveBayes classifier using scikit-learn, and so far things are going well if I have a set body of data to train. However, for the particular project I'm working on, there will be new data coming in every day that ideally would be part of the training set. I'm aware that you can pickle the classifier to ...
Updating a NaiveBayes Classifier (in scikit-learn) over time
1.2
0
0
346
24,744,701
2014-07-14T19:49:00.000
1
0
0
0
python,machine-learning,neural-network,gpu,theano
24,765,554
1
true
0
0
For a plain CudaNdarray variable, something like this should work: '''x = CudaNdarray... x_new=theano.tensor.TensorVariable(CudaNdarrayType([False] * tensor_dim)) f = theano.function([x_new], x_new) converted_x = f(x) '''
1
1
1
I'm trying to convert a pylearn2 GPU model to a CPU compatible version for prediction on a remote server -- how can I convert CudaNdarraySharedVariable's to TensorVariable's to avoid an error calling cuda code on a GPU-less machine? The experimental theano flag unpickle_gpu_to_cpu seems to have left a few CudaNdarrayS...
Convert CudaNdarraySharedVariable to TensorVariable
1.2
0
0
505
24,749,764
2014-07-15T04:15:00.000
2
0
1
1
ipython,tornado,ipython-notebook
27,664,732
2
false
0
0
Errno 5 is a low level error usually reported when your disk has bad sectors. I don't think the error is related to the file or ipython, check your disk with an appropriate tool (fsck if you are using Linux).
1
2
0
I have a git folder with several ipython notebook files in it. I've just got a new comp and installed ipython. When I open some files, it works fine, others, however, display this error: Error loading notebook, bad request. The log looks like: 2014-07-16 00:20:11.523 [NotebookApp] WARNING | Unreadable Notebook: /nas-60...
iPython notebook won't open some files
0.197375
0
0
1,542
24,749,992
2014-07-15T04:44:00.000
0
0
0
0
python,google-drive-api
24,760,552
1
true
0
0
Not possible as you already found out since its not on the docs.
1
2
0
I have a very large file hierarchy in Google Drive which follows a standard naming convention. Is it possible to issue a list query that returns Folder Name and ID for all folders matching a specific pattern? I can't seem to find this in the documentation, so I'm thinking that it may not be possible.
Is it possible to query Google Drive via SDK using a regular expression?
1.2
0
0
87
24,754,321
2014-07-15T09:17:00.000
0
0
0
1
python,mongodb
45,618,082
1
false
0
0
You need to make sure you're running mongod in another terminal tab first.
1
1
0
I am a newbie in Python and has installed MongoDB but each time I try to run mongo.exe from command prompt C:\Program Files\MongoDB 2.6 Standard\bin>mongo.exe, it issues the following: MongoDB shell version: 2.6.3 connecting to: test 2014-07-15T10:02:02.670+0100 warning: Failed to connect to 127.0.0.1:27017, reas on: e...
MongoDB Not Running from Command Prompt
0
0
0
254
24,755,246
2014-07-15T10:00:00.000
3
0
1
0
python,console,sublimetext2,shortcut
37,505,351
3
false
0
0
A new window will always have a clean console. You can use this to open a new window, close the old one and then reopen your project (assuming it is a saved project and not anonymous). This requires the hot_exit setting to be true, which is the default.
2
47
0
How to clear console in sublime text editor. I have searched on internet too..But can't find proper shortcut for that. Please provide info
How to clear console in sublime text editor
0.197375
0
0
24,547
24,755,246
2014-07-15T10:00:00.000
18
0
1
0
python,console,sublimetext2,shortcut
42,431,629
3
false
0
0
I installed ClearConsole package, then type alt+k to clear then console.
2
47
0
How to clear console in sublime text editor. I have searched on internet too..But can't find proper shortcut for that. Please provide info
How to clear console in sublime text editor
1
0
0
24,547
24,760,322
2014-07-15T14:03:00.000
1
0
0
0
python,pyqtgraph
25,269,345
2
false
0
1
While pyqtgraph is awesome, for my use case I found a much better tool to do this. graphviz is a nice tool to develop Control Flow Graphs quite conveniently, and has a large number of features for this particular problem.
2
0
0
I am trying to visualize a Control Flow Graph in Python using pyqtgraph. I have the following two problems. How can I visualize the edges with a direction? How can I visualize a self edge? I tried looking into the documentation, but couldn't find. Obviously, I didn't get time to read it all!
Edges with Direction in pyqtgraph GraphItem
0.099668
0
0
375
24,760,322
2014-07-15T14:03:00.000
0
0
0
0
python,pyqtgraph
24,763,543
2
true
0
1
For direction, you might add a pg.ArrowItem at the end of each line (although this could have poor performance for large networks), and for self connections, QtGui.QGraphicsEllipseItem combined with an arrow.
2
0
0
I am trying to visualize a Control Flow Graph in Python using pyqtgraph. I have the following two problems. How can I visualize the edges with a direction? How can I visualize a self edge? I tried looking into the documentation, but couldn't find. Obviously, I didn't get time to read it all!
Edges with Direction in pyqtgraph GraphItem
1.2
0
0
375
24,761,787
2014-07-15T15:09:00.000
0
0
0
0
python,image
24,762,074
2
false
0
0
It is possible, if you us NumPy and especially numpy.memmap to store the image data. That way the image data looks as if it were in memory but is on the disk using the mmap mechanism. The nice thing is that the numpy.memmap arrays are not more difficult to handle than ordinary arrays. There is some performance overhead...
1
0
1
I have a large number of images of different categories, e.g. "Cat", "Dog", "Bird". The images have some hierarchical structure, like a dict. So for example the key is the animal name and the value is a list of animal images, e.g. animalPictures[animal][index]. I want to manipulate each image (e.g. compute histogram) a...
Manipulating Large Amounts of Image Data in Python
0
0
0
258