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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32,715,175 | 2015-09-22T11:02:00.000 | 1 | 0 | 0 | 0 | python,mysql,django | 32,723,517 | 3 | false | 1 | 0 | This approach worked ! I was able to install the mysqlclient inside the virtual environment through the following command:-
python -m pip install mysqlclient
Thanks Much..!!!!! | 1 | 0 | 0 | I had posted about this error some time back but need some more clarification on this.
I'm currently building out a Django Web Application using Visual Studio 2013 on a Windows 10 machine (Running Python3.4). While starting out I was constantly dealing with the MySQL connectivity issue, for which I did a mysqlclient pi... | No Module Named MySqlDb in Python Virtual Enviroment | 0.066568 | 1 | 0 | 660 |
32,719,789 | 2015-09-22T14:36:00.000 | 2 | 0 | 0 | 0 | python,tkinter | 32,720,291 | 1 | true | 0 | 1 | No, there is no supported way to get the command via introspection. Your solution of adding it as an attribute is a perfectly reasonable thing to do. If you're bothered by the fact it takes two lines of code instead of one, you can subclass the button to hide that detail. | 1 | 1 | 0 | After a ttk.Button has been created, the name of the callback function can be obtained in various ways. But is there a way to obtain the callback function itself?
The use case is that I want to use the button's callback function in the callback function to be assigned to another widget.
Currently I'm assigning the but... | How can the command function be obtained from a Tkinter button? | 1.2 | 0 | 0 | 34 |
32,724,891 | 2015-09-22T19:04:00.000 | 1 | 0 | 1 | 0 | python,python-3.x | 32,725,931 | 1 | true | 0 | 0 | Let's say you have a program that reads a temperature from a sensor every minute, and stores them in a list. You might end up with a list like this:
[23, 24, 24, 23, 25, 24]
Now let's assume that sometimes the connection to your sensor fails (maybe it's wireless), and you get no reading. What do you put in your list? I... | 1 | 0 | 0 | I'm reading an online book about Python,and the writer mentioned that "the None value can be helpful when you need to store something that won’t be confused for a real value in a variable", but I didn't understand it.Can anybody explain that for me with an example? | The None value in Python | 1.2 | 0 | 0 | 196 |
32,725,493 | 2015-09-22T19:42:00.000 | 1 | 0 | 0 | 0 | python-3.x,flask | 32,732,460 | 1 | true | 1 | 0 | Short answer: Depends on when and where the class is initialised.
Objects have little to do with a user logging in and logging out. Object lifetimes are dependent on when and where they are initialised.
Objects initialised outside a function or class are effectively singletons and last as long as the application insta... | 1 | 1 | 0 | I have a web app that retrieves data from a database and displays it on a UI. I have a class called table that handles the database requests based on the URL variables.
My question is: Does flask recycle objects when a new URL is requested? Or does it keep the objects in memory until the user logs out?
Should I have o... | Lifetime of objects in a flask app | 1.2 | 0 | 0 | 958 |
32,728,024 | 2015-09-22T22:27:00.000 | 0 | 0 | 1 | 0 | python,bit,valueconverter | 32,728,304 | 3 | false | 0 | 0 | maybe someone will need:
From ctypes import c_short
C_short (0xF800 | (N & 0x7ff)). Value | 1 | 1 | 0 | I have the formula: (short) (0xF800 | (N & 0x7ff)). With the help of C/CPP/C# I changed the sign of the eight-bit numbers (eg 1202 numbers to -846). In Python this trick is not working. How do I get the same result? | operation with bit in python | 0 | 0 | 0 | 123 |
32,739,428 | 2015-09-23T12:19:00.000 | 2 | 0 | 0 | 0 | python,modelica | 32,745,918 | 2 | false | 1 | 0 | It might be a strcutrual parameter, these are evaluated also. It should work if you explicitly set Evaluate=False for the parameter that you want to study.
Is it not visible in the variable browser or is it just greyed out and constant? If it is not visible at all you should check if it is protected. | 1 | 3 | 0 | I want to run parameter studies in different modelica building libraries (buildings, IDEAS) with python: For example: change the infiltration rate.
I tried: simulateModel and simulateExtendedModel(..."zone.n50", [value])
My questions:Why is it not possible to translate the model and then change the parameter: Warning:... | Modelica Parameter studies with python | 0.197375 | 0 | 0 | 738 |
32,742,093 | 2015-09-23T14:18:00.000 | 20 | 0 | 0 | 1 | python,windows,python-2.7,cmd | 32,742,619 | 2 | true | 0 | 0 | py command comes with Python3.x and allow to choose among multiple Python interpreters. For example if you have both Python 3.4 and 2.7 installed, py -2 will start python2.7 and py -3 will start python3.4 . If you just use py it will start the one that was defined as default.
So the official way would be to install Pyt... | 1 | 6 | 0 | I have a very weird request. An executable I have has a system call to a python script which goes like py file1.py
Now, in my system though py is shown as an unrecognized internal or external command. python file1.py works however.
is there some way I can get my windows command prompt to recognize that py and python re... | how to access python from command line using py instead of python | 1.2 | 0 | 0 | 29,688 |
32,743,668 | 2015-09-23T15:28:00.000 | 1 | 0 | 0 | 0 | python,django,authentication,django-rest-framework,one-time-password | 32,759,648 | 1 | true | 1 | 0 | You can create a view that generates a time-based OTP and then use it in a custom auth module to authenticate against a single user. You can also use JWT with an expiry time to authenticate against a single user. | 1 | 2 | 0 | I have a Django and django rest framework project where I want a mobile to be able to request a token and then use that token for x minutes before they're disconnected. I do not want to create a user for each mobile device, I just want a one time password.
I tried using the auth system built into drf, however it requir... | Python Django DRF API one time session/token/pass authentication without a username/password | 1.2 | 0 | 0 | 1,261 |
32,751,538 | 2015-09-24T00:29:00.000 | 0 | 0 | 0 | 0 | android,python,rotation,kivy,buildozer | 32,758,159 | 2 | true | 0 | 1 | It would be much better to just not use absolute coordinates, but rather to use kivy's layout classes to achieve relative positioning (you can also specify the relative positioning manually but that's harder and more verbose, and you're just reinventing the layouts if you do it).
In any case, the direct answer to your ... | 1 | 0 | 0 | I just made an apk app using kivy. In the code, I defined the positions of all widgets according to scale of the screen. However, when I rotate the screen, say, from portrait to landscape, the absolute coordinates still stay the same, and it doesn't fit in very well.
Is there a method to identify whether portrait or la... | How to identify whether the screen is in Portrait or Landscape in Kivy | 1.2 | 0 | 0 | 888 |
32,755,412 | 2015-09-24T07:09:00.000 | 0 | 1 | 1 | 0 | python,function,python-import,code-organization | 32,755,617 | 3 | true | 0 | 0 | It's a common use to make all imports on top, mainly for readability: you shouldn't have to look around the whole code to find an import. Of course you have to import a symbol before you can use it.
Anyway in Python it's not always wrong to import inside functions or classes, this is because of the way Python actually ... | 3 | 1 | 0 | I'm writing a password management program that encrypts the passwords and saves the hashes to a document. Should I import before defining the functions, import in the functions they are used, or import after defining the functions but before running the functions. I'm trying to make my code as neat as possible. I'm cur... | Python - Does it matter if i import modules before or after defining functions? Newb Ques | 1.2 | 0 | 0 | 308 |
32,755,412 | 2015-09-24T07:09:00.000 | 0 | 1 | 1 | 0 | python,function,python-import,code-organization | 32,755,537 | 3 | false | 0 | 0 | It's a good style to import in the very beginning of the code. So you have an overview and can avoid multiple imports. | 3 | 1 | 0 | I'm writing a password management program that encrypts the passwords and saves the hashes to a document. Should I import before defining the functions, import in the functions they are used, or import after defining the functions but before running the functions. I'm trying to make my code as neat as possible. I'm cur... | Python - Does it matter if i import modules before or after defining functions? Newb Ques | 0 | 0 | 0 | 308 |
32,755,412 | 2015-09-24T07:09:00.000 | 0 | 1 | 1 | 0 | python,function,python-import,code-organization | 32,755,514 | 3 | false | 0 | 0 | Typically imports come first in any design pattern I have seen. Imports > large scope variables > functions. | 3 | 1 | 0 | I'm writing a password management program that encrypts the passwords and saves the hashes to a document. Should I import before defining the functions, import in the functions they are used, or import after defining the functions but before running the functions. I'm trying to make my code as neat as possible. I'm cur... | Python - Does it matter if i import modules before or after defining functions? Newb Ques | 0 | 0 | 0 | 308 |
32,756,140 | 2015-09-24T07:54:00.000 | 2 | 0 | 0 | 0 | python,c++,opencv,cuda,nvidia | 32,797,781 | 1 | false | 0 | 0 | Upgrading from CMake 2.8 to CMake 3.2.2 seems to have solved this particular issue.
[This answer has been added from information gleaned from comments in order to get the question off the unanswered list] | 1 | 0 | 1 | I installed OpenCV 3.0.0 but I'm having troubles any C++ or Python code using OpenCV. For testing, I went into the directory opencv-3.0.0/samples and ran cmake to build the samples. I got the following error:
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find C... | OpenCV can't find the right version of CUDA | 0.379949 | 0 | 0 | 1,214 |
32,756,711 | 2015-09-24T08:25:00.000 | 12 | 0 | 1 | 0 | python,flask,virtualenv | 32,756,729 | 1 | true | 1 | 0 | No, there is no requirement to use a virtualenv. No project ever would require you to use one; it is just a method of insulating a collection of Python libraries from other projects.
I personally do strongly recommend you use a virtualenv, because it makes it much, much easier to swap out versions of libraries and not ... | 1 | 6 | 0 | I just started exploring Flask. Earlier I tried to explore Django but found it a bit complicated. However, Installing Flask requires us to install virtualenv first which, As I can recall, is not required in the case of Django.
In case it is not required, how to go ahead without virtualenv? | Is it necessary to use virtualenv to use Flask framework? | 1.2 | 0 | 0 | 2,441 |
32,759,078 | 2015-09-24T10:30:00.000 | 1 | 0 | 0 | 1 | python,c,file-descriptor | 32,759,245 | 2 | false | 0 | 0 | Look earlier in the strace output for when the file descriptor was returned from open() (or perhaps socket()), there you'll see the additional arguments used in the call. | 1 | 1 | 0 | I am trying to debug a process that hangs, the output of strace for the process id has last line :
recvfrom(9, <detached ...>
From this what I understand that the process is waiting on the socket.
But I don't know which or what kind of socket is this. How can I discover more about this ? does the file descriptor 9 wi... | How to find more information about the file descriptor? | 0.099668 | 0 | 0 | 2,426 |
32,759,082 | 2015-09-24T10:30:00.000 | 2 | 0 | 0 | 0 | python,django,api,rest,response | 32,759,144 | 1 | true | 1 | 0 | As far as I know, No you can't send Multipart http response not yet atleast. Multipart response is only valid in http requests. Why? Because no browser as I know of completely supports this.
Firefox 3.5: Renders only the last part, others are ignored.
IE 8: Shows all the content as if it were text/plain, including the... | 1 | 2 | 0 | I apologise if this is a daft question. I'm currently writing against a Django API (which I also maintain) and wish under certain circumstances to be able to generate multiple partial responses in the case where a single request yields a large number of objects, rather than sending the entire JSON structure as a single... | Can Django send multi-part responses for a single request? | 1.2 | 0 | 0 | 1,409 |
32,759,106 | 2015-09-24T10:32:00.000 | -1 | 0 | 1 | 1 | python | 32,759,202 | 1 | false | 0 | 0 | Simply pass the full path you have now to os.path.basename to get only the filename part. | 1 | 0 | 0 | I'd like to find out the currently running script's file name. Usually via __file__ or __main__.__file__ or even with sys.argv[0].
But when installed as shell command with setup.py and entry_points / console_scripts, /usr/local/bin/... is returned instead of the actual file name.
My next guess was the inspect module, l... | actual script file name when installed as shell command with setup.py | -0.197375 | 0 | 0 | 31 |
32,760,681 | 2015-09-24T11:55:00.000 | 1 | 0 | 0 | 0 | python,django,url,tags,server-error | 32,765,111 | 1 | false | 1 | 0 | I solved the issue by adding #-*- coding: utf-8 -*- at the begenning of all my Python (*.py) files because it's an old version about python (2.6)
Thank's to all :) | 1 | 1 | 0 | I have an issue when I put online my Django Project.
If I have an {% url ... %} tag in my main html file (base.html), I see "Server Error 500".
If I remove all these lines with {% url ... %}, my django website works fine and the "Server Error 500" disappears ! I have this issue only with the URL tag.
For information,... | Django - Server error 500 with URL tag | 0.197375 | 0 | 0 | 419 |
32,761,556 | 2015-09-24T12:38:00.000 | 8 | 0 | 1 | 0 | python,parallel-processing,scikit-learn,joblib | 55,287,554 | 3 | false | 0 | 0 | what is the point of using n-jobs (and joblib) if the the library uses all cores anyway?
It does not, if you specify n_jobs to -1, it will use all cores. If it is set to 1 or 2, it will use one or two cores only (test done scikit-learn 0.20.3 under Linux). | 2 | 19 | 1 | This is not a real issue, but I'd like to understand:
running sklearn from Anaconda distrib on a Win7 4 cores 8 GB system
fitting a KMeans model on a 200.000 samples*200 values table.
running with n-jobs = -1: (after adding the if __name__ == '__main__': line to my script) I see the script starting 4 processes with
10... | Python scikit learn n_jobs | 1 | 0 | 0 | 46,321 |
32,761,556 | 2015-09-24T12:38:00.000 | -1 | 0 | 1 | 0 | python,parallel-processing,scikit-learn,joblib | 59,874,972 | 3 | false | 0 | 0 | You should either use n_jobs or joblib, don't use both simultaneously. | 2 | 19 | 1 | This is not a real issue, but I'd like to understand:
running sklearn from Anaconda distrib on a Win7 4 cores 8 GB system
fitting a KMeans model on a 200.000 samples*200 values table.
running with n-jobs = -1: (after adding the if __name__ == '__main__': line to my script) I see the script starting 4 processes with
10... | Python scikit learn n_jobs | -0.066568 | 0 | 0 | 46,321 |
32,762,675 | 2015-09-24T13:29:00.000 | 2 | 1 | 0 | 1 | python,salt-stack | 32,769,491 | 1 | true | 0 | 0 | Only python extensions are supported, so your best bet is to do the following:
1) Deploy your non-Python components via a file.managed / file.recurse state.
2) Ensure your custom execution module has a __virtual__() function checking for the existence of the non-Python dependencies, and returning False if they are not ... | 1 | 0 | 0 | I am currently transforming a perl / bash tool into a salt module and I am wondering how I should sync the non-python parts of this module to my minions.
I want to run salt agent-less and ideally the dependencies would by synced automatically alongside the module itself once its called via salt-ssh.
But it seems that o... | How to sync a salt execution module with non-python dependencies | 1.2 | 0 | 0 | 284 |
32,763,625 | 2015-09-24T14:12:00.000 | 1 | 1 | 1 | 0 | python,neo4j,py2neo | 32,781,464 | 1 | true | 0 | 0 | Depending on which version of py2neo you're using, and which Cypher endpoint - legacy or transactional - this may be one of the auto-generated errors built dynamically from the server response. Newer functionality (i.e. the transaction endpoint) no longer does this and instead holds hard-coded definitions for all excep... | 1 | 3 | 0 | I'm expectedly getting a CypherExecutionException. I would like to catch it but I can't seem to find the import for it.
Where is it?
How do I find it myself next time? | import for py2neo.error.CypherExecutionException | 1.2 | 0 | 0 | 139 |
32,768,371 | 2015-09-24T18:25:00.000 | 1 | 0 | 1 | 0 | python,pycharm,interpreter | 57,447,300 | 4 | false | 0 | 0 | I think it's better to run this command
$ sudo apt-get install python3-distutils | 2 | 4 | 0 | When I try to run code in editor,it says that there is no available interpreters.Please,help.How can I solve the problem? | How can I add interpreter to PyCharm? | 0.049958 | 0 | 0 | 33,226 |
32,768,371 | 2015-09-24T18:25:00.000 | 0 | 0 | 1 | 0 | python,pycharm,interpreter | 69,997,735 | 4 | false | 0 | 0 | Go to File.
Settings
Then you receive another window. Find line which is called project name.
Expand and it Click interpeter.
Then click the wheel icon which is next to the interpreter.
Click add button.
Then it gives a new window. Then we can create a new environment or add exiting environment.
Choos is yours..... | 2 | 4 | 0 | When I try to run code in editor,it says that there is no available interpreters.Please,help.How can I solve the problem? | How can I add interpreter to PyCharm? | 0 | 0 | 0 | 33,226 |
32,771,481 | 2015-09-24T21:48:00.000 | 1 | 0 | 0 | 0 | python,pygame,python-idle | 32,771,570 | 1 | false | 0 | 1 | If you're on windows, a quick thing could be to make a one-line batch script.
start pythonw.exe <filename>
The start keyword causes the shell to not wait for the program to finish.
pythonw vs python prevents the python terminal from appearing.
If you're on linux/mac, you could do the same with shell scripts. | 1 | 0 | 0 | I'm just wondering (as im starting to make a game with pygame) is there a way to 1) Run a program that only opens a GUI and not the shell
and
2) Run the program without having to edit with idle (I'd like to do this so the game will look more professional.
I would like to just have a desktop shortcut or something that ... | How to make the text shell not appear when running a program | 0.197375 | 0 | 0 | 87 |
32,772,343 | 2015-09-24T23:06:00.000 | 0 | 0 | 0 | 0 | python,apache,flask | 32,772,507 | 1 | false | 1 | 0 | You could use S3 to host the file with a temporary URL. Use Flask to upload the file to S3 (using boto3), but use a dynamically-generated temporary key.
Example URL: http://yourbucket.s3.amazon.com/static/c258d53d-bfa4-453a-8af1-f069d278732c/sound.mp3
Then, when you tell the user where to download the file, give them t... | 1 | 2 | 0 | I have a Flask app that lets users download MP3 files. How can I make it so the URL for the download is only valid for a certain time period?
For example, instead of letting anyone simply go to example.com/static/sound.mp3 and access the file, I want to validate each request to prevent an unnecessary amount of bandwidt... | How to generate temporary downloads in Flask? | 0 | 0 | 0 | 684 |
32,772,672 | 2015-09-24T23:45:00.000 | 1 | 1 | 0 | 1 | python,image,file,sequence,exists | 32,875,932 | 2 | false | 0 | 0 | You should probably not loop for candidates using os.path.isfile(), but use glob.glob() or os.listdir() and check the returned lists for matching your file patterns, i.e. prefer memory operations over disk accesses. | 2 | 0 | 0 | I have a potentially big list of image sequences from nuke. The format of the string can be:
/path/to/single_file.ext
/path/to/img_seq.###[.suffix].ext
/path/to/img_seq.%0id[.suffix].ext, i being an integer value, the values between [] being optional.
The question is: given this string, that can represent a sequence or... | Fastest way to check if an image sequence string actually exists on disk | 0.099668 | 0 | 0 | 1,146 |
32,772,672 | 2015-09-24T23:45:00.000 | 0 | 1 | 0 | 1 | python,image,file,sequence,exists | 32,930,114 | 2 | false | 0 | 0 | If there are potentially so many files that you're worried about wasting memory for a dictionary that holds them all, you could just store a single key for each img_seq.###[.suffix].ext pattern, removing the sequence number as you scan the directory. Then a single lookup will suffice. The values in the dictionary could... | 2 | 0 | 0 | I have a potentially big list of image sequences from nuke. The format of the string can be:
/path/to/single_file.ext
/path/to/img_seq.###[.suffix].ext
/path/to/img_seq.%0id[.suffix].ext, i being an integer value, the values between [] being optional.
The question is: given this string, that can represent a sequence or... | Fastest way to check if an image sequence string actually exists on disk | 0 | 0 | 0 | 1,146 |
32,772,954 | 2015-09-25T00:21:00.000 | 2 | 0 | 0 | 0 | python,python-2.7,openpyxl | 32,776,318 | 2 | false | 0 | 0 | If you want to preserve the integrity of the workbook, ie. retain the formulae, the you cannot use data_only=True. The documentation makes this very clear. | 1 | 6 | 0 | Because I need to parse and then use the actual data in cells, I open an xlsm in openpyxl with data_only = True.
This has proved very useful. Now though, having the same need for an xlsm that contains formuale in cells, when I then save my changes, the formulae are missing from the saved version.
Are data_only = True a... | How to save in openpyxl without losing formulae? | 0.197375 | 1 | 0 | 6,128 |
32,773,464 | 2015-09-25T01:40:00.000 | 17 | 0 | 1 | 0 | java,python,arrays,arraylist | 32,773,699 | 2 | true | 0 | 0 | ArrayList in java and list in python are both dynamic arrays. They both have O(1) average indexing time and O(1) average adding an element to the end time.
Array in java is not tuple in python. While it is true that you cannot add elements to both data structures. Python tuple does not support assignment, that is you c... | 2 | 8 | 0 | I just looked up array and arrayList
and found out that an array is fixed length and can't be changed while an arraylist can be changed and is variable in length
my question is:
is array == tuple in python?
and is arraylist == list in python?
and if they aren't what are array and arraylist's python equivalent? | Array ArrayList python equivalent | 1.2 | 0 | 0 | 33,386 |
32,773,464 | 2015-09-25T01:40:00.000 | 0 | 0 | 1 | 0 | java,python,arrays,arraylist | 32,773,498 | 2 | false | 0 | 0 | Java's ArrayList is similar to Python's List.
Nicer than Array for adding and removing items.
Java's Array has fixed length like you
mentioned.
Not sure what its equivalent in Python would be. | 2 | 8 | 0 | I just looked up array and arrayList
and found out that an array is fixed length and can't be changed while an arraylist can be changed and is variable in length
my question is:
is array == tuple in python?
and is arraylist == list in python?
and if they aren't what are array and arraylist's python equivalent? | Array ArrayList python equivalent | 0 | 0 | 0 | 33,386 |
32,774,520 | 2015-09-25T03:54:00.000 | -1 | 0 | 0 | 0 | python,matplotlib | 59,199,255 | 5 | false | 0 | 0 | Had this problem. You just have to use show() function to show it in a window. Use pyplot.show() | 2 | 26 | 1 | I am using python 2.7.9 on win8. When I tried to plot using matplotlib, the following error showed up:
from pylab import *
plot([1,2,3,4])
[matplotlib.lines.Line2D object at 0x0392A9D0]
I tried the test code "python simple_plot.py --verbose-helpful", and the following warning showed up:
$HOME=C:\Users\XX
matplot... | why matplotlib give the error []? | -0.039979 | 0 | 0 | 61,800 |
32,774,520 | 2015-09-25T03:54:00.000 | 0 | 0 | 0 | 0 | python,matplotlib | 62,611,119 | 5 | false | 0 | 0 | When you run plt.plot() on Spider, you will now receive the following notification:
Figures now render in the Plots pane by default. To make them also appear inline in the Console, uncheck "Mute Inline Plotting" under the Plots pane options menu.
I followed this instruction, and it works. | 2 | 26 | 1 | I am using python 2.7.9 on win8. When I tried to plot using matplotlib, the following error showed up:
from pylab import *
plot([1,2,3,4])
[matplotlib.lines.Line2D object at 0x0392A9D0]
I tried the test code "python simple_plot.py --verbose-helpful", and the following warning showed up:
$HOME=C:\Users\XX
matplot... | why matplotlib give the error []? | 0 | 0 | 0 | 61,800 |
32,774,796 | 2015-09-25T04:25:00.000 | 2 | 0 | 0 | 0 | python,django,solr | 32,996,183 | 1 | true | 1 | 0 | It seems Django-Haystack does not support SOLR 5 well. SOLR 5's solrconfig.xml file for its core uses ManagedIndexSchemaFactory as default schemaFactory. If you change it to ClassicIndexSchemaFactory, you will run in troubles with your schema.xml which is generated by python manage.py build_solr_schema. Lots of fields... | 1 | 2 | 0 | Trying to find an example of how to build an application using solr 5.x with django-haystack, but most examples online are using solr 4.x or solr 3.x. Can anyone give some instructions on how to work with solr 5.x using django-haystack, or just offer some example project? Thanks! | Can anyone offer a full example of django-haystack with solr 5.x? | 1.2 | 0 | 0 | 520 |
32,775,445 | 2015-09-25T05:31:00.000 | 0 | 0 | 1 | 0 | python,oop | 32,775,491 | 2 | false | 0 | 0 | If you are reading a normal attribute then it doesn't matter. If you are binding a normal attribute then you must use the correct one in order for the code to work. If you are accessing a descriptor then you must use an instance. | 1 | 0 | 0 | I was searching for the meaning of default parameters object,self that are present as default class and function parameters, so moving away from it, if we are calling an attribute of a class should we use Foo (class reference) or should we use Foo() (instance of the class). | What is the functionality difference between the Reference of a class and its object/instance in python while calling its objects? | 0 | 0 | 0 | 47 |
32,776,134 | 2015-09-25T06:31:00.000 | 5 | 0 | 0 | 0 | python,numpy,pandas,bigdata | 32,776,321 | 1 | true | 0 | 0 | Memory consumption depends very much on the way data is stored. For example 1 as string takes only one byte, as an int it takes two bytes and eight bytes as double. Then there is the overhead of creating it as in Object of DaataFrame and Series. All this is done for efficient processing.
As a general rule of thumb data... | 1 | 0 | 1 | I am new to bigdata, I want to parse the whole data, so I cant split it when i try to use numpy array for processing 1 GB data it takes 4GB memory (In real time I am dealing with huge data). Is there any optimized way to use these array for this much data or any special function to handle huge data. | Why Numpy and Pandas arrays consuming more memory than source data? | 1.2 | 0 | 0 | 1,066 |
32,777,369 | 2015-09-25T07:53:00.000 | 0 | 0 | 1 | 1 | python,ubuntu,python-import,python-c-extension,python-install | 32,778,352 | 3 | false | 0 | 0 | I reinstalled Python 3.4 via Ubuntu package system, and suddenly everything worked fine. I still have no clue how Ubuntu customize its own Python, since Python's configure command has no related option at all. Anyway, it works, so why bother :P. Finally, thank you for helping me with this problem. | 2 | 1 | 0 | I installed Python 3.5 from source and broke a number of modules on Python 3.4, which unfortunately, was an essential part of Ubuntu. I've been trying to fix the system, now I'm almost there, with (hopefully) the last problem: My Python 3.4 only recognize C modules with name *.cpython-34m.so, while all packages from Ub... | How to change python's "full name" (something like `cpython-34m-x86_64-linux-gnu`)? | 0 | 0 | 0 | 348 |
32,777,369 | 2015-09-25T07:53:00.000 | 1 | 0 | 1 | 1 | python,ubuntu,python-import,python-c-extension,python-install | 32,778,449 | 3 | true | 0 | 0 | What you are trying makes no sense. The name cannot be changed, for a good reason. The reason the names are different is to prevent incompatible versions from mixing up each other. You can compile a different version with different options and then the name will be different, too. | 2 | 1 | 0 | I installed Python 3.5 from source and broke a number of modules on Python 3.4, which unfortunately, was an essential part of Ubuntu. I've been trying to fix the system, now I'm almost there, with (hopefully) the last problem: My Python 3.4 only recognize C modules with name *.cpython-34m.so, while all packages from Ub... | How to change python's "full name" (something like `cpython-34m-x86_64-linux-gnu`)? | 1.2 | 0 | 0 | 348 |
32,777,714 | 2015-09-25T08:14:00.000 | 4 | 0 | 1 | 0 | python,qt,pyqt,pyside,cython | 32,781,979 | 1 | true | 0 | 0 | You can Cythonize your modules file by file if you want to, however all the dependencies will remain the way they are in Python. Cython does not provide a mechanism to embedd all the required modules the way pyinstaller does.
This is, however, a bad idea. The general approach for optimization in scientific python is t... | 1 | 3 | 0 | I have a PySide project with many modules, files and folders. I also used Numpy, Matplotlib and many other modules.
I want to build this project with cython. The code is pure python, and i want cython to add all dependencies together, just like when using pyinstaller
is it possible or cython is just made for writing ex... | how to build whole python project with cython | 1.2 | 0 | 0 | 3,039 |
32,778,316 | 2015-09-25T08:50:00.000 | 1 | 0 | 1 | 0 | python,vim,intellij-idea | 32,778,637 | 3 | true | 0 | 0 | It seems that vim used tabs for indentation whereas it is common in Python to use whitespaces. Code -> Reformat Code... in Intellij will make correct indentation.
Or you can choose Edit -> Convert Indents and convert tabs to white spaces. | 1 | 1 | 0 | I am a vim user and edited a large python file using vim, everything is OK and it could run properly. Now I want to build a huge projects and I want to edit this python file in Intellij, but the indentation in intellij is completely wrong, and it's hard for me to edit one line by one line. Do you know what happened? (i... | python file edited in vim move to intellij meet inconsistent indentation error | 1.2 | 0 | 0 | 71 |
32,778,426 | 2015-09-25T08:56:00.000 | 0 | 0 | 1 | 0 | python,visual-studio | 32,779,409 | 1 | false | 0 | 0 | All Python distributions include random module and as it is part of the Python standard library. Unless Python is purposely slimmed down e.g. for embedded environments. But in this case it should not be the case.
_random (And all underscore prefixed modules) are native extensions for Python written in C and should not ... | 1 | 1 | 0 | Simple question: When using pip to install a library in the Python Environment window of Visual Studio 2015 Community I find the import statement then requires an underscore.
Example
Normal Python distribution: import random
Community : import _random
I also find random.randint() is now not available in the community... | Python Library differences between vendors | 0 | 0 | 0 | 73 |
32,786,482 | 2015-09-25T16:15:00.000 | 2 | 0 | 0 | 0 | python,django,django-admin | 32,786,679 | 2 | true | 1 | 0 | If you don't want to use Django's Group and Permission, maybe you don't want to use django.contrib.auth at all? If that is the case, simply remove django.contrib.auth from INSTALLED_APPS.
However, I want to point out that I can't really think of a usecase where this would make sense. You have to have a really good reas... | 1 | 1 | 0 | I want to create my own Group and Permission model. However, Django has its built-in models for this which are giving me naming conflicts on it's own modelGroup. I know you can deregister to remove it from this admin, but this does not help me.
What is best here?
Is it possible to use Django's own and models for Group... | How to remove Group and Permission models from Django | 1.2 | 0 | 0 | 3,099 |
32,786,620 | 2015-09-25T16:24:00.000 | -1 | 0 | 0 | 0 | python,mysql,linux,python-2.7 | 32,786,846 | 2 | false | 0 | 0 | Nevermind!!!
Apparently I am installing Python and libraries in the right directories and such (I have always used YUM), but apparently there are other versions of Python installed.. need to clean that up.
Running: /usr/bin/python
All the modules worked!
Running: python (Linux finding python in the path somewhere)
Mod... | 2 | 0 | 0 | Arrghh... I am trying to use mySQL with Python. I have installed all the libraries for using mySQL, but keep getting the: "ImportError: No module named mysql.connector" for "import mysql.connector", "mysql", etc..
Here is my config:
I have a RHEL server:
Red Hat Enterprise Linux Server release 6.7 (Santiago)
with P... | mySQL within Python 2.7.9 | -0.099668 | 1 | 0 | 544 |
32,786,620 | 2015-09-25T16:24:00.000 | 2 | 0 | 0 | 0 | python,mysql,linux,python-2.7 | 32,786,680 | 2 | true | 0 | 0 | You should use virtualenv in order to isolate the environment. That way your project libs won't clash with other projects libs. Also, you probably should install the Mysql driver/connector from pip.
Virtualenv is a CLI tool for managing your environment. It is really easy to use and helps a lot. What it does is to crea... | 2 | 0 | 0 | Arrghh... I am trying to use mySQL with Python. I have installed all the libraries for using mySQL, but keep getting the: "ImportError: No module named mysql.connector" for "import mysql.connector", "mysql", etc..
Here is my config:
I have a RHEL server:
Red Hat Enterprise Linux Server release 6.7 (Santiago)
with P... | mySQL within Python 2.7.9 | 1.2 | 1 | 0 | 544 |
32,788,716 | 2015-09-25T18:45:00.000 | 0 | 0 | 0 | 0 | python,excel,openpyxl | 32,790,713 | 1 | false | 0 | 0 | openpyxl does not support multiple styles within an individual cell. | 1 | 3 | 0 | I wrote a Python program which produces invoices in a specific form as .xlsx files using openpyxl. I have the general invoice form as an Excel workbook and my program copies this form and fills up the details about the specific client (eg. client refernce number, price, etc.) which are read from another .txt file.
The ... | Multiple styles in one cell in openpyxl | 0 | 1 | 0 | 1,165 |
32,789,247 | 2015-09-25T19:22:00.000 | 1 | 1 | 1 | 0 | multithreading,python-2.7,serialization,subprocess | 32,807,914 | 2 | false | 0 | 0 | There can be different approaches based on the type of architecture and driver. One of them can be as below :
As soon as you receive data via receive interrupt, post the data to the main receive buffer queue. There can be a single thread called Rx dispatcher/Rx Manager that always reads the main receive buffer queue an... | 1 | 3 | 0 | I have a serial port which gives me a lot of different data from different pieces of hardware. I need to send different commands to the serial port to receive different kinds of data from it. So, I need to write and read data simultaneously from the port in different functions. Sometimes, I might need to read and write... | Reading and writing from a single serial port simultaneously from multiple threads | 0.099668 | 0 | 0 | 5,692 |
32,791,851 | 2015-09-25T23:03:00.000 | 20 | 0 | 0 | 0 | python,django,postgresql,hstore,jsonb | 32,792,698 | 1 | true | 1 | 0 | If you need indexing, use jsonb if you're on 9.4 or newer, otherwise hstore. There's really no reason to prefer hstore over jsonb if both are available.
If you don't need indexing and fast processing and you're just storing and retrieving validated data, use plain json. Unlike the other two options this preserves dupli... | 1 | 21 | 0 | Django 1.8 provides HStoreField and Django 1.9 will provide JSONField (which uses jsonb) for PostgreSQL.
My understanding is that hstore is faster than json, but does not allow nesting and only allows strings.
When should one be used over the other? Should one be preferred over the other? Is hstore still the clear winn... | When should HStoreField be used instead of JSONField? | 1.2 | 0 | 0 | 4,193 |
32,794,943 | 2015-09-26T07:57:00.000 | 1 | 0 | 0 | 0 | python,ssl,automated-tests,twisted | 32,816,518 | 1 | false | 0 | 0 | Ultimately Twisted will just speak TLS to a Transport and dump bytes into it; you can specify a pyOpenSSL context object configured however you like. So this is really more of a question about pyOpenSSL or Cryptography.
The TLS handshake generally involves generating random data (session keys) at various points. Whil... | 1 | 0 | 0 | I've written a TLS parser library in C++ which now I need to write unit tests for. The library is simply fed the TLS data stream and it invokes various callbacks on certain events in TLS protocol. I'm searching for a Python implementation of TLS protocol for both client and server sides which allow me to create several... | Create a controlled TLS conversation in Python twisted and store it to be used as test data | 0.197375 | 0 | 1 | 80 |
32,796,751 | 2015-09-26T11:35:00.000 | 0 | 0 | 0 | 0 | python,python-requests,loaded | 32,796,957 | 1 | false | 1 | 0 | First requests GET will return you the entire page but requests is no a browser, it does not parse the content.
When you load a page with the browser, it does usually 10-50 requests for each resource, runs the JavaScript, .... | 1 | 0 | 0 | I want to know if there is a response from requests.get(url) when the page is fully loaded. I did tests with around 200 refreshes of my page and it happens randomly that once or twice the page does not load the footer. | Detect page is fully loaded using requests library | 0 | 0 | 1 | 522 |
32,802,726 | 2015-09-26T22:39:00.000 | 0 | 0 | 0 | 0 | python-3.x,pygame | 32,802,814 | 1 | false | 0 | 1 | Is it possible to make camera tracking without moving the whole world?
No.
By relativity, moving the player within the world is the same as moving the world around the player. Since your camera is fixed on the player, by definition you will see the world moving when the player moves within it. Therefore, you must dr... | 1 | 0 | 0 | I don't really want to move the whole world in my game but I do want the screen to follow my character.
So for example, normally pygame would render at the position of 0,0 and the window height width would allow you to expand that viewing area. But I want to move the starting position so that I can view something at c... | Is it possible to make camera tracking without moving the whole world? | 0 | 0 | 0 | 24 |
32,803,057 | 2015-09-26T23:27:00.000 | 1 | 0 | 1 | 1 | python,macos,ubuntu,virtualenv | 32,803,088 | 1 | true | 0 | 0 | It's not possible, because virtualenv use absolute paths to setup the environment.
Also it's kind of the reverse of what virtualenv is created for. | 1 | 1 | 0 | Is it possible to set up a virtualenv on a Dropbox folder from a Mac and activate that from Ubuntu that also has access to that Dropbox folder?
I seem to be able to call source env/bin/activate and it activates the environment, but when I call which python, it gives me /usr/bin/python instead of the one in the virtual ... | python virtualenv set up from mac - use it in linux | 1.2 | 0 | 0 | 57 |
32,804,410 | 2015-09-27T03:53:00.000 | 0 | 0 | 1 | 1 | python,web-scraping,pip,virtualenv | 32,820,352 | 2 | false | 0 | 0 | After upgrading the python3.4 package in Ubuntu 14.04 I get the same error.
A quick solution is to delete and re-create the virtualenv. | 2 | 0 | 0 | I have virtualenv-13.1.2 set up with python 3.4 (global python is python-2.7) in ubuntu 14.04. When I try to install GoogleScraper using coammandpip install GoogleScraper it gives an error
setuptools must be installed to install from a source distribution
If I do pip install setuptools
Requirement already satisfied... | GoogleScraper Installation error - setuptools must be installed | 0 | 0 | 0 | 589 |
32,804,410 | 2015-09-27T03:53:00.000 | 1 | 0 | 1 | 1 | python,web-scraping,pip,virtualenv | 32,836,035 | 2 | true | 0 | 0 | I was missing python3-dev tools. I did sudo apt-get install python3-dev and it worked like a charm. | 2 | 0 | 0 | I have virtualenv-13.1.2 set up with python 3.4 (global python is python-2.7) in ubuntu 14.04. When I try to install GoogleScraper using coammandpip install GoogleScraper it gives an error
setuptools must be installed to install from a source distribution
If I do pip install setuptools
Requirement already satisfied... | GoogleScraper Installation error - setuptools must be installed | 1.2 | 0 | 0 | 589 |
32,806,238 | 2015-09-27T09:01:00.000 | 0 | 1 | 0 | 1 | python-2.7,mechanize-python | 32,806,729 | 2 | false | 0 | 0 | It sounds like you are trying to download the file into memory but you don't have enough. Try using the retrieve method with a file name to stream the downloaded file to disc. | 2 | 0 | 0 | I am trying to download some files via mechanize. Files smaller than 1GB are downloaded without causing any trouble. However, if a file is bigger than 1GB the script runs out of memory:
The mechanize_response.py script throws out of memory at the following line
self.__cache.write(self.wrapped.read())
__cache is a cStr... | python mechanize retrieving files larger than 1GB | 0 | 0 | 0 | 304 |
32,806,238 | 2015-09-27T09:01:00.000 | 0 | 1 | 0 | 1 | python-2.7,mechanize-python | 32,808,075 | 2 | false | 0 | 0 | I finally figured out a work around.
Other than using browser.retrieve or browser.open I used mechanize.urlopen which returned the urllib2 Handler. This allowed me to download files larger than 1GB.
I am still interested in figuring out how to make retrieve work for files larger than 1GB. | 2 | 0 | 0 | I am trying to download some files via mechanize. Files smaller than 1GB are downloaded without causing any trouble. However, if a file is bigger than 1GB the script runs out of memory:
The mechanize_response.py script throws out of memory at the following line
self.__cache.write(self.wrapped.read())
__cache is a cStr... | python mechanize retrieving files larger than 1GB | 0 | 0 | 0 | 304 |
32,808,686 | 2015-09-27T13:58:00.000 | 6 | 0 | 1 | 0 | python,random | 32,809,283 | 1 | true | 0 | 0 | You can save the state of the PRNG using random.getstate() (then, e.g., use pickle to save it to disk. Later, a random.setstate(state) will return your PRNG to exactly the state it was in. | 1 | 4 | 1 | I'm designing a program which:
Includes randomness
Can stop executing and save its state at certain points (in XML)
Can start executing starting from a saved state
Is deterministic (so the program can run from the same state twice and produces the same result)
The problem here is saving the randomness. I can initial... | Storing a Random state | 1.2 | 0 | 0 | 2,249 |
32,811,713 | 2015-09-27T19:02:00.000 | 7 | 0 | 1 | 1 | python,python-3.x,python-2.7,osx-yosemite | 32,811,789 | 7 | false | 0 | 0 | As long as you keep your installation folders organized, you should have no issues having both on your computer, besides one thing. The path environment variable for python will determine which version is used by default, so I would say stick to one version, or make sure to make your programs as backwards compatible as... | 6 | 16 | 0 | Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes s... | Is it ok to install both Python 2.7 and 3.5? | 1 | 0 | 0 | 50,311 |
32,811,713 | 2015-09-27T19:02:00.000 | 17 | 0 | 1 | 1 | python,python-3.x,python-2.7,osx-yosemite | 32,823,074 | 7 | true | 0 | 0 | I have installed two versions, 2.7, 3.4 and I do not have any problem by now. 3.4 I am using for my work project in eclipse environment, 2.7 for udacity course, like You ;). | 6 | 16 | 0 | Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes s... | Is it ok to install both Python 2.7 and 3.5? | 1.2 | 0 | 0 | 50,311 |
32,811,713 | 2015-09-27T19:02:00.000 | 1 | 0 | 1 | 1 | python,python-3.x,python-2.7,osx-yosemite | 38,431,312 | 7 | false | 0 | 0 | Im not sure about OSX, but with windows 10 my environment variables for 2.7 were overwritten with the 3.5 path. Not a tough fix, but a little confusing, since it was months later when I needed 2.7 again. | 6 | 16 | 0 | Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes s... | Is it ok to install both Python 2.7 and 3.5? | 0.028564 | 0 | 0 | 50,311 |
32,811,713 | 2015-09-27T19:02:00.000 | 3 | 0 | 1 | 1 | python,python-3.x,python-2.7,osx-yosemite | 38,438,902 | 7 | false | 0 | 0 | As others have said, if the installation directory is different it should be no problem at all.
One thing that'll make your life easier for switching between the two is to use an IDE such as PyCharm, you just have to change a drop down to switch between the two versions. | 6 | 16 | 0 | Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes s... | Is it ok to install both Python 2.7 and 3.5? | 0.085505 | 0 | 0 | 50,311 |
32,811,713 | 2015-09-27T19:02:00.000 | 2 | 0 | 1 | 1 | python,python-3.x,python-2.7,osx-yosemite | 34,581,673 | 7 | false | 0 | 0 | It should be fine. Its actually pretty common to have multiple Python environments. It helps to prevent dependency conflicts between your projects. That is what is happening when you are using tools like pyenv and virtualenv.
Using tools like pyenv and virtualenv may also help you with the path problems that others men... | 6 | 16 | 0 | Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes s... | Is it ok to install both Python 2.7 and 3.5? | 0.057081 | 0 | 0 | 50,311 |
32,811,713 | 2015-09-27T19:02:00.000 | 0 | 0 | 1 | 1 | python,python-3.x,python-2.7,osx-yosemite | 34,580,951 | 7 | false | 0 | 0 | I have the same problem and it is not necessary to uninstall on version of python. Please take care to not mix them up - When you search them up on the start menu. You can make a desktop shortcut saying 2.6 and 3.5. | 6 | 16 | 0 | Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes s... | Is it ok to install both Python 2.7 and 3.5? | 0 | 0 | 0 | 50,311 |
32,811,951 | 2015-09-27T19:26:00.000 | 0 | 0 | 0 | 0 | python,printing,tkinter | 32,812,217 | 1 | false | 0 | 1 | No, there is not. You'll have to create your own popup window for that specific problem. | 1 | 0 | 0 | Is there a command in Tkinter that allows the program to pop up a window that lets the user pick a printer from the list of drivers that they have installed?
Sorry that I can't provide any details, but I haven't found anything about this topic on the web. | Tkinter Print function[filedialog] | 0 | 0 | 0 | 62 |
32,812,765 | 2015-09-27T20:57:00.000 | 2 | 0 | 1 | 0 | python,ide,format,spyder | 33,624,414 | 1 | false | 1 | 0 | I tried this
Source -> Fix Indentation, Remove Trailing Spaces
This is not the most efficient way, but it seems there are no key combinations to do these. Even in preferences, they have not allowed to add new shortcut for this. | 1 | 3 | 0 | Can anyone please advice the key combination to format python code in annaconda/Spyder IDE? In Eclipse IDE when coding in Java I usually use command F, however in Spyder IDEthe key combination causes search window to pop up. | Format python code in Spyder IDE | 0.379949 | 0 | 0 | 5,911 |
32,813,107 | 2015-09-27T21:37:00.000 | 3 | 0 | 1 | 0 | python,function,module | 32,813,261 | 1 | false | 0 | 0 | Code should be made to be easily readable by a human; Readability counts (from The Zen of Python).
Stick to the conventions of PEP-8, unless you have good reason not to do so.
My suggestion would be to start with the main parts of the module in a sequence that makes sense for this particular module. Helper functions an... | 1 | 1 | 0 | I've fully graduated from writing scripts to writing modules. Now that I have a module full of functions, I'm not quite sure if I should order them in some way.
Alphabetical seems to make sense to me, but I wanted to see if there were others schools of thought on how they should be ordered in a module. Maybe try to app... | Pythonic way to order functions within a module | 0.53705 | 0 | 0 | 1,354 |
32,813,646 | 2015-09-27T22:49:00.000 | 0 | 0 | 0 | 0 | python,selenium,beautifulsoup | 32,815,252 | 1 | false | 1 | 0 | These are completely different tools that, in general, cannot be considered alternatives, though they somewhat cross on the "Locating Elements" front. The located elements though are very different - one is a Tag instance in BeautifulSoup and the other one is a webdriver WebElement instance that can actually be interac... | 1 | 3 | 0 | I am using Selenium to navigate a webpage. To analyze the elements and data, I use BeautifulSoup because of the excellent options they give, including searching with regex.
So now I have an element located in BeautifulSoup. I want to select it in Selenium.
I figured I could somehow pass a XPath or CSS selector from the... | Send element from BeautifulSoup to Selenium | 0 | 0 | 1 | 386 |
32,816,538 | 2015-09-28T06:00:00.000 | 1 | 0 | 1 | 0 | python,python-2.7,python-imaging-library | 36,235,535 | 1 | false | 0 | 0 | Hey Just recompile your python with option ./configure --enable-unicode=ucs2, It will be get fixed. | 1 | 5 | 0 | I have installed python2.7 and while executing my application getting error as like
/usr/local/lib/python2.7/site-packages/PIL/_imaging.so: undefined
symbol: PyUnicodeUCS2_AsLatin1String
Also i checked by build and displays as 'UCS2'
How can we resolve this. | undefined symbol: PyUnicodeUCS2_AsLatin1String | 0.197375 | 0 | 0 | 2,097 |
32,816,966 | 2015-09-28T06:36:00.000 | 0 | 0 | 0 | 0 | python,django,django-models | 32,830,790 | 2 | false | 1 | 0 | it is not clear what you mean by "my user" .
is this just the admin user who set this configuration globaly for the site .
or do you mean evey user of the site has his/her own preferences ?
if the latter case then make a new model called Preferences which has one to one relation to the user model .
then in your query y... | 1 | 1 | 0 | suppose i have three models, at my view I am showing all the item of these models, i want to give my user privilege to set which model's objects are to be shown at view at first, second and third.
what is the best way to implement this? | how to keep django models in database for users customized view? | 0 | 0 | 0 | 106 |
32,817,302 | 2015-09-28T06:59:00.000 | 0 | 0 | 0 | 1 | python,linux,macos,terminal,stdout | 32,818,127 | 2 | false | 0 | 0 | File write operations are buffered by default so the file isn't effectiveley written until either the buffer is full, the file is closed or you explicitely call flush() on the file.
But anyway: dont use direct file access if you want to log to a file, use either a logging.StreamHandler with an opened file as stream or... | 1 | 6 | 0 | This is a python question, but also a linux/BSD question.
I have a python script with two threads, one downloading data from the web and the other sending data to a device over a serial port. Both of these threads print a lot of status information to stdout using python's logging module.
What I would like is to have tw... | Is it possible to output to and monitor streams other than stdin, stdout & stderr? (python) | 0 | 0 | 0 | 437 |
32,818,009 | 2015-09-28T07:47:00.000 | 1 | 0 | 1 | 0 | python,ipython,pycharm | 32,950,379 | 1 | false | 0 | 0 | I've had the same problem and have a partial solution.
To include your file, add the following to a cell:
execfile("superSource.py").
This should load and execute it and make its contents available for reuse so that you can access variable and call functions defined or imported by it in other cells.
Unfortunately, Py... | 1 | 0 | 0 | Within my project XYZ, I have a file superSource.py, which contains some functions.
Now, I've used the new cool pyCharm feature of creating an IPython notebook, which I calltest test.ipynb, and saved it in the projects main directory (next to superSource.py).
However, when I run import superSource; foo = superSource.p... | PyCharm and IPython Notebook: Include files from project | 0.197375 | 0 | 0 | 336 |
32,820,673 | 2015-09-28T10:21:00.000 | 1 | 0 | 1 | 1 | python,windows,uninstallation | 32,821,417 | 2 | true | 0 | 0 | Did you try to reinstall the version you want to delete and then uninstall it afterwards ? | 1 | 3 | 0 | I accidentally downloaded Python 3.4.2 a while back but I actually needed Python 2.7, so I deleted the 3.4.2 files and downloaded 2.7 instead. Now I need Python 3, so I tried to download it but I noticed that in the control panel in the Uninstall Programs section it tells me that the 3.4.2 from back then is still on my... | Can't uninstall Python on Windows (3.4.2) | 1.2 | 0 | 0 | 8,420 |
32,820,862 | 2015-09-28T10:31:00.000 | 1 | 0 | 1 | 0 | python,swap,system-calls | 32,830,257 | 1 | true | 0 | 0 | For CPython, there is no good answer for this that doesn't involve writing a Python C extension, since mlock works on pages, not objects. The internals of the str object differ from version to version (in Py3.3 and higher, a str may actually have several copies of the data in memory in different encodings, some inlined... | 1 | 7 | 0 | I'm working on a password manager application for linux and I'm using Python for it.
Because of the security reasons I want to call mlock system call in order to avoid swapping password variable on hard drive.
I noticed that python itself didn't wrap this function.
so is there any way so can I avoid swapping?
Thank... | mlock a variable in python | 1.2 | 0 | 0 | 1,295 |
32,824,889 | 2015-09-28T13:57:00.000 | 0 | 1 | 0 | 1 | python,c,bluetooth-lowenergy,dbus,bluez | 34,717,559 | 2 | false | 0 | 0 | Something more to consider:
the latest BlueZ (eg. 5.36+), BLE should work fine and has been very stable for me - and remember to add "experimental" when building it and "-E" as a service parameter to get manufacturerData (and other experimental features)
Using the C API, I think your code must be GPL (not 100% sure th... | 2 | 4 | 0 | For a project I am doing I have to connect my Linux PC to a Bluetooth LE device. The application I design will be deployed on an ARM embedded system when it is complete.
Searching for documentation online hints that the preferred programming language for these kind of applications is Python. All the Bluez /test example... | Dbus & Bluez programming language | 0 | 0 | 0 | 1,918 |
32,824,889 | 2015-09-28T13:57:00.000 | 3 | 1 | 0 | 1 | python,c,bluetooth-lowenergy,dbus,bluez | 32,861,048 | 2 | true | 0 | 0 | This is quite an open question as there are so many things to consider when making this decision. So the best "answer" might rather be an attempt to narrow down the discussion:
Based on the question, I'm making the assumption that the system you are targeting has D-Bus and Python available with all needed dependencies.... | 2 | 4 | 0 | For a project I am doing I have to connect my Linux PC to a Bluetooth LE device. The application I design will be deployed on an ARM embedded system when it is complete.
Searching for documentation online hints that the preferred programming language for these kind of applications is Python. All the Bluez /test example... | Dbus & Bluez programming language | 1.2 | 0 | 0 | 1,918 |
32,826,166 | 2015-09-28T15:02:00.000 | 1 | 1 | 1 | 0 | python,python-2.7,unit-testing,python-3.x | 32,826,392 | 2 | false | 0 | 0 | If you don't inherit from unit.TestCase, the testing framework won't know that you want those classes to be test cases. So when you try to run your tests, nothing will happen! | 1 | 1 | 0 | What's the motivation behind having my unit test classes inherit from unittest.TestCase, rather than object? Does it matter if I'm using Nose (or PyTest) instead of unittest? | Why inherit from unittest.TestCase? | 0.099668 | 0 | 0 | 212 |
32,826,262 | 2015-09-28T15:07:00.000 | 0 | 0 | 0 | 1 | python,ffmpeg | 32,859,122 | 1 | true | 0 | 0 | I run python ***.py in the CMD is OK.Should`t run the program in the PyCharm.Perhaps the environment is differnet. | 1 | 1 | 0 | I had installed ffmpeg in WIN7 64bit. When I use
os.system("ffmpeg -i rtsp://218.204.223.237:554/live/1/66251FC11353191F/e7ooqwcfbqjoo80j.sdp -c copy dump.mp4") in my program by the PyCharm,it can also run but I can`t play the dump.mp4. I can run the same command in CMD or Python(command line) and get the dump.mp... | Python ffmpeg on Windows | 1.2 | 0 | 0 | 1,646 |
32,826,804 | 2015-09-28T15:38:00.000 | 0 | 0 | 0 | 0 | python,freebsd | 32,839,165 | 1 | false | 0 | 0 | It seems like you mixed 32 and 64bit libraries.
I suggest cleaning up the wrong libraries (at least libz seems to be affected) and restoring them from backup/installation medium | 1 | 1 | 0 | I want to install py-MySQLdb but I always get the same lib error..
Any suggestions?
Thanks in advance
ImportError: /usr/lib/libz.so.6: unsupported file layout
*** [do-configure] Error code 1
Stop in /usr/ports/databases/py-MySQLdb.
*** [install] Error code 1
Stop in /usr/ports/databases/py-MySQLdb. | FreeBSD 9.3 ImportError while installing py-MySQLdb | 0 | 1 | 0 | 226 |
32,831,050 | 2015-09-28T20:15:00.000 | 0 | 0 | 1 | 0 | python,debugging,pycharm | 60,892,355 | 4 | false | 0 | 0 | Try pydevd.settrace() as a first line of the function you try to debugging, or right after deepcopy() | 1 | 4 | 0 | PyCharm's debugger works perfectly, except when hitting lines that contain the built-in method copy.deepcopy(). Stepping over them causes the program to run to conclusion, as if no debugger were running. I have tried stepping into deepcopy(), but I always seem to get caught in a recursive loop. The code runs fine, debu... | PyCharm's debugger gives up when hitting copy.deepcopy() | 0 | 0 | 0 | 520 |
32,831,111 | 2015-09-28T20:18:00.000 | 3 | 0 | 0 | 1 | python,rabbitmq,celery | 58,830,493 | 2 | false | 1 | 0 | Best option is to use celery.send_task from the producing server, then deploy the workers onto n instances. The workers can then be run as @ealeon mentioned, using celery -A proj worker -l info -Ofair.
This way, load will be distributed across all servers without having to have the codebase present on the consuming se... | 1 | 6 | 0 | I'm running celery on multiple servers, each with a concurrency of 2 or more and I want to load balance celery tasks so that the server that has the lowest CPU usage can process my celery tasks.
For example, lets say I have 2 servers (A and B), each with a concurrency of 2, if I have 2 tasks in the queue, I want A to ... | How to load balance celery tasks across several servers? | 0.291313 | 0 | 0 | 4,182 |
32,832,056 | 2015-09-28T21:23:00.000 | 2 | 0 | 1 | 0 | python | 46,797,129 | 1 | false | 0 | 0 | Based on my understanding, threads cannot be executed in parallel (executed based on availability and random)
Correct
and thats the reason Eventlet are being used.
Not so correct. The Eventlet library is used to simplify non-blocking IO programming. It does not actually add parallelism. Thread execution is still lim... | 1 | 7 | 0 | Based on my understanding, threads cannot be executed in parallel(executed based on availability and random) and thats the reason Eventlet are being used.
If Eventlets are more for parallelism why can't we just use multiprocessing module of Python.
I thought of executing multi process modules and use the join method()... | Python Multiprocessing vs Eventlet | 0.379949 | 0 | 0 | 981 |
32,832,062 | 2015-09-28T21:23:00.000 | 3 | 0 | 1 | 0 | python,pycharm,interpreter,python-3.5 | 32,832,234 | 7 | false | 0 | 0 | When creating a project in PyCharm, if the interpret is not already selected, in the drop down menu under the projects "Location:", you can click the gear-looking icon to the right of the interpreter option, and click "Add Local"; then select the file location of the python.exe file that you have installed. It will pro... | 5 | 16 | 0 | I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. A... | PyCharm doesn't detect interpreter | 0.085505 | 0 | 0 | 53,023 |
32,832,062 | 2015-09-28T21:23:00.000 | 0 | 0 | 1 | 0 | python,pycharm,interpreter,python-3.5 | 38,293,191 | 7 | false | 0 | 0 | I have had the exact same problem and was unable to find the solution until just now. Hopefully this works for anyone that was struggling with it.
I went to the location of the Python 3.5 (32-Bit) in my C: Drive which it turns out is just a shortcut to the actual Python application, right click on it and select Open fi... | 5 | 16 | 0 | I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. A... | PyCharm doesn't detect interpreter | 0 | 0 | 0 | 53,023 |
32,832,062 | 2015-09-28T21:23:00.000 | 0 | 0 | 1 | 0 | python,pycharm,interpreter,python-3.5 | 40,060,261 | 7 | false | 0 | 0 | If you kept the default settings while installing python, Your project interpreter for PyCharm will be:
C:\Users\yourUserName\AppData\Local\Programs\Python\Python36\python.exe
Chose the above location as your project interpreter inside PyCharm.
Depending on which python version you have, it could be either Python36\pyt... | 5 | 16 | 0 | I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. A... | PyCharm doesn't detect interpreter | 0 | 0 | 0 | 53,023 |
32,832,062 | 2015-09-28T21:23:00.000 | 0 | 0 | 1 | 0 | python,pycharm,interpreter,python-3.5 | 58,375,447 | 7 | false | 0 | 0 | For me the following solution it worked:
My configuration:
Pycharm Community edition 2019.1.1
Anaconda distribution with python 3.7. Interpreter in standard location.
Problem:
Pycharm was not able to find python interpreter after reinstallation of anaconda distribution.
Solution:
- Make sure you run pycharm as admin (r... | 5 | 16 | 0 | I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. A... | PyCharm doesn't detect interpreter | 0 | 0 | 0 | 53,023 |
32,832,062 | 2015-09-28T21:23:00.000 | 12 | 0 | 1 | 0 | python,pycharm,interpreter,python-3.5 | 55,796,938 | 7 | false | 0 | 0 | file > new project settings > project Interpreter > click in the drop down and select 'show all' > click the '+' button >
Now, in the Virtualenv Environment tab under the New environment radio button, check the path in the 'Base interpreter:' field. For me, mine was set to an invalid path. Once I had corrected the pat... | 5 | 16 | 0 | I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. A... | PyCharm doesn't detect interpreter | 1 | 0 | 0 | 53,023 |
32,832,755 | 2015-09-28T22:25:00.000 | 2 | 1 | 1 | 0 | python-2.7,python-3.x | 32,832,829 | 1 | false | 0 | 0 | Learn Python 3 first. It's the future of Python and 2.x is in the rear-view mirror for most of the core developers.
Learning Python 2.7.x won't be a waste of your time, as you'll often run into it "in the wild," but it takes years to gain mastery, so you might as well start on the path that will be the most relevant w... | 1 | 0 | 0 | I'm very new to programming, and have decided to start by learning Python; I've only been studying it for a little over a month, so I am very much still a beginner. Thus far, I really love the language, and am starting to grasp some of it.
But that brings me to my question/concerns; because I am currently only trying ... | Is learning Python 2 along with 3 a waste of effort? | 0.379949 | 0 | 0 | 106 |
32,834,722 | 2015-09-29T02:28:00.000 | 6 | 0 | 1 | 0 | python,spyder | 43,390,881 | 4 | false | 0 | 0 | Just use combination of shift+ctrl+v | 4 | 21 | 0 | I accidentally closed the variable explorer on my Pythone(Spyder)...
Does anyone know how I can reopen it?
If I must reinstall the program, then I will but I just want to see if there is a way.
Thank you! | spyder python how to re-open Variable Explorer | 1 | 0 | 0 | 51,281 |
32,834,722 | 2015-09-29T02:28:00.000 | 2 | 0 | 1 | 0 | python,spyder | 59,318,950 | 4 | false | 0 | 0 | You can go to view then in view click on window layout then in that click on reset to spyder default which will give you the default layout of spyder. | 4 | 21 | 0 | I accidentally closed the variable explorer on my Pythone(Spyder)...
Does anyone know how I can reopen it?
If I must reinstall the program, then I will but I just want to see if there is a way.
Thank you! | spyder python how to re-open Variable Explorer | 0.099668 | 0 | 0 | 51,281 |
32,834,722 | 2015-09-29T02:28:00.000 | 39 | 0 | 1 | 0 | python,spyder | 32,834,969 | 4 | true | 0 | 0 | Go to View/Panes and select Variable Explorer. | 4 | 21 | 0 | I accidentally closed the variable explorer on my Pythone(Spyder)...
Does anyone know how I can reopen it?
If I must reinstall the program, then I will but I just want to see if there is a way.
Thank you! | spyder python how to re-open Variable Explorer | 1.2 | 0 | 0 | 51,281 |
32,834,722 | 2015-09-29T02:28:00.000 | 1 | 0 | 1 | 0 | python,spyder | 56,264,798 | 4 | false | 0 | 0 | Just go to tools(look at the dashboard at top middle)
and select reset spyder to factory dafaults and click ok
You will get your default spyder console. | 4 | 21 | 0 | I accidentally closed the variable explorer on my Pythone(Spyder)...
Does anyone know how I can reopen it?
If I must reinstall the program, then I will but I just want to see if there is a way.
Thank you! | spyder python how to re-open Variable Explorer | 0.049958 | 0 | 0 | 51,281 |
32,836,510 | 2015-09-29T05:47:00.000 | 0 | 0 | 0 | 0 | python,oracle,database-connection,cx-oracle | 32,836,606 | 2 | false | 0 | 0 | Yes, you definitely need to install an Oracle Client, it even says so in cx_oracle readme.txt.
Another recommendation you can find there is installing an oracle instant client, which is the minimal installation needed to communicate with Oracle, and is the simplest to use.
Other dependencies can usually be found in the... | 1 | 1 | 0 | I am writing a Python script to fetch and update some data on a remote oracle database from a Linux server. I would like to know how can I connect to remote oracle database from the server.
Do I necessarily need to have an oracle client installed on my server or any connector can be used for the same?
And also if I use... | Python connection to Oracle database | 0 | 1 | 0 | 6,425 |
32,847,487 | 2015-09-29T15:04:00.000 | 0 | 0 | 1 | 0 | javascript,python,date,web,format | 32,847,574 | 2 | false | 1 | 0 | You can use Javascript to give the user the feedback that the correct format(s) is being used. But if you are taking any data to your server be sure verify the data on the server.
To verify the correct dataformat you can use Regular expressions and check if any format is correct. You should iterate through all allowed... | 1 | 0 | 0 | I should preface this post by saying that I am a very elementary developer with a generic IS degree. Without going into too much detail, I was given a moderately large web application from an interning software engineer to support an enhance if need be. It was written primarily in Python, JavaScript and HTML5 and utili... | javascript accepting multiple date format | 0 | 0 | 1 | 163 |
32,849,325 | 2015-09-29T16:35:00.000 | 0 | 0 | 0 | 0 | python,contextmenu,menuitem,maya,right-click | 32,870,983 | 1 | true | 1 | 0 | Okay i think I have found a solution, that's the best I have found but this is not very handy...
create a copy of the buildobjectMenuItemsNow.mel and dagMenuProc.mel in your script folder so Maya will read those ones instead of the native ones. Once you have done that you can modify the dagMenuProc.mel without destruct... | 1 | 0 | 0 | I am trying to edit the right click context sensitive menu from Maya. I have found how to add a menuItem but I would like to have this Item in the top of the list not at the bottom... I think in this case I need to deleteAllItems from the menu, add mine and then re-add the default Maya ones but I don't know how to re-a... | Maya right click context sensitive menu | 1.2 | 0 | 0 | 955 |
32,854,150 | 2015-09-29T21:34:00.000 | 0 | 0 | 1 | 1 | python,macos,terminal | 32,854,492 | 3 | false | 0 | 0 | Also, if you just need to know which installation of Python is the system using, the way to do it is typing which python at the terminal. | 1 | 1 | 0 | I have several two python on my mac, one is original, and another is downloaded on the website, when I open the python in terminal, how can I decide which I'm opening? Thanks for help. | How can I decide which python I will open in mac terminal? | 0 | 0 | 0 | 71 |
32,857,467 | 2015-09-30T03:50:00.000 | 1 | 0 | 1 | 0 | python,regex | 32,857,478 | 3 | false | 0 | 0 | r"\bH[A-Za-z0-9]{9,19}\b" looks for precisely that. | 1 | 0 | 0 | Say I have a string "ldhjshjds HdAjhdshj4 Hdsshj4 kdskjdshjdsjds"
I only want to search for substrings (alphanumeric only) starting with "H", but only if the string is between 10-20 characters.
"HdAjhdshj4" would be a match. "Hdsshj4" would not.
Would such a regex be costly on CPU cycles? | How to search for alphanumeric substring of specific length in Python? | 0.066568 | 0 | 0 | 1,281 |
32,859,460 | 2015-09-30T06:41:00.000 | 0 | 0 | 1 | 0 | python-2.7,machine-learning,scikit-learn,text-mining,text-classification | 32,859,613 | 1 | true | 0 | 0 | You can train individual classifiers for descriptions and merchants, and obtain a final score using score = w1 * predictions + w2 * components.
The values of w1 and w2 should be obtained using cross validation.
Alternatively, you can train a single multiclass classifier by combining the training dataset.
You will now ... | 1 | 0 | 1 | I have text classification data with predictions depending on categories, 'descriptions' and 'components'. I could do the classification using bag of words in python with scikit on 'descriptions'. But I want to get predictions using both categories in bag of words with weights to individual feature sets
x = descripti... | How to combine multiple feature sets in bag of words | 1.2 | 0 | 0 | 713 |
32,860,932 | 2015-09-30T08:03:00.000 | 1 | 0 | 0 | 0 | io,rethinkdb,rethinkdb-python | 32,872,765 | 1 | false | 0 | 0 | RethinkDB uses a blocker pool to do IO. On Linux systems, each thread in this blocker pool contributes 1 to the load average while blocking on disk, so RethinkDB sometimes causes the system to report an extremely high load average even under normal load.
Using 100% of your disk throughput is a different story. If you... | 1 | 0 | 0 | Rethinkdb IO reaches 100% whenever there is a data upload. The load reaches near about 50. Is this a common phenomenon, or do we need to do some optimizations here? | Rethinkdb IO reaches 100% | 0.197375 | 0 | 1 | 86 |
32,863,132 | 2015-09-30T09:56:00.000 | 2 | 0 | 0 | 0 | analytics,ironpython,spotfire | 32,942,923 | 1 | true | 0 | 0 | As @niko said, this is almost the same as your previous question. But basically you want show your data with 4 quarters in your bar chart.
In that case, do not make 4 variables, but make 1 date variable and let spotfire do the splitting in quarters. This is a standard functionality in spotfire to create date hierarchie... | 1 | 0 | 0 | I need to use PG_Fiscal Quarter(Date(2015,10,1)) to make quarter 1. Similarly by putting four other starting dates in the fiscal quater I need four quarters in one bar graph. How can i have that. i cant simply assign them in custom expression | Displaying 4 custom expression in one graph | 1.2 | 0 | 0 | 85 |
32,866,710 | 2015-09-30T12:56:00.000 | 5 | 0 | 1 | 0 | python,pycharm | 32,866,753 | 2 | false | 0 | 0 | When you import the class, it imports it as-is at the current time. If you make changes after that, you need to import it again. In this case, you should just be able to terminate the shell, and start it again.
This is not an error, or a bug. | 1 | 3 | 0 | I think this is a really silly / dumb question, but I am using PyCharm and constantly adding methods to a class or changing the body of the methods. When I test the class by importing the .py file and initiating the class object, it doesnt seem to recognize the changes to the class.
Is there some button I need to hit... | PyCharm not recognizing new class method without reload | 0.462117 | 0 | 0 | 1,172 |
32,869,355 | 2015-09-30T14:56:00.000 | 0 | 0 | 0 | 0 | python,mesh,abaqus,orphan | 33,103,479 | 1 | false | 0 | 0 | In Abaqus you can only edit Native Meshes. This time, as you said, you have an Orphan Mesh. The only way to edit this kind of mesh is doing it by yourself with an external script. | 1 | 0 | 1 | I am trying to generate an orphan mesh on a part with python.
I have already defined the nodes by using a code giving by Tim in another post.
However, the with the following command:
ListElem.append(myTrabPart.Element(nodes=tup,elemShape=HEX8)
I ended up by the message "there is no mesh to edit". It seems that the List... | Generate orphan mesh in abaqus python | 0 | 0 | 0 | 424 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.