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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22,464,900 | 2014-03-17T20:40:00.000 | 1 | 0 | 1 | 0 | python,dictionary | 22,464,944 | 3 | false | 0 | 0 | As I know there's no limit but consider that more the key is long, the more the time to create/access the keys | 1 | 26 | 0 | I was wondering if Python had a limit on the length of a dictionary key.
For clarification, I'm not talking about the number of keys, but the length of each individual key. I'm going to be building my dictionaries based on dynamic values (after validation), but I'm not sure if I should be taking length into account in... | Do Dictionaries have a key length limit? | 0.066568 | 0 | 0 | 27,246 |
22,473,370 | 2014-03-18T07:56:00.000 | 0 | 0 | 0 | 0 | python,django,amazon-s3 | 22,474,074 | 1 | false | 1 | 0 | django-storages works quite well and many other Django products rely on it. It does provide other storage services besides S3 but, of course, you don't need to use any of the others.
It does need to know your AWS access key & secret key, but you don't need to actually put those values in your settings.py; typically, yo... | 1 | 0 | 0 | I am looking for a simple but effective S3 based Django Package through which subscribers from the website can directly use storage services without any hassle. I am a beginner for django so really looking for something simple to use. Please recommend something exactly as per requirement as previously I've found some r... | Need Django Package for S3 | 0 | 0 | 0 | 67 |
22,474,051 | 2014-03-18T08:36:00.000 | 3 | 0 | 1 | 0 | python,visual-studio-2010,python-2.7,visual-studio-2012,ptvs | 22,486,749 | 1 | true | 0 | 0 | When you say you're setting breakpoint at function definitions do you mean on the line with the "def ..." or are you setting the breakpoint on the 1st statement of the function?
In Python functions are executable statements so if you're putting the breakpoint on the def line then you're going to hit the breakpoint when... | 1 | 3 | 0 | I have integrated PTVS into Visual studio so that i can have intellisense support and debugging capability.
I set Breakpoints at Function definitions, but when i debug the control goes directly out of function. And in some points the Console window pops up and it never iterates to the next line of code.
I liked PTVS ... | Console Window Appears while debugging Python code using PTVS in Visual Studio | 1.2 | 0 | 0 | 1,650 |
22,474,657 | 2014-03-18T09:07:00.000 | 3 | 0 | 0 | 0 | django,python-2.7,django-models,django-forms | 22,474,781 | 2 | true | 1 | 0 | No. blank is enforced solely at the application level. | 1 | 0 | 0 | I have deployed my Django website but just now realized that I didn't make one of the fields compulsory. For the field it is currently,
blank=True, null=True
Now if I go ahead and change it to
blank=False
will there be any effect on the database and already existing data in it? | Making a field "blank=False" in production | 1.2 | 0 | 0 | 104 |
22,479,095 | 2014-03-18T12:15:00.000 | 6 | 0 | 0 | 0 | python,django,rest,django-models,django-views | 22,479,708 | 2 | true | 1 | 0 | I think it is an opinion where to call web services. I would say don't pollute your models because it means you probably need instances of those models to call these web services. That might not make any sense. Your other choice there is to make things @classmethod on the models, which is not very clean design I would ... | 2 | 10 | 0 | I have to call external REST APIs from Django. The external data source schemas resemble my Django models. I'm supposed to keep the remote data and local ones in sync (maybe not relevant for the question)
Questions:
What is the most logical place from where to call external web services: from a model method or from a... | Django calling REST API from models or views? | 1.2 | 0 | 0 | 4,474 |
22,479,095 | 2014-03-18T12:15:00.000 | 3 | 0 | 0 | 0 | python,django,rest,django-models,django-views | 22,479,360 | 2 | false | 1 | 0 | What is the most logical place from where to call external web services: from a model method or from a view?
Ideally your models should only talk to database and have no clue what's happening with your business logic.
Should I put the code that call the remote API in external modules that will be then called by the ... | 2 | 10 | 0 | I have to call external REST APIs from Django. The external data source schemas resemble my Django models. I'm supposed to keep the remote data and local ones in sync (maybe not relevant for the question)
Questions:
What is the most logical place from where to call external web services: from a model method or from a... | Django calling REST API from models or views? | 0.291313 | 0 | 0 | 4,474 |
22,483,205 | 2014-03-18T15:03:00.000 | 1 | 0 | 0 | 0 | python,mysql,django | 22,500,375 | 1 | false | 1 | 0 | Found the solution - I had to use dumpdata app.model --natural | 1 | 0 | 0 | I have a model with two DateField - fields in it, which I dumped to JSON using dumpdata. Now I want to load those fixtures (I am using South) to my MySQL-Database which leads to the following Error:
CommandError: The database backend does not accept 0 as a value for AutoField.
Does anybody know that problem and the ... | Python Django: Load Autofield to MySql Table using loaddata | 0.197375 | 0 | 0 | 344 |
22,487,388 | 2014-03-18T18:00:00.000 | 0 | 0 | 0 | 0 | python,sockets,udp,port,nat | 22,487,519 | 2 | false | 0 | 0 | The simple answer is you don't care what the "real" (ie: pre-natted) port is. Just reply to the nat query and allow the nat to handling delivering the result. If you ABSOLUTELY have to know the source UDP port, include the information in your UDP packet -- but I strongly recommend against this. | 2 | 1 | 0 | I'm working on something that sends data from one program over UDP to another program at a known IP and port. The program at the known IP and port receives the message from the originating IP but thanks to the NAT the port is obscured (to something like 30129). The program at the known IP and port wants to send an ac... | How to determine outgoing port in Python through NAT | 0 | 0 | 1 | 369 |
22,487,388 | 2014-03-18T18:00:00.000 | 1 | 0 | 0 | 0 | python,sockets,udp,port,nat | 22,488,054 | 2 | false | 0 | 0 | Okay, I figured it out - the trick is to use the same sock object to receive that you used to send. At least in initial experiments, that seems to do the trick. Thanks for your help. | 2 | 1 | 0 | I'm working on something that sends data from one program over UDP to another program at a known IP and port. The program at the known IP and port receives the message from the originating IP but thanks to the NAT the port is obscured (to something like 30129). The program at the known IP and port wants to send an ac... | How to determine outgoing port in Python through NAT | 0.099668 | 0 | 1 | 369 |
22,488,460 | 2014-03-18T18:51:00.000 | 0 | 0 | 0 | 0 | python,scipy,filtering | 22,663,453 | 2 | true | 0 | 0 | So finally I adapted one filter to get the zerofrequency and another bandpassfilter to get the 600 Hz frequency. Passzero has to be true just for the zerofrequency then it works.
I'm not yet happy with the phase delay but I'm working on it.
1)bandpass 600 Hz:
taps_bp = bandpass_fir(ntaps, lowcut, highcut, fs)
Function ... | 1 | 0 | 1 | I am implementing a bandpass filter in Python using scipy.signal (using the firwin function). My original signal consists of two frequencies (w_1=600Hz, w_2=800Hz). There might be a lot more frequencies that's why I need a bandpass filter.
In this case I want to filter the frequency band around 600 Hz, so I took 600 +... | Time signal shifted in amplitude, FIR filter with scipy.signal | 1.2 | 0 | 0 | 794 |
22,490,257 | 2014-03-18T20:24:00.000 | 2 | 0 | 0 | 0 | python,django,amazon-web-services,amazon-ec2 | 22,513,826 | 1 | true | 1 | 0 | sudo python manage.py runserver 0.0.0.0:80
did the trick. | 1 | 3 | 0 | I am new to AWS setup:
here are the steps i followed to setup a Django web server. ( but its not running on public ip )
created AWS instance
installed Django 1.6.2
created sample app
added security group (Inbound Requests) of running instance with HTTP - TCP - 80 - 0.0.0.0/0
tried following ways to run server.
python ... | AWS EC2 not running web server on default port | 1.2 | 0 | 0 | 647 |
22,490,452 | 2014-03-18T20:35:00.000 | 0 | 0 | 0 | 0 | python,http | 22,567,478 | 1 | false | 0 | 0 | I would like to make question more clear
here http location mentioned is a common share folder link which can use by number of people by accessing through username/passwd.
for ex: my target location has:
I have http:/commonfolder.mydomain.com/somelocation/345333 location
I have username = someuid ,password = xxxxx
my... | 1 | 0 | 0 | I am looking for a script which will upload files from a unix server to an HTTP location.
I want to use only these modules - cookielib, urllib2, urllib, mimetypes, mimetools, traceback | How to upload files to an HTTP location using a python script | 0 | 0 | 1 | 62 |
22,493,765 | 2014-03-19T00:16:00.000 | 2 | 0 | 1 | 0 | java,python | 55,081,785 | 6 | false | 0 | 0 | There is no (strict) equivalent since in java you have to specify the return type for the method in its declaration which is then checked against a computed type of the following the return statement. So for methods that have a return type - neither semicollon nor leaving empty braces will work;
I personally use: throw... | 2 | 57 | 0 | What is the equivalent to Python's pass in Java? I realize that I could use continue or not complete the body of a statement to achieve that effect, but I like having a pass statement. | Java do nothing | 0.066568 | 0 | 0 | 100,196 |
22,493,765 | 2014-03-19T00:16:00.000 | 92 | 0 | 1 | 0 | java,python | 22,493,796 | 6 | true | 0 | 0 | Just use a semi-colon ;, it has the same effect. | 2 | 57 | 0 | What is the equivalent to Python's pass in Java? I realize that I could use continue or not complete the body of a statement to achieve that effect, but I like having a pass statement. | Java do nothing | 1.2 | 0 | 0 | 100,196 |
22,495,767 | 2014-03-19T03:42:00.000 | 1 | 0 | 0 | 0 | python,django,session,flask,server-side | 22,520,376 | 2 | false | 1 | 0 | Celery is a great solution, but it can be overpowered for many setups. If you just need tasks to run periodically (once an hour, once a day, etc) then consider just using cron.
There's a lot less setup and it can get you quite far. | 1 | 0 | 0 | I have searched the forums for my question but im either searching for a thing naming it wrongly or the question is hard which i really doubt.
I am developing a web-app which would have an web-interface written in one of the MVC frameworks like django or even flask and allow user to login, will identify users session a... | Server side python code runing continuosly per session | 0.099668 | 0 | 0 | 183 |
22,495,894 | 2014-03-19T03:54:00.000 | 11 | 1 | 0 | 0 | python,django,cloud,wsgi | 22,497,827 | 4 | true | 1 | 0 | Deploying .pyc files will not always work. If using Apache/mod_wsgi for example, at least the WSGI script file still needs to be straight Python code.
Some web frameworks also may require the original source code files to be available. Using .pyc files also does little to obscure any sensitive information that may be i... | 3 | 6 | 0 | I want to deploy a Django application to a cloud computing environment, but I am worried about source code security. Can I deploy only the compiled .pyc files there? According to official python doc, pyc files are 'moderately hard to reverse engineer'.
What are the pros and cons of taking this approach? Is this a stand... | Should I deploy only the .pyc files on server if I worry about code security? | 1.2 | 0 | 0 | 6,259 |
22,495,894 | 2014-03-19T03:54:00.000 | 1 | 1 | 0 | 0 | python,django,cloud,wsgi | 22,496,250 | 4 | false | 1 | 0 | Generally, deploying PYC files will work fine.
The Pros, as you said, a bit helpful for protecting source codes.
Cons, here are the points I found:
1). PYC only works with same Python version. E.g., "a.pyc" was compiled by Python2.6, "b.pyc" was by 2.7, and b.pyc "import a", it won't work. Similarly, "python2.6 b.pyc" ... | 3 | 6 | 0 | I want to deploy a Django application to a cloud computing environment, but I am worried about source code security. Can I deploy only the compiled .pyc files there? According to official python doc, pyc files are 'moderately hard to reverse engineer'.
What are the pros and cons of taking this approach? Is this a stand... | Should I deploy only the .pyc files on server if I worry about code security? | 0.049958 | 0 | 0 | 6,259 |
22,495,894 | 2014-03-19T03:54:00.000 | 1 | 1 | 0 | 0 | python,django,cloud,wsgi | 22,495,975 | 4 | false | 1 | 0 | Yes, just deploying the compiled files is fine. Another point to consider are the other aspects of your application. One aspect could be if current bugs let malicious users know what technology stack you are using, type of error messages displayed when (if) your application crashes. To me, these seem like some of the o... | 3 | 6 | 0 | I want to deploy a Django application to a cloud computing environment, but I am worried about source code security. Can I deploy only the compiled .pyc files there? According to official python doc, pyc files are 'moderately hard to reverse engineer'.
What are the pros and cons of taking this approach? Is this a stand... | Should I deploy only the .pyc files on server if I worry about code security? | 0.049958 | 0 | 0 | 6,259 |
22,498,877 | 2014-03-19T07:18:00.000 | 0 | 1 | 1 | 0 | python,migration,dynamic-typing | 22,498,955 | 5 | false | 0 | 0 | One of the tradeoffs between statically and dynamically typed languages is that the latter require less scaffolding in the form of type declarations, but also provide less help with refactoring tools and compile-time error detection. Some Python IDEs do offer a certain level of type inference and help with refactoring,... | 1 | 4 | 0 | I'm learning python and came into a situation where I need to change the behvaviour of a function. I'm initially a java programmer so in the Java world a change in a function would let Eclipse shows that a lot of source files in Java has errors. That way I can know which files need to get modified. But how would one do... | Tracking changes in python source files? | 0 | 0 | 0 | 696 |
22,501,155 | 2014-03-19T09:21:00.000 | 1 | 1 | 1 | 0 | php,python,python-2.7,shared-libraries | 22,503,228 | 1 | false | 0 | 0 | .py files are compiles on the fly to .pyc files, the .pyc is used if it is more recent than the .py file.
Some modules can be written in C/C++, then they are delivered as a .so file. | 1 | 0 | 0 | This is not a language compare question like asked on various forums. I am interested to know about more specific term core libraries/modules calling/execution in python.
As I checked python modules installation directory like /usr/lib/python2.7 (On Ubuntu). I found .py (Source Code) and .pyc (Byte Code). I am assumin... | php compare to python in perspective of core libraries | 0.197375 | 0 | 0 | 92 |
22,501,431 | 2014-03-19T09:32:00.000 | 0 | 0 | 1 | 0 | python,ipython | 28,310,783 | 2 | false | 0 | 1 | In Spyder, try View - Panes - Object inspector. Then type the full name of the function. | 1 | 1 | 0 | I'm using IPython qtconsole under windows 7, and when I first write a method name and type the bracket, a popup shows method parameters.
What is the way to display that popup explicitly, once it has disappeared? This is pretty common 'show method parameters' shortcut that I'm talking about, but I've failed to find th... | How do I display function arguments in ipython qtconsole? | 0 | 0 | 0 | 1,486 |
22,502,741 | 2014-03-19T10:22:00.000 | 0 | 0 | 0 | 0 | python,udp,scapy,icmp | 22,513,923 | 1 | true | 0 | 0 | Well, at least for the ID and sequence fields, these can be any 16-bit numbered combination and the kernel will accept the packet and forward it to all registered ICMP socket handlers.
But if the checksum field is incorrect, the receiving kernel will not pass the header up to the handlers (it will however to link laye... | 1 | 0 | 0 | I am writing python two scripts using scapy one executed on server side and the other on client side. On client side, the script sends UDP packets to a closed port on server. The aim of my scripts, is to test if client will accept invalid ICMP packets received from server. On server side, I am going to sniff for incomi... | Invalid field Raw in an ICMP destination unreachable (port unreachable) packet | 1.2 | 0 | 1 | 609 |
22,506,268 | 2014-03-19T12:45:00.000 | 1 | 0 | 0 | 0 | python,scipy,weibull | 22,522,819 | 2 | false | 0 | 0 | If I understand correctly, then this requires estimation with censored data.
None of the scipy.stats.distribution will directly estimate this case. You need to combine the likelihood function of the non-censored and the likelihood function of the censored observations.
You can use the pdf and the cdf, or better sf, of ... | 1 | 2 | 1 | I'm currently working with some lifetime data that corresponds to the Installation date and Failure date of units. The data is field data, so I do have a major number of suspensions (units that haven't presented a failure yet). I would like to make some Weibull analysis with this data using Scipy stats library (fitting... | Weibull Censored Data | 0.099668 | 0 | 0 | 1,430 |
22,511,472 | 2014-03-19T15:57:00.000 | 0 | 0 | 0 | 0 | python,windows,wxpython,gdi | 23,710,926 | 1 | false | 0 | 1 | OP seemed to find the solution.
The solution I found is to call wx.Yield() to releases unused
ressources. But this only work perfectly on linux. On windows, i need
to call wx.Frame.DestroyChildren(). | 1 | 2 | 0 | First, sorry for my language, english is not my native language :-/
I have some troubles using wxpython 2.8/python 2.7 with Windows.
My app using wxPython is quite big now and uses a lot of widgets. My problem is : In a for loop, i open a frame as a variable (myVar = myFrame(...)), and give it some values/variables (li... | wxPython : GDI ressources are not release after wxFrame.destroy() | 0 | 0 | 0 | 296 |
22,511,568 | 2014-03-19T16:01:00.000 | 0 | 0 | 0 | 0 | python,django,performance,caching | 22,516,105 | 1 | false | 1 | 0 | I think your idea to store the prepped data in a file is a good one. I might name the file something like this:
/tmp/prepped-data-{{session_id}}.json
You could then just have a function in each view called get_prepped_data(session_id) that either computes it or reads it from the file. You could also delete old files wh... | 1 | 0 | 0 | Let's say I have a page I'd like to render which will present some (expensive to compute) data in a few ways. For example, I want to hit my database and get some large-size pile of data. Then I want to group that data and otherwise manipulate it in Python (for example, using Pandas). Say the result of this manipulat... | How to cache data to be used in multiple ways at a single URL | 0 | 0 | 0 | 64 |
22,512,321 | 2014-03-19T16:32:00.000 | 0 | 1 | 0 | 0 | php,python,joomla,cherrypy,joomla3.0 | 22,783,076 | 5 | false | 1 | 0 | Before considering Python
What are you wanting to customize? (perhaps some clever Javascript or a Joomla extension already exists)
Is the Joomla-way not a better solution for your problem, given the fact that you're using Joomla? (change the template, or the view-templates of the modules and component in particular)
i... | 1 | 5 | 0 | I'm building a Joomla 3 web site but I have the need to customize quite a few pages. I know I can use PHP with Joomla, but is it also possible to use Python with it? Specifically, I'm looking to use CherryPy to write some custom pieces of code but I want them to be displayed in native Joomla pages (not just iFrames). ... | Can you display python web code in Joomla? | 0 | 0 | 0 | 5,932 |
22,516,007 | 2014-03-19T19:16:00.000 | 0 | 0 | 0 | 0 | python,linux,audio,pexpect,julius-speech | 22,633,327 | 1 | false | 0 | 0 | A workaround for my problem was the following:
using dsnoop for ALSA audio settings in .asoundrc. | 1 | 0 | 0 | I am using pexpect in python to receive continuous audio data from an audio input for my home automation project. Is there a way to pause the pexpect from using my audio device? Or can I use the audio device in two separate programs/scripts?
What I want to do is: Use speech recognition (julius) to listen for keywords. ... | python pause pexpect.spawn and its used devices | 0 | 0 | 1 | 248 |
22,516,246 | 2014-03-19T19:29:00.000 | 1 | 0 | 1 | 1 | python-2.7,batch-file,csv,task,scheduler | 22,519,416 | 1 | true | 0 | 0 | Assuming that you try this under the windows 7 Task-scheduler...
You may try the following:
In the security options of your Task (1st page) ensure that you have selected the SYSTEM account. Tick the high privileges check box near the bottom of the dialog (i guess you already did that)
check if the file can be accessed... | 1 | 1 | 0 | I have a .py file that reads integers from a separate csv , i just cant launch it from windows task scheduler, after 2 days and much frustration im posting here. A lot of similar questions have been posted but none are answered adequately for my case.
I have no problems launching other python files or exe's, the probl... | Open python file with Task scheduler | 1.2 | 0 | 0 | 359 |
22,516,612 | 2014-03-19T19:48:00.000 | 1 | 0 | 1 | 0 | emacs,elisp,python-mode | 24,333,355 | 1 | true | 0 | 0 | I had the mode hook in my ~/.emacs.d/el-get-init-files/init-python-mode.el. I put a call to (message "FOO BAR") in the file and noticed it wasn't being loaded on startup.
Looks like el-get only loads files from the el-get-init-files directory for packages it has installed. Since python mode comes with emacs, and wasn't... | 1 | 0 | 0 | I'm trying to tweak my emacs configuration to treat _ as a word character.
I've added (add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) to my .emacs file, but it doesn't seem to work.
If I execute (modify-syntax-entry ?_ "w") directly in the mini-buffer, then it starts working.
I'm guessing that o... | python-mode-hook not working as I'd expect | 1.2 | 0 | 0 | 412 |
22,517,604 | 2014-03-19T20:39:00.000 | 1 | 0 | 0 | 0 | php,python,ldap,single-sign-on,saml | 22,533,335 | 1 | false | 1 | 0 | Rather than using the user's credentials to bind to LDAP, get an application account at LDAP that has read permissions for the attributes you need on the users within the directory. Then, when you get the username via SSO, you just query LDAP using your application's ID.
Make sure you make your application ID's passwor... | 1 | 1 | 0 | I have this web application with LDAP backend, to read and modify some LDAP attributes.
Web application use the SSO (Single Sign-on) to authenticate user.
How can I bind to LDAP, if I only get a user name as an attribute from SSO, withouth asking for password again, because it will make SSO useless?
I use SimpleSAMLphp... | Bind to LDAP after SSO? | 0.197375 | 0 | 1 | 153 |
22,521,912 | 2014-03-20T01:54:00.000 | 1 | 0 | 0 | 0 | python,localhost,simplehttpserver,localserver | 22,522,021 | 2 | true | 1 | 0 | Only one process can listen on a port; you cannot have two SimpleHTTPServer processes listening on the same port. You can however leave an old server process up and then disregard failed startup of the new server process or error message about automatic port conflict resolution.
To debug this process, use netstat ( ... | 2 | 2 | 0 | I'm in the directory /backbone/ which has a main.js file within scripts. I run python -m SimpleHTTPServer from the backbone directory and display it in the browser and the console reads the error $ is not defined and references a completely different main.js file from something I was working on days ago with a local p... | Local server giving wrong files. Is it possible I'm running 2 python servers? | 1.2 | 0 | 0 | 1,036 |
22,521,912 | 2014-03-20T01:54:00.000 | 0 | 0 | 0 | 0 | python,localhost,simplehttpserver,localserver | 67,453,910 | 2 | false | 1 | 0 | I recently had this problem and it was due to the old page being stored in the browser cache. Accessing the port from a different browser worked for me (or you can clear your cache). | 2 | 2 | 0 | I'm in the directory /backbone/ which has a main.js file within scripts. I run python -m SimpleHTTPServer from the backbone directory and display it in the browser and the console reads the error $ is not defined and references a completely different main.js file from something I was working on days ago with a local p... | Local server giving wrong files. Is it possible I'm running 2 python servers? | 0 | 0 | 0 | 1,036 |
22,522,802 | 2014-03-20T03:19:00.000 | 1 | 0 | 1 | 0 | python,multithreading,locking | 22,524,103 | 1 | true | 1 | 0 | Since the updates are so infrequent, you're better off just making a copy of the object, updating copy, and then updating the global variable to point to the new object. Simple assignments in python are atomic so you don't need any locks at all. | 1 | 0 | 0 | I'm developing a tiny web application with Flask/Gunicorn on Heroku. Since I'm just prototyping, I have a single web process (dyno) with a worker thread started by the same process. The web application is just returning a JSON dump of a global object, which is periodically updated by the worker thread monitoring an ext... | Shared lock for Python objects | 1.2 | 0 | 0 | 1,254 |
22,523,519 | 2014-03-20T04:28:00.000 | 1 | 0 | 0 | 0 | python,django,postgresql | 22,527,486 | 1 | false | 1 | 0 | From ./manage.py help syncdb:
--database=DATABASE Nominates a database to synchronize. Defaults to the
"default" database.
You can add another database definition in your DATABASES configuration, and run ./manage.py syncdb --database=name_of_database_definition. You might want to create a sm... | 1 | 3 | 0 | I'm using Django 1.6 with PostgreSQL and I want to use a two different Postgres users - one for creating the initial tables (syncdb) and performing migrations, and one for general access to the database in my application. Is there a way of doing this? | Different Postgres users for syncdb/migrations and general database access in Django | 0.197375 | 1 | 0 | 78 |
22,525,601 | 2014-03-20T06:54:00.000 | 1 | 0 | 0 | 0 | python,cloud,openstack,openstack-nova,openstack-horizon | 43,255,570 | 5 | false | 0 | 0 | check the core service is running by typing command " netstat -an | grep LISTENING". In the controller node,it should contains
listening port 8778(placement_api service), 8774(compute-service),9292(Image service),9696(network),5000(Identify service),5672(rabbitmq server),
11211( memcache server),35357(Identify service)... | 5 | 5 | 0 | I'm getting the following error on my Openstack (DevStack) every time I try to launch an image other than cirrOS. Walking through internet leads me to:
Openstack cannot allocate RAM, CPU resources.
It's not true because I have a lot of RAM, disk space and CPU available.
set in nova.conf -> scheduler_default_filters=Al... | Openstack. "No valid host was found" for any image other than cirrOS | 0.039979 | 0 | 0 | 6,243 |
22,525,601 | 2014-03-20T06:54:00.000 | 1 | 0 | 0 | 0 | python,cloud,openstack,openstack-nova,openstack-horizon | 27,073,835 | 5 | false | 0 | 0 | For me, I got this same error because I mistakenly added an ubuntu image and set the metadata "hypervisor" tag to be "KVM" and not "QEMU". My host only had QEMU capability, of course. When I went to launch it, it gave that "No Valid Host was found". I'd say make sure the tags on the image aren't preventing the host f... | 5 | 5 | 0 | I'm getting the following error on my Openstack (DevStack) every time I try to launch an image other than cirrOS. Walking through internet leads me to:
Openstack cannot allocate RAM, CPU resources.
It's not true because I have a lot of RAM, disk space and CPU available.
set in nova.conf -> scheduler_default_filters=Al... | Openstack. "No valid host was found" for any image other than cirrOS | 0.039979 | 0 | 0 | 6,243 |
22,525,601 | 2014-03-20T06:54:00.000 | 0 | 0 | 0 | 0 | python,cloud,openstack,openstack-nova,openstack-horizon | 22,552,298 | 5 | false | 0 | 0 | The error can be due to many reasons. As you have told that it works with cirros, try this.
Run the command "glance index".
you will get the images you have in your glance.
Now do a "glance show (your-glance-id)"
Compare this between Cirros image and the rest. | 5 | 5 | 0 | I'm getting the following error on my Openstack (DevStack) every time I try to launch an image other than cirrOS. Walking through internet leads me to:
Openstack cannot allocate RAM, CPU resources.
It's not true because I have a lot of RAM, disk space and CPU available.
set in nova.conf -> scheduler_default_filters=Al... | Openstack. "No valid host was found" for any image other than cirrOS | 0 | 0 | 0 | 6,243 |
22,525,601 | 2014-03-20T06:54:00.000 | 0 | 0 | 0 | 0 | python,cloud,openstack,openstack-nova,openstack-horizon | 22,528,201 | 5 | false | 0 | 0 | I don't know WHY but after a while I can launch Ubuntu
saucy-server-cloudimg-i386-disk1.img — Ubuntu 13.10 x32
but can not
saucy-server-cloudimg-amd64-disk1.img — Ubuntu 13.10 x64
and vise versa, I can launch
precise-server-cloudimg-amd64-disk1.img — Ubuntu 13.04 x64
and cannot
precise-server-cloudimg-i386-disk1.im... | 5 | 5 | 0 | I'm getting the following error on my Openstack (DevStack) every time I try to launch an image other than cirrOS. Walking through internet leads me to:
Openstack cannot allocate RAM, CPU resources.
It's not true because I have a lot of RAM, disk space and CPU available.
set in nova.conf -> scheduler_default_filters=Al... | Openstack. "No valid host was found" for any image other than cirrOS | 0 | 0 | 0 | 6,243 |
22,525,601 | 2014-03-20T06:54:00.000 | 4 | 0 | 0 | 0 | python,cloud,openstack,openstack-nova,openstack-horizon | 22,526,659 | 5 | false | 0 | 0 | Make sure the flavour size you select is size "small" or larger, cirros uses tiny by default, as do others if not changed | 5 | 5 | 0 | I'm getting the following error on my Openstack (DevStack) every time I try to launch an image other than cirrOS. Walking through internet leads me to:
Openstack cannot allocate RAM, CPU resources.
It's not true because I have a lot of RAM, disk space and CPU available.
set in nova.conf -> scheduler_default_filters=Al... | Openstack. "No valid host was found" for any image other than cirrOS | 0.158649 | 0 | 0 | 6,243 |
22,529,007 | 2014-03-20T09:47:00.000 | 2 | 0 | 1 | 0 | python | 22,529,061 | 2 | false | 0 | 0 | item in your_list is O(n) operation in Python. If all items are distinct and the order doesn't matter and you need to do multiple looks up then you could use a set() instead of a list. item in your_set is O(1) (O(n) worst case). | 1 | 0 | 0 | Suppose I have a list of tuples of the form list = [(key1,value1), (key2,value2)], then is it fast/good to look up if a tuple exists in the list like this: (key_x,value_x) in list ? Also how does python search the list?! Does it compare pointers or how?! I'm new to Python coming from Java. | Cost of looking up a tuple in a list of tuple? | 0.197375 | 0 | 0 | 187 |
22,530,287 | 2014-03-20T10:37:00.000 | 1 | 1 | 1 | 0 | python,regex,email | 22,530,391 | 2 | true | 0 | 0 | <* means: "the character < zero or more times". You are looking for <.*@.*> | 2 | 0 | 0 | I am trying to get the address of the sender in mbox formated mails in python. When I get the line that contains the sender, it looks like From: Mister X <misterx@domain>. I am able to retrieve the mail address with, for example, re.findall('<[a-zA-Z0-9\.]+@[a-zA-Z0-9\.]+>', str). I think that should be fine since emai... | Matching address in mbox format in python | 1.2 | 0 | 0 | 134 |
22,530,287 | 2014-03-20T10:37:00.000 | 0 | 1 | 1 | 0 | python,regex,email | 22,535,800 | 2 | false | 0 | 0 | Here is my answer.
why the expression <*@*>, which I expected to match any characters in the email address does not work at all.
Because you are using re module that evaluate your expression <*@*> as regular expression. If you want to make your expression evaluated as wildcard, use fnmatch module. But fnmatch have on... | 2 | 0 | 0 | I am trying to get the address of the sender in mbox formated mails in python. When I get the line that contains the sender, it looks like From: Mister X <misterx@domain>. I am able to retrieve the mail address with, for example, re.findall('<[a-zA-Z0-9\.]+@[a-zA-Z0-9\.]+>', str). I think that should be fine since emai... | Matching address in mbox format in python | 0 | 0 | 0 | 134 |
22,531,334 | 2014-03-20T11:19:00.000 | 4 | 0 | 1 | 0 | python,list | 22,531,335 | 3 | false | 0 | 0 | Figured out a way, posting here for easy reference. Try this:
if any(term in terms for term in ("foo", "bar", "baz")):
pass | 1 | 3 | 0 | The question is about a quicker, ie. more pythonic, way to test if any of the elements in an iterable exists inside another iterable.
What I am trying to do is something like:
if "foo" in terms or "bar" in terms or "baz" in terms:
pass
But apparently this way repeats the 'in terms' clause and bloats the code, espec... | Find if any element of list exists in another list in Python | 0.26052 | 0 | 0 | 1,872 |
22,532,644 | 2014-03-20T12:12:00.000 | 0 | 0 | 0 | 0 | jquery,python,django | 22,533,787 | 1 | false | 1 | 0 | I think ajax should do the trick for you | 1 | 0 | 0 | I have a website and I want to have a form on the website that multiple people can view. As the firm gets updated by any of the individuals looking at it, everyone else can also see the updates without refreshing the web page. Basically it will be a row from a table displayed as a form and each part of the form will be... | Realtime forms in Django | 0 | 0 | 0 | 81 |
22,535,539 | 2014-03-20T14:09:00.000 | 1 | 0 | 0 | 0 | python,web-scraping,python-2.5 | 22,536,352 | 1 | true | 0 | 0 | If you really want to do it old-school entirely within Python but without urllib, then you'll have to use socket and implement a tiny subset of HTTP 1.0 to fetch the page. Jumping through the hoops to get through a proxy will be really painful though.
Use wget or curl and save yourself a few days of debugging. | 1 | 0 | 0 | I am working on an appliance using an old version of python (2.5.2).
I'm working on a script which needs to read a webpage, but I can't access the normal libraries
- urllib, urllib2 and requests are not available.
How did people collect this in the olden days?
I could do a wget/curl from the shell, but I'd prefer to ... | collect web page source with python 2.5.2 | 1.2 | 0 | 1 | 79 |
22,536,589 | 2014-03-20T14:48:00.000 | 3 | 0 | 1 | 0 | python,numpy,complex-numbers | 22,562,740 | 2 | false | 0 | 0 | The short answer is that the C99 standard (Annex G) on complex number arithmetic recognizes only a single complex infinity (think: Riemann sphere). (inf, nan) is one representation for it, and (-inf, 6j) is another, equivalent representation. | 1 | 3 | 1 | At some point in my python script, I require to make the calculation: 1*(-inf + 6.28318530718j). I understand why this will return -inf + nan*j since the imaginary component of 1 is obviously 0, but I would like the multiplication to have the return value of -inf + 6.28318530718j as would be expected. I also want whate... | How to deal with indeterminate form in Python | 0.291313 | 0 | 0 | 584 |
22,542,566 | 2014-03-20T18:56:00.000 | 1 | 1 | 0 | 0 | php,python | 22,542,914 | 1 | false | 1 | 0 | Write a Python script that takes a path in sys.argv or the audio data via sys.stdin and writes metadata to sys.stdout. Call it from PHP using exec. | 1 | 4 | 0 | Is it possible to exchange data between a PHP page and a Python application? How can I implement a PHP page that reacts to a Python application?
EDIT:
My application is divided in 2 parts: the web backend and a Python daemon. Via the web backend I upload MP3s to my server; these MP3s are processed by my Python daemon w... | Exchange data between Python and PHP | 0.197375 | 0 | 0 | 419 |
22,548,223 | 2014-03-21T00:57:00.000 | 1 | 0 | 0 | 0 | python,django,facebook,facebook-graph-api,python-social-auth | 41,433,786 | 2 | false | 1 | 0 | Just some extra for the reply above. To get the token from extra_data you need to import the model with that data (took me a while to find this):
from social.apps.django_app.default.models import UserSocialAuth | 1 | 11 | 0 | How can I retrieve Facebook friend's information using Python-Social-auth and Django? I already retrieve a profile information and authenticate the user, but I want to get more information about their friends and invite them to my app.
Thanks! | How to retrieve Facebook friend's information with Python-Social-auth and Django | 0.099668 | 0 | 0 | 7,106 |
22,548,412 | 2014-03-21T01:15:00.000 | 0 | 0 | 0 | 0 | python,macos,xlwt,cinema-4d | 22,853,287 | 2 | true | 0 | 0 | You have to install the python packages into the Python Library Folder of Cinema4D. If you select the Preferences Menu in Cinema4D there is a Button called "Open Preferences Folder..." this will lead to a folder called CINEMA 4D R_
Inside this folder library/python/packages/osx/ is the folder where you have to install... | 1 | 0 | 0 | I'm trying to read excel from Cinema4d using python. I believed this can be achieved using XLWT. Where did I should copy and pasthe the XLWT package in Mac? I know in Window the location is here :C:\Users\user\AppData\Roaming\MAXON\CINEMA 4D version\library\python\packages\. How about Mac? | Cinema 4D - Import xlwt location | 1.2 | 0 | 0 | 227 |
22,548,621 | 2014-03-21T01:37:00.000 | 1 | 0 | 1 | 0 | python,cuda,parallel-processing,mpi,openmp | 22,548,699 | 2 | true | 0 | 0 | As far as I know, pyPar and/or pyMPI are the two most frequently used libraries for computation intensive applications in the scientific field.
pyPar tends to be easier to use, while pyMPI is more feature complete - so the first is used more frequently for less complex computations.
Iirc, they are just python wrappers... | 1 | 1 | 0 | It seems like there are many options of parallelizing Python. I have seen these options below:
shared memory:
therading, multiprocessing, joblib, cython.parallel
distributed memory:
mpi4py, parallelpython (pp)
any CUDA, OpenCL options?
Does anyone have experiences in using these or other parallel libraries? How do th... | Choice of parallelism in python | 1.2 | 0 | 0 | 226 |
22,549,501 | 2014-03-21T03:18:00.000 | 0 | 0 | 1 | 0 | python | 22,549,535 | 7 | false | 0 | 0 | It sounds like you are looking for the interactive prompt, and a text editor.
If you want the interactive Python prompt:
If you are on Windows, look for a directory called C:\Python? and find a bin\python.exe.
If you are on Linux or OSX, typing python in the Terminal should get you the interactive prompt.
For a text ... | 3 | 0 | 0 | I'm not sure if this question is appropriate for here, so if it isn't, I apologize, however I'm not sure where else to ask.
I've been learning python on codecademy however when I downloaded python myself it is nothing like what I've become used to. I can't for the life of me figure out where to define fucntions and I d... | where can i find the version of python that is on codecademy | 0 | 0 | 0 | 1,952 |
22,549,501 | 2014-03-21T03:18:00.000 | 0 | 0 | 1 | 0 | python | 22,549,892 | 7 | false | 0 | 0 | When I want to write a Python program, I open Windows explorer and go to the directory where I keep my .py files. When I right click a .py file, I am given the choice to "Edit with IDLE." I like IDLE really well. When I "Run" a program a Python Shell window opens. I work between these two windows.
(I think I used N... | 3 | 0 | 0 | I'm not sure if this question is appropriate for here, so if it isn't, I apologize, however I'm not sure where else to ask.
I've been learning python on codecademy however when I downloaded python myself it is nothing like what I've become used to. I can't for the life of me figure out where to define fucntions and I d... | where can i find the version of python that is on codecademy | 0 | 0 | 0 | 1,952 |
22,549,501 | 2014-03-21T03:18:00.000 | 0 | 0 | 1 | 0 | python | 32,239,844 | 7 | false | 0 | 0 | I think Komodo Edit is the editor codeacademy used to teach us. | 3 | 0 | 0 | I'm not sure if this question is appropriate for here, so if it isn't, I apologize, however I'm not sure where else to ask.
I've been learning python on codecademy however when I downloaded python myself it is nothing like what I've become used to. I can't for the life of me figure out where to define fucntions and I d... | where can i find the version of python that is on codecademy | 0 | 0 | 0 | 1,952 |
22,552,304 | 2014-03-21T07:03:00.000 | 0 | 0 | 1 | 0 | python,compiler-construction,interpreter | 22,552,400 | 2 | true | 0 | 1 | Python saves the precompiled .pyc file only for imported modules, not for the main script you're running.
Running a program as main or importing it as a module is not the exact same thing, but very similar because in a module everything that is at top level is executed at import time.
Note that for main program the sou... | 1 | 1 | 0 | I seen the some difference when I execute the .py file. I have observed two cases,
1) when I run the .py file using the python mypython.py
I got the result. But .pyc file not created in my folder.
2) when I run the .py file using the python -c "import mypython"
I got the same result. But .pyc file was created in my fol... | Understanding python compile | 1.2 | 0 | 0 | 102 |
22,553,659 | 2014-03-21T08:26:00.000 | 2 | 0 | 0 | 1 | python,celery,celery-task,flower | 22,554,555 | 1 | true | 0 | 0 | I found i out.
It is the matter of setting the persistant flag in command running celery flower. | 1 | 1 | 0 | I started to use celery flower for tasks monitoring and it is working like a charm. I have one concern though, how can i "reload" info about monitored tasks after flower restart ?
I use redis as a broker, and i need to have option to check on tasks even in case of unexpected restart of service (or server).
Thanks in ad... | Celery Flower - how can i load previous catched tasks? | 1.2 | 0 | 0 | 1,345 |
22,557,975 | 2014-03-21T11:50:00.000 | 3 | 0 | 1 | 0 | python,ipython | 22,558,254 | 2 | true | 0 | 0 | In Ipython, use run -i myscript.py. from the docs,
-i run the file in IPython's namespace instead of an empty one. This is
useful if you are experimenting with code written in a text editor
which depends on variables defined interactively. | 1 | 1 | 0 | Is it possible to run a .py code file using the existing variables from previous executions ? I mean to run the new .py file using the variables on memory,that is,the variables I see when I enter the who command. | IPython : Running a .py file using the existing variables | 1.2 | 0 | 0 | 180 |
22,562,540 | 2014-03-21T14:31:00.000 | 6 | 0 | 0 | 0 | python,pandas,scikit-learn | 22,584,181 | 2 | false | 0 | 0 | Pandas DataFrames are very good at acting like Numpy arrays when they need to. If in doubt, you can always use the values attribute to get a Numpy representation (df.values will give you a Numpy array of the values in DataFrame df. | 1 | 11 | 1 | Can we run scikit-learn models on Pandas DataFrames or do we need to convert DataFrames into NumPy arrays? | Pandas dataset into an array for modelling in Scikit-Learn | 1 | 0 | 0 | 9,121 |
22,562,786 | 2014-03-21T15:22:00.000 | 1 | 0 | 0 | 0 | python,analytics | 22,563,437 | 3 | false | 0 | 0 | You can use many 'web' analytics platforms inside of desktop or mobile apps.
Mixpanel is a popular one that I have looked at, but you can use google analytics in this way as well. You basically just will have method calls in your code that call out to the mixpanel server whenever you want to log an event.
It will be ea... | 1 | 1 | 0 | I have published a library that is used in-house. It is not a web based library but it unifies access to several different datasources and provides access in a unified way.
I would like to gather usage statistics of this library - obviously with the proviso that users of the library don't mind these statistics being ta... | Python analytics (non web based) | 0.066568 | 0 | 0 | 106 |
22,563,386 | 2014-03-21T15:49:00.000 | 3 | 0 | 0 | 0 | android,python,kivy | 22,563,987 | 1 | true | 0 | 1 | What do you mean by 'window'? In the practical sense, you can easily create different screens with kivy and switch between them, e.g. to have a menu screen, settings screen, game screen etc. Is this the kind of thing you mean? More generally, you can easily achieve any particular windowing behaviour you want within kiv... | 1 | 0 | 0 | I'm evaluating Kivy for android development. I need to know if is it possible to create an application with multiple windows using Kivy. I dont know for sure how android works with this kind of approach.
In c#, windows forms, we have a main window and from that we open/close another forms. How can I accomplish this app... | Kivy Multiple windows | 1.2 | 0 | 0 | 1,083 |
22,564,503 | 2014-03-21T16:40:00.000 | 0 | 0 | 0 | 0 | python,sql,oracle,pandas,cx-oracle | 53,431,165 | 7 | false | 0 | 0 | kind of complicated but possible. I have seen it once. You need to
create a javaclass inside oracle database. This class calls a .py file in the directory which contains it.
create a procedure that calls the java class of item 1.
in your sql query, call the procedure of item 2 whenever you need it. | 1 | 18 | 0 | Is it possible to call Python within an Oracle procedure? I've read plenty of literature about the reverse case (calling Oracle SQL from Python), but not the other way around.
What I would like to do is to have Oracle produce a database table, then I would like to call Python and pass this database table to it in a Dat... | Calling Python from Oracle | 0 | 1 | 0 | 12,854 |
22,567,255 | 2014-03-21T18:54:00.000 | 2 | 0 | 0 | 0 | python,paypal | 22,621,678 | 1 | false | 1 | 0 | Your question embodies a contradiction in terms. The purpose of so-called encrypted buttons is for Paypal to check that they exist as registered buttons. If you roll your own buttons, Paypal can't do that.
You're looking at the problem the wrong way. If someone chooses to send you money, that's very nice, but unless it... | 1 | 0 | 0 | in my current web application project, I'm developing a small commerce with many products...
I need to implement PayPal for payments and I have read a lot of documentation in paypal developer site.
The solution of implement Payment standard Buttons (add to cart button in my case) is fantastic, but I need to auto gener... | Paypal, encrypted add to cart button generate dynamically | 0.379949 | 0 | 0 | 383 |
22,570,422 | 2014-03-21T22:10:00.000 | 0 | 0 | 1 | 0 | python | 22,570,461 | 2 | true | 0 | 0 | myList = [tup[0] for tup in mySet]
They're not "keys" per se. | 1 | 0 | 0 | I have a set of tuple(a, b, c). How can I return a list of all a inside this set? Is there something like .keys() as dictionaries have? | Python set/tuple operations iteration | 1.2 | 0 | 0 | 54 |
22,574,996 | 2014-03-22T07:54:00.000 | 1 | 0 | 0 | 0 | python,qt,terminal,pyqt,pyqt4 | 22,578,889 | 2 | false | 0 | 1 | I tried similar things before. For logging. Its a pain and it is very slow for a lot of lines.
If you expect having a lot of lines cummulating in the terminal then consider writing an item model and attach it to a view.
There are lot of possibilites in tweaking the appearance of such a view and it allows showing a smal... | 1 | 0 | 0 | I am willing to make a Terminal like QTextEdit using pyqt4, but do not know what property to edit,so that when text from a process is dumped, it should start from the bottom and goes up.
Any help for a starting point would be really appreciated.
Cheers. | Loading text in QTextEdit from down up like in Terminal | 0.099668 | 0 | 0 | 541 |
22,578,624 | 2014-03-22T14:07:00.000 | 4 | 0 | 0 | 0 | android,python,kivy | 22,578,797 | 1 | false | 0 | 1 | What are the packages which need to be installed for writing scripts using PyJius in system ?
I'm not sure what you mean here. To run use pyjnius, all you need is...pyjnius. It is a separate module, not part of kivy itself, though kivy uses it on android. Kivy's mobile build tools automatically package this when you b... | 1 | 1 | 0 | What are the packages which need to be installed for writing scripts using PyJius in system ?
Is there anyway by which i could run these python scripts on android phone ?
What is K ivy Launcher for android ? Will it be helpful for executing my scripts ?
How actually Kivy works ( in detail say in I want to switch on Bl... | Kivy for android | 0.664037 | 0 | 0 | 768 |
22,583,604 | 2014-03-22T21:06:00.000 | 1 | 0 | 1 | 0 | python | 22,583,678 | 2 | false | 0 | 0 | You'll need to build a little parser. Iterate through the characters of the string, keeping track of the current nesting level of parentheses. Then you can detect the . you care about by checking that first, the character is a ., and second, there's only one level of parentheses open at that point. Then just place the ... | 1 | 0 | 0 | So I want to do something like this
"(1.0)" which returns ["1","0"]
similarly "((1.0).1)" which returns ["(1.0)", "1")
How do i do this python? Thanks for the help
so basically I want to break the string "(1.0)" into a list [1,0] where the dot is the separator.
some examples
((1.0).(2.0)) -> [(1.0), (2.0)]
(((1.0).(2... | How to split with multiple bracket | 0.099668 | 0 | 0 | 63 |
22,585,235 | 2014-03-22T23:51:00.000 | 3 | 0 | 1 | 1 | python,anaconda | 50,594,422 | 19 | false | 0 | 0 | In case you have multiple version of anaconda,
rm -rf ~/anaconda2 [for version 2]
rm -rf ~/anaconda3 [for version 3]
Open .bashrc file in a text editor
vim .bashrc
remove anaconda directory from your PATH.
export PATH="/home/{username}/anaconda2/bin:$PATH" [for version 2]
export PATH="/home/{username}/anaconda3/bin:$PA... | 4 | 275 | 0 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python | Python Anaconda - How to Safely Uninstall | 0.031568 | 0 | 0 | 666,412 |
22,585,235 | 2014-03-22T23:51:00.000 | 0 | 0 | 1 | 1 | python,anaconda | 68,270,547 | 19 | false | 0 | 0 | In macOs
rm -rf ~/opt/anaconda3 | 4 | 275 | 0 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python | Python Anaconda - How to Safely Uninstall | 0 | 0 | 0 | 666,412 |
22,585,235 | 2014-03-22T23:51:00.000 | 1 | 0 | 1 | 1 | python,anaconda | 50,807,405 | 19 | false | 0 | 0 | To uninstall Anaconda Fully from your System :
Open Terminal
rm -rf ~/miniconda
rm -rf ~/.condarc ~/.conda ~/.continuum | 4 | 275 | 0 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python | Python Anaconda - How to Safely Uninstall | 0.010526 | 0 | 0 | 666,412 |
22,585,235 | 2014-03-22T23:51:00.000 | 152 | 0 | 1 | 1 | python,anaconda | 22,585,265 | 19 | false | 0 | 0 | The anaconda installer adds a line in your ~/.bash_profile script that prepends the anaconda bin directory to your $PATH environment variable. Deleting the anaconda directory should be all you need to do, but it's good housekeeping to remove this line from your setup script too. | 4 | 275 | 0 | I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other changes required?
Currently when I run which python I get this path:
/Users/username/anaconda/bin/python | Python Anaconda - How to Safely Uninstall | 1 | 0 | 0 | 666,412 |
22,590,490 | 2014-03-23T11:50:00.000 | 1 | 0 | 0 | 1 | python,shell | 29,597,942 | 1 | true | 0 | 0 | I encountered the same problem. After trying a lot of things I arrived at this solution. The trick is to make a new Proxification Rule in proxifier. Name it anything you prefer, say PythonIdle.
In application box add python.exe and pythonw.exe.
Set action to Direct.
Hope it will solves your problem! | 1 | 1 | 0 | I have recently installed Python 2.7.6 in windows 7. When I tried to open the IDLE, it gave fatal errors.
There are two error message popping up subsequently showing error messages:
"IDLE Subprocess Error"
"Socket Error:No connection could be made because the target machine
actively refused it"
"Subprocess Startu... | Error in Python IDLE and shell while Proxifier is on | 1.2 | 0 | 0 | 603 |
22,590,718 | 2014-03-23T12:11:00.000 | 0 | 1 | 1 | 0 | python,git | 22,590,792 | 1 | false | 0 | 0 | A pull is a complex command which will do a few different things depending on the configuration. It is not something you should use in a script, as it will try to merge (or rebase if so configured) which means that files with conflict markers may be left on the filesystem, which will make anything that tries to compile... | 1 | 0 | 0 | I'm building a little python script that is supposed to update itself everytime it starts. Currently I'm thinking about putting MD5 hashes on a "website" and downloading the files into a temp folder via the srcipt itself. Then if the MD5 Hashes line up the temp files will be moved over the old ones.
But now I'm wonderi... | Does git always produce stable results when doing a pull? | 0 | 0 | 0 | 41 |
22,590,730 | 2014-03-23T12:12:00.000 | 3 | 0 | 1 | 0 | python,pycharm | 25,076,327 | 1 | false | 0 | 0 | This may be due to Community Edition which doesn't provide all functionality. Download the professional edition of pycharm. The professional edition is free to use for one month. | 1 | 9 | 0 | I've just downloaded PyCharm community edition for my Mac. It seems to work great but for some reason project type -dropdown is missing in Create project dialog. I'm newbie to PyCharm (and Python overall) so I don't know if there is some obvious reason for this.
I was able to create projects however - even in virtualen... | PyCharm is missing project type drop down | 0.53705 | 0 | 0 | 3,046 |
22,590,811 | 2014-03-23T12:18:00.000 | 1 | 0 | 0 | 0 | python,c++,opencv,numpy | 22,591,329 | 1 | true | 0 | 0 | there is no question at all, - use cv2
the old cv api, that wraps IplImage and CvMat is being phased out, and will be no more available in the next release of opencv
the newer cv2 api uses numpy arrays for almost anything, so you can easily combine it with scipy, matplotlib, etc. | 1 | 1 | 1 | I've recently started using openCV in python. I've come across various posts comparing cv and cv2 and with an overview saying how cv2 is based on numpy and makes use of an array (cvMat) as opposed to cv makes use of old openCV bindings that was using Iplimage * (correct me if i'm wrong).
However I would really like kn... | Can anyone in detail explain how cv and cv2 are different and what makes cv2 better and faster than cv? | 1.2 | 0 | 0 | 230 |
22,591,947 | 2014-03-23T14:08:00.000 | 1 | 0 | 1 | 0 | c,stack,pypy,vm-implementation,rpython | 22,592,504 | 1 | true | 0 | 0 | That depends. Do you want to push the string, or a pointer to a string? If it's the former, you have a problem, because the string will have variable length, unlike a pointer or a number. If it's the latter, you have to consider memory management aside from your stack. | 1 | 0 | 0 | I'm making a stack based virtual machine in RPython using the PyPy toolchain to convert the RPython to C. So far I have 4 instructions.
EOP - End of Program
EOI - End of Instruction
PUSH - Push item onto the stack
PRINT - Print the top of the stack
My question is, how do you push a String to the top of the stack. Is ... | Stack Machine with Strings | 1.2 | 0 | 0 | 393 |
22,593,328 | 2014-03-23T16:03:00.000 | 1 | 0 | 0 | 0 | python,user-interface,matplotlib,tkinter,wxpython | 22,595,047 | 1 | false | 0 | 0 | Tkinter, which is part of python, comes with a canvas widget that can be used for some simple plotting. It can draw lines and curves, and one datapoint every couple of seconds is very easy for it to handle. | 1 | 0 | 1 | Is there a minimalistic python module out there that I can use to plot real time data that comes in every 2-3 seconds?
I've tried matplotlib but I'm having a couple errors trying to get it to run so I'm not looking for something as robust and with many features. | Python widget for real time plotting | 0.197375 | 0 | 0 | 133 |
22,597,239 | 2014-03-23T21:22:00.000 | 0 | 0 | 0 | 0 | python,scikit-learn | 48,487,656 | 2 | false | 0 | 0 | My recommendation is to not use the cross-validation split that had the best performance. That could potential give you problems with high bias. Afterall, the performance just happened to be good because there was a fold used for testing that just happened to match the data used for training. When you generalize it to ... | 1 | 2 | 1 | I'm using scikit-learn to train classifiers. I want also to do cross validation, but after cross-validation I want to train on the entire dataset. I found that cross_validation.cross_val_score() just returns the scores.
Edit: I would like to train the classifier that had the best cross-validation score with all of my d... | Making scikit-learn train on all training data after cross-validation | 0 | 0 | 0 | 1,088 |
22,600,861 | 2014-03-24T04:01:00.000 | 0 | 0 | 0 | 0 | python,mysql,mysql-python | 22,600,910 | 3 | false | 0 | 0 | You need to quote only character and other non-integer data types.
Integer data types need not be quoted. | 1 | 0 | 0 | insert_query = u"""
INSERT INTO did_you_know (
name, to_be_handled, creator, nominator, timestamp)
VALUES ('{0}', '{1}', '{2}', '{3}', '{4}')
""".format("whatever", "whatever", "whatever", "whatever", "whatever") is my example.
Does every single value in a MySQL query have to contain quotes?... | Does every single value in a MySQL query have to be quoted? | 0 | 1 | 0 | 55 |
22,602,065 | 2014-03-24T05:56:00.000 | 2 | 0 | 1 | 0 | python,compatibility,mysql-python,anaconda | 24,050,784 | 1 | false | 0 | 0 | You don't need to uninstall anaconda. In your case, Try pip install PyMySql. If which pip return /Users/vincent/anaconda/bin/pip, this should work. | 1 | 1 | 0 | so I am new to both programming and Python, but I think I have the issue narrowed down enough to ask a meaningful question.
I am trying to use MySQLdb on my computer. No problem, right? I just enter:
import PyMySQL
PyMySQL.install_as_MySQLdb()
import MySQLdb
At the top of the script.
But here is the problem. I installe... | ImportError: No module named PyMySQL - issues connecting with Anaconda | 0.379949 | 1 | 0 | 7,318 |
22,602,390 | 2014-03-24T06:24:00.000 | 0 | 0 | 0 | 0 | python,django,data-binding,architecture | 22,629,711 | 2 | false | 1 | 0 | Sounds like you need a message queue.
You would run a separate broker server which is sent tasks by your web app. This could be on the same machine. On your two local machines you would run queue workers which connect to the broker to receive tasks (so no inbound connection required), then notify the broker in real tim... | 1 | 0 | 0 | The scenario is
I have multiple local computers running a python application. These are on separate networks waiting for data to be sent to them from a web server. These computers are on networks without a static IP and generally behind firewall and proxy.
On the other hand I have web server which gets updates from the... | Sync data with Local Computer Architecture | 0 | 0 | 1 | 63 |
22,604,179 | 2014-03-24T08:20:00.000 | 1 | 0 | 1 | 0 | python | 22,604,199 | 1 | true | 0 | 0 | It's probably a custom module. The python standard library does not have an error module.
Maybe you missed something in the textbook where an error module was created. | 1 | 0 | 0 | does python have error module? when i wrote 'import error' in python 2.7.6, it returns "No module named error.' but 'import error' is a part of program in a textbook?should i doult something in the textbook? | Does python have an "error" module? | 1.2 | 0 | 0 | 35 |
22,604,620 | 2014-03-24T08:46:00.000 | 0 | 0 | 0 | 0 | python,openerp | 22,627,251 | 1 | false | 1 | 0 | The user can add fields, models, can customize the views etc from client side. These are in Settings/Technical/Database Structure, here you can find the menus Fields, Models etc where the user can add fields. And the views can be customized in Settings/Technical/User Interface. | 1 | 0 | 0 | I have been developing modules in OpenERP-7 using Python on Ubuntu-12.04. I want to give my users a feature by which they will have the ability to create what ever fields they want to . Like they will set the name, data_type etc for the field and then on click , this field will be created. I dont have any idea how this... | How to code in openerp so that user can create his fields? | 0 | 0 | 0 | 103 |
22,608,905 | 2014-03-24T12:03:00.000 | 1 | 0 | 0 | 0 | python-2.7,computer-vision,python-module | 22,609,701 | 2 | false | 0 | 0 | OpenCV is free to use.
But SIFT itself as algorithm is patented, so if you would make your own implementation of SIFT, not based on Lowe`s code, you still could not use it in commercial application. So, unless you have got a license for SIFT, no library with it, is free.
But you can consult with patent guys - some cou... | 2 | 2 | 1 | In python which library is able to extract SIFT visual descriptors? I know opencv has an implementation but it is not free to use and skimage does not include SIFT particularly. | what library is able to extract SIFT features in Python? | 0.099668 | 0 | 0 | 2,214 |
22,608,905 | 2014-03-24T12:03:00.000 | 2 | 0 | 0 | 0 | python-2.7,computer-vision,python-module | 23,098,414 | 2 | true | 0 | 0 | I would like to suggest VLFeat, another open source vision library. It also has a python wrapper. The implementation of SIFT in VLFeat is modified from the original algorithm, but I think the performance is good. | 2 | 2 | 1 | In python which library is able to extract SIFT visual descriptors? I know opencv has an implementation but it is not free to use and skimage does not include SIFT particularly. | what library is able to extract SIFT features in Python? | 1.2 | 0 | 0 | 2,214 |
22,609,272 | 2014-03-24T12:22:00.000 | 2 | 0 | 1 | 0 | python,python-3.x,dictionary,namespaces,base | 22,609,390 | 3 | false | 0 | 0 | __name__ is a string containing the name of the class.
__bases__ is a tuple of classes from which the current class derives.
__dict__ is a dictionary of all methods and fields defined in the class.
The use case for type(name, bases, dict) is when you want to dynamically generate classes at runtime.
Just imagine that ... | 1 | 11 | 0 | Docs:
With three arguments, return a new type object. This is essentially a dynamic form of the class statement. The name string is the class name and becomes the __name__ attribute; the bases tuple itemizes the base classes and becomes the __bases__ attribute; and the dict dictionary is the namespace containing defin... | Python - type(name,bases,dict) | 0.132549 | 0 | 0 | 4,642 |
22,609,742 | 2014-03-24T12:43:00.000 | 1 | 0 | 0 | 1 | python,ubuntu-12.04,thumbnails,thumbor | 23,401,532 | 1 | false | 0 | 0 | You are missing a closing bracket in the filters option in your thumbor.conf.
Did you miss it posting here or actually in the thumbor.conf file? | 1 | 0 | 0 | I have followed the wiki and set up everything necessary, but all the images are broken right now. I used the aptitude package manager to install.
Here are my configuration files:
/etc/default/thumbor
# set this to 0 to disable thumbor, remove or set anything else to enable it
# you can temporarily override this with... | Thumbor installation not working | 0.197375 | 0 | 1 | 3,567 |
22,609,931 | 2014-03-24T12:50:00.000 | 0 | 0 | 0 | 1 | python | 22,610,165 | 1 | true | 0 | 0 | Look up phrases like "port scan" and "port mapping" for some ideas. You'll need to make use of whatever services are already running on the target machine, which could include Avahi/Bonjour/mDNS, HTTP, SSH, SMTP, etc. You'd try to figure out what ports might be open, try to connect there (or send UDP datagrams), and ... | 1 | 0 | 0 | I would like to query a device (e.g. an Android phone on WiFi) to find out what Operating System it is running, without having to run anything on the device or install an additional agent?
Is this possible? | Query network device to determine operating system, without installing a remote agent? | 1.2 | 0 | 0 | 83 |
22,610,616 | 2014-03-24T13:19:00.000 | 3 | 0 | 0 | 1 | python,macos,firefox,firefox-addon,firefox-addon-sdk | 22,612,244 | 1 | true | 1 | 0 | It's looking for the Firefox binary file, not your application's binaries. You have to install Firefox because cfx run will open a browser with your add-on installed so you can use it and test it live.
If firefox is already installed, then it is in a non-standar path, so you must tell cfx command where to find it, thi... | 1 | 1 | 0 | I installed the the latest Add-On SDK by Mozilla (version 1.15). Installation was successful and when I execute cfx I get a list of all possible commands. I made a new separate empty folder, cd'd into it and ran cfx init. This was also successful and all necessary folders and files got created.
Now when I try to run t... | When I try to run 'cfx run' or 'cfx test' using the Mozilla Add-On SDK, my application binaries are not found | 1.2 | 0 | 0 | 730 |
22,612,189 | 2014-03-24T14:25:00.000 | 1 | 0 | 1 | 0 | python,debugging,ipython,pycharm | 35,292,220 | 3 | false | 0 | 0 | On ubuntu i had to change the line kernel.yama.ptrace_scope = 1 in /etc/sysctl.d/10-ptrace.conf to kernel.yama.ptrace_scope = 0
otherwise pycharm was not able to attach to the ipython process. | 1 | 12 | 0 | Is it possible to hit graphical breakpoints when running codes in PyCharm's IPython console?
i.e.:
You have a script foo() in foo.py
You place a graphical breakpoint inside foo() from the editor (the red dot next to line number)
You import foo into a PyCharm's IPython console and execute foo() (Note: not running from ... | Debugging inside PyCharm IPython | 0.066568 | 0 | 0 | 4,151 |
22,614,608 | 2014-03-24T16:06:00.000 | 1 | 0 | 1 | 1 | python | 22,614,609 | 1 | true | 0 | 0 | I found the solution to be this:
python -c "import zipfile;file=zipfile.ZipFile('archive.zip');file.extractall('.')"
The contents of archive.zip will be placed into the directory this command is executed from. | 1 | 0 | 0 | I have a zip file, but no unzipping tool installed. I do have python installed, but I can't easily create a python script file on this machine. How do I unzip the contents of the zip file using the python executable's -c argument? | Unzip all files in zip archive with inline command | 1.2 | 0 | 0 | 174 |
22,619,437 | 2014-03-24T20:00:00.000 | 0 | 0 | 0 | 0 | python,django,django-south | 22,619,479 | 1 | true | 1 | 0 | Well... the answer is to use apps.
That's what they're for. They were designed the way the are exactly because standard modules don't provide the level of integration needed.
If you start hacking away on your library to make it work on its own, you'll end up with mess of code and glue about the same size of a django ap... | 1 | 0 | 0 | I'm currently working on a django project which tends to get pretty complex in time. Therefore I'm planning to encapsulate basic core models and utilities that are going to be reused throughout the application in a separate space. Since these models are mostly base models needed by other apps, imho there's no need to c... | Django: Core library and South migrations | 1.2 | 0 | 0 | 78 |
22,619,506 | 2014-03-24T20:04:00.000 | 2 | 0 | 0 | 0 | python,opencv,image-processing,numpy,scikit-image | 22,619,589 | 2 | false | 0 | 0 | Here is a list of ideas I can think of:
get the np.sum() and if it is lower than a threshold, then consider it almost black
calculate np.mean() and np.std() of the image, an almost black image is an image that has low mean and low variance | 2 | 0 | 1 | How can i see in if a binary image is almost all black or all white in numpy or scikit-image modules ?
I thought about numpy.all function or numpy.any but i do not know how neither for a total black image nor for a almost black image. | How can i check in numpy if a binary image is almost all black? | 0.197375 | 0 | 0 | 1,554 |
22,619,506 | 2014-03-24T20:04:00.000 | 2 | 0 | 0 | 0 | python,opencv,image-processing,numpy,scikit-image | 22,619,838 | 2 | true | 0 | 0 | Assuming that all the pixels really are ones or zeros, something like this might work (not at all tested):
def is_sorta_black(arr, threshold=0.8):
tot = np.float(np.sum(arr))
if tot/arr.size > (1-threshold):
print "is not black"
return False
else:
print "is kinda black"
return... | 2 | 0 | 1 | How can i see in if a binary image is almost all black or all white in numpy or scikit-image modules ?
I thought about numpy.all function or numpy.any but i do not know how neither for a total black image nor for a almost black image. | How can i check in numpy if a binary image is almost all black? | 1.2 | 0 | 0 | 1,554 |
22,621,259 | 2014-03-24T21:46:00.000 | 3 | 0 | 0 | 0 | python,ios,xcode,python-requests,kivy | 22,622,162 | 1 | true | 0 | 1 | I don't know how kivy-ios manages different modules, but in the absence of anything else you can simply copy the requests module into your app dir so it's included along with everything else. | 1 | 3 | 0 | I finally have some idea how to build Kivy app in Xcode with help of Kivy-ios. But Xcode and mac environment is new to me. My issue is: how to compile other python modules that required for my application. There is 'build-all.sh' in 'kivy-ios/tools' that builds standard things, but how to add some other module. In part... | Compile custom module for Kivy-ios | 1.2 | 0 | 0 | 462 |
22,623,375 | 2014-03-25T00:39:00.000 | 0 | 0 | 1 | 0 | python | 61,510,856 | 5 | false | 0 | 0 | In simple words,int() method in python is the type conversion function similar to float() and str(), and can be used for converting float numbers to int numbers. | 1 | 7 | 0 | How can I remove all decimal places form a float?
a = 100.0
I want that to become 100
I tried str(a).rstrip('.0'), but it just returned 1 | python - remove all decimals from a float | 0 | 0 | 0 | 40,286 |
22,624,070 | 2014-03-25T01:55:00.000 | 0 | 0 | 0 | 0 | python,wxpython,wxwidgets | 22,635,854 | 1 | true | 0 | 1 | Selected items in wxListCtrl, wxListBox and so on always use the system background selection colour, it can't be changed. | 1 | 0 | 0 | I'm trying to set a custom background for selected items in wxPython 2.8. I cannot figure out how to do so. I've tried SetItemBackground with no luck. | Setting selection background in ListCtrl | 1.2 | 0 | 0 | 209 |
22,624,987 | 2014-03-25T03:35:00.000 | 0 | 0 | 0 | 0 | android,python,android-ndk,kivy | 22,644,004 | 2 | false | 0 | 1 | Android SDK are released more often that NDK. It happened more than once that if you use a too recent SDK, the NDK will not have the .h for it. Now i'm not sure this would be related to your issue at all. | 1 | 2 | 0 | Should/does NDK9 work with android API19? (though it was released with API18).
Full story:
I was building an Android App using kivy, python-for-android and buildozer.
compiling with MDK9 (ie 9d) and api19 result in error:
E/AndroidRuntime( 1773): java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_relocate(lin... | android nkd and sdk compatibility issue (run time linker error) | 0 | 0 | 0 | 681 |
22,626,203 | 2014-03-25T05:36:00.000 | 1 | 0 | 0 | 0 | python,flask | 22,659,358 | 1 | true | 1 | 0 | The Werkzeug Request object heavily relies on properties and anything that touches request data is lazily cached; e.g. only when you actually access the .form attribute would any parsing take place, with the result cached.
In other words, don't touch .files, .form, .get_data(), etc. and nothing will be sucked into memo... | 1 | 0 | 0 | I have an endpoint in my Flask application that accepts large data as the content. I would like to ensure that Flask never attempts to process this body, regardless of its content-type, and always ensures I can read it with the Rquest.stream interface.
This applies only to a couple of endpoints, not my entire applicati... | Flask accept request data as a stream without processing? | 1.2 | 0 | 0 | 92 |
22,633,008 | 2014-03-25T11:19:00.000 | 1 | 0 | 1 | 0 | python,permutation,combinatorics | 22,666,834 | 2 | true | 0 | 0 | I believe that a block cipher, like AES, provides exactly this functionality. | 1 | 4 | 0 | I'm not sure whether this is possible even theoretically; but if it is, I'd like to know how to do it in Python.
I want to generate a big, random permutation cheaply. For example, say that I want a permutation on range(10**9). I want the permutation to be uniform (i.e. I want the numbers to be all over the place withou... | Python: Generating a big uniform permutation cheaply | 1.2 | 0 | 0 | 151 |
22,634,264 | 2014-03-25T12:13:00.000 | 0 | 0 | 0 | 1 | python | 22,634,599 | 2 | false | 0 | 0 | You can run any python command from cmd using Python.exe -c //code
For example, Python.exe -c print(10*10) will print 100 to your console.
Does this help? Your question is a little unclear, sorry. | 1 | 0 | 0 | I would like to launch a python program.exe to test it from another python code i,e launch it on the cmd (myprogram.exe -a arg1 -b arg2) and eventually get the error message it can print or any console output
does anyone have an idea how to do this?
thanks
EDIT
Actually I launch it with os.popen(command) but what I w... | launch a python program with it's arguments on cmd and get the output messages python | 0 | 0 | 0 | 47 |
22,636,894 | 2014-03-25T14:01:00.000 | 0 | 0 | 0 | 0 | python,router | 22,789,614 | 1 | true | 0 | 0 | Its possible by using route add command in linux | 1 | 1 | 0 | Is it possible to switch between interfaces in Python program?
I will have eth0 and wlan0 connection, both are different routers.
I'm using boto to upload images to AWS server. And I need to upload using router with fast upload speed and for other downloads I need to use another interface which is connected to a router... | Use different interfaces (eth0 and wlan0) for sending and receiving in Python program | 1.2 | 0 | 1 | 409 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.