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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31,003,994 | 2015-06-23T13:22:00.000 | 2 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 61,646,022 | 10 | false | 0 | 0 | You should find installed packages in :
anaconda's directory / lib / site_packages
That's where i found mine. | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 0.039979 | 0 | 0 | 179,229 |
31,003,994 | 2015-06-23T13:22:00.000 | 0 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 65,584,502 | 10 | false | 0 | 0 | I encountered this issue in my conda environment. The reason is that packages have been installed into two different folders, only one of which is recognised by the Python executable.
~/anaconda2/envs/[my_env]/site-packages
~/anaconda2/envs/[my_env]/lib/python2.7/site-packages
A proved solution is to add both folders t... | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 0 | 0 | 0 | 179,229 |
31,003,994 | 2015-06-23T13:22:00.000 | 4 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 31,637,998 | 10 | false | 0 | 0 | You could also type 'conda list' in a command line. This will print out the installed modules with the version numbers. The path within your file structure will be printed at the top of this list. | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 0.07983 | 0 | 0 | 179,229 |
31,003,994 | 2015-06-23T13:22:00.000 | 6 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 55,619,141 | 10 | false | 0 | 0 | I installed miniconda and found all the installed packages in /miniconda3/pkgs | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 1 | 0 | 0 | 179,229 |
31,003,994 | 2015-06-23T13:22:00.000 | 111 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 31,004,084 | 10 | true | 0 | 0 | You can import the module and check the module.__file__ string. It contains the path to the associated source file.
Alternatively, you can read the File tag in the the module documentation, which can be accessed using help(module), or module? in IPython. | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 1.2 | 0 | 0 | 179,229 |
31,003,994 | 2015-06-23T13:22:00.000 | 2 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 66,036,836 | 10 | false | 0 | 0 | At least with Miniconda (I assume it's the same for Anaconda), within the environment folder, the packages are installed in a folder called \conda-meta.
i.e.
C:\Users\username\Miniconda3\envs\environmentname\conda-meta
If you install on the base environment, the location is:
C:\Users\username\Miniconda3\pkgs | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 0.039979 | 0 | 0 | 179,229 |
31,003,994 | 2015-06-23T13:22:00.000 | 5 | 0 | 1 | 0 | python,python-2.7,pip,anaconda | 67,448,916 | 10 | false | 0 | 0 | One more option using the interpreter:
import site; print(''.join(site.getsitepackages()))
And using a terminal/prompt:
python -c "import site; print(''.join(site.getsitepackages()))"
Also in this case you can easily print one of the directory (in case there are more than one) using own filter | 7 | 103 | 0 | After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.
Where can I find the site-packages directory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages | Anaconda site-packages | 0.099668 | 0 | 0 | 179,229 |
31,005,233 | 2015-06-23T14:13:00.000 | 0 | 1 | 0 | 0 | python,twitter | 31,005,344 | 1 | false | 0 | 0 | Use of Stream API could help you. You can collect the real time information there and using some clustering algorithms and data mining techniques can solve it. | 1 | 0 | 0 | I am doing some research of spam detection on Twitter where my program is dynamic enough which can built a tree of datastructure of metadata of user and his tweets just taking a parameter as Screen_name or Twitter id but collecting legitimate user name and spammer name is a manual task. (If there is any other way plea... | Is there any way to get current legitimate user list from Twitter in 5000 to 10000 | 0 | 0 | 1 | 73 |
31,008,719 | 2015-06-23T16:46:00.000 | 0 | 0 | 0 | 1 | python-2.7,google-app-engine,go | 31,039,704 | 1 | false | 1 | 0 | I re-installed Python (the module_test and other tests failed) and updated the gae-go sdk. This fixed my problem. I believe that a recently identified Flash exploit had something to do with it as I experienced a number of Flash crashes in web page ads just before the problems began. | 1 | 0 | 0 | I've been successfully using go for months - last night my app started 404 page not found errors but only on pages that use Templates. Those that don't use the Template system work fine.
I re-installed the Go sdk and discovered that the Guestbook demo ( also uses Templates) doesn't work either. ... and then I notic... | GAE golang templates stopped working | 0 | 0 | 0 | 50 |
31,009,284 | 2015-06-23T17:16:00.000 | 2 | 0 | 0 | 0 | python,csv | 31,009,436 | 1 | true | 0 | 0 | I believe the write will immediately write to the disk, so there isn't any benefit that I can see from closing and reopening the file. The file isn't stored in memory when it's opened, you just get essentially a pointer to the file, and then load or write a portion of it at a time.
Edit
To be more explicit, no, openi... | 1 | 3 | 1 | I am writing a program with a while loop, which would write giant amount of data into a csv file. There maybe more than 1 million rows.
Considering running time, memory usage, debugging and so on, what is the better option between the two:
open a CSV file, keep it open and write line by line, until the 1 million all w... | When writing large data into .csv file, is it better to open and close file often? | 1.2 | 0 | 0 | 2,830 |
31,009,555 | 2015-06-23T17:30:00.000 | 0 | 0 | 0 | 0 | python,django,selenium,functional-testing | 31,042,109 | 2 | true | 1 | 0 | I've decided that I am just going to call the method of the nightly methods directly, instead of making a truly functional test. | 1 | 0 | 0 | I am learning TDD and am using Django and Selenium to do some functional testing. I wanted to make it so that a user selects a checkbox that essentially says "add 1 to this number nightly". Then, for all of the users that have this setting on, a nightly process will automatically increment the number on these accounts.... | Django Functional Test for Time Delayed Procedure | 1.2 | 0 | 0 | 74 |
31,014,137 | 2015-06-23T21:49:00.000 | 15 | 0 | 1 | 0 | python,command-prompt,pyinstaller | 31,014,207 | 2 | true | 0 | 0 | Manually open a command prompt (Start > Run > cmd), navigate to the folder containing your program (cd C:/Users/Ladmerc/python_programs), and then run the program (my_program.exe). The terminal window will stay open after the program exits. | 1 | 3 | 0 | I know there are lots of questions on this topic, however none so far is the result of a pyinstaller package.
I used pyinstaller to package a python file. It runs well before packaging, but when I open the exe, it briefly displays an error and closes before I get the chance to read.
How can I stop the command prompt fr... | Command prompt closing too quickly | 1.2 | 0 | 0 | 3,802 |
31,014,858 | 2015-06-23T22:57:00.000 | 0 | 1 | 1 | 1 | python,python-2.7 | 31,015,074 | 3 | false | 0 | 0 | Thanks, @JoranBeasley, @barunsthakur, @PadraicCunningham, and all.
I had PYTHONSTARTUP set in .bashrc.
May help forgetful people in the future. | 2 | 0 | 0 | I'm taking a python course, I save exercise scripts in /this/is/where/I save/exercises/exercise.py.
Now whenever I type python in terminal it immediately gives me this:
IOError: [Errno 2] No such file or directory: '/this/is/where/I save/exercises/exercise.py'
I know it's not found since I deleted the file. But why is ... | Typing 'python' in terminal runs a python script and spits error | 0 | 0 | 0 | 64 |
31,014,858 | 2015-06-23T22:57:00.000 | -1 | 1 | 1 | 1 | python,python-2.7 | 31,014,929 | 3 | false | 0 | 0 | Python has a special script that is run on startup. On my platform it is located at /usr/lib/python2.5/site-packages/sitecustomize.py IIRC. You may want to check that file for any script calls to that directory. Also, if you are on a linux machine you could check /etc/bashrc or /etc/profile.d. If that doesn't help, try... | 2 | 0 | 0 | I'm taking a python course, I save exercise scripts in /this/is/where/I save/exercises/exercise.py.
Now whenever I type python in terminal it immediately gives me this:
IOError: [Errno 2] No such file or directory: '/this/is/where/I save/exercises/exercise.py'
I know it's not found since I deleted the file. But why is ... | Typing 'python' in terminal runs a python script and spits error | -0.066568 | 0 | 0 | 64 |
31,015,556 | 2015-06-24T00:13:00.000 | 7 | 1 | 0 | 1 | python,recovery | 31,015,993 | 3 | true | 0 | 0 | As far as I know, Python doesn't keep the source in memory, and the method presented in the comment only keeps executables alive, not scripts. Dumping the memory of the program probably allows you to get to the bytecode, but I have no idea how much effort that might require.
Instead, I'd first try a non-Python-specific... | 1 | 5 | 0 | Help, I screwed up.
I have a somewhat complex python script that is currently running in a putty window to a Ubuntu server.
I accidentally overwrote the script using another putty window, so the copy on the hard drive is now gone, but the script is still running from memory in the first window.
This happened before I h... | Recover Python script from memory, I screwed up | 1.2 | 0 | 0 | 17,971 |
31,017,006 | 2015-06-24T03:16:00.000 | 0 | 0 | 1 | 1 | python,macos,python-2.7,python-3.x | 36,225,388 | 2 | false | 0 | 0 | I have similar issue with pip install. However, if I do "sudo su -" then do my pip install 'fileName', that solve the problem for me. | 1 | 0 | 0 | I have just installed Python 3.4.3 on my MAC (Yosemite). I need to install a couple of lxml, however everytime I type in: pip install /""/, I get error messages.
I have followed multiple tutorials and pip is installed.
MAC already had Python 2.7., but I installed the 3.4.3. version, not sure if that is the issue.
The e... | Python pip install error | 0 | 0 | 0 | 1,929 |
31,019,164 | 2015-06-24T06:29:00.000 | 1 | 0 | 0 | 0 | python,django,django-models,django-admin | 31,019,876 | 1 | false | 1 | 0 | Superusers are special as their permission system returns True on every permission request (it is hardcoded). There is no "super group". You can simply create a group and give it all permissions (so add, change and delete permission to every model). | 1 | 0 | 0 | I am making an app. In which multiple superusers are there and beneath these super user we have multiple user. I am able to make superuser.But I am not able to add user in that for that super user.I am relatively new in django. | Making group in django app. | 0.197375 | 0 | 0 | 53 |
31,020,766 | 2015-06-24T07:49:00.000 | 0 | 0 | 0 | 0 | python,excel,openpyxl | 31,022,634 | 2 | true | 0 | 0 | This is currently (version 2.2) not possible. | 1 | 1 | 0 | I'm using openpyxl to write to an existing file and everything works fine. However after the data is saved on the file, graphs disappear.
I understand Openpyxl currently only supports chart creation within a worksheet only. Charts in existing workbooks will be lost.
Are there any alternate libraries in Python to achie... | Graphs lost while overwriting to existing excel file in Python | 1.2 | 1 | 0 | 2,336 |
31,022,379 | 2015-06-24T09:09:00.000 | 0 | 0 | 0 | 0 | python,pandas | 31,022,952 | 4 | false | 0 | 0 | You can not use any of these chars in the file name ;
/:*?\"| | 1 | 0 | 1 | I want to save a dataframe to a .csv file with the name '123/123', but it will split it in to two strings if I just type like df.to_csv('123/123.csv').
Anyone knows how to keep the slash in the name of the file? | How to save a dataframe as a csv file with '/' in the file name | 0 | 0 | 0 | 373 |
31,023,793 | 2015-06-24T10:11:00.000 | 1 | 1 | 1 | 0 | pdf,python-3.x,pdf-parsing,pdfminer | 52,716,999 | 3 | false | 0 | 0 | For python3, you can download pdfminer as:
python -m pip install pdfminer.six | 1 | 3 | 0 | The texts in the pdf files are text formats, not scanned. PDFMiner does not support python3, is there any other solutions? | PDF text extract with Python3.4 | 0.066568 | 0 | 0 | 3,008 |
31,024,852 | 2015-06-24T11:04:00.000 | 0 | 0 | 1 | 0 | python | 31,025,251 | 1 | false | 0 | 0 | There's no way to "listen" for changes other than repeatedly requesting that URL to check if something has changed; i.e. classic "pull updates". To get actual live notifications of changes, that other server needs to offer a way to push such a notification to you. If it's just hosting the file and is not offering any a... | 1 | 0 | 0 | I am new to python. I want to read JSON data from URL and if there is any change in JSON data on server, I want to update in my JSON file which is on client. How can I do that through python?
Actually i am ploting graph on django using JSON data which is on another server. That JSON data is updated frequently. So here ... | Asynchronous way to listen web service for data change | 0 | 0 | 1 | 190 |
31,025,169 | 2015-06-24T11:20:00.000 | 0 | 1 | 0 | 0 | python,photoshop | 31,025,935 | 1 | false | 0 | 0 | It seems this is due to a change in the Photoshop API.
You may want to report it to them and get the right feedback.
Since most of the stackflow user might be more "code-oriented", it is likely that you won't get effective answer. | 1 | 0 | 0 | I have used python to write script for Photoshop using versions from CS6 to CC 2014 and my scripts have worked flawlessly. Last week I updated my Photoshop to CC 2015 and my scripts stopped working. I got error messages about missing attributes. I thought this was due to CC 2015 having changed something about the COM i... | Python and Photoshop | 0 | 0 | 0 | 2,211 |
31,025,392 | 2015-06-24T11:31:00.000 | 4 | 1 | 0 | 1 | python,bash,unix,crontab | 31,025,417 | 2 | true | 0 | 0 | The working directory of the cron is different from the directory you run the script directly.
Make your bash script to use absolute path for python script files.
Or make the bash script to change directory to where you run the script directly. | 1 | 1 | 0 | I have a bash script to automate few things I do. The bash calls 2 python scripts, If I run the bash script normally, everything runs, no errors what so ever. I set up a cron job to Automate this and when I checked the logs I noticed the python scripts don't run at all. It gives me the following error.
python: can't op... | Crontab, python script fails to run | 1.2 | 0 | 0 | 1,804 |
31,027,840 | 2015-06-24T13:24:00.000 | 3 | 0 | 1 | 0 | python,arrays,linked-list,dynamic-arrays | 31,028,040 | 1 | true | 0 | 0 | Yes, it does. Removing a link from a linked list is O(1), while it is linear for a dynamic array.
Suppose you want to build a data structure for an LRU. Typically, you would have a hash-table for "touch" operations, plus a sequence array to see what has aged. When an item is accessed, the hash table finds it in the seq... | 1 | 2 | 0 | Does a linked list have any value in a language which has dynamic arrays, such as Python (which, of course, has the list data structure)?
I currently understand a list in python to really just be a static array which, as more data is inserted, redefines itself as a new array (larger in size) copying the data from the o... | Does a linked list have any value in a language which has dynamic arrays? | 1.2 | 0 | 0 | 66 |
31,028,239 | 2015-06-24T13:40:00.000 | 0 | 1 | 0 | 0 | python,json,tweepy | 31,028,615 | 1 | false | 0 | 0 | There is no specific GETfeature that would allow that.
What you'll need to do is create a search for that keyword and Get search/tweets and use the since_id and max_id like you have and look at time_created_at from the JSON and filter yet again using that.
The problem with the previous step is that you're limited to 1... | 1 | 2 | 0 | Im using tweepy to search for a keyword in all tweets in the last 5 minutes. But I couldn't find a way to do this. I saw the since_id and max_id arguments, but they only work if I know the tweet_id before 5 minutes. | Using tweepy: how to retrieve all tweets within past 5 minutes | 0 | 0 | 1 | 3,078 |
31,029,523 | 2015-06-24T14:35:00.000 | 1 | 0 | 1 | 0 | python,python-2.7 | 31,029,658 | 1 | true | 0 | 0 | You can’t do this with time.sleep(). However, you can use the output of time.time() which gives you the number of seconds since Jan, 1st 1970, based on your computer’s clock. It’s then easy to store this value in variables when you start and stop the timer and to compare them to get the elapsed time. | 1 | 0 | 0 | I've found a lot of similar questions to this, and maybe a more astute mind would have been able to figure this out through inference. Unfortunately I have very limited experience in Python, bear with me.
What I'm trying to do is create a Pomodoro timer, which in itself is very simple, but I can't seem to find out how ... | How to pause Python's time.sleep() function? | 1.2 | 0 | 0 | 641 |
31,031,503 | 2015-06-24T16:03:00.000 | -11 | 0 | 1 | 0 | python,function,module,python-import | 31,031,981 | 5 | false | 0 | 0 | 1.Open in editor
2. Find the definition
3. Copy paste the old fashioned away
Simplest solution is sometimes the dirtiest. | 1 | 14 | 0 | I need to import only a single function from another python file which runs stuff in it, but when I import the function, it runs the entire code instead of importing just the function I want. Is there anyway to only import a single function from another .py file without running the entire code? | Import a python module without running it | -1 | 0 | 0 | 22,060 |
31,035,318 | 2015-06-24T19:27:00.000 | 0 | 0 | 0 | 0 | python,django,httpresponse | 31,035,689 | 2 | false | 1 | 0 | Yes that's a way to parse HTML into a DOM tree. If other people don't do that, they might have other requirements.
In general your idea is not bad, it might require more CPU time then other testing method (for example regular expressions. But if it fits your needs for testing, just do it. Performance it rarely a probl... | 1 | 0 | 0 | I want to do a unit test on a html page which is returned as a byte string in an HttpResponse object... e.g. "find_elements_by_tag_name". Is the solution simply to xml.dom.minidom.parseString the bytes of response.content?
I couldn't find any examples of people doing this online or in Django manuals or tutorials, wh... | Django get a DOM object from an HttpResponse | 0 | 0 | 1 | 627 |
31,037,748 | 2015-06-24T21:51:00.000 | 2 | 0 | 0 | 0 | android,python,scale,kivy,screen-density | 31,038,234 | 1 | false | 0 | 1 | Using size_hint alone already guarantees a degree of scale independence, as (as you note) all the sizes will be relative.
Kivy internally checks some resolution related values of the device, and this is basically the point of dp; something like dp(10) for instance should be the same actual size on any device, in terms ... | 1 | 1 | 0 | I am trying to get my game to look/scale well across different devices. I am attempting to introduce the dp and sp metrics into my apps as much as possible, but in this case I am refactoring a game to use these metrics for layout and widget sizing.
Where before, my layouts were sized using size_hint in order to have e... | Proper usage of metrics with Kivy(So GUI scales well across devices) | 0.379949 | 0 | 0 | 766 |
31,045,708 | 2015-06-25T08:59:00.000 | 1 | 1 | 0 | 0 | python,selenium,robotframework,xvfb | 36,692,169 | 2 | false | 1 | 0 | Yes there is with Xvfb installed.
In very short:
/usr/bin/Xvfb :0 -screen 0 1024x768x24&
export DISPLAY=:0
robot your_selenium_test | 1 | 3 | 0 | I prepare some test suites for an e-commerce web site, so i use Selenium2Library which requires a running browser on a display. I am able to run these test on my local machine but i had to run them on remote server which does not have an actual display. I tried to use xvfb to create a virtual display but it did not wor... | Is there anyway to run robot framework tests without a display? | 0.099668 | 0 | 1 | 2,600 |
31,054,656 | 2015-06-25T15:30:00.000 | 4 | 0 | 0 | 0 | python,twitter,tweepy | 31,058,208 | 2 | false | 0 | 0 | If you're only concerned with tweets, use on_status(). This will give you what you needed without the added information and doing so will not hinder your limit.
If you want detailed information use on_data(). --That's rarely the case unless you're doing heavy analysis. | 1 | 10 | 0 | I just started using tweepy library to connect with streaming api of twitter. I encountered both on_status() and on_data() methods of the StreamListener class. What is the difference? Total noob here! | What is the difference between on_data and on_status in the tweepy library? | 0.379949 | 0 | 1 | 7,894 |
31,058,446 | 2015-06-25T18:49:00.000 | 0 | 0 | 0 | 0 | python,3d,geometry,computational-geometry | 31,058,586 | 2 | true | 0 | 0 | Get the normal vector of the plane. (you can make a cross product between two non parallel vectors in the plane for that).
Take the velocity vector components relative to the normal vector and:
Make parallel component negative
Keep perpendicular components the same.
Following an approach similar to @jacdeh:
Normali... | 2 | 2 | 1 | I am trying to simulate a particle bouncing off the sides of a cylinder (inside) or any closed curved surface in 3 dimensions.
At the moment of interaction with the surface, I have the position vector, the velocity vector, and the plane tangent to the surface at the intersection, and I am looking to derive the new vel... | How to model particle bouncing off of a curved surface in 3D? | 1.2 | 0 | 0 | 222 |
31,058,446 | 2015-06-25T18:49:00.000 | 0 | 0 | 0 | 0 | python,3d,geometry,computational-geometry | 31,058,674 | 2 | false | 0 | 0 | Compute normal vector as cross product of two tangent vectors to your surface
Normalize it to get unit normal
Compute inner product (dot product) of minus velocity and normal vector
Multiply inner product with unit normal to get projection on normal
Subtract projection on normal from minus velocity
Add that to projecti... | 2 | 2 | 1 | I am trying to simulate a particle bouncing off the sides of a cylinder (inside) or any closed curved surface in 3 dimensions.
At the moment of interaction with the surface, I have the position vector, the velocity vector, and the plane tangent to the surface at the intersection, and I am looking to derive the new vel... | How to model particle bouncing off of a curved surface in 3D? | 0 | 0 | 0 | 222 |
31,059,562 | 2015-06-25T19:52:00.000 | 0 | 0 | 0 | 1 | python,windows-7,scheduled-tasks | 31,075,460 | 1 | false | 0 | 0 | While I had the Task Scheduler open, the screen was showing "running". After I closed the screen and let it run the next day, everything worked fine. It must be something to do with the refresh on the task scheduler.
So my solution was to close the Task Scheduler and let it run as scheduled. | 1 | 1 | 0 | I'm a noobie to python and have over the past few days tested and created a .PY file that runs perfectly from the command prompt either with the D:\Python34 or just as
Its pretty basic. Gets info from web and places it in a spreadsheet - I import requests, BeautifulSoup and openpyxl. The last statement is to save th... | python script via windows 7 scheduler still running | 0 | 0 | 0 | 627 |
31,060,517 | 2015-06-25T20:48:00.000 | 5 | 1 | 1 | 0 | python | 31,061,329 | 1 | true | 0 | 0 | Look at sys.excepthook. As its name suggests, it's a hook into the exception. You can use it to send you an email when exceptions are raised. | 1 | 5 | 0 | i have a scenario where some unknown exceptions may be raised during program execution and i can't except most of them and i want every time any exception will raise an email should send to me as exceptions cause program to terminate if not properly catch!
so i have read about python provide atexit module but it did no... | how to use atexit when exception is raised | 1.2 | 0 | 0 | 2,151 |
31,062,620 | 2015-06-25T23:43:00.000 | 6 | 0 | 1 | 0 | python,scikit-learn | 31,062,641 | 1 | true | 0 | 0 | Use the __module__ attribute, i.e.: Ridge.__module__
If you want to know it from an instance of the class: inst.__class__.__module__
If you need the module object (not just the name as string): sys.modules[Ridge.__module__] | 1 | 4 | 1 | Is there any way to determine where a class is coming from in python (especially sklearn)? I want to determine if a class is from sklearn.linear_models or sklearn.ensemble.
As an example, I would like to be able to determine if Ridge() is a member of sklearn.linear_model.
The fit function is a bit different dependin... | Determine where a class is imported from in python | 1.2 | 0 | 0 | 62 |
31,066,456 | 2015-06-26T06:33:00.000 | 0 | 0 | 0 | 0 | php,python,ios,server,backend | 31,067,192 | 2 | false | 1 | 0 | No it should not cause an error, you are requesting the server with an HTTP method(POST) which serves every request from a new user as a new request because HTTP is a stateless protocol it doesn't save user states(unless you are managing user sessions explicitly)
So if 100 users are requesting at the same time, they ar... | 1 | 2 | 0 | I have an iOS app that is send a POST request to my server and then it runs a function and returns some data back to the app.
My question is if my app has lets say 100 people using it at the same time and make the POST request in quick succession, is this going to case an error?
I am on a shared server if that matters... | Send multiple POST requests a once | 0 | 0 | 1 | 1,192 |
31,067,386 | 2015-06-26T07:25:00.000 | 1 | 0 | 0 | 0 | python,django,authentication,django-socialauth | 31,069,180 | 1 | true | 1 | 0 | To override the default django user model use AUTH_USER_MODEL. To use django-social-auth with the new model point to it by using SOCIAL_AUTH_USER_MODEL. Both use auth.User by default. | 1 | 0 | 0 | A bit frustrated about this.
What the difference between those options?
Which I need to use to override default django user model?
What the value SOCIAL_AUTH_USER_MODEL has by default? | What the difference between SOCIAL_AUTH_USER_MODEL(django-social-auth) and AUTH_USER_MODEL(Django)? | 1.2 | 0 | 0 | 1,091 |
31,068,381 | 2015-06-26T08:23:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,virtual-machine,google-cloud-platform | 31,260,767 | 1 | true | 1 | 0 | Sticking with the described POST request using urllib2. We decided we might move this part of the project to a different provider so better to not use Google Cloud only methods. | 1 | 1 | 0 | My website runs on Python on Google App Engine, and I've setup a Virtual Machine to use libraries that weren't supported by the default App Engine environment. Now I need to send data from my app to the VM and retrieve the response. Data in this case will be an email address and an email message.
Currently I am testin... | Processing data from Google App Engine on a Google Virtual Machine | 1.2 | 0 | 0 | 47 |
31,068,690 | 2015-06-26T08:43:00.000 | 0 | 0 | 0 | 0 | python,flask,scalability,binaryfiles | 31,069,570 | 2 | false | 1 | 0 | Pickle files is good way to load data in python. By the way consider using the C implementation: cPickle.
If you want to scale, using pickle files. Ideally you want to look for a partition key, that fits for your data and your project needs.
Let's say for example you have historical data, instead of having a single fil... | 1 | 2 | 0 | I am working on my first web application. I am doing it in Python with Flask, and I want to run a piece of Python code that takes an object, with Pickle, from a (binary) file of several MB which contains all the necessary data. I have been told that so using Pickle in a web app is not a good idea because of scalability... | Is it feasible to unpickle large amounts of data in a Python web app that needs to be scalable? | 0 | 0 | 0 | 1,053 |
31,069,347 | 2015-06-26T09:16:00.000 | 1 | 0 | 0 | 0 | python,html,django,if-statement | 31,069,665 | 4 | false | 1 | 0 | There is no if-then control explanation in HTML, or whatever other programming capacities. HTML is a markup dialect. Writing computer programs isn't conceivable.
Css will permit you to pick between styles in light of classes and IDs.
You can do this sort of thing with JavaScript, yet you can keep it straightforward w... | 2 | 0 | 0 | I have a Django project that consists of many html pages.
I want to add an if else condition inside my html tag to return "None" whenever the time stamp = 0000-00-00 00:00:00 and return the time when it's not. My code is shown below, I used a tag to get the time in date format.
<td>{{ table.start_time|date:"Y-m-d G:i:... | If, Else inside html using Django templates | 0.049958 | 0 | 0 | 4,761 |
31,069,347 | 2015-06-26T09:16:00.000 | 2 | 0 | 0 | 0 | python,html,django,if-statement | 31,070,870 | 4 | true | 1 | 0 | I just used another tag:
<td>{{ table.start_time|date:"Y-m-d G:i:s"|default:"None"}}</td>
Thanks all!! | 2 | 0 | 0 | I have a Django project that consists of many html pages.
I want to add an if else condition inside my html tag to return "None" whenever the time stamp = 0000-00-00 00:00:00 and return the time when it's not. My code is shown below, I used a tag to get the time in date format.
<td>{{ table.start_time|date:"Y-m-d G:i:... | If, Else inside html using Django templates | 1.2 | 0 | 0 | 4,761 |
31,069,449 | 2015-06-26T09:20:00.000 | 0 | 0 | 0 | 0 | python,django,cloud | 31,069,855 | 2 | false | 1 | 0 | Developing directly in production environment is highly discouraged. You should develop locally using version control systems (git) and test suites to check everything works before the deploy.
Once you've checked everything works, you can pull changes from the remote repository to apply the modifications or use somethi... | 1 | 0 | 0 | I have been working with Django on Linux with Sublime Text for a while, but I constantly switch to Windows for graphics design and gaming. I wonder what's the most effective way to develop Django completely in the cloud without having to setup new Django environment for every OS I touch. It would be fantastic if I can ... | How to fully develop Django projects in the cloud? | 0 | 0 | 0 | 134 |
31,073,993 | 2015-06-26T13:07:00.000 | 0 | 1 | 0 | 1 | python,git,salt-stack | 31,254,893 | 3 | true | 0 | 0 | If you need the highstate on the minion to cause something to occur on the master than you are going to want too look into using salt's Reactor (which is designed to do exactly this kind of multi-machine stuff). | 2 | 0 | 0 | I allow myself to write to you, due to a block on my part at Salt.
I made a bash script that adds a host in my zabbix monitoring server. it works perfectly when I run .sh
the idea is that I want to automate this configuration through salt. I am when I do a highstate my state that contains the script runs in the master ... | Run script bash on saltstack master before minion | 1.2 | 0 | 0 | 905 |
31,073,993 | 2015-06-26T13:07:00.000 | 0 | 1 | 0 | 1 | python,git,salt-stack | 31,083,687 | 3 | false | 0 | 0 | Run a minion on the same box as your master, then you can run the script on your master's minion and then on the other server. | 2 | 0 | 0 | I allow myself to write to you, due to a block on my part at Salt.
I made a bash script that adds a host in my zabbix monitoring server. it works perfectly when I run .sh
the idea is that I want to automate this configuration through salt. I am when I do a highstate my state that contains the script runs in the master ... | Run script bash on saltstack master before minion | 0 | 0 | 0 | 905 |
31,074,329 | 2015-06-26T13:22:00.000 | 2 | 0 | 1 | 1 | python,windows,pycparser | 31,080,381 | 1 | true | 0 | 0 | The documentation is one and the same. You cannot effectively use pycparser without a basic understanding of how the C compilation pipeline works - sorry!
The documentation actually addresses Windows directly. The only difference is that instead of relying on a system C compiler (on Linux) you have to explicitly downlo... | 1 | 1 | 0 | We can support new typedefs , #includes and #defines , by preprocessing it with the help of pycparser parse_file . I also went through the documentation: README page and the blog post , but all the documentation was written for linux systems.I have no clue about linux systems and would love to get the documentation fo... | Including Fake-headers via pycparser in Windows? | 1.2 | 0 | 0 | 261 |
31,074,551 | 2015-06-26T13:32:00.000 | -1 | 0 | 1 | 0 | python,executable | 31,074,610 | 1 | false | 0 | 0 | There are several such utilities
I've used py2exe from py2exe.org | 1 | 0 | 0 | which might not even have Python. I'm making dozens of scripts for my company but it only just now dawned on me that people might not even be able to use them.
I'm asking here because I'm not sure what keywords I would use on Google.
So the question is - can I somehow package Python+external libraries into one executab... | Launch python script from other computers | -0.197375 | 0 | 0 | 62 |
31,075,271 | 2015-06-26T14:04:00.000 | 1 | 0 | 1 | 0 | ironpython | 31,115,541 | 1 | true | 0 | 0 | somestring[:-1] is a correct answer also for IronPython | 1 | 0 | 0 | How to remove last char from string in IronPyhon ?
I am looking for a Substring method or sth similar. | How to remove last char from string in IronPyhon? | 1.2 | 0 | 0 | 572 |
31,075,818 | 2015-06-26T14:30:00.000 | 1 | 0 | 1 | 1 | python-2.7,pip | 31,088,517 | 1 | true | 0 | 0 | I have solved my problem:
When I have tried to run get-pip, I have right-clicked on the file get-pip.py and I have chosen "Python Launcher for Windows" to run it. Instead, I should have opened the command prompt in the right folder and I should have written "python get-pip.py". | 1 | 1 | 0 | I have installed Python2.7 on Windows. I tried to install pip, so I downloaded get-pip, then I run it but it didn't install anything in "scripts" in python27, neither in Python27/Tools/Scripts | Why haven't I got "Scripts" in Python27 on Windows? | 1.2 | 0 | 0 | 1,848 |
31,077,965 | 2015-06-26T16:27:00.000 | 2 | 0 | 0 | 0 | django,facebook,python-social-auth | 31,138,364 | 2 | false | 1 | 0 | I did wrong Facebook app setup. In the Security / Server IP Whitelist I put 127.0.0.1 address. The problem was gone after removing this address (blank space is okey). | 2 | 0 | 0 | I am trying to implement website login using Facebook credentials. I see different responses when I press Cancel on Facebook widget or Okay. When I press Cancel I see the following
Environment:
Request Method: GET
Request URL: http://wakevent.com/complete/facebook/?redirect_state=cvZGNl42bKvgcDDDezBy14V... | Django Python Social Auth, Authentication Canceled by Facebook app | 0.197375 | 0 | 0 | 3,048 |
31,077,965 | 2015-06-26T16:27:00.000 | 0 | 0 | 0 | 0 | django,facebook,python-social-auth | 36,288,484 | 2 | false | 1 | 0 | Check the redirect URL. I had wrongly specified redirect URL along with client ID while making post request. For Facebook redirect URI is optional. Try removing that and it will work fine. | 2 | 0 | 0 | I am trying to implement website login using Facebook credentials. I see different responses when I press Cancel on Facebook widget or Okay. When I press Cancel I see the following
Environment:
Request Method: GET
Request URL: http://wakevent.com/complete/facebook/?redirect_state=cvZGNl42bKvgcDDDezBy14V... | Django Python Social Auth, Authentication Canceled by Facebook app | 0 | 0 | 0 | 3,048 |
31,079,888 | 2015-06-26T18:30:00.000 | 0 | 0 | 1 | 0 | python,excel,parsing,openpyxl | 31,088,239 | 1 | false | 0 | 0 | This will be possible in version 2.3. | 1 | 0 | 1 | I'm writing a parsing script in python and am curious as to how I could create a graph with two axis's under different data ranges.
Is this possible in openpyxl? | Multi-Axis Graph using the OpenPyxl library in Python | 0 | 0 | 0 | 196 |
31,080,295 | 2015-06-26T18:56:00.000 | 0 | 0 | 1 | 0 | python,file-io | 31,080,371 | 4 | false | 0 | 0 | File objects are generators, so they will continue from the next line. | 2 | 0 | 0 | I am passing a file object as an argument to a function in Python. Inside this function I want to read the content of the file passed as an argument.
Will I be able to read the file from the beginning or will it continue from the last line read before passing it to the current function ? | Python File Object | 0 | 0 | 0 | 879 |
31,080,295 | 2015-06-26T18:56:00.000 | 6 | 0 | 1 | 0 | python,file-io | 31,080,353 | 4 | false | 0 | 0 | This is something you could easily find out yourself by testing. The filehandle remembers it's current line so it will continue reading where it left of. | 2 | 0 | 0 | I am passing a file object as an argument to a function in Python. Inside this function I want to read the content of the file passed as an argument.
Will I be able to read the file from the beginning or will it continue from the last line read before passing it to the current function ? | Python File Object | 1 | 0 | 0 | 879 |
31,080,544 | 2015-06-26T19:12:00.000 | 2 | 0 | 0 | 0 | python,flask,flask-admin | 31,249,046 | 1 | false | 1 | 0 | This option was removed because you can explicitly add id field to the create and edit forms. | 1 | 0 | 0 | Previous version of Flask-Admin had a hide_backrefs option which could be set to False if you wanted to show them in the admin view.
The current version seems to have it no longer. Does it go by some other name? If I want to display backreferences in the admin list view, is there a better solution than just manually se... | Where did Flask-Admin's `hide_backrefs` option go? How to display backrefs in admin list view? | 0.379949 | 0 | 0 | 115 |
31,082,231 | 2015-06-26T21:12:00.000 | 0 | 0 | 1 | 0 | python,algorithm | 31,084,184 | 1 | false | 0 | 0 | I just don't see how I can find the exact intervals where there are anomalies using windows.
You can't. How do you know there aren't two anomalies?
Is there an approximation method that anyone can come up with?
For each interval of windows where there is continuously an anomaly detected, assume that there is an anom... | 1 | 0 | 0 | I've been trying to determine how to detect point-anomalies given window-anomalies.
In more detail, I know for each 30-day window whether it contains an anomaly. For example, window 1 starts at 1/1/2009, window 2 at 1/2/2009, and so on.
Now I'm trying to use this knowledge to determine which dates these anomalies lie. ... | how to determine point anomalies given window anomalies? | 0 | 0 | 0 | 43 |
31,092,232 | 2015-06-27T18:41:00.000 | 0 | 0 | 1 | 0 | python,matplotlib,import,module,importerror | 52,132,286 | 1 | false | 0 | 0 | Try pip uninstall matplotlib then python -mpip install matplotlib see if it helps. Otherwise, i'd recommend using a virtual environment which you can install using sudo easy_install virtualenv or pip install virtualenv This way you could just install and use matplotlib by following these steps:
Create a new virtual en... | 1 | 1 | 1 | I installed matplotlib using (pip install --user matplotlib) and the installation was successful. when I try to import it using (import matplotlib) in python shell I get this error:
Traceback (most recent call last):
File "", line 1, in
import matplotlib
ImportError: No module named matplotlib
I couldn't find a... | Cant import matplotlib on python 2.7.5 | 0 | 0 | 0 | 3,341 |
31,093,986 | 2015-06-27T22:05:00.000 | 0 | 0 | 0 | 0 | python,numpy,mpmath,gmpy | 31,280,601 | 3 | false | 0 | 0 | As far as I'm aware, there is no existing Python library that supports vectorized array operations on multiple precision values. There's unfortunately no particularly efficient way to use multiple precision values within a numpy ndarray, and it's extremely unlikely that there ever will be, since multiple precision valu... | 1 | 1 | 1 | Numpy is a library for efficient numerical arrays.
mpmath, when backed by gmpy, is a library for efficient multiprecision numbers.
How do I put them together efficiently? Or is it already efficient to just use a Numpy array with mpmath numbers?
It doesn't make sense to ask for "as efficient as native floats", but you c... | Efficient multiple precision numerical arrays | 0 | 0 | 0 | 807 |
31,096,527 | 2015-06-28T05:43:00.000 | 1 | 0 | 1 | 0 | python,powershell,virtualenvwrapper | 37,604,982 | 2 | false | 0 | 0 | You need to paste the VirtualEnvWrapper folder in the following directory. It works for me
**
`
C:\Windows\System32\WindowsPowerShell\v1.0\Modules
`
** | 1 | 1 | 0 | I am using powershell.
I successfully installed virtualenvwrapper-powershell.
But when I typed 'Import-Module virtualenvwrapper', I got an error as following:
PS C:\Python27> Import-Module virtualenvwrapper Import-Module : The
specified module 'virtualenvwrapper' was not loaded because no valid
module file wa... | Import-Module virtualenvwrapper | 0.099668 | 0 | 0 | 3,277 |
31,096,849 | 2015-06-28T06:33:00.000 | 2 | 0 | 0 | 0 | python,matlab | 31,097,467 | 1 | false | 0 | 0 | Matlab comes with it's own python Installation which is located in your Matlab installation directory. There these 3rd party libraries are probably not installed.
Go to the python folder inside the Matlab installation directory, search for pip and use it to install the libraries you need. | 1 | 2 | 1 | As matlab2015a has been able to support python. But it seems it can only call standard library in matlab. If I want to import other library such as numpy, scipy or sklearn, what should I do? And can I execute the python script directly. Unfortunately, the offical document of matlab has not given enough explanations. If... | call python from matlab2015a | 0.379949 | 0 | 0 | 88 |
31,098,228 | 2015-06-28T09:40:00.000 | 2 | 0 | 0 | 0 | python,numpy,matrix,equation-solving | 48,433,206 | 3 | false | 0 | 0 | You could add a row consisting of ones to A and add one to B. After that use
result = linalg.lstsq(A, B)[0]
Or you can replace one of A's rows to row consisting of ones, also replace value in B to one in the same row. Then use
result = linalg.solve(A, B) | 1 | 7 | 1 | I want to solve some system in the form of matrices using linalg, but the resulting solutions should sum up to 1. For example, suppose there are 3 unknowns, x, y, z. After solving the system their values should sum up to 1, like .3, .5, .2. Can anyone please tell me how I can do that?
Currently, I am using something l... | Solving system using linalg with constraints | 0.132549 | 0 | 0 | 9,737 |
31,098,786 | 2015-06-28T10:33:00.000 | 0 | 0 | 1 | 0 | python,window,parent | 31,100,428 | 3 | false | 0 | 1 | I don't think you will be able to do this easily. Notepad is using its own toolkit which, most probably, is not compatible with the one you are using.
If you want to open eg. an editor, look for a widget in the toolkit of your choice which does what you want (or nearly). Eg. if you want an editor, use the GtkTextView i... | 2 | 0 | 0 | I am new to python and want to learn this from the basic.
I want to open two other application like notepad in a single window. I searched for any examples by using "tkinter". Any idea for implementing this using "tkinter".
PS: two tabs one in left and one in right so that one tab will be having notepad and other will... | Opening other application in single window using python | 0 | 0 | 0 | 509 |
31,098,786 | 2015-06-28T10:33:00.000 | -1 | 0 | 1 | 0 | python,window,parent | 31,098,854 | 3 | false | 0 | 1 | For what you need, you will have to use libraries like tkinter or pyqt. As you want to learn it from the basic, I would suggest you to pick a GUI library and start learning it. Eventually you will know how to get the result that you desire. | 2 | 0 | 0 | I am new to python and want to learn this from the basic.
I want to open two other application like notepad in a single window. I searched for any examples by using "tkinter". Any idea for implementing this using "tkinter".
PS: two tabs one in left and one in right so that one tab will be having notepad and other will... | Opening other application in single window using python | -0.066568 | 0 | 0 | 509 |
31,105,836 | 2015-06-28T23:24:00.000 | 0 | 0 | 1 | 0 | python,tkinter,optionmenu | 31,127,939 | 2 | false | 0 | 1 | Try using the fg(or foreground) and bg(or background) options. If a is the menu, use:
a.entryconfig( optionindex , bg=" color_name " ) for the background, and
a.entryconfig( optionindex , bg= " color_name " ) for the foreground. | 1 | 1 | 0 | I am trying to make a Drop Down Menu of colors. Red Green Blue Yellow. I want the words inside the option box to be colored with their respected name. So the when the user clicks the arrow to open the optionMenu, Option red will have red letters. blue will have blue letters and so forth.
Is this Possible?
Thanks. | How do you change the color of the words in a Python Tkinter OptionMenu | 0 | 0 | 0 | 439 |
31,106,242 | 2015-06-29T00:32:00.000 | 0 | 0 | 0 | 0 | python,oop | 31,106,283 | 2 | false | 1 | 0 | That method is defined as def SetStrength(self, strength):. That means that, in addition to the self which is passed automatically, you need to provide an additional argument - in this case, the new strength value you'd like to set. It works very similarly to setName, which you call with an argument on the previous lin... | 1 | 0 | 0 | Error fixed - I only needed one parameter in the headers of the setters. Thanks | TypeError: SetStrength() missing 1 required positional argument: 'strength' | 0 | 0 | 0 | 84 |
31,106,542 | 2015-06-29T01:26:00.000 | 1 | 0 | 0 | 0 | python,xlwings | 31,110,844 | 1 | false | 0 | 0 | Ok, based on your comments I think I can answer your question: Actually, yes, xlwings can handle various instances. But workbooks from untrusted locations (like downloaded from the internet or sometimes on shared network drives) don't play nicely.
So in your case you could try to add the network location to File > Opti... | 1 | 1 | 0 | Is this a known limitation that will be addressed at some point, or is this just something that I need to accept?
If this is not possible with xlwings, I wonder if any of the other alternatives out there supports connecting to other instances.
I'm specifically talking about the scenario where you are calling python fro... | Does xlwings only work with the first instance of Excel? | 0.197375 | 1 | 0 | 1,096 |
31,109,330 | 2015-06-29T06:44:00.000 | 0 | 0 | 0 | 0 | python,bytearray | 31,109,570 | 1 | false | 0 | 0 | I think you should use the struct and namedtuple from collections module. Collect logical units into a namedtuple and use struct to pack/unpack those namedtuples. That's one of the most 'readable' and 'maintainable' ways of going about it.
Another thing to keep in mind is to read the file in binary mode and use read i... | 1 | 0 | 0 | I am currently doing work which programmatically attempts to manipulate PE files. The approach so far has been to parse out all the information (headers, variables within the headers, etc) from a raw array of bytes, representing the PE file.
As a result of this I currently have approximately 70 variables each pointing... | Updating Variables for Increased Bytearray Size | 0 | 0 | 0 | 94 |
31,111,488 | 2015-06-29T08:53:00.000 | 4 | 1 | 0 | 0 | python,eclipse,pydev | 34,672,189 | 1 | true | 0 | 0 | It seems I've found the solution:
Open Window -> Preferences, goto PyDev -> Editor -> Code Style -> File Types, look for "Valid source files (comma-separated)" and append ", log".
The file extensions listed in this filed are evaluated by FileTypesPreferencesPage.java:getDottedValidSourceFiles(), which is called by Pyth... | 1 | 2 | 0 | In Eclipse, I have the following Console output
Logfile: File "C:\temp2\file1.log", line 1
Testimplementierung: File "A:\TestSafety\file2.py", line 222
Both paths are shown as hyperlinks.
When I click these hyperlinks in Eclipse Kepler, the files are openend in the Python Text Editor (this is what I want).
When I cli... | Eclipse PyDev error message "compiled extension" | 1.2 | 0 | 0 | 914 |
31,112,366 | 2015-06-29T09:37:00.000 | 1 | 0 | 0 | 0 | java,python,tomcat,java-web-start | 31,113,115 | 1 | false | 1 | 0 | Java WebStart will install a desktop application into the cache of the client. That will run on the client not on the server, however you can easily create a webapplication as a service, i.e. on Tomcat. The webapp will be able to receive client requests, i.e. via RMI, RESTfull service or webservice, call the proprietar... | 1 | 0 | 0 | I have a Java application that needs to run the proprietary software PowerWorld on the server and then return output to the client side Web Start window. Is this possible? How do I go about doing this?
I am using Apache Tomcat to run the server. My Java code uses Runtime.exec() to run a Python script that runs PowerWor... | Can Java Web Start be used to run server-side programs? | 0.197375 | 0 | 1 | 94 |
31,113,114 | 2015-06-29T10:17:00.000 | 1 | 0 | 1 | 1 | windows,batch-file,python-3.x | 31,158,200 | 2 | true | 0 | 0 | I solved the problem by removing the path from normal python installation. I also uninstalled the normal python distribution. I also made a path to the python version in WinPython. Now I can use the normal cmd to run the program. :-) | 1 | 4 | 0 | How do I write an batch file that will execute a commando "python my_program.py" from the WinPython Command Prompt? Not from the cmd.exe! | Make an batch file that runs commando in WinPython Command Prompt | 1.2 | 0 | 0 | 4,820 |
31,117,704 | 2015-06-29T14:01:00.000 | 1 | 0 | 1 | 0 | python,error-handling,multiprocessing | 31,117,998 | 1 | false | 0 | 0 | If the error occurs in the communication process, you could use your existing socket to send a special task that asks the receiver to close. This would be received by one worker, that notifies the communication process (through some socket) that it is exiting, and then exits.
The communication process could basically f... | 1 | 0 | 0 | I have an application that creates one multiprocessing process for communication and n for workers. I would need to find a way to exit the whole application when there is an error somewhere or the user presses control-C.
// the agents are connected via zmq | Exiting a multiprocessing program on error | 0.197375 | 0 | 0 | 35 |
31,118,164 | 2015-06-29T14:22:00.000 | 0 | 0 | 0 | 1 | python,windows | 31,119,681 | 1 | false | 0 | 0 | The solution I came up with uses two batch files. One to run Load with an argument of 105 that is in the startup folder and the other batch file will be put on the desktop with a time of 45. Not my favorite solution, but it gets the job done and it's fairly easy to understand. | 1 | 1 | 0 | I wrote a program called load, to show a loading bar for 0:45 seconds while another program is starting which has no indication that it is loading. It works exactly as I want when the system is already running, but I have it so it runs at startup which causes the program to take a 1:45 to start. I am trying to figure o... | How to tell if windows processes have started | 0 | 0 | 0 | 34 |
31,118,668 | 2015-06-29T14:44:00.000 | 0 | 0 | 0 | 0 | python,events,grid,wxpython,wxwidgets | 31,124,993 | 1 | true | 0 | 1 | Adding event.Skip() at the end of my custom handler passes the event to the default handler. | 1 | 0 | 0 | In the program I'm writing, the user needs to be able to select a cell in the grid and edit its value. The program also shows what the value of the currently selected value is in hexadecimal (so (0,0) is 0x00, (1,3) is 0x19, etc.) I originally had this display be updated through a binding to the wx.grd.EVT_GRID_SELECT_... | In wxPython Grid, creating event handler for Cell Selection disables moving the GridCursor | 1.2 | 0 | 0 | 137 |
31,122,778 | 2015-06-29T18:18:00.000 | 0 | 0 | 1 | 0 | ipython-notebook,jupyter | 66,611,829 | 2 | false | 1 | 0 | Try refreshing the web page and download as .py should show up. | 1 | 0 | 0 | After I open Jupyter and write down codes, I want to download it as .py file, but it is always downloaded as HTML. How can I fix it? | IPython notebook Jupyter cannot download as .py | 0 | 0 | 0 | 1,573 |
31,123,293 | 2015-06-29T18:50:00.000 | 0 | 0 | 1 | 0 | python,pyqt | 31,123,417 | 2 | false | 0 | 1 | It depends on what you are looking to do. I have done it and it worked but there are other questions that can factor in like who will maintain or update the code, and do they know Python. You can look at cx_freeze for making a windows executable out of a python program as one of many options. | 2 | 0 | 0 | I'm wondering if python is a good choice to develop a desktop application for a small business.
Is it possible to build something using PyQT or even Swing + Jython ? How I can make a executable file at the end? | Is python a good choice to build a desktop application? | 0 | 0 | 0 | 2,859 |
31,123,293 | 2015-06-29T18:50:00.000 | 8 | 0 | 1 | 0 | python,pyqt | 31,123,686 | 2 | true | 0 | 1 | I've found Python to be an excellent choice for developing a broad scala of applications including desktop applications. I've developed in C++ for many years, and for parts that are really time critical I sometimes use it still, but for most of my code Python helps me get results much faster. There are several ways to ... | 2 | 0 | 0 | I'm wondering if python is a good choice to develop a desktop application for a small business.
Is it possible to build something using PyQT or even Swing + Jython ? How I can make a executable file at the end? | Is python a good choice to build a desktop application? | 1.2 | 0 | 0 | 2,859 |
31,123,357 | 2015-06-29T18:54:00.000 | 1 | 0 | 0 | 0 | jira,jira-plugin,jql,python-jira | 31,676,903 | 2 | false | 0 | 0 | One way of doing this stuff what you want to do is with Excel directly.
0. create the filter in JIRA
1. create a VBA for Excel script which will Open the Exported to Excel filter from JIRA. In order to do that you have to copy the link from JIRA, -> export -> Excel current fields.
2. Most probably you will have to log... | 1 | 1 | 0 | I have limited experience with Jira and Jira query language.
This is regarding JIRA Query language. I have a set of 124 rows (issues) in Jira that are under a certain 'Label' say 'myLabel'.
I need to extract columns col1, col2 and col5 for all of the above 124 rows where the Label field is 'myLabel'.
Once I have the a... | JQL to retrive specific columns for a cetain label | 0.099668 | 1 | 0 | 1,804 |
31,123,896 | 2015-06-29T19:24:00.000 | 0 | 0 | 0 | 0 | python,mongodb,cursor,pymongo | 31,413,796 | 2 | true | 0 | 0 | So far this has been my "slice/batch" solution and it has been much more effective than individually iterating each document from the cursor:
Keep note of the id field last document you have grabbed
Open a cursor with the query "Greater than _id of last doc" and with a limit of
whatever your batch_size is
Now you sho... | 1 | 1 | 0 | I am interested in using a cursor to duplicate a database from one mongod to another. I want to limit the amount of insert requests sent so instead of inserting each document in the cursor individually I want to do an insert_many of each cursor batch.
Is there a way to do this in pymongo/python?
I have tried converti... | How to insertmany from a cursor using Pymongo? | 1.2 | 1 | 0 | 1,052 |
31,124,088 | 2015-06-29T19:35:00.000 | 2 | 0 | 1 | 0 | python | 31,124,233 | 4 | false | 0 | 0 | If the file is not fixed length, you are out of luck. Some function will have to read the file. If the file is fixed length, you can open the file, use the function file.seek(line*linesize). Then read the file from there. | 1 | 2 | 0 | I am working with a very large text file (tsv) around 200 million entries. One of the column is date and records are sorted on date. Now I want to start reading the record from a given date. Currently I was just reading from start which is very slow since I need to read almost 100-150 million records just to reach that... | Python goto text file line without reading previous lines | 0.099668 | 0 | 0 | 791 |
31,124,202 | 2015-06-29T19:41:00.000 | 6 | 0 | 0 | 0 | python,django | 31,124,296 | 3 | false | 1 | 0 | If you are using the runserver command, you will see the output of print-statements in that command prompt, like a live logging. | 1 | 2 | 0 | I'm a near-total newbie to Django, and am trying to debug a piece of code which is returning a null list to a template even though it should be returning a list with items in it. Is there any way to print the list to the console from within views.py for debugging purposes? I obviously can't run python views.py as the i... | How do I print a list from views.py to the console? | 1 | 0 | 0 | 18,314 |
31,125,113 | 2015-06-29T20:36:00.000 | 0 | 0 | 1 | 1 | python,macos,bash,installation | 31,131,268 | 1 | false | 0 | 0 | Are you using python2 or python3? Dependencies for scapy differ. | 1 | 0 | 0 | I'm writing what is a relatively small desktop application, but I'm using several technologies/languages and not sure the best way to create a installer script.
I have a python script which uses tornado and scapy (which also requires pcapy), and have a kernel extension that needs to be installed.
This python script is ... | Installer script for OSX, python + node | 0 | 0 | 0 | 35 |
31,128,435 | 2015-06-30T02:07:00.000 | 1 | 0 | 1 | 0 | python,module,installation,pip | 31,128,500 | 2 | false | 0 | 0 | The easiest way is writting:
pip install beautifulsoup on the cmd or powershell
Another way:
Extract the file *.tar.gz
open the folder of the extractor on cmd
execute python setup.py install | 1 | 0 | 0 | I am completely new to python, and am unable to install python modules using
pip install, and from ____ import _____.
I want to use BeautifulSoup, and I have the tar.gz file in my directory:
C:\Python27\Lib
I don't have administrator's access to my laptop, but I can get someone who has it. Would this be a problem from ... | Unable to install python modules | 0.099668 | 0 | 0 | 176 |
31,128,840 | 2015-06-30T03:02:00.000 | -3 | 0 | 1 | 1 | python,python-2.7,ubuntu,tkinter,versions | 31,129,540 | 3 | false | 0 | 0 | You can delete the whole /usr/local directory and the system won't be affected because /usr/local is the directory defined by the user solely. When you freshly install Ubuntu /usr/local is empty | 1 | 2 | 0 | So apparently I have 2 Pythons (same version) installed in different folders...one is in /usr/bin/ and the other one is in /usr/local/bin but the one the shell uses when I type in python is the one in /usr/local/bin. I'd like to use the /usr/bin/ version because is the one that works with many imports I've been dealing... | Remove 1 version of Python in Ubuntu | -0.197375 | 0 | 0 | 2,398 |
31,129,801 | 2015-06-30T04:50:00.000 | 1 | 0 | 0 | 0 | javascript,php,python,node.js,api | 31,129,923 | 3 | false | 0 | 0 | There is definitely not 'the one and only' way to create an API.
However, checking the type of client is definitely not the way to go, as it would mean checking headers, which can be forged when sending the request.
For authentication, if you want to use different methods, your best bet is probably to have different au... | 1 | 0 | 0 | I want to create an api that various clients can connect to it like Web, Mobile platforms etc. My problem is that sometimes things are different with each client. For example i use different method for authentication for Web and Mobile platforms and my question is:
I have to create different files for each type of cl... | Creating clean and standard API with different type of clients | 0.066568 | 0 | 1 | 71 |
31,130,348 | 2015-06-30T05:37:00.000 | 2 | 0 | 0 | 0 | python,r,database,csv | 31,130,479 | 3 | false | 0 | 0 | Depending how much data is in each column and if you're planning to do statistical analysis, I would definitely go with R. If no analysis then python with pandas is a good solution. Do not use office for those files, it'll give you a headache.
If you're brave and your data is going to increase, implement MongoDB with e... | 1 | 1 | 1 | I have a CSV file with approximately 700 columns and 10,000 rows. Each of these columns contains attribute information for the object in column 1 of each row. I would like to search through this "database" for specific records that match a set of requirements based on their attribute information.
For instance, one co... | Does it make sense to use R to read in and search through extremely large CSV file? | 0.132549 | 0 | 0 | 104 |
31,130,960 | 2015-06-30T06:18:00.000 | 1 | 0 | 1 | 1 | python,windows,python-2.7,executable | 33,310,327 | 4 | false | 0 | 0 | Use VBScript:
1-> create anyname.vbs with this data:
Set wvbs=CreateObject("Wscript.Shell")
wvbs.run "full location of your File",0
2-> copy anyname.vbs file in C:\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup this folder
Now when windows start it will run your file in hidden mode | 1 | 2 | 0 | I am developing a key-logger on Python (only for curiosity sake). And the script will be an executable. Without access to the computer so the process should not need a UI or user interaction.
Is there any way, even in another executable to make the key-logger start at start-up ? | Run a Python program at start-up on Windows | 0.049958 | 0 | 0 | 11,230 |
31,131,855 | 2015-06-30T07:13:00.000 | 1 | 0 | 0 | 0 | python,scala,apache-spark | 31,134,116 | 1 | false | 0 | 0 | If your data doesn't have newlines in then a simple text-based format such as TSV is probably best.
If you need to include binary data then a separated format like protobuf makes sense - anything for which a hadoop InputFormat exists should be fine. | 1 | 0 | 1 | I have python scripts (no Spark here) producing some data files, that I want to be readable easily as Dataframes in a scala/spark application.
What's the best choice ? | A file format writable by python, readable as a Dataframe in Spark | 0.197375 | 0 | 0 | 57 |
31,137,204 | 2015-06-30T11:37:00.000 | 2 | 0 | 0 | 0 | python,scapy,man-in-the-middle | 31,139,789 | 1 | false | 0 | 0 | What you need sounds more like a proxy. What kind of protocol you try to inject into? If it was HTTP it would be easy - take any HTTP proxy and mitm away.
Or you can use something like socksify, but I am not aware of anything working on Windows. Or you need something that works as a network driver.
You cannot easily ac... | 1 | 2 | 0 | I want to catch a packet my computer is sending, modify it and send it. I can't use sniff, because it gives me a copy of the packet. The packet itself is sent.
I want to stop the sending of the packet, change it and then send it forward - MitM attack.
How can I do it using scapy? | Python - Man in the Middle | 0.379949 | 0 | 1 | 1,594 |
31,142,810 | 2015-06-30T15:46:00.000 | 1 | 0 | 1 | 0 | ipython-notebook,jupyter | 31,546,622 | 2 | false | 0 | 0 | If you are handy with jQuery, you can edit IPython's static files and customize the "tree" page you are referring to.
On my Ubuntu machine I could manipulate the page by editing the file /usr/local/lib/python2.7/dist-packages/IPython/html/static/tree/js/notebooklist.js | 1 | 7 | 1 | How can I change the sort order of files in the notebook list? I would like it to be alphabetical for all file types and not case sensitive. Directories can appear before files or within the files.
Currently my list is sorted as follows:
- Directories (starting with upper case)
- directories (starting with lower case)... | Sort (sorting) order of files in notebook list | 0.099668 | 0 | 0 | 2,153 |
31,145,860 | 2015-06-30T18:35:00.000 | 5 | 0 | 1 | 0 | python,regex | 31,145,877 | 1 | true | 0 | 0 | Don't use regexes for that. s.split(',') will do exactly what you want. | 1 | 0 | 0 | There are several questions regarding this topic, but none of them seem to answer this question specifically.
If I have the pattern p='([0-9]+)(,([0-9]+))*' and s='1,2,3,4,5' and I run m = re.match(p, s, 0) I get a match (as expected). However, I would like to be able to print the list ('1', '2', '3', '4', '5'). I ... | How to match and print list of comma separated numbers in python? | 1.2 | 0 | 0 | 507 |
31,148,582 | 2015-06-30T21:11:00.000 | 4 | 0 | 0 | 0 | python,r,nlp,nltk,wordnet | 31,157,260 | 5 | false | 0 | 0 | Your best bet is probably is to label the clusters manually, especially if there are few of them. This a difficult problem even for humans to solve, because you might need a domain expert. Anyone claiming they could do that automatically and reliably (except in some very limited domains) is probably running a startup a... | 1 | 9 | 1 | The context is : I already have clusters of words (phrases actually) resulting from kmeans applied to internet search queries and using common urls in the results of the search engine as a distance (co-occurrence of urls rather than words if I simplify a lot).
I would like to automatically label the clusters using sema... | How to automatically label a cluster of words using semantics? | 0.158649 | 0 | 0 | 3,398 |
31,165,248 | 2015-07-01T15:13:00.000 | 1 | 0 | 1 | 1 | python,windows,neo4j | 31,165,664 | 1 | false | 0 | 0 | py2Neo is a library which you can generate/configure/manipulate Neo4j graph database. It is not an executable application. As far as your Python works on Windows, py2neo should work as well. You can download py2neo via pip install as you can download many libraries as well. | 1 | 0 | 0 | I would like to use Neo4j from Python in Windows 7 operating system. Which library can I install? Py2Neo seems to work for Linux and Mac but not for Windows. | Neo4j from Python in Windows 7 | 0.197375 | 0 | 0 | 340 |
31,167,283 | 2015-07-01T16:50:00.000 | 0 | 0 | 1 | 0 | python,dependencies,pyqt4,setuptools,setup.py | 31,167,583 | 1 | false | 0 | 1 | A search of the Python Package Index reveals it's actually python-qt. Annoying, but I suppose it works.
EDIT: Actually, it's not. See the comments below. | 1 | 1 | 0 | I'm creating a setup.py install script for my upcoming PyQt application. The PyQt modules are all spelled with camel case as opposed to the standard module name conventions, and I can't find what name to use in the setup script.
What is the name of the PyQt4 module to be used in the install_requires field of setup()? | PyQt4 as dependency in setup script | 0 | 0 | 0 | 432 |
31,167,457 | 2015-07-01T16:59:00.000 | 2 | 0 | 0 | 0 | python,django | 31,168,478 | 1 | false | 1 | 0 | In short, yes.
You need to know which users need to change their password. If you don't want to use a custom User model, I would recommend having another model to store the users that need to change their password. You would add the users to this table upon user registration/creation.
Then you could write a very simple... | 1 | 1 | 0 | I would like to force the user to change their password on first login. Can I do this with the default django authentication system? | Require the user to change their password on first login? | 0.379949 | 0 | 0 | 2,193 |
31,167,717 | 2015-07-01T17:14:00.000 | -1 | 0 | 1 | 0 | python,list,iterator,listiterator | 31,167,984 | 1 | false | 0 | 0 | Iterating order is guaranteed for lists, but not for dictionaries or sets. This holds for both python 2 and 3, and is VERY unlikely to be ever changed. | 1 | 1 | 0 | As far as I can see in Python 2.7, the iterator of a list traverse the list in an increasing-index order. I would like to know if this order is guaranteed by Python 2/3, or is this order clearly defined as the behavior of a list iterator.
In other words, if I want to traverse the list in an increasing-index order (and ... | Does Python guarantee the traversal order of a list iterator? | -0.197375 | 0 | 0 | 1,278 |
31,169,430 | 2015-07-01T18:54:00.000 | 0 | 0 | 1 | 0 | python,matrix,virtual-machine,sage | 31,186,231 | 1 | true | 0 | 0 | Sage can only use its own Python, if that makes sense. On Windows there are a lot of problems with certain components of Sage compiling properly (non-Python components, of course) which is why there is not a 'native port', though Cygwin should work okay if that is an option for you. From what I hear it's not too diff... | 1 | 0 | 0 | I'm writing code that is really heavy on linear algebra, specifically matrix operations. Because the matrices I'm using are very large, I'm running out of memory when I use the SymPy library. I think I can do what I want to in with Sage, but for my purposes I can't run my code in a VM. It has to be on my host OS. Witho... | Using Sage as a Python library (Windows) | 1.2 | 0 | 0 | 152 |
31,171,941 | 2015-07-01T21:22:00.000 | 8 | 0 | 1 | 0 | python,multiprocessing,python-multiprocessing | 31,356,196 | 1 | true | 0 | 0 | When you create a Pool of worker processes, new processes are spawned from the parent one. This is a very fast operation but it has its cost.
Therefore, as long as you don't have a very good reason, for example the Pool breaks due to one worker dying unexpectedly, it's better to always use the same Pool instance.
The ... | 1 | 8 | 0 | I'm trying to understand the best practices with Python's multiprocessing.Pool object.
In my program I use Pool.imap very frequently. Normally every time I start tasks in parallel I create a new pool object and then close it after I'm done.
I recently encountered a hang where the number of tasks submitted to the pool ... | Should I create a new Pool object every time or reuse a single one? | 1.2 | 0 | 0 | 3,782 |
31,172,195 | 2015-07-01T21:41:00.000 | 3 | 0 | 1 | 0 | python | 31,172,218 | 2 | false | 0 | 0 | In computer science, the term "flush" doesn't mean to erase what's already in a buffer; rather, it means to take the unwritten contents of a buffer in memory (like the stdout buffer) and write it, in this case to the screen. So when you tell the program to "flush stdout", you're really just telling it to "take what's i... | 1 | 1 | 0 | What I'm trying to do is have some 'progress text' on the bottom of a script that I've creating. If I for loop a list [1,2,3,4,5] and print i, then it simply prints 1,2,3,4, and 5 on separate lines. How about if I want to print 1 out to the screen, sleep 5 seconds, clear that out and then print 2?
I've tried using stdo... | Stdout and flush? It's appending and not flushing | 0.291313 | 0 | 0 | 353 |
31,173,867 | 2015-07-02T00:39:00.000 | 0 | 0 | 1 | 0 | python,selenium,pycharm | 31,180,054 | 2 | false | 0 | 0 | Maybe you use python 2.x and 3.x on your computer and you configured in pycharm other then the one you use in console? If it is so then pip could install selenium to python 2.x and in pycharm you are using 3.x or the other way round. | 2 | 3 | 0 | I installed Selenium on my system using 'pip install selenium' and it works great on Mac Console. But when I tried using selenium in my project on Pycharm, I got an error that No module named Selenium exists. What am I doing wrong? | Selenium not working on Pycharm | 0 | 0 | 1 | 5,003 |
31,173,867 | 2015-07-02T00:39:00.000 | 1 | 0 | 1 | 0 | python,selenium,pycharm | 31,191,965 | 2 | true | 0 | 0 | So I found what I was doing wrong. My Mac Terminal and Pycharm were using different Python that I installed on my system, so I changed the path on Pycharm interpreter to the local path where Selenium was installed. | 2 | 3 | 0 | I installed Selenium on my system using 'pip install selenium' and it works great on Mac Console. But when I tried using selenium in my project on Pycharm, I got an error that No module named Selenium exists. What am I doing wrong? | Selenium not working on Pycharm | 1.2 | 0 | 1 | 5,003 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.