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
28,100,993
2015-01-23T00:13:00.000
0
0
1
0
python
28,101,077
3
false
0
0
Don't took it as pure English, r+ means read extended actually, Python!=English. All of the languages has basic rules, and @John Kugelman mentioned, Python stuck with old.
1
22
0
In Python, when opening a file, we use 'r' to indicate read-only and 'w' write-only. Then we use 'r+' to mean "read and write". Why not use 'rw'? Doesn't 'rw' looks more natural than 'r+'? Edit on Jan. 25th: Oh.. I guess my question looks a little confusing.. What I was trying to ask is: 'r' is the first letter of 're...
In Python, why is 'r+' but not 'rw' used to mean "read & write"?
0
0
0
11,276
28,101,097
2015-01-23T00:25:00.000
2
0
1
0
python
28,101,159
2
false
0
0
The two expressions are equivalent, but the first one is more idiomatic, so it's preferred.
2
0
0
In Python 3, is there a difference between using these two expressions? item not in list vs. not item in list
What's the proper way of checking non-inclusion in Python
0.197375
0
0
47
28,101,097
2015-01-23T00:25:00.000
0
0
1
0
python
28,101,158
2
false
0
0
item not in list is being mentioned in the Python documentation and not item in list is not. Which means that it is better to use item not in list.
2
0
0
In Python 3, is there a difference between using these two expressions? item not in list vs. not item in list
What's the proper way of checking non-inclusion in Python
0
0
0
47
28,101,995
2015-01-23T02:12:00.000
2
0
0
1
python,bash,hadoop,mapreduce,apache-spark
28,112,455
1
false
0
0
The main idea why Hadoop Streaming is considered to be slow is that for both mapper and reducer you have to pass arguments via stdin, which means you have to serialize them as a text, and to get the output of both mapper and reducer you have to deserialize them from the text back to Java structures, which usually consu...
1
0
0
I have heard from several articles that Hadoop streaming with bash is significantly slower than a compiled code or python. Is this only true for sort commands and the like? My script needs to -copy file to node -on node execute a commercial program with file as argument -pass output back to folder My intuition is tell...
Hadoop streaming with Bash - how slow?
0.379949
0
0
481
28,103,374
2015-01-23T05:06:00.000
0
0
0
0
python,django,django-forms,django-templates,django-views
28,103,925
1
false
1
0
Probably the best way to do that is to use the session: When the password_change view is valid and before redirecting to the password_change_done view, just set a password_changed session attribute to True, something like this: request.session['password_changed'] = True After that, in your password_change_done view, ch...
1
0
0
I require the password_change_done url to be visible only when the password_change view redirects to it (on successful change of password). Otherwise on going to the password_change_done view, it must redirect to the password_change view How can this be done?
Django password_change_done viewable only on redirect from password_change view (on succesful password change)
0
0
0
100
28,105,364
2015-01-23T07:56:00.000
0
0
0
1
python,django,celerybeat
51,928,073
2
false
0
0
celery -A your-project beat --detach -l info -f beat.log
1
3
0
I know there is a command for celeryd to run as daemon, i.e; celeryd_detach. But how can I run celery-beat as daemon using any command? Please help me in this. TIA
How to run celery beat as daemon?
0
0
0
4,649
28,106,854
2015-01-23T09:36:00.000
2
0
0
0
python,django,function,session
28,107,498
1
true
1
0
You can't. This question betrays a fundamental misunderstanding of how both sessions and web applications work. Web code is stateless; there is nothing "running" for any user in between the requests that user makes. If a user doesn't make any requests for longer than the session timeout, the only time the server code k...
1
0
0
So i'm using the request.session.set_expiry(NUMBER_OF_SECONDS) in order to check if the user of my webpage has been inactive for a number of seconds and clossing the session when it happens. The problem is that i want to call a function for doing some things jsut before the session expires and i don't know how can I do...
Django: calling a function before session expires
1.2
0
0
312
28,108,106
2015-01-23T10:43:00.000
2
0
1
0
python,64-bit,32-bit,anaconda,pythonxy
28,198,803
1
true
0
0
You'll need to reinstall everything for the 64-bit Python, but note that Anaconda and conda may already come with everything that you need.
1
2
0
I have some doubts about how to do that, I hope anybody can point me in the correct direction. My current situation is that I am working with the python package Python(x,y) 32 bits in a Windows machine with 64 bits. And, as many of you know, I am having some problems with the Memory error. So that I am thinking about c...
from python 32 bits to python 64 bits
1.2
0
0
5,321
28,109,268
2015-01-23T11:49:00.000
0
0
1
0
python,windows,numpy
47,223,192
4
false
0
0
Wasted a lot of time trying to install on Windows from various binaries and installers, which all seemed to install a broken version, until I found that this worked: navigate to the python install directory and do python .\site-packages\pip install numpy
1
5
1
I am trying to install numpy for python 2.7, I've downloaded the zip, unzipped it and was expecting a Windows download file (.exe), but there isn't one. Which of these files do I use to install it? I tried running the setup.py file but don't seem to be getting anywhere. Thanks!!!
How do I install Numpy for Python 2.7 on Windows?
0
0
0
21,104
28,109,630
2015-01-23T12:10:00.000
0
0
0
0
python,browser,client,server
28,124,355
2
false
0
0
Answering my question for future reference or other people with similar requests. All of the requirements for this can be found in the standard module BaseHTTPServer
1
1
0
I have written a python server that does a task depending on the input given by the user through a client. Unfortunately, this requires the user to use the terminal. I'd like the user to use a browser instead to send the data to the server. How would I go on about this? Does anyone here have suggestions? Perhaps even a...
Python - Server and browser-client
0
0
1
231
28,110,884
2015-01-23T13:21:00.000
4
0
1
0
python,operator-overloading,overloading
28,111,055
1
false
0
0
No. The only operator overloading that is allowed in Python is changing the runtime semantics of pre-existing operators. The syntax <MyObj1 | MyObj2 > would involve either making < and > into unary operators (one prefix, one postfix) or making them both into a single "circumfix" operator. As they are currently both ...
1
1
0
Pretty odd question but is it possible to overload the meaning of certain bracket types e.g. <, >, [, ] and | in Python. For instance if I have some object instances MyObj1 and MyObj2 could I design something whereby <MyObj1 | MyObj2 > was understood as either a method call in MyObj1? I think it probably can't/shouldn...
Overload angle brackets in Python
0.664037
0
0
1,245
28,114,303
2015-01-23T16:26:00.000
0
0
1
1
python
28,114,840
1
false
0
0
You can do all necessary imports before os.chroot.
1
0
0
I am writing some Python script and I would like to use os.chroot to execute some code under chroot environment. The problem is after calling os.chroot, paths in sys.path lie outside of the chroot jail, so import won't work. What's the best way to do it?
Python import packages under chroot environment
0
0
0
133
28,115,111
2015-01-23T17:10:00.000
0
0
0
0
django,python-2.7
28,115,962
1
false
1
0
Found the answer: req = urllib2.Request(url=your_url, data=your_data) req.get_method = lambda: 'PUT'
1
0
0
In my Django app I need to send an HTTP PUT request to a url. What is the proper syntax for that?
How to send an HTTP PUT request using urllib2 or requests
0
0
1
831
28,121,148
2015-01-24T00:59:00.000
9
0
0
1
python,macos
28,121,167
2
false
0
0
Solution is to run commands below: export CC=/usr/bin/clang export CXX=/usr/bin/clang++
1
4
0
You may have following issue while compiling python packages on Mac: cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes...
How to fix "cc: error: unrecognized command line option '-Wshorten-64-to-32'" issue on Mac
1
0
0
5,118
28,121,229
2015-01-24T01:10:00.000
0
0
0
0
macos,sqlalchemy,pycharm,osx-yosemite,python-2.x
28,123,162
1
true
0
0
Go into Settings -> Project Settings -> Project Interpreter. Then press configure interpreter, and navigate to the "Paths" tab. Press the + button in the Paths area. You can put the path to the module you'd like it to recognize.
1
0
0
i installed PyCharm 4 on my Mac Yosemite, then installed SQLAlchemy through easy_install with console, also I have already official python 2.7.9 IDLE. I tried to import SQLAlchemy module in official IDLE and it works, but in PyCharm 4 IDE it doesn't. How can i fix this error? Traceback (most recent call last): File "/U...
SQLAlchemy with Pycharm 4
1.2
1
0
664
28,121,876
2015-01-24T03:07:00.000
7
0
0
0
python,qt,pyqt,qtabwidget
28,122,425
1
true
0
1
When a new tab is selected currentChanged(int index) signal of the QTabWidget is emitted. Just connect that signal to some slot and check the index of the newly selected tab which is passed as argument.
1
8
0
I am using PyQt5 to make the user interface. Now I have set up a tab widget, and I want to trigger the event at such a time when a specific tab is selected. In other words, for example, I have tab A and tab B, and I want to execute the function every time user is switching from tab A to tab B.
How to connect event when tab widget is selected?
1.2
0
0
5,574
28,124,450
2015-01-24T10:20:00.000
2
0
0
0
python,python-2.7
28,124,506
1
true
0
0
What you could do is choose a min/max interval of how long you want to wait. Keep a note of how many requests have been made in the last 60 minutes and if you're still below the quota, download a document and wait for rand(min, max). This is not very fancy and doesn't distribute the wait times across the whole 60 minut...
1
0
0
I am using an API that returns me articles in my language in determined categories. This API limits me in 100 calls for each interval of 60 minutes. I don't want to make 100 calls straight away and make my script wait until 60 minutes has passed. I could then shoot an API call every 36 seconds, but I also don't want th...
How can I distribute 100 API calls randomly in a 60 minutes time interval?
1.2
0
1
303
28,125,037
2015-01-24T11:32:00.000
0
0
0
0
python,django,django-cms
29,008,788
3
false
1
0
One more hint: static placeholders are good for this purposes.
1
3
0
I have a few placeholders in my DjangoCMS template (par example, header, contetent and footer). I want to automatically populate any newly-created pages with default items: header placeholder with header plugin and footer placeholder with footer plugin. How can it be done?
DjangoCMS: how to auto-add default plugins in placeholders
0
0
0
790
28,127,310
2015-01-24T16:00:00.000
2
0
1
0
python,python-3.x
28,127,456
3
false
0
0
On windows, you can quit the interpreter with CTRL-z and on linux/mac you can quit with CTRL-D. If you type exit, it will tell you exactly what to do. If you are not running interactively (i.e. by running python your_script.py) the code will just end when it's reached the bottom of the file. If you actually do need to...
1
2
0
I have made a number guessing game and once you have guessed the number it will say well done but idle stays open, how do I get it to close?
how do I get my program to close once finished in python
0.132549
0
0
4,071
28,127,730
2015-01-24T16:40:00.000
3
0
1
0
python,pygame,pip,python-3.4
28,127,786
9
false
0
1
14 y/o? Good for you! You can put the file into your python/scripts folder and run pip install *file* (where *file* is your filename).
1
9
0
So I have this little problem. When I try to install PyGame for Python 3.4 I download a .whl (wheel?) file and don't know how to use it. Some guys told me something about pip but don't know how to use/install it.
How to install PyGame on Python 3.4?
0.066568
0
0
64,844
28,131,654
2015-01-24T23:55:00.000
1
0
1
1
python,bash,package
28,131,853
1
true
0
0
assuming ubuntu is somewhat like debian. /etc/profile.d is probably the best way. Don't edit any files just drop a file into profile.d that checks for bash and that your package is installed and then does whatever it needs.
1
0
0
I'm planning to make a program which should edit the users bashrc. In the case of python library, I'd like to add a binary to /bin/ automatically. When it is executed, then it should add a function and call it every time when a user is loggd in to bash, so I definitely should change bashrc. In the case of ubuntu packag...
Proper way to change bashrc when making a ubuntu package or python package
1.2
0
0
57
28,132,156
2015-01-25T01:13:00.000
0
0
0
0
python,linux,arduino,pygame,raspberry-pi
28,132,200
1
true
0
1
(x + 1.0) / 2.0 where x is whatever you get from the controller should give you a range of 0..1 (the + 1.0 is to get you in the range 0..2)
1
0
0
I am using Pygame 1.9.2 with Python 3.4 to create a control program for a robot. The controller is a new Xbox One controller connected via USB which is working fine with pygame. The problem is that the trigger buttons are considered Axes which give values from -1 to 1 depending on how hard you press. Is there a way t...
How can I set the range for Xbox One controller Triggers using Pygame?
1.2
0
0
1,152
28,133,177
2015-01-25T04:18:00.000
3
0
0
0
python,django
28,133,201
1
true
1
0
Properly written django project will work from any directory. The only thing you need to change is the database settings and, may be, some paths in settings.py.
1
0
0
Is it possible to duplicate an entire Django project and rename it? For example, let's say Client1 asks me for a Django project. I would name the entire project Client1. Client2 now comes and asks for the exact same file. Can I simply copy and paste Client1's project and rename it to Client2, or do I need to rename a f...
Duplicating an entire Django project
1.2
0
0
1,706
28,135,050
2015-01-25T09:40:00.000
0
0
0
0
python,html,django
28,135,065
2
false
1
0
Yes. You need to use Context Processor. Google "django context procoessor" it'll come up with many results.
1
0
0
I have a base html file (for which code shouldn't be necessary) that requires some tags in the menu to be filled with id numbers (which are dynamic, and can't be hard coded). It seems to me that writing code to populate the tags for each view violates the DRY principle, and as such there should be some way to provide v...
How to fill data in a base html file Django
0
0
0
77
28,136,063
2015-01-25T11:52:00.000
1
0
0
0
ajax,python-3.x,cookies,xmlhttprequest,bottle
28,137,747
2
false
1
0
I tried to set_cookies('test', 123, secret='mysecret') under AJAX request, it worked, but still couldn't find previous cookies. Then I remarked that my previous cookies, called cook1 and cook2, written under 'normal' http request, if they had same domain, had different 'path' (under Chrome ressource explorer). They w...
1
1
0
I use bottle set/get cookie mecanism to track my user_id (with 'secret' param when calling set/get_cookie() During normal http(s) request everything is fine but when making a xhr request (same domain)user_id = request.get_cookie('user_id', secret='mysecret') returns None. When checking on client browser, cookie and key...
Bottle, how to get_cookie during AJAX request (same domain)
0.099668
0
0
167
28,139,507
2015-01-25T17:50:00.000
0
0
1
0
ipython
34,588,036
2
false
0
0
You can output your history with the commands %history -f filename history with lines and sessions %history -g -f filename
1
3
0
I use vim with a couple of plugins as a python ide. Along with an open vim session, I run an ipython session in a split console. I've found their combination is a great productivity tool for programming data analysis scripts. What I'm missing is a way to show all current session history in a side panel, so that I coul...
Where does ipython store the current session history?
0
0
0
851
28,142,420
2015-01-25T22:38:00.000
6
0
0
0
python,excel,pandas
28,254,411
6
false
0
0
I'm 90% confident the answer to "can pandas do this" is no. Posting a negative is tough, because there always might be something clever that I've missed, but here's a case: Possible interface engines are xlrd/xlwt/xlutils, openpyxl, and xlsxwriter. None will work for your purposes, as xlrd/wt don't support all formu...
1
26
0
Many spreadsheets have formulas and formatting that Python tools for reading and writing Excel files cannot faithfully reproduce. That means that any file I want to create programmatically must be something I basically create from scratch, and then other Excel files (with the aforementioned sophistication) have to refe...
Can Pandas read and modify a single Excel file worksheet (tab) without modifying the rest of the file?
1
1
0
32,281
28,143,334
2015-01-26T00:44:00.000
1
0
1
1
python
28,143,351
1
false
0
0
The file you're deleting might be in use or requires administrative privileges to remove. You can use a subprocess to call you script as an administrator.
1
1
0
I am using os.remove in a for loop. Sometimes, the process was blocked, like a dead lock, but I'm not using a thread. I want to know why process was blocked, and what can I do to prevent it?
In python os library, process was blocked
0.197375
0
0
39
28,144,261
2015-01-26T03:04:00.000
0
0
0
0
python,turtle-graphics
28,177,122
1
false
0
1
I was asked this question by a friend, and re installation solved the problem
1
0
0
I am trying to run a simple Turtle Graphics file, but no drawing shows up and IDLE asks me what background color you want? What's wrong with my Python?
Drawing not shown using Python Turtle Graphics
0
0
0
197
28,144,352
2015-01-26T03:16:00.000
13
0
1
0
python,pycharm
28,388,454
11
false
0
0
PyCharm version 4.04 does not allow me to paste text from a source (like a text editor, url, document) into a file open in PyCharm. I can cut and paste between two files open in PyCharm. Reverting back to PyCharm version 4.01 returned the expected paste operation for me. Running PyCharm on windows 8
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
1
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
21
0
1
0
python,pycharm
47,894,764
11
false
0
0
Most likely you installed the IdeaVim support when you first installed PyCharm. To un-install the plugin, go to: File --> Settings --> Plugins and uncheck the IdeaVim entry. You will need to restart PyCharm. After I did this, I could easily copy and paste via CTRL + C/X/V from anywhere into PyCharm.
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
1
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
0
0
1
0
python,pycharm
47,471,422
11
false
0
0
I have just learned that using the python browser allows you to paste too the pi only (my experience). not from the desktop to pi. I assume it is because their are two different platforms running on the same screen. when i'm on full screen with the pi on my desktop, i can't (ALT Tab) to the desktop. But i can vice vers...
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
0
0
1
0
python,pycharm
64,817,538
11
false
0
0
Resolved my issues of copy, paste, inserting after selection. Go to [Tools] in pychar-menu-bar and uncheck on [Vim Emulator]
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
0
0
1
0
python,pycharm
64,265,383
11
false
0
0
Go to "View" then goto "quick switch scheme" then set you "keymap" to "windows". This worked for me. I did not need to uninstall idealvim.
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
1
0
1
0
python,pycharm
61,390,107
11
false
0
0
IdeaVim plugin doesnot allow to to use shortcut keys properly as it has different configuration for shortcut keys. So uninstalling IdeaVim and then followed by restarting PyCharm works out well. To do the above :- File -> Settings -> Plugins -> (search for IdeaVim) Uninstall it or disable it It will ask for restart, s...
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0.01818
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
0
0
1
0
python,pycharm
39,496,631
11
false
0
0
When the copy/ paste shortcuts are failed, I found Execute Selection in Console (alt + shift + E) is useful.
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
1
0
1
0
python,pycharm
36,463,803
11
false
0
0
Looks like just a bug. I use 2016.1 and restart helps.
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0.01818
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
0
0
1
0
python,pycharm
33,716,038
11
false
0
0
This happened to me as well, I fixed it after disabling antivirus safe search in the browser and restarted Pycharm.
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0
0
0
16,809
28,144,352
2015-01-26T03:16:00.000
1
0
1
0
python,pycharm
32,481,871
11
false
0
0
Similar here.. Windows 7, Pycharm community edition 4.5.4. Can copy-paste from pycharm to outside apps. But when doing reverse, there are inconsistent behaviors. From notepad (or even this editor windows where I am typing this), I can copy to pycharm. However, if I copy any other text (say, an article from wikiped...
10
21
0
Every time I try to copy and paste a web url into PyCharm, I even tried Paste Simple, I see nothing. Is there any force that could potentially block out people who try to paste information in? I really have no clue what's going on.
How do you copy and Paste in Pycharm?
0.01818
0
0
16,809
28,146,773
2015-01-26T08:33:00.000
4
0
1
0
python,python-2.7,anaconda,spyder
28,176,485
2
true
0
0
The easiest solution here is to use the Spyder that comes with Anaconda.
1
7
0
I installed Spyder IDE before I have installed the Anaconda (on Ubuntu 14.04), on the terminal when I type python I have the anaconda python and I can import all of its packages. But on Spyder I still have the original python and I cannot import the Anaconda packages, how can I setup Spyder to use the Anaconda python?
Setup Spyder to work with Anaconda python on Ubuntu 14.04
1.2
0
0
5,940
28,150,201
2015-01-26T12:32:00.000
1
0
1
0
python,pygame,raspberry-pi
32,603,009
2
false
0
1
There is no "solution", only workarounds here. To have working environment I install system package with pygame (i.e. pacman -S python2-pygame in Arch Linux) then create virtualenv with --system-site-packages switch. Pygame has not been updated for more than 5 years so it's highly unlikely that any changes will come in...
1
2
0
I have a Pythonscript where I want to import pygameui. When I perform: sudo pip install pygameui in the terminal, I get the following message: Downloading/unpacking pygameui Running setup.py egg_info for package pygameui Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/l...
Trouble with PyGameUI - RaspberryPi
0.099668
0
0
1,630
28,151,557
2015-01-26T14:01:00.000
0
1
0
1
java,python,ubuntu
28,151,615
2
false
0
0
If you put it in ~/.bashrc it will run at the same time you log in
1
0
0
I have made a script in Java and Python that logs in to my internet. I want to run one of it on my Ubuntu 14.10 at boot (before user login). How do I do it?
How to run a script that logs in to the internet at boot (before user login) on ubuntu
0
0
0
38
28,152,579
2015-01-26T14:54:00.000
0
1
0
0
python,cisco,pysnmp
48,458,525
1
false
0
0
Approach 1 is better from most perspectives. It uses a little memory on the PC due to running a trap collecting daemon, but the footprint should be reasonably small since it only needs to listen for traps and decode them, not do any complex task. Existing tools to receive traps include the net-snmp suite which allows...
1
2
0
Which is the more resource-friendly way to collect SNMP traps from a Cisco router via python: I could use a manager on a PC running a server, where the Cisco SNMP traps are sent to in case one occurs I could use an agent to send a GET/GETBULK request every x timeframe to check if any new traps have occurred I am look...
Collecting SNMP traps with pySNMP
0
0
1
2,151
28,154,828
2015-01-26T16:53:00.000
1
0
0
0
python,video,google-drive-api,html5-video,chromecast
28,157,049
1
true
0
0
What you are looking to do is called progressive download, or pseudo-streaming. It is possible with the mp4 container if the moov atom is before the mdat atom. This is sometimes called faststart
1
2
0
I'm using Google Drive's API to download a video from my Drive account. However, I'm using Partial Download, receiving the file by chunks. This is done by a Python script. If I try to play it using html5 , it won't work as I want because it plays until the size the file had before loading the page and then it stops, wi...
How to play a video being downloaded as if it was a stream?
1.2
0
1
369
28,156,037
2015-01-26T18:07:00.000
1
0
1
0
python,pyinstaller,py2app,praw
30,129,259
1
true
1
0
I came across this error today - not in the context of py2app, but after a pip upgrade of praw. In case you still have this problem (unlikely :)) and/or in the interest of posterity, here's how I was able to fix it: I noticed that the error was in reading the praw.ini file, which very much exists on my system. The real...
1
0
0
I'm trying to wrap my Python script into an application using py2app, but when I try to run the app I'm getting this PRAW related error: Exception: Could not find config file in any of: ['/Users/username/CS/Applicationame/dist/applicationname.app/Contents/Resources/lib/python2.7/site-packages.zip/praw/praw.ini', '/User...
Cannot find PRAW config file when wrapping application with py2app
1.2
0
0
399
28,156,422
2015-01-26T18:32:00.000
0
0
0
0
python,django,django-deployment
28,159,360
2
false
1
0
The built-in development server (that you get by doing python manage.py runserver) will refresh whenever you make a change. Apache will not (by default). You either need to restart apache, or you need to set maximum-requests=1 in your WSGI config. The way to go is to run the built-in dev server for development, and th...
1
1
0
I have a sample Django app which is being hosted on an Apache2 server using mod_wsgi. Currently I am testing it only on the loopback address (127.0.0.1). So this is what I do: Open a tab and go to the loop back address. And then I work on the Django app. Now when I start another tab and go to the loopback address, th...
Django app shows the same instance every time I hit the server
0
0
0
98
28,159,111
2015-01-26T21:30:00.000
0
0
1
0
python,django
28,159,200
1
true
1
0
Make sure your wsgi file points to the right virtualenv!
1
0
0
I installed a django-secure into a virtualenv using pip. The install was normal. The module shows up in the virtualenv pip list and in virtualenvs/dev/lib/python2.7/site-packages. I get the following error when running my code. ImportError: No module named djangosecure The folder is in there and there is an init. N...
Virtualenv installed package not found
1.2
0
0
196
28,161,508
2015-01-27T00:53:00.000
0
0
1
1
python,gitpython
28,179,875
1
false
0
0
You might not have git.ext in your PATH, but that can easily be tested by executing it yourself. If you see an error, you can either add it to the PATH, or set the GIT_PYTHON_GIT_EXECUTABLEto the executable git-python should execute for git commandline services.
1
0
0
I am facing an issue while cloning a git repo. I am using function clone_from from GitPython library from git import Repo Repo.clone_from("git://github.com/facebook/buck.git", "D:\sample") I am getting error WindowsError: The system cannot find the file specified Can someone please tell me if this is how to clone a...
GitPython - clone_from not working
0
0
0
1,005
28,162,229
2015-01-27T02:26:00.000
0
1
0
1
python,linux,bash,ssh
28,223,316
2
true
0
0
The solution to my problem is to use PATH=/cygdrive/c/WINDOWS/system32:/bin cmd /c in front of the script call, sth like: ssh user@host "PATH=/cygdrive/c/WINDOWS/system32:/bin cmd /c script" .This will run the script using in Windows env. In my case the problem was that the script was run under cygwin env and I wanted ...
1
1
0
I know I can find multiple answers to this question but I have a problem with the result. I have a Windows PC with a script on it and a Linux PC that has to start the script using ssh. The problem I am seeing is that for some reason it's using the Linux environment to run the script and not the Windows env. Is this exp...
How to execute a remote script using ssh
1.2
0
0
865
28,163,981
2015-01-27T05:43:00.000
0
0
1
0
python,python-2.7,logging,elasticsearch,logstash
39,983,169
1
false
0
0
As the question have been about "how can I push a specific file to the elasticsearch via logstash with python", I'd suggest to: Observe a directory for *.log with filebeat or logstash directly. Create symlinks for files you need to push.
1
0
0
My requirement is to read from Logstash based log files, and index them into Elasticsearch. For now, I have configured the Logstash and started the daemon to do so. But what I need to know is if there is any existing Python2.x API for Logstash for the mentioned use-case.
Logstash Python API to read from files
0
0
0
620
28,167,648
2015-01-27T10:00:00.000
10
0
0
0
python,optimization,scipy
28,249,829
4
true
0
0
There is actually no need to see your code to explain what is happening. I will answer point by point quoting you. My problem is, when I start the minimization, the value printed decreases untill it reaches a certain point (the value 46700222.800). There it continues to decrease by very small bites, e.g., 467002...
2
6
1
I have a function I want to minimize with scipy.optimize.fmin. Note that I force a print when my function is evaluated. My problem is, when I start the minimization, the value printed decreases untill it reaches a certain point (the value 46700222.800). There it continues to decrease by very small bites, e.g., 46700222...
seeking convergence with optimize.fmin on scipy
1.2
0
0
13,104
28,167,648
2015-01-27T10:00:00.000
0
0
0
0
python,optimization,scipy
28,219,470
4
false
0
0
Your question is a bit ambiguous. Are you printing the value of your function, or the point where it is evaluated? My understanding of xtol and ftol is as follows. The iteration stops when the change in the value of the function between iterations is less than ftol AND when the change in x between successive iterati...
2
6
1
I have a function I want to minimize with scipy.optimize.fmin. Note that I force a print when my function is evaluated. My problem is, when I start the minimization, the value printed decreases untill it reaches a certain point (the value 46700222.800). There it continues to decrease by very small bites, e.g., 46700222...
seeking convergence with optimize.fmin on scipy
0
0
0
13,104
28,170,340
2015-01-27T12:16:00.000
2
0
0
0
javascript,python,lua,freeswitch
28,245,548
2
true
0
0
Using the EventSocket or simply a shell script calling fscli -x "reloadxml"
1
0
0
After adding a user, how can I reload the Dial-plan XML dynamical using script.
In freeswitch is there any possibility to reload xml using script
1.2
0
1
864
28,172,741
2015-01-27T14:22:00.000
0
0
0
1
python,shell,input,ksh
28,246,101
2
false
0
0
You can save your parameters in Python and give them on the commandline each time you call the script. Your script can store them in a file (or database, service, ..) and read them when started again.
1
0
0
I'm using Python to run a .ksh script, using subprocess.call(). This script requires the user to enter text at certain points - whatever the equivalent of Python's input() is in KSH I guess. The problem I'm having is that I have to run the script ~200 times, and I don't want to have to enter this information each time....
Passing values to KSH scripts from Python
0
0
0
1,004
28,173,716
2015-01-27T15:12:00.000
0
0
1
0
python-multithreading
28,207,425
1
true
0
0
How about you create a list of 101 elements, 0 through 100. Then store the output from processing file x into list element x. When all processing is complete, write the data in the list elements from 0 to 100 to the file.
1
0
0
I am using Python threading to process multiple files and I want output of each of the files 0 through 100 being processed to be written in a file in orderly fashion Currently I am saving output of all the thread as they get executed and hence the order is not maintained. How can I achieve this?
Python threading how get output of multiprocess in sequence
1.2
0
0
109
28,174,487
2015-01-27T15:50:00.000
3
0
0
0
python,sockets,ethernet
28,174,528
1
false
0
0
Unplug one and if it stops working - you found the right one. If it does not stop working it is the other one.
1
1
0
I have an embedded system connected with an ethernet port to one of my 2 ethernet interfaces, but I have the problem that my python code for the socket connection does not know where to connect to the embedded. I mean, sometimes I get the connection and sometimes I just don't (and I have to change the cable to the othe...
I have 2 ethernet interfaces on the same PC, how to know which interface is connected in python?
0.53705
0
1
172
28,174,683
2015-01-27T15:59:00.000
3
0
1
0
python,python-2.7,tkinter,tkinter-canvas
28,174,950
1
true
0
1
All Tkinter classes in python 2.x are old style classes.
1
1
0
I would like to know if Tkinter.Canvas is a classic or modern Python class, because super does not work as expected (for me).
Is Tkinter.Canvas a classic class?
1.2
0
0
58
28,175,349
2015-01-27T16:34:00.000
2
0
1
0
python,anaconda,canopy,spyder,libtiff
28,198,230
2
false
0
0
Conda's libtiff package is the C library, not the Python library. The easiest way to get it would be to use conda to install the dependencies (like libtiff, numpy), and then use pip to install libtiff (pip install libtiff).
1
2
0
I have played around with Python a little but never have I had to install my own packages. I am currently trying to write a program that reads in 'tiff' files so I'm trying to install the 'libtiff' package and I'm having a nightmare! First, I was using the Anaconda distribution and the phrase 'conda install libtiff' wh...
Installing Python modules with Anaconda or Canopy
0.197375
0
0
2,924
28,177,807
2015-01-27T18:49:00.000
1
0
0
0
python,user-interface,tkinter
28,177,945
1
true
0
0
As long as you clearly separate your GUI logic from your processing logic, it shouldn't. As is the case with all optimization though, the best approach is to make the thing work first, then profile and optimize if it isn't performing fast enough for you. I would suggest you first create your web crawler and forget the ...
1
0
0
Hi I want to make a web crawler that checks URL for data, If i make a simple Gui that would make the script easier to look for variables in that data, Would adding code for the gui make my web crawler less efficient ? I need the crawler to be as efficient as possible, to be able to process data as fast as possible. Wou...
If I make a simple gui for my python script, would it affect its efficiency?
1.2
0
1
150
28,177,983
2015-01-27T18:59:00.000
1
0
1
0
python
28,178,022
4
false
0
0
The "W" means that you are opening the file called filename with the purpose of writing to it(hence the "W" for write.)
1
0
0
I'm reading Exercise 16 of "Learn Python The Hard way" and I'm confused about open(filename, "w") -- what does the "w" mean?
What does the "w" mean in open(filename, "w")?
0.049958
0
0
21,567
28,178,161
2015-01-27T19:10:00.000
1
0
1
0
python,python-3.x
28,178,223
2
false
0
0
The constructor is optional. However, if you specify one, it must be named __init__; it cannot be named anything else (otherwise, how would Python know which function is the constructor?). One, called __init__ (though it can call out to other functions). No, but using a name other than self will make your code harder t...
1
0
0
Do you always have to use __init__ as constructor? How many constructors can you use it in one class? Do you need to have 'self' as first argument or you can use any other name like 'shapes' instead of 'self'?
Do you always have to use __init__ as constructor?
0.099668
0
0
79
28,179,883
2015-01-27T20:59:00.000
0
1
1
1
python,windows,multithreading
28,252,408
1
false
0
0
My solution is place testing code in exe file. Now i can kill all python scripts, as previously. Maybe someone will offer another solution?
1
0
0
I need to kill all python scripts except one. Unfortunattely, all scripts have similar name "pythonw.exe". Difference in PID only. First time, i don't need to leave one script alive, thats why i just kill all python scripts in system by taskkill /F /T /IM "python*" command. But now, i have one script, that automates al...
Python kill scripts
0
0
0
207
28,180,013
2015-01-27T21:07:00.000
1
1
0
0
python,git,timeout
29,615,466
2
true
0
0
No you can't, you need to timeout the command using a wrapper.
1
1
0
I have some git commands scripted in python and occasionally git fetch can hang for hours if there is no connectivity. Is there a way to time it out and report a failure instead?
Can you specify a timeout to git fetch?
1.2
0
1
2,127
28,180,074
2015-01-27T21:11:00.000
1
0
0
0
python,django,django-views
28,180,194
1
true
1
0
I think the flow would look more like: Question_Page -> Post Data View (processes the data from the question page) -> redirect to Output page (based upon data results). The only page someone would "see" is the "Question Page" and "Output page"... now if processing takes a long time, they could click submit again on the...
1
0
0
I have a generic set up where you take an assessment which kicks you to a processing page which massages the data, stores it, and then funnels you to the correct output page. You never actually see the processing page it runs and sorts you to the results. I'm concerned this could be exploited. Is there a way to hide...
Django Hide Processing Page
1.2
0
0
34
28,182,566
2015-01-28T00:22:00.000
0
0
1
0
python,spyder
54,209,443
3
false
0
0
A simple way to help you: use right shift key as End+Enter First : sudo apt-get install xdotool In settings, open keyboard and add a custom shortcut name : New_line command : xdotool key End KP_Enter then click the 'disabled' and type R_shift key Now you can use right shift to achieve what you want !
1
1
0
When using other editors, most of them have a function about "new line". For example, the Sublime Text, use Ctrl + enter to enter new line directly whatever cursor is at end of line or not. After checked all the setting about spyder, have no idea about this. Thus i want to add new feature about "new line" with Ctrl ...
How to add "new line" keyboard shortcuts in spyder
0
0
0
7,437
28,183,527
2015-01-28T02:18:00.000
0
1
0
0
python,email,gmail
28,184,142
2
false
0
0
Unfortunately the categories are not exposed to IMAP. You can work around that by using filters in Gmail to apply normal user labels. (Filter on, e.g., category:social.)
2
0
0
I am trying to extract mails from gmail using python. I noticed that I can get mails from "[Gmail]/All Mail", "[Gmail]/Drafts","[Gmail]/Spam" and so on. However, is there any method to retrieve mails that are labeled with "Primary", "Social", "Promotions" etc.? These tags are under the "categories" label, and I don't k...
How to extract mail in "categories" label in gmail?
0
0
1
596
28,183,527
2015-01-28T02:18:00.000
0
1
0
0
python,email,gmail
28,218,594
2
false
0
0
Yes, categories are not available in IMAP. However, rather than filters, I found that gmail api is more favorable for me to get mail by category.
2
0
0
I am trying to extract mails from gmail using python. I noticed that I can get mails from "[Gmail]/All Mail", "[Gmail]/Drafts","[Gmail]/Spam" and so on. However, is there any method to retrieve mails that are labeled with "Primary", "Social", "Promotions" etc.? These tags are under the "categories" label, and I don't k...
How to extract mail in "categories" label in gmail?
0
0
1
596
28,185,311
2015-01-28T05:32:00.000
0
0
1
0
python,algorithm,list,moving-average
28,185,443
2
false
0
0
Here is an answer that retains floating point for keeping a running total - I think a weighted average requires only two running totals: Allocate an array to store your numbers in, so that inserting a number means finding an empty space in the array and setting it to that value and deleting a number means setting its v...
2
2
0
I'm constantly adding/removing tuples to a list in Python and am interested in the weighted average (not the list itself). Since this part is computationally quite expensive compared to the rest, I want to optimise it. What's the best way of keeping track of the weighted average? I can think of two methods: keeping t...
"Running" weighted average
0
0
0
627
28,185,311
2015-01-28T05:32:00.000
1
0
1
0
python,algorithm,list,moving-average
28,185,734
2
false
0
0
Try doing it in integers? Python bignums should make a rational argument for rational numbers (sorry, It's late... really sorry actually). It really depends on how many terms you are using and what your weighting coefficient is as to weather you will experience much floating point drift. You only get 53 bits of precisi...
2
2
0
I'm constantly adding/removing tuples to a list in Python and am interested in the weighted average (not the list itself). Since this part is computationally quite expensive compared to the rest, I want to optimise it. What's the best way of keeping track of the weighted average? I can think of two methods: keeping t...
"Running" weighted average
0.099668
0
0
627
28,187,233
2015-01-28T07:56:00.000
2
0
0
0
python,matlab,curve-fitting,least-squares,surface
28,189,659
2
false
0
0
Dont use any toolboxes, GUIs or special functions for this problem. Your problem is very common and the equation you provided may be solved in a very straight-forward manner. The solution to the linear least squares problem can be outlined as: The basis of the vector space is x^2, y^2, z^2, xy, yz, zx, x, y, z, 1. The...
2
0
1
I have a set of experimentally determined (x, y, z) points which correspond to a parabola. Unfortunately, the data is not aligned along any particular axis, and hence corresponds to a rotated parabola. I have the following general surface: Ax^2 + By^2 + Cz^2 + Dxy + Gyz + Hzx + Ix + Jy + Kz + L = 0 I need to produce a...
Rotated Paraboloid Surface Fitting
0.197375
0
0
1,508
28,187,233
2015-01-28T07:56:00.000
0
0
0
0
python,matlab,curve-fitting,least-squares,surface
28,188,683
2
false
0
0
Do you have enough data points to fit all 10 parameters - you will need at least 10? I also suspect that 10 parameters are to many to describe a general paraboloid, meaning that some of the parameters are dependent. My fealing is that a translated and rotated paraboloid needs 7 parameters (although I'm not really sure)
2
0
1
I have a set of experimentally determined (x, y, z) points which correspond to a parabola. Unfortunately, the data is not aligned along any particular axis, and hence corresponds to a rotated parabola. I have the following general surface: Ax^2 + By^2 + Cz^2 + Dxy + Gyz + Hzx + Ix + Jy + Kz + L = 0 I need to produce a...
Rotated Paraboloid Surface Fitting
0
0
0
1,508
28,187,661
2015-01-28T08:28:00.000
1
0
1
0
python,bytecode,vm-implementation
33,724,808
2
false
0
0
I know this answer is like 11 months out of date but from my tinkering it seems the following is happening To access co_names in bytecode, one uses LOAD_GLOBAL(co names index) and this pushes a reference to the desired co_names onto the stack, eg its indirect To access co_consts in bytecode, one uses LOAD_CONST(co cons...
1
5
0
A code object generated by Python compiler contains a tuple of constants used in the instructions (named co_consts) and also a tuple containing names (named co_names). Why having two distinct lists? Wouldn't be simpler to just use co_consts for names too?
Why does python VM have co_names instead of just using co_consts?
0.099668
0
0
581
28,188,783
2015-01-28T09:34:00.000
1
0
0
1
java,c#,python,ide,desktop-application
28,188,969
2
false
1
0
You need a web application.Now this web application when loads send request to backend code that backend code will do SSH to remote machine and read the file from specific location.Now that read stream will be send back in response and displayed on web based UI. In these type of application few thinks matters. 1) Like ...
1
0
0
I have a simple cloud IDE,I want to make it able to build and run applications remotely, the target application's source files will be in a remote server in isolated virtual machine (e.g Windows 8.1,or Ubuntu 14.04). It's not difficult to build that application but how to run it and view its output to users ? What if i...
View running application output in the browser, how?
0.099668
0
0
1,186
28,189,763
2015-01-28T10:23:00.000
24
0
1
0
python,pycharm
28,190,671
3
true
0
0
There isn't a way to do so. You can extract certain parts of code, but you cannot have pycharm generate getters and setters for you. There is no need either, since all variables are public, and the _var values, even though are treated as private variables can be altered as well. EDIT (Change in question): If you want t...
1
24
0
I wonder whether there is some way of using Pycharm to automatically generate getter(@property) or setter for all my variables in a class. If there is a way, can someone point it out ? thanks! Actually I meant to generate (@property) and (@x.setter) automatically.
Pycharm (@property) and (@x.setter) autogeneration
1.2
0
0
18,235
28,190,568
2015-01-28T11:01:00.000
1
0
0
0
python,svg,warnings
32,072,588
2
false
0
0
contributors are working on refactoring those parts of code where scribus blocks the scripts with popups. patches have already been applied to the 1.5svn development version to better manage them. my hint to you: use the stable version for creating your documents but -- as long as the new stable 1.6 is not out -- use ...
1
1
0
When importing a svg file to the DTP programme "Scribus" it shows a warning message (with just one OK-button), that has to be confirmed to go on. This stops my Python Script from working. So I need a possibility to either confirm the message or - even better - to stop Scribus from showing this message. (something like ...
Disable warning message in scribus
0.099668
0
0
108
28,195,547
2015-01-28T15:05:00.000
0
0
0
0
python,django,angularjs,api
28,196,456
1
false
1
0
Depending from your needs you should think about storing the token in the session storage in the local storage or in a cookie(in this case the cookie is used as a storage mechanism and not as an authentication mechanism).
1
0
0
I'm developing my first AngularJS application with Django as backend. My overall architecture is composed of: Public API json-rpc server (from which I must retrive data previous authentication process (the client send a user/password with a POST request, and then, the server response with a token string). Django frame...
Right Auth with AngularJS, Django and external API service
0
0
0
246
28,196,645
2015-01-28T15:54:00.000
-2
0
1
0
python,windows,installation,pygame,pip
28,196,768
3
false
0
0
The best solution to all pip problems is that you newly install python 2.7.9 and then run it. Otherwise, your exact problem can be very hard to track down.
1
6
0
I have installed pip, and I have moved my directory in cmd to C:\Python27\Scripts. I try this code: 'pip install whatever.whl' It says at the bottom of random code(looks like python): 'ImportError: No module named commands.install' What is happening?
Why does pip say "No module named commands.install"?
-0.132549
0
0
11,839
28,197,444
2015-01-28T16:31:00.000
3
0
0
0
python,machine-learning,scikit-learn
28,198,700
2
true
0
0
Column 0 corresponds to the class 0, column 1 corresponds to the class 1.
2
1
1
Suppose my labeled data has two classes 1 and 0. When I run predict_proba on the test set it returns an array with two columns. Which column corresponds to which class ?
Python predict_proba class identification
1.2
0
0
655
28,197,444
2015-01-28T16:31:00.000
0
0
0
0
python,machine-learning,scikit-learn
56,207,791
2
false
0
0
You can check that by printing the classes with print(estimator.classes_). The array will have the same order like the output.
2
1
1
Suppose my labeled data has two classes 1 and 0. When I run predict_proba on the test set it returns an array with two columns. Which column corresponds to which class ?
Python predict_proba class identification
0
0
0
655
28,197,813
2015-01-28T16:50:00.000
2
0
0
0
python,statsmodels
28,202,075
1
true
0
0
Inference for parameters is the same across models and is mostly inherited from the base classes. Quantile regression has a model specific covariance matrix of the parameters. tvalues, pvalues, confidence intervals, t_test and wald_test are all based on the assumption of an asymptotic normal distribution of the estimat...
1
2
1
I am using the statsmodels.formulas.api.quantreg() for quantile regression in Python. I see that when fitting the quantile regression model, there is an option to specify the significance level for confidence intervals of the regression coefficients, and the confidence interval result appears in the summary of the fit....
statsmodels: Method used to generate condifence intervals for quantile regression coefficients?
1.2
0
0
843
28,200,366
2015-01-28T19:05:00.000
16
1
1
0
python-3.x,stringio,cstringio
50,033,540
3
false
0
0
I had the same issue because my file was called email.py. I renamed the file and the issue disappeared.
2
97
0
How do I solve an ImportError: No module named 'cStringIO' under Python 3.x?
python 3.x ImportError: No module named 'cStringIO'
1
0
0
138,242
28,200,366
2015-01-28T19:05:00.000
0
1
1
0
python-3.x,stringio,cstringio
68,349,549
3
false
0
0
I had the issue because my directory was called email. I renamed the directory to emails and the issue was gone.
2
97
0
How do I solve an ImportError: No module named 'cStringIO' under Python 3.x?
python 3.x ImportError: No module named 'cStringIO'
0
0
0
138,242
28,201,859
2015-01-28T20:32:00.000
2
0
0
0
python,django
28,201,899
2
false
1
0
Migrations are not required. They can be useful for creating and tracking database changes via code, but Django applications will run properly without them.
2
2
0
I want to use Django with nothing but legacy databases. Lots of them. I want to use raw SQL in my model(s). Do I need migration to make Django function properly? I don't want to use migration because I don't want Django to do anything with or to my databases. I prefer to use SQL and return data.
Is migration required in a Django application?
0.197375
0
0
228
28,201,859
2015-01-28T20:32:00.000
2
0
0
0
python,django
28,201,926
2
true
1
0
No, you don't need to use migrations. (Also, it may be relevant to note that you can use raw SQL, but Django will still set up some things for you so you can use its ORM, even with legacy databases. But migrations are not one of these things it does for you.)
2
2
0
I want to use Django with nothing but legacy databases. Lots of them. I want to use raw SQL in my model(s). Do I need migration to make Django function properly? I don't want to use migration because I don't want Django to do anything with or to my databases. I prefer to use SQL and return data.
Is migration required in a Django application?
1.2
0
0
228
28,202,854
2015-01-28T21:35:00.000
1
0
1
1
python-3.x,pip
28,203,008
2
false
0
0
In Python 3 the program will be installed as pip3. So you should be able to find it using which pip3.
1
0
0
Cannot locate PIP in a newly-installed Python3.4 (redhat linux 4) environment. $ python -V Python 3.4.1 $ which pip /usr/bin/which: no pip in (/usr/ $ python -m pip install requests /usr/local/bin/python3.4: No module named pip I installed this as an alternate installation and am able to successfully create and run pyt...
Cannot find PIP in a newly-installed Python3.4 (redhat linux 4) environment
0.099668
0
0
752
28,204,071
2015-01-28T23:01:00.000
23
0
0
0
python,flask,python-decorators,flask-login
28,204,335
4
true
1
0
While there probably won't be any problem in this case no matter what the order, you probably want login_required to execute first so that you don't make queries and paginate results that will just get thrown away. Decorators wrap the original function bottom to top, so when the function is called the wrapper added by ...
1
15
0
I'm using the login_required decorator and another decorator which paginates output data. Is it important which one comes first?
Does the order of decorators matter on a Flask view?
1.2
0
0
3,907
28,205,527
2015-01-29T01:25:00.000
2
0
0
1
python,sockets,http,webserver
28,205,847
1
false
0
0
Found it! It is "self.request"!! Confusing style of naming.
1
1
0
In C socket programming at the server-side, after a connection is accepted we can get a handle of the new socket (who is transmitting the data) by "connfd" which is the return value of "accept". Now I'm trying to implement a web server with Python, I have a handler based on BaseHttpRequestHandler, who handles the requ...
where's the equivalent of connfd (created socket in C) in python's BaseHTTPRequestHandler
0.379949
0
1
141
28,207,166
2015-01-29T04:45:00.000
-2
0
1
0
list,python-3.x,append
70,091,548
4
false
0
0
y = [] [y.append(i) for i in range(10)] print(y) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1
7
0
I am trying to append numbers from a generator to an empty list using a single line for loop but it returns None. I understand it can be done using a for loop with 2 lines but I was wondering what I am missing. i.e., >>> [].append(i) for i in range(10) [None, None, None, None, None, None, None, None, None, None] I was...
Append to an empty list using a single line for-loop python
-0.099668
0
0
22,106
28,215,153
2015-01-29T12:46:00.000
3
0
0
0
python
28,215,366
2
false
1
0
If you are using Windows i would suggest using Windows Task Scheduler, it's quite simple thanks to the UI and from there Trigger your Python code. For a server environment like Linux you could set up a Cron task.
1
3
0
I am having a simple python script scraping some data from html page and writing out results to a csv file. How can I automate the scraping, i.e. kick it off every five minutes under Windows. Thanks Peter
Run python script every 5 minutes under Windows
0.291313
0
1
11,625
28,215,502
2015-01-29T13:05:00.000
2
0
0
1
python,svn,externals
28,215,771
1
true
0
0
First of all, don't use sed. Use Python's string methods or the re module. Second, I recommend to run svn propget ... first, to fetch the old value. Then, you manipulate it (within Python, no need to run sed). Finally, you run svn propset. Alternatively, you could run a second Python script as editor for svn propedit. ...
1
0
0
I am currently writing a python script which needs to run a sed command to replace stuff from the svn:externals data. I tried to run sed on "svn propedit svn:externals ." but the outcome is not the one expected. Does anyone know how to do this ?
Run replace command on svn:externals (python)
1.2
0
0
153
28,216,315
2015-01-29T13:46:00.000
0
1
1
0
php,python,wordpress,amazon-web-services
28,217,518
2
false
1
0
If you can run it on the same physical server, you can run it on an EC2 server the same way. There is no difference as far as that is concerned.
1
0
0
I'm running a Python-based application on an AWS instance but now I want to install a Wordpress (PHP) blog as a sub-domain or as a sub-folder as an addition in the application. Is it technically possible to run two different stack applications on a single cloud instance? Currently getting an inscrutable error installin...
Running different stacks on same cloud instance
0
0
0
31
28,216,549
2015-01-29T13:58:00.000
1
0
0
0
python,django,angularjs,heroku
28,218,300
2
false
1
0
There's nothing particularly special about this setup. Angular code is just static files, and can be served from whatever point you want; then the Ajax calls to the REST backend go to the endpoint you determined.
1
5
0
I have a project consisting of the Django Rest Backend and AngularJS frontend. The project root directory contains two folders: backend and frontend, in the first one there is placed the whole Django app and in the second one the Angular frontend app. Is it possible to deploy such a structure to Heroku in one subdomain...
Django + Angular deployment on Heroku
0.099668
0
0
2,836
28,222,797
2015-01-29T19:17:00.000
1
0
0
0
python,rest,twilio
28,222,877
2
false
0
1
This is where Twilio gets tricky. Technically the call is picked up instantly, so there is no timeout to let it ring. What you can do, is initialize the phone call with a timeout, and using the Play verb, use an MP3 recording of the standard ring before letting the program do it's thing.
1
0
0
I have just started using twillio. Im not sure if its the right tool for what I am trying. Currently if I dial my number, there is no ring, it just picks up straight away. The reason I am mentioning this is because I would like it to first ring before it picks up. So my user can actually put down the phone before the c...
Letting twillio ring before it picks up
0.099668
0
0
91
28,225,600
2015-01-29T22:10:00.000
3
0
0
0
python,image,image-processing,matplotlib,scipy
28,225,707
1
true
0
0
I think I've figured out why. By convention, floats in skimage are supposed to be in the range [0, 1].
1
1
1
I have an array of graysale image read in from a color one. If I use matplotlib to imshow the grayscale image, it looks just fine. But when I io.imsave it, it's ruined (by an outrageous amount of noise). However, if I numpy.around it first before io.imsave-ing, then it's significantly better, but black and white are st...
skimage.io.imsave "destroys" grayscale image?
1.2
0
0
998
28,226,283
2015-01-29T22:58:00.000
-3
0
1
0
python,deployment
28,262,034
2
false
0
0
So the question is how do I solve this? You have not solve this problem anyhow. There is no any method to describe external dependencies outside of python ecosystem in setup.py. Just provide it in a README.
1
7
0
For python applications that install with pip, how can you handle their C extension requirements automatically? For example, the mysqlclient module requires development libs of MySQL installed on the system. When you initially install an application requiring that module it'll fail if the MySQL development libraries a...
How to handle C extensions for python apps with pip?
-0.291313
0
0
371
28,228,383
2015-01-30T02:41:00.000
17
0
1
0
python,utf-8
28,228,471
2
true
0
0
"\n" is the class Unix/linux style for new line. "\r\n" is the default Windows style for line separator. "\r" is classic Mac style for line separator. I think "\n" is better, because this also looks good on windows, but some "\r\n" may not looks so good in some editor under linux, such as eclipse or notepad++. If you a...
1
14
0
I have a script that sometimes prints a newline as \n and sometimes uses \r\n. What is the difference between the two, and is one preferable over the other?
Difference between \n and \r\n in python
1.2
0
0
46,931
28,228,431
2015-01-30T02:48:00.000
0
0
0
0
python,pygame,collision
28,228,513
1
true
0
1
What you are looking for is functionality usually provided by a so-called physics engine. For very basic shapes, it is simple enough to code the basic functionality yourself. (The simplest case for 2D shapes is the collision detection between circles). Collision detection gets pretty hard pretty quickly, especially ...
1
0
0
I have a pygame program where there's a face in the center. What I want the program to do is have a bunch of objects on the screen, all irregular. Some would be circles, others would be cut-out pictures of objects like surf boards, chairs, bananas, etc. The user would be able to drag the objects around, and they'd coll...
Pygame image collision
1.2
0
0
123
28,229,010
2015-01-30T03:57:00.000
5
0
1
0
python-2.7,logging,ide,anaconda,spyder
28,279,767
2
false
0
0
(Spyder dev here) Well, there is a way to save the output shown in our consoles but not after each execution. You have to do it manually, like this: For our Python consoles, you need to do a right mouse click over any console and select the option Save history log. For our IPython consoles, you need to do a right mous...
2
5
0
I use Spyder as my Python IDE. In most of what I do I use the editor to write code and execute portions of the program one at a time. I typically go back and forth, change things, add pieces, execute portions... you get it. Is there a way to save to file what Spyder shows in the console portion of the IDE after each po...
How can save to file the on screen output of a Python IDE?
0.462117
0
0
10,295
28,229,010
2015-01-30T03:57:00.000
0
0
1
0
python-2.7,logging,ide,anaconda,spyder
39,460,738
2
false
0
0
One way to capture entire console output of Sypder IDE: 1. Go to "Profile" (Shortcut: F10) under "Run" Tab. 2. On Right hand side, you can see Run, Stop and Output buttons. 3. Click on Run and the entire console session is captured under Output. Hope, this helps. Kindly correct me if I am wrong.
2
5
0
I use Spyder as my Python IDE. In most of what I do I use the editor to write code and execute portions of the program one at a time. I typically go back and forth, change things, add pieces, execute portions... you get it. Is there a way to save to file what Spyder shows in the console portion of the IDE after each po...
How can save to file the on screen output of a Python IDE?
0
0
0
10,295
28,230,528
2015-01-30T06:40:00.000
0
0
1
1
python,python-2.7,cygwin
28,230,732
2
false
0
0
No, you don't need to do so. In fact, CYGWIN will inherit the PC's PATH, plus with virtual PATH, you can input "echo $PATH" in CYGWIN and input "PATH" and the windows console, you could find that CYGWIN has more PATH setting than the windows. However, as you already overwrite the bash_profile, so it might not looks as...
1
0
0
I would like to know the difference in installing Python, Paramiko packages in Cygwin and Python is already installed in my Windows PC. I have installed Cygwin too (but without Python package) and in Cygwin terminal I do the following: $echo "PATH=\$PATH:/cygdrive/c/Python27" >> .bash_profile then, source .bash_profi...
Python in Cygwin
0
0
0
1,910