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
29,235,535
2015-03-24T14:42:00.000
1
0
0
0
python,html,parsing,url,urlencode
29,235,977
3
false
0
0
I would try using urlparse.urlparse it will probably get you most of the way there and a little extra work on your end will get what you want.
1
1
0
Many search engines track clicked URLs by adding the result's URL to the query string which can take a format like: http://www.example.com/result?track=http://www.stackoverflow.com/questions/ask In the above example the result URL is part of the query string but in some cases it takes the form http://www.example.com/http://www.stackoverflow.com/questions/ask or URL encoding is used. The approach I tried first is to split searchengineurl.split("http://"). Some obvious problems with this: it would return all parts of the query string that follow the result URL and not just the result URL. This would be a problem with an URL like this: http://www.example.com/result?track=http://www.stackoverflow.com/questions/ask&showauthor=False&display=None it does not distinguish between any additional parts of the search engine tracking URL's query string and the result URL's query string. This would be a problem with an URL like this: http://www.example.com/result?track=http://www.stackoverflow.com/questions/ask?showauthor=False&display=None it fails if the "http://" is ommitted in the result URL What is the most reliable, general and non-hacky way in Python to extract URLs contained in other URLs?
How to reliably extract URLs contained in URLs with Python?
0.066568
0
1
99
29,237,279
2015-03-24T15:56:00.000
0
0
1
0
c#,.net,instance,ironpython,activator
34,271,320
3
true
0
0
The short answer, no it is not possible.
1
0
0
Is it possible to use Activator.CreateInstance to create a class in c# based on a Type declared in Ironpython? If I try to use it, I always get the message, that no parameter-less constructor is found. Thank you!
Activator.CreateInstance for create Ironpython class
1.2
0
0
547
29,238,171
2015-03-24T16:38:00.000
2
0
0
0
python,django
29,238,435
1
true
1
0
That is not a part of a standard Django project and is not automatically called by Django itself. I guess it's just a standalone file that the developer created, to run from the command line to populate the db.
1
0
0
I am working on a Django project that someone else started, and I'm new to Django, so I'm not sure about the workflow. I see that there is a file called load_fixtures.py in the root directory (so the file is a sibling of manage.py) , but I don't understand why (and when) is that file called. When? Does it get called only during syncdb? Why? i.e. which file includes / calls it? Is it called just because it's in the root directory? Or does a line from settings.py include it? Thanks in advance !
How does django call the .py files at root directory?
1.2
0
0
73
29,239,033
2015-03-24T17:21:00.000
1
0
1
1
python,linux,windows,macos,kivy
29,239,289
1
true
0
0
Your best bet will be to setup a VM for Windows and a VM for Linux, then create the packages for each OS within those VMs. You might be able to use pyinstaller with Wine to make the Windows package directly on OSX - I have read that this can be done on Linux, so in theory it could work on OSX. But you will probably get better results using a VM where you can also test the package and make sure it installs and runs properly.
1
1
0
I've packaged a Kivy program that I made on OSX, but I also want to be able to distribute it for Windows and Linux. Is there currently a way of creating a Windows or Linux package from OSX? Or is there an ETA on when Buildozer will be able to create Windows packages?
Create Kivy package for Windows from OSX
1.2
0
0
327
29,239,877
2015-03-24T18:08:00.000
2
0
1
1
python,macos,virtualenvwrapper
29,287,001
1
true
0
0
You can use the -p arg like so -- virtualenv -p $(which python3)
1
0
0
My machine is OsX 10.10.2 and I have Python 2 installed. It is possible to create a virtualenv using virtualenvwrapper command mkvirtualenv to run on Python 3? I am reluctant to install Python3 in my system as the last time I did that, python on the whole stopped working. Not sure why, I am a new. May I screwed up. I am looking for the command to run.
How to create a virtualenv with Python3 while my system is OsX 10 with Python2
1.2
0
0
62
29,240,835
2015-03-24T19:04:00.000
0
0
1
0
python,intellij-idea,pycharm,doctest
56,109,348
3
false
0
0
If the above doesn't work for you - make sure that your module is not named doctest; it will cause a conflict and therefore cause the exception.
2
32
0
In the PyCharm IDE, if I right-click on a function/method with a doctest, sometimes the right-click menu will give me the option: "Run 'Doctest my_function_name'" and sometimes the right-click menu, instead, only gives the option to run the whole file (NOT as a doctest). What determines when it will give the "run doctest" option and when it will not? Is there a way to force it one way or the other?
How do I run doctests with PyCharm?
0
0
0
14,596
29,240,835
2015-03-24T19:04:00.000
13
0
1
0
python,intellij-idea,pycharm,doctest
38,528,401
3
false
0
0
If you don't want to delete configurations, you can also hit the shortcut key for Run | Resume Program (F9 for me) to pop up a complete list of choices
2
32
0
In the PyCharm IDE, if I right-click on a function/method with a doctest, sometimes the right-click menu will give me the option: "Run 'Doctest my_function_name'" and sometimes the right-click menu, instead, only gives the option to run the whole file (NOT as a doctest). What determines when it will give the "run doctest" option and when it will not? Is there a way to force it one way or the other?
How do I run doctests with PyCharm?
1
0
0
14,596
29,240,840
2015-03-24T19:05:00.000
0
0
0
0
android,python,opencv,parse-platform
29,240,968
2
false
0
0
No. JavaScript is the only language currently supported for writing CloudCode.
2
0
1
This will be my new post if I go wrong please don't judge me hard :) I'm developing an OpenCV project with Python and also I'm developing its mobile interface in Android. My purpose is to compare plant pictures and decide their species.Researchers who use Android application will take plant photos and upload them (such as 'tree leaf photo'). I intent to execute comparison algorithms in the cloud. I use Parse as mobile database so I thought that I could use Cloud Code in Parse to run my Python codes. Can I do this ?
Using OpenCV in Parse Cloud Code
0
0
0
89
29,240,840
2015-03-24T19:05:00.000
0
0
0
0
android,python,opencv,parse-platform
29,246,105
2
true
0
0
You can have Parse Cloud Code call out to your Python code using HTTP if you want. Just as you can do the same from the Android app. This code can tell the web hook what images to download and process based on some condition (such as a researcher has uploaded a photo to be processed). Purely up to you how you trigger this. Your Cloud Code is JavaScript only though, same as your Android app is Java only (usually, unless you use Xamarin with C# or something else of course).
2
0
1
This will be my new post if I go wrong please don't judge me hard :) I'm developing an OpenCV project with Python and also I'm developing its mobile interface in Android. My purpose is to compare plant pictures and decide their species.Researchers who use Android application will take plant photos and upload them (such as 'tree leaf photo'). I intent to execute comparison algorithms in the cloud. I use Parse as mobile database so I thought that I could use Cloud Code in Parse to run my Python codes. Can I do this ?
Using OpenCV in Parse Cloud Code
1.2
0
0
89
29,241,353
2015-03-24T19:35:00.000
0
0
0
0
python,selenium,selenium-webdriver,webdriver,internet-explorer-11
39,231,646
3
false
1
0
Use remote driver with desired cap (pageLoadStrategy) Release notes from seleniumhq.org. Note that we have to use version 2.46 for the jar, iedriverserver.exe and python client driver in order to have things work correctly. It is unclear why 2.45 does not work given the release notes below. v2.45.0.2 Updates to JavaScript automation atoms. Added pageLoadStrategy to IE driver. Setting a capability named pageLoadStrategy when creating a session with the IE driver will now change the wait behavior when navigating to a new page. The valid values are: "normal" - Waits for document.readyState to be 'complete'. This is the default, and is the same behavior as all previous versions of the IE driver. "eager" - Will abort the wait when document.readyState is 'interactive' instead of waiting for 'complete'. "none" - Will abort the wait immediately, without waiting for any of the page to load. Setting the capability to an invalid value will result in use of the "normal" page load strategy.
2
0
0
For the IE webdriver, it opens the IE browsers but it starts to load the local host and then stops (ie/ It never stated loading ). WHen the browser stops loading it shows the msg 'Initial start page for webdriver server'. The problem is that this does not occur every time I execute the test case making it difficult to identify what could be the cause of the issue. What I have noticed is when this issue occurs, the url will take ~25 secs to load manually on the same machine. When the issue does not occur, the URL will load within 3secs. All security setting are the same (protected Mode enabled across all zone) enhance protected mode is disabled IE version 11 the URL is added as a trusted site. Any clue why it does not load the URL sometimes?
IE11 stuck at initial start page for webdriver server only when connection to the URL is slow
0
0
1
2,136
29,241,353
2015-03-24T19:35:00.000
0
0
0
0
python,selenium,selenium-webdriver,webdriver,internet-explorer-11
62,954,013
3
false
1
0
It hasn't been updated for a while, but recently I had very similar issue - IEDriverServer was eventually opening page under test, but in most cases just stuck on Initial page of WebDriver. What I found the root cause (in my case) was startup setting of IE. I had Start with tabs from the last session enabled, when changed back to Start with home page driver started to work like a charm, opening page under test in 100% of tries.
2
0
0
For the IE webdriver, it opens the IE browsers but it starts to load the local host and then stops (ie/ It never stated loading ). WHen the browser stops loading it shows the msg 'Initial start page for webdriver server'. The problem is that this does not occur every time I execute the test case making it difficult to identify what could be the cause of the issue. What I have noticed is when this issue occurs, the url will take ~25 secs to load manually on the same machine. When the issue does not occur, the URL will load within 3secs. All security setting are the same (protected Mode enabled across all zone) enhance protected mode is disabled IE version 11 the URL is added as a trusted site. Any clue why it does not load the URL sometimes?
IE11 stuck at initial start page for webdriver server only when connection to the URL is slow
0
0
1
2,136
29,241,797
2015-03-24T20:01:00.000
1
0
0
1
python,google-app-engine,faceted-search
29,302,041
2
true
1
0
Facet value cannot be empty string. You can workaround it by not including facets with empty values or have a special value for your empty facets. The local implementation of faceted search (python) currently accepts empty facets that is a bug and will be fixed.
1
1
0
I've just created locally on my machine a perfectly running faceted search service using Google App Engine Faceted Search, written in Python. As soon as I deploy to our production server, it throws an error during the index creation, specifically when the code try to execute index.put(docs), where docs is an array of [max 100] search.Document. The error is: "PutError: one or more put document operations failed: Value is empty" I tried then to step back to the the previous version of my service, which was working like a charm until then. I removed all the new search.TextField added and I removed the facets=[search.AtomFacet(...)] from the search.Document constructor keywords. It started working again. Then, baby step forward again, I've added all the fields I needed, but still no facets=[] in the constructor. It worked.As soon as I added again facets=[search.AtomFacet(name='propName', value=doc.propName if doc.propName else '')] then the error appeared again. Whilst locally on my machine, it works perfectly. Is there any setting / configuration we need to enable on production server to have this feature? Thank you
Google App Engine Faceted Search in production has to be enabled / activated?
1.2
0
0
223
29,242,825
2015-03-24T21:02:00.000
-1
0
0
0
python,graph-tool
29,264,444
1
true
0
0
I suggest you continue using the python-igraph package since the graph-tool is not working on windows. The igraph package has all you need.
1
0
0
I have been trying to run a code I got from stackoverflow which contains a function called "get_degrees_dic". I figured this function is from graph-tool package. Since I am doing my project in Windows and graph-tool is not suitable for it, I was wondering if anyone knows a similar package or at least could explain to me what does this function do? Thanks in advance
graph-tool similar package for windows
1.2
0
0
592
29,243,748
2015-03-24T22:03:00.000
0
1
0
1
java,python,performance,subprocess,processbuilder
29,289,687
1
false
1
0
It seems like python doesn't spawn subprocess. Which is why it was faster. I am sorry with confusion. thank you
1
2
0
I was trying to write a wrapper for a third party C tool using Java processbuilder. I need to run this process builder millions of times. But, I found something weird about the speed. I already have a wrapper for this third party tool C tool for python. In python, the wrapper uses the python subprocess.check_output. So, I ran the java wrapper 10000 times with same command. Also, ran the python wrapper 10000 time with same command. With python, my 10000 tests ran in about 0.01 second. With java processbuilder, it ran in 40 seconds. Can someone explain why I am getting large difference in speed between two languages? You try this experiment with a simple command like "time".
why is Java Processbuilder 4000 times slower at running commands then Python Subprocess.check_output
0
0
0
1,183
29,243,919
2015-03-24T22:16:00.000
0
0
0
0
python,pdf,reportlab
29,244,104
1
true
0
0
A PDF can contain images, but PDF isn't an image format. You need to save images as images, in an image format (PNG, JPG, etc.).
1
0
0
I do not think. It is just to be sure that I need to save in png, jpeg, etc ... format the images or graphs before inserting in the document.
Is it possible inserting pdf format image in a reportlab generated pdf document?
1.2
0
0
130
29,244,337
2015-03-24T22:48:00.000
1
0
0
0
python,django
29,244,430
3
false
1
0
If this script is for a specific app, you could make a [app]/scripts/ directory. If it's for the project as a whole, you could make a scripts directory in the project root directory. Then you would use a task scheduler, like cron if you're on *nix, to run that script however often you'd like.
1
0
0
I have a Django web sever, on this server, I'd like to run a process (let's say every couple hours) that updates an app's database. To be more specific, my Django site hosts a large list of words that are combed from Google trends and I want to run a process on the server that updates that data periodically. I already have created this process and can run it off my machine, I don't have it on the server yet, where in a Django project may I integrate this process?
Django: Run process on server that updates data periodically
0.066568
0
0
868
29,246,687
2015-03-25T02:58:00.000
0
0
1
0
python,python-2.7,dictionary,key
29,246,758
6
false
0
0
a key only has one value, you would need to make the value a tuple or list etc If you know you are going to have multiple values for a key then i suggest you make the values capable of handling this when they are created
1
5
0
the current code I have is category1[name]=(number) however if the same name comes up the value in the dictionary is replaced by the new number how would I make it so instead of the value being replaced the original value is kept and the new value is also added, giving the key two values now, thanks.
How to add to python dictionary without replacing
0
0
0
10,467
29,246,709
2015-03-25T03:02:00.000
0
0
1
0
storage,ipython
29,247,542
1
false
0
0
I found the files. These were in the System32 folder.
1
1
0
After the most recent windows update (I downloaded about an hour ago), I can no longer locate my Ipython Notebooks. I run the Ipython Notebook as administrator since these wouldn't print properly otherwise, and this would show and save notebooks from/on a different location from the default (the default location being the one wherein I don't have to run as administrator). With this most recent update, the ran-as-administrator notebooks no longer show up, and I also can't locate them in my hard drive. I tried a system restore but this didn't help. I'm using Python 2.7 with Windows 7 professional on a Thinkpad T520. I want to know where I can find the missing notebooks. These don't know show up in the Ipython Notebook home page, and also when I search the system for .ipynb files.
Ipython Notebooks missing
0
0
0
167
29,247,204
2015-03-25T04:00:00.000
0
0
0
0
qpython,qpython3
29,415,173
1
false
0
1
Try to insert the "#qpy:console" into your script, does it work for you ?
1
0
0
I've recently begun programming with QPython3 on my android phone, and I've found it slightly annoying that the console pops up whenever I run a script. I often have it sending the output through a Toast since I usually only need the information for a second. Is there a way I can make it, either within my script or in the settings of QPython3, that the console is default to the background while running a script? Thank you
QPython 3 console
0
0
0
733
29,249,041
2015-03-25T06:39:00.000
0
0
0
0
javascript,jquery,python,django,matplotlib
29,267,045
1
false
1
0
For providing a web service you will probably want to reorganize your application code such that you can share the matplotlib things between a wxPython application and a separate web services application. (So, IOW, move the non wx application code to a separate set of packages that can be shared with your new web application code, for example.) Once that is done then can do things like have your new web application use the shared code, have matplotlib generate plots as PNG files and serve those PNGs to the browser. Etc.
1
0
0
I have been using WxPython, Matplotlib, Numpy, Scipy quiet a time and familiar with developing Web Page. Is it possible that using WxPython, Matplotlib I can create or render a dynamic web page via Apapche - WxPython has its own output window which I do not want to make use. My aim is to create a dynamic web page using JS / Jquery where users can enter values in text boxes, select via drop down list etc (all HTML UI items) - then a plot is rendered in the same web page. The user over and over again selects or modifies the values and the graph gets modified accordingly.
Matplotlib & Dynamic Web Page
0
0
0
424
29,252,233
2015-03-25T09:47:00.000
3
0
1
0
python,python-3.x,asynchronous,python-asyncio
29,729,638
2
true
0
0
The standard way to deal with this is by starting multiple server processes (each with its own event loop), with a load balancer in front. Each such process typically cannot utilize more than one CPU core, so you might want to have as many processes as you have cores.
1
6
0
I am trying to create an asynchronous application using Python's asyncio module. However, all implementations I can find on the documentation is based on a single Event Loop. Is there any way to launch multiple Event Loops running the same application, so I can achieve high availability and fault tolerance? In other words, I want to scale-out my application by inserting new nodes that would share the execution of coroutines behind a load balancer. I understand there is an inherent issue between asynchronous programming and thread-safety, perhaps what I have in mind isn't even possible. If so, how to avoid this kind of SPOF on asynchronous architectures?
High availability for Python's asyncio
1.2
0
0
1,433
29,258,237
2015-03-25T14:17:00.000
2
0
1
0
python,excel,python-2.7,xlwings
57,833,558
4
false
0
1
For anybody like me who comes to this now and doesn't find these solutions are working, I found accessing the pywin32 API directly with work_sheet.range('A:A').api.WrapText = True worked in Python 3.7 and xlwings 0.15.8 in Windows 7 and Excel 2010.
1
2
0
Can I control the "Wrap Text" property of a cell using Python+xlwings?
Does xlwings support "Wrap Text" property?
0.099668
0
0
2,055
29,260,969
2015-03-25T16:16:00.000
0
0
1
0
ipython-notebook
44,298,912
1
false
0
0
You can also just change the notebook permissions to be read-only by opening a new Terminal directly in your Jupyter server.
1
5
0
I have IPython notebooks running on a server, and I'm editing/prototyping them locally. I use rsync to push my local notebooks when I'm ready to show them to others. Problem is, with all these notebooks open, it's easy to accidentally edit things on the server notebooks instead of the local ones. Is there some reasonable mechanism to prevent accidental editing of notebooks? I still want to be able to run the server-notebooks, and they still should be able to write output - I just want to somehow lock them so they can't be edited.
Locking an IPython notebook for editing
0
0
0
2,205
29,262,565
2015-03-25T17:32:00.000
1
0
1
0
python,anaconda
29,286,130
1
true
0
0
The pkgs directory is the cache of packages used by conda. You shouldn't use those libraries directly. Conda installs the packages to the install environment (in this case, /opt/anaconda) by hardlinking the files from pkgs. Also, it is typically not necessary to use LD_LIBRARY_PATH when using Anaconda. If you are using the Anaconda Python, it will load the libpython2.7.so from the Anaconda lib directory automatically.
1
2
0
There two identical libpython2.7.so in Anaconda's install directory. They are absolutely same(compared with diff). lrwxrwxrwx 1 me me 19 Mar 23 20:20 /opt/anaconda/lib/libpython2.7.so -> libpython2.7.so.1.0 lrwxrwxrwx 1 me me 19 Aug 22 2014 /opt/anaconda/pkgs/python-2.7.8-1/lib/libpython2.7.so -> libpython2.7.so.1.0 That makes me confused. Should I put the /anaconda/pkgs/python-2.7.8-1/lib directory in LD_LIBRARY_PATH or the seemly more right one /anaconda/lib. Why the anaconda guys put two identical python dynamic library in the package at different places? What're the purposes of the two directories?
Why Anaconda has two same `libpython2.7.so`?
1.2
0
0
1,131
29,262,859
2015-03-25T17:46:00.000
3
0
1
0
python,date
29,263,021
3
false
0
0
You're almost there, take the date of Dec. 28. If there is a monday after that, it will only have 3 days in the old year and hence be week 1 of the new year.
1
6
0
In Python, how can we find out the number of calendar weeks in a year? I didn't find a function in the standard library. I then thought about date(year, 12, 31).isocalendar()[1], but For example, 2004 begins on a Thursday, so the first week of ISO year 2004 begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004, so that date(2003, 12, 29).isocalendar() == (2004, 1, 1) and date(2004, 1, 4).isocalendar() == (2004, 1, 7).
The number of calendar weeks in a year?
0.197375
0
0
7,322
29,264,142
2015-03-25T18:52:00.000
0
0
0
0
python,django
29,264,294
1
true
1
0
Along with the homepage, you're going to encounter other things that don't really fit into an application, such as shared utils, base templates, about page, contact page, etc. For these things it's generally best to put them into an application that is general to the project, I name my general application "main".
1
0
0
What would be considered the best practice for integrating your website's homepage in your Django project? Should you make a new application, naming it "homepage" and place the view for it in there? Or is it considered a waste of space to create an entire application just for that? Or should you just stick it somewhere in one of your applications randomly? Or is there some other better option I'm not seeing?
Best way to integrate your Django project homepage
1.2
0
0
43
29,264,398
2015-03-25T19:06:00.000
3
0
1
0
python,multiprocessing,pylucene
29,284,827
1
false
0
0
I found the problem. The program is blocked when I import the nltk module. This only happend in a multiprocess execution. I guess that nltk also uses java libraries and they are messing with jcc.
1
0
0
I'm using pylucene to build a index that will be used in a multiprocessing python program. When I try to search in the index the execution is blocked when I use QueryParser.parse or IndexSearcher.search methods. The block doesn't happen all the time and it happens with distinct searches in the first seconds of the execution. What I'm doing wrong? What is the best way to use multiprocessing and pylucene? Thank you
Pylucene and multiprocessing
0.53705
0
0
171
29,268,732
2015-03-25T23:53:00.000
1
0
0
0
python,hadoop,solr,flask,hbase
32,148,555
1
false
1
0
I'm looking into this as well. I've found the "happybase" python module. That should help connecting Python Flask with HBase.
1
1
0
I am designing an API service for a fairly big data set. The data is currently stored in HDFS and we(BAs) usually query it from Hive. In the end, we have several tables that we want to expose to customers in the format of API, the API might also be used in the future to backup frontend app. I am a Python programmer and I have used Flask before. However, what is the correct technology combo to build an API service that can scale well? I heard some people mentioned "HBase + Solr Cloud" will be the solution. Any suggestion will be super helpful and I will delete this post if think this is not programing related. (I am also open to PaaS, IaaS like AWS, googlecloud if they actually have a decent package already.)
Flask with HBase
0.197375
0
0
1,213
29,269,401
2015-03-26T01:12:00.000
0
1
0
0
python,c,structure,swig,mixed-programming
32,625,890
1
false
0
1
In my experience, SWIG should be able to handle arbitrarily nested structs the way you'd "expect". – brunobeltran0
1
0
0
I have a working C program and now I'm embedding a python script implementing a specific function. The question is, the arguments passed into Python is a complicated(I mean nested) C structure defined in C. And I hope the solution would be able to do the two ways communication easily: 1.Create structure in C, and pass it into Python. Let the Python do some modification. 2.Create the structure in Python. And pass it back to C. I was trying "SWIG" to generate some wrappers for the structure, as well as some helper functions using SWIG for Python so that it could return me some nested part of the structure so that I could visit the structure through Python easily. Will this be a good solution or I may miss some very simple way of solving it?
How do I pass C structure into Python when embedding a Python module in a C program
0
0
0
134
29,270,188
2015-03-26T02:41:00.000
0
0
1
0
python,multithreading
29,272,511
3
false
0
0
If you are reading the file line by line, it 's not easy to do mutithreading with python. Because the seek() method needs to know the byte offset of each line. An alternative is to split your file first, say using "split" on linux. Then start multiple threads to process the split files respectively.
1
3
0
I have a file with about 3 million lines. Each lines contains some data i would like to parse and post it to remote service call. If i sequentially read the file it takes too long for the entire program to complete running. I was thinking of starting a pool of thread each iterating on different lines of the file(for eg: thread 1 would read line 1 to 10, thread 2 line 11 to 20 and so on..), classic map/reduce problem. Is there a quick way to do this in python, any library that will help me with this task.
Python : How to make different thread read different sections of my file
0
0
0
182
29,275,491
2015-03-26T09:57:00.000
1
0
0
0
python,django,web-hosting
29,275,740
1
false
1
0
You shouldn't be installing as root anyway. Use a virtualenv in your allocated directory, and install everything in there. You should be using a virtualenv in development as well, so that you can create a requirements file as part of your codebase which can then be used to rebuild everything in production. If the host doesn't include mod_wsgi, there are plenty of alternatives these days. Mostly I'm using gunicorn for my projects; it's easy to set up and you can run it yourself, with Apache or nginx simply working as a reverse proxy to send requests there. However, that does depend on the ability to run long-running processes on your host; if they don't allow that (some don't), it's a problem. An alternative might be FCGI though, although at this point I'd probably be looking for an alternative host.
1
0
0
I am about to deploy my Django application on the production server. Currently, I am facing a bad thing: the production server is a shared web hosting platform (on OVH). So, the first problem I have is that I cannot install django myself. Also, I am not sure about mod_wsgi being installed (or installable) on Apache. My question is: is there a workaround to installing django? If so, where do I find some documentation to do it? Thanks.
Django application on server with no root access
0.197375
0
0
615
29,282,771
2015-03-26T15:40:00.000
2
1
0
1
python,linux,oracle,centos,cx-oracle
29,283,004
1
false
0
0
You have a newer version of python installed than the corresponding source package you're trying to install. You have python 2.6.6-37 installed but the latest available source package from your repos (that you can successfully connect to) is 2.6.6-36. But it looks like the python you have installed came from your "updates" repo, http://192.168.210.26/centos/6/updates/i386/repodata/repomd.xml which isn't working at t he moment. If that repo also had the corresponding python-devel-2.6.6-37 package, and it worked, (didn't throw a PYCURL error) you'd be fine, yum would find that and use it. So your first step should be fixing your LAN repo / mirror.
1
0
0
bash-4.1# yum install python-devel Loaded plugins: fastestmirror, rhnplugin This system is receiving updates from RHN Classic or RHN Satellite. Loading mirror speeds from cached hostfile * rpmforge: mirror.smartmedia.net.id * webtatic-el5: uk.repo.webtatic.com http://192.168.210.26/centos/6/updates/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package python-devel.x86_64 0:2.6.6-36.el6 will be installed --> Processing Dependency: python(x86-64) = 2.6.6-36.el6 for package: python-devel-2.6.6-36.el6.x86_64 --> Finished Dependency Resolution Error: Package: python-devel-2.6.6-36.el6.x86_64 (centos64-x86_64) Requires: python(x86-64) = 2.6.6-36.el6 Installed: python-2.6.6-37.el6_4.x86_64 (@centos64-updates-x86_64) python(x86-64) = 2.6.6-37.el6_4 Available: python-2.6.6-36.el6.x86_64 (centos64-x86_64) python(x86-64) = 2.6.6-36.el6 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest Can somebody help me with above error , I am getting. Just to let everybody know I am trying to install cx_Oracle on my CentOS system (CentOS release 6.4) and I got this error:- error: command 'gcc' failed with exit status 1 So, I searched and found out to install python-devel and to do that I am getting the above error.
Installing Python devel on centos
0.379949
0
0
3,455
29,284,106
2015-03-26T16:39:00.000
1
1
0
0
python,django,multithreading,email,celery
29,284,405
2
false
1
0
I confirm the thread handling the request will be blocked until the email is sent. In a typical Django setup one thread is created per request.
2
3
0
I have a django-rest-framework API, and am trying to understand how sending email from it works. Suppose I'm using django.core.mail.backends.smtp.EmailBackend as email backend to send emails. Sending of an email is quite slow, and I'm wondering, if the django main thread will be blocked somehow during that time so that the other APIs would be unusable during it? Is that true? Would it be a good call to send the email in a background process created by celery for example?
Is django thread blocked while sending email?
0.099668
0
0
822
29,284,106
2015-03-26T16:39:00.000
3
1
0
0
python,django,multithreading,email,celery
29,284,457
2
true
1
0
Yes. Django thread is blocked for that particular user. You might want to use Celery along with Rabbit Mq for sending mail in background.
2
3
0
I have a django-rest-framework API, and am trying to understand how sending email from it works. Suppose I'm using django.core.mail.backends.smtp.EmailBackend as email backend to send emails. Sending of an email is quite slow, and I'm wondering, if the django main thread will be blocked somehow during that time so that the other APIs would be unusable during it? Is that true? Would it be a good call to send the email in a background process created by celery for example?
Is django thread blocked while sending email?
1.2
0
0
822
29,284,282
2015-03-26T16:48:00.000
8
0
1
1
python,numpy,module
33,483,629
2
false
0
0
See the easiest solution is to unzip the .whl file using 7-zip. Then in the unzipped directory you will find the module which you can copy and paste in the directory C:/Python34/Lib/site-packages/ (or wherever else you have installed Python).
2
5
0
I recently tried to re-install numpy for python 3.4, since I got a new computer, and am struggling. I am on windows 8.1, and from what I remember I previously used a .exe file that did everything for me. However, this time I was given a .whl file (apparently this is a "Wheel" file), which I cannot figure out how to install. Other posts have explained that I have to use PIP, however the explanations of how to install these files that I have been able to find are dreadful. The command "python install pip" or "pip install numpy" or all the other various commands I have seen only return an error that "python is not recognized as an internal or external command, operable program or batch file", or "pip is not recognised as an internal...." ect. I have also tried "python3.4", "python.exe" and many others since it does not like python. The file name of the numpy file that I downloaded is "numpy-1.9.2+mkl-cp34-none-win_amd64.whl". So can anybody give me a Detailed tutorial of how to use these, as by the looks of things all modules are using these now. Also, why did people stop using .exe files to install these? It was so much easier!
How to install in python 3.4 - .whl files
1
0
0
22,006
29,284,282
2015-03-26T16:48:00.000
6
0
1
1
python,numpy,module
29,286,276
2
true
0
0
Python 3.4 comes with PIP already included in the package, so you should be able to start using PIP immediately after installing Python 3.4. Commands like pip install <packagename> only work if the path to PIP is included in your path environment variable. If it's not, and you'd rather not edit your environment variables, you need to provide the full path. The default location for PIP in Python 3.4 is in C:\Python34\Scripts\pip3.4.exe. If that file exists there (it should), enter the command C:\Python34\Scripts\pip3.4.exe install <numpy_whl_path>, where <numpy_whl_path> is the full path to your numpy .whl file. For example: C:\Python34\Scripts\pip3.4.exe install C:\Users\mwinfield\Downloads\numpy‑1.9.2+mkl‑cp34‑none‑win_amd64.whl.
2
5
0
I recently tried to re-install numpy for python 3.4, since I got a new computer, and am struggling. I am on windows 8.1, and from what I remember I previously used a .exe file that did everything for me. However, this time I was given a .whl file (apparently this is a "Wheel" file), which I cannot figure out how to install. Other posts have explained that I have to use PIP, however the explanations of how to install these files that I have been able to find are dreadful. The command "python install pip" or "pip install numpy" or all the other various commands I have seen only return an error that "python is not recognized as an internal or external command, operable program or batch file", or "pip is not recognised as an internal...." ect. I have also tried "python3.4", "python.exe" and many others since it does not like python. The file name of the numpy file that I downloaded is "numpy-1.9.2+mkl-cp34-none-win_amd64.whl". So can anybody give me a Detailed tutorial of how to use these, as by the looks of things all modules are using these now. Also, why did people stop using .exe files to install these? It was so much easier!
How to install in python 3.4 - .whl files
1.2
0
0
22,006
29,286,485
2015-03-26T18:45:00.000
0
0
1
1
python,debugging,subprocess,pdb
29,286,660
2
false
0
0
You will have to step through the code if you have a pdb. If you have the source files, leave a breakpoint in the line of your interest and use pdb to automatically stop at your line of interest. This is what we do in .net. Hopefully it should work for python too..
1
3
0
I have some python code with many calls to subprocess (for example, subprocess.check_call()). It apparently can't debug into the subprocess. Is there any way (e.g. adding code) to make it do that, or must I use a different debugger?
Use pdb to debug into subprocess?
0
0
0
3,428
29,287,224
2015-03-26T19:27:00.000
14
0
0
0
python,pandas
29,287,544
4
false
0
0
Make sure you specify pass header=None and add usecols=[3,6] for the 4th and 7th columns.
1
347
1
How can I read in a .csv file (with no headers) and when I only want a subset of the columns (say 4th and 7th out of a total of 20 columns), using pandas? I cannot seem to be able to do usecols
Pandas read in table without headers
1
0
0
539,397
29,287,966
2015-03-26T20:14:00.000
4
0
0
0
python,django,django-settings,django-apps
29,288,008
1
false
1
0
Make a global settings.py, and specify which settings are needed in the apps documentation. You should not make app-specific settings.py files, unless they have some unrelated, internal use. You might want to use something like getattr(settings, 'SOME_SETTING_NAME', 'default value') to fetch the option with a default. If you want to have separate settings for prod/staging/dev, then you'll want to make a settings/ folder with an __init__.py file that imports based on an ENV variable.
1
0
0
What is the convention about including app-level settings in Django? For e.g. I am writing a Django app that has a view that makes an API call to another webservice, gets its response, modifies it and returns it back. Now, I would like to have a settings variable that will hold the value of this API URL (and depending upon whether Django web server is running in stage/dev/prod, the API URL will differ). Should I create a settings.py in app directory? Or modify the project's settings.py? If I do later, then app no longer remains pluggable/portable. Is that okay? Please provide a rationale for you response (i.e. please explain why it may be a good idea to include the setting in global settings.py even though it reduces the portability of the app). Thanks.
App level settings in Django
0.664037
0
0
837
29,289,518
2015-03-26T21:47:00.000
0
1
1
0
python,multithreading,email,smtp
29,312,580
3
false
0
0
The other approach is to use an outside service, such as icontact or mailchimp to manage your important messages. That can be done on a cloud based service, and can provide legal compliance. With some, you can even determine whether the mail has been read! They might even be able to set up opt-in SMS for you to use with your clients.
1
1
0
I need to send a certain email to a lot of different addresses, one recipient at a time. It has an attachment. So far, I've programmed this as such : 1) create a Thread object per mail-address (looping through the recipients list). 2) within each Thread object, create the MIMEMultipart() message. 3) within each Thread object, send the mail through smtplib.SMTP("smtp.gmail.com:587") It's working fine. The problem with this approach is that the attachment has to be attached separately for every single email. Is there a way to only attach it once ? A global MIMEMultipart() message is not possible because different threads would have to change it (to change the recipient's address).
Python - sending multiple emails with same attachment on separate threads
0
0
0
2,213
29,290,361
2015-03-26T22:57:00.000
0
1
1
0
python,camera,raspberry-pi
29,363,197
2
false
0
0
You do realise that the Pi Camera board has a fixed focus at 1m to infinity ? & If you want focus <1m you're gonna have to manually twist the lens, after removing the glue that fixates it in the housing.
2
0
0
I just got my raspberry pi yesterday and have gone through all the setup and update steps required to enable the camera extension (which took me like 6 hrs; yes, I am a newbie). I need to create a focus point on the camera's output and use the arrow keys to move this point around the screen. My question is how to access the pixel addresses in order to achieve this (if that is even how to do it). Please can one of you gurus out there point me in the right direction.
A focus point on the raspberry pi camera
0
0
0
1,081
29,290,361
2015-03-26T22:57:00.000
0
1
1
0
python,camera,raspberry-pi
38,924,580
2
false
0
0
If you need to take close-ups or if you are capturing image very close to camera lens then you need to manually set the focus.
2
0
0
I just got my raspberry pi yesterday and have gone through all the setup and update steps required to enable the camera extension (which took me like 6 hrs; yes, I am a newbie). I need to create a focus point on the camera's output and use the arrow keys to move this point around the screen. My question is how to access the pixel addresses in order to achieve this (if that is even how to do it). Please can one of you gurus out there point me in the right direction.
A focus point on the raspberry pi camera
0
0
0
1,081
29,295,830
2015-03-27T08:00:00.000
4
0
1
0
python,multithreading,tkinter
29,298,504
1
false
0
1
Generally speaking, you can't use threading with Tkinter. Or more accurately, you can only access tkinter widgets and functions from the thread that created them. If your thread is creating a window, that simply will not work on windows, and may work non-deterministically on other platforms.
1
0
0
I have written a program which use thread in Tkinter. It works fine when I run this program on linux, but when the same program run on Windows it doesn't work. Problem exist when loop (which is run under thread) is ended and call function which cause to appear Toplevel window Any suggestions??
Is there any difference in threading between Linux and Windows on python?
0.664037
0
0
391
29,296,153
2015-03-27T08:22:00.000
2
0
1
0
python-2.7,scrapy
29,298,450
1
false
1
0
Look in /usr/local/bin/python2.6/dist-packages or /usr/local/bin/python2.6/site-packages and remove any scrapy directories (and files) you find there. Next time, use "pip install" instead of easy_install, so you can use "pip uninstall" to uninstall.
1
2
0
I have installed scrapy0.14 through easy_install scrapy, but now I find that scrapy0.24.5 is more useful, I hope to unstall the old scrapy and install new scrapy by pip, how can I uninstall the old one?
how can I uninstall scrapy
0.379949
0
0
9,158
29,298,191
2015-03-27T10:14:00.000
0
0
1
0
python,xml-parsing,python-2.4
29,298,306
1
false
0
0
You don't need to upgrade the system Python. Install your own local version of 2.7 into your home directory, create a virtualenv using that version, and install your libraries there.
1
1
0
I want to use a library which is available from python 2.7 onwards on a system with python 2.4. I cannot upgrade the system to python 2.7, as many other libraries and softwares are written in python 2.4. For instance, i want to use the xml.eTree library in python 2.4. Can i take the source code of that library and do few changes and compile it on 2.4 ? If yes, could you please tell how to proceed?
how to use a library that's compiled for python 2.7 in python 2.4
0
0
0
52
29,298,550
2015-03-27T10:31:00.000
1
0
0
0
python,bdd,gherkin
29,350,461
3
false
0
0
As far as I know you can't do it. But you can use either an empty string or a placeholder value (e.g. 'N/A') that you can look out for in your step definitions.
1
4
0
Scenaio Outline: Blah de blah When I enter and on the input field Then Everything is good Examples: | a | b | | 1 | 2 | |    | 3 | The above scenario throws the following error in BBD Behave Test undefined Please define test I am not sure how I can come around this. Any suggestions?
Is it possible to have a scenario outline table with empty values?
0.066568
0
0
5,103
29,300,510
2015-03-27T12:19:00.000
-1
0
0
0
python,matplotlib
60,968,639
1
false
0
0
not sure if this issue is still open, but I had a similar problem and updating seaborn fixed the issue for me. For you it might be matplotlib, depending which package you used for creating the graph.
1
1
1
Basically I am running some optimisation algorithms that I have created using Numpy and I want to plot the log of the error against the number of iterations. Having done this with linear regression and having had no issues, it is very strange that I seem to get issues when doing the exact same thing with logistic regression. I get the following "warning": /usr/lib64/python2.6/site-packages/matplotlib/axis.py:1004: UserWarning: Unable to find pixel distance along axis for interval padding; assuming no interval padding needed. warnings.warn("Unable to find pixel distance along axis for interval padding; assuming no interval padding needed.") However, when I don't use a log axis for the y axis, I don't get the error either. All the elements of the array that I am using are also positive, so it shouldn't have anything to do with taking the log of a non-positive number. Has anyone ever encountered this before? Does anyone know what it may be referring to? Thanks
matplotlib UserWarning When log axis is used in some cases
-0.197375
0
0
1,303
29,302,706
2015-03-27T14:11:00.000
4
1
1
0
python,shell,vim
29,302,759
1
true
0
0
^D is what you are actually looking for. Alternatively, you can use the expression exit() or quit().
1
2
0
I have typed ":!python" to launch python shell in vim, but I can't close it. I have tried ^Z but it has no effect.
How to exit from ":!python" in Vim?
1.2
0
0
182
29,304,395
2015-03-27T15:29:00.000
2
0
0
1
python,google-app-engine,authentication,yaml
29,311,398
1
true
1
0
Essentially, you have the following alternatives: either give up on static file / dir serving directly from App Engine infrastructure (transparently to your application), or give up on using your custom user class for authentication. I suspect you'll pick the first alternative, serving all files from your app (at least, all files that must be kept secret from all but authorized users) -- that "just" costs more resources (and possibly slightly increases latency for users), but lets you implement whatever functionality you require. The advantage of serving static files/dirs directly with the static_files: &c directives in app.yaml is that your app does not actually get involved -- App Engine's infrastructure does it all for you, which saves you resources and possibly makes things faster for users (better caching/CDN-like delivery). But if your app does not actually get involved, then how could any code you wrote for custom auth possibly be running?! That would be a logical contradiction... If you're reluctant to serve static files from your app specifically because they're very large, then you can get the speed fully back (and then some), and some resource savings back too, by serving the URL from your app, but then, after authentication, going right on to Google Cloud Storage for it to actually do the serving. More generally, a mix of files you don't actually need to keep secret (place those in static_dir &c app.yaml directives), ones that are large enough to warrant serving from Cloud Storage, and ones your app can best serve directly, can let you optimize along all fronts -- while keeping full control of your custom auth wherever it matters!
1
0
0
On Google app engine I use a custom user class with methods. ( Not the class and functions provided by webapp2 ) However, I still need to block users from accessing certain static directory url's with html pages behind them. The current solution I have is that the user authentication happens after the user visits the page, but they still see the entire page loaded for a moment. This looks bad and is not very secure. How can I use a custom authentication option with the login : required attribute in the YAML file? So that users are immediately redirected ( before landing on the page ) when they are not logged in.
How to use custom authentication with the login: required attribute in app.yaml ( Google app engine, python )
1.2
0
0
648
29,305,308
2015-03-27T16:14:00.000
1
0
0
1
python,openshift,django-1.7
29,305,330
1
true
1
0
You probably just need to stop & start (not restart) your application via the rhc command line so that your python environment can pick them up.
1
0
0
I'm trying to get a Python 2.7, Django 1.7 web gear up and running. I have hot_deploy activated. However, after setting my required env vars (via rhc), and I see them set in the gear ('env | grep MY_VAR' is OK), when running the WSGI script the vars are NOT SET. os.environ['MY_VAR'] yields KeyError. Is this somehow related to hot_deploy?
Openshift custom env vars not available in Python
1.2
0
0
37
29,306,487
2015-03-27T17:17:00.000
0
0
1
0
python,pycharm
29,307,037
2
false
0
0
Apparently PyCharm and OneDrive don't work well together. I moved my project folder out of the OneDrive hierarchy and everything settled down.
2
4
0
Pretty much what it says in the title- I am constantly getting "Project Files Changed" messages in PyCharm. The exact message is: Project components were changed externally and cannot be reloaded: RunManager Would you like to reload project? For example, Alt-Tabbing out of PyCharm for a few seconds and then Alt-Tabbing back in is likely to generate the message. It usually doesn't occur unless I switch to another application, although sometimes it does anyways. Kinda stumped. Anybody seen this before? Any input would be appreciated!
Constantly getting "Project Files Changed" messages in PyCharm, even though I haven't changed any of the files in my project
0
0
0
2,045
29,306,487
2015-03-27T17:17:00.000
6
0
1
0
python,pycharm
31,154,182
2
true
0
0
I have resolved this problem by turning off "Synchronize files on frame activation" in Settings --> Apperance and Behaviour --> System Settings --> Synchronization. The problem happens when your project use symlinks or a network file system...
2
4
0
Pretty much what it says in the title- I am constantly getting "Project Files Changed" messages in PyCharm. The exact message is: Project components were changed externally and cannot be reloaded: RunManager Would you like to reload project? For example, Alt-Tabbing out of PyCharm for a few seconds and then Alt-Tabbing back in is likely to generate the message. It usually doesn't occur unless I switch to another application, although sometimes it does anyways. Kinda stumped. Anybody seen this before? Any input would be appreciated!
Constantly getting "Project Files Changed" messages in PyCharm, even though I haven't changed any of the files in my project
1.2
0
0
2,045
29,306,962
2015-03-27T17:45:00.000
0
0
0
1
python,tcp,proxy,buffer
29,309,592
1
false
0
0
I recommend you join the two scripts into one and just use memory. If you can't join the scripts for some reason, create a unix-domain socket to pass the raw, binary data directly from one to the other. These fifos have limited size so you'll still have to do in-memory buffering on one side or another, probably the B side. If the data is too big for memory, you can write it out to a temporary file and re-read it when it's time to pass it on. It'll be easiest if the same script both writes and reads the file as then you won't have to guess when to write, advanced to a new file, or deal with separate readers and writers.
1
0
0
I am trying to build a proxy to buffer some packets according to some schedules. I have two TCP connections, one from host A to the proxy and the other one from the proxy to host B. The proxy forwards the packets between A and B. The proxy will buffer the packets according to the scheduled instructions. At certain time, it will buffer the packets. After the buffering period is over, it will forward the packets in the buffer and also do its normal forwarding work. I am using python. Which module would be the best in this situation? I tried pickle but it is difficult to remove and append elements in the file. Any suggestions? Thanks!
Build a buffer in file for stream of TCP packets
0
0
1
261
29,307,829
2015-03-27T18:34:00.000
1
0
1
0
python,python-2.7,pandas,pycharm,anaconda
29,353,457
1
true
0
0
If you are using conda, use the --offline flag when installing the conda package that you downloaded, like conda install --offline pandas-0.15.2-np19py27.tar.bz2.
1
1
0
Hi I have both Pycharm and Anaconda installed on my computer and I would like to upgrade the package Pandas to the latest version (i have the 0.14 version) Unfortunately my computer has strong firewall restrictions and I am not able to use the internet to update it. I can download the source files though. Is there a way to install the package manually? I use win 7 64 by the way Many thanks!!!
how to update a Python package (Pandas) manually?
1.2
0
0
1,167
29,310,688
2015-03-27T21:45:00.000
8
0
1
0
python,pip,sudo
29,310,731
2
false
0
0
sudo pip install probably means that you want to install a package system-wide. For some packages, such as virtualenvwrapper, that might be useful, but besides that I'd avoid installing system-wide packages and create a virtualenv for each application and pip install to that virtualenv (which can be done without sudo).
1
24
0
Can't remember where I read this, but either somewhere on here or in the comments of a tutorial I was following, a person said: 'Never never ever use sudo pip install; you could overwrite important stuff without knowing it. Use pip install --user instead!' I see lots of references to sudo pip install everywhere though, so did this person know what they were talking about and I should avoid it, or... ?
sudo pip install VS pip install --user
1
0
0
32,846
29,310,849
2015-03-27T21:59:00.000
0
0
0
1
python,python-wheel,devpi
29,356,362
2
true
0
0
I wound up using twine for the upload. The devpi interfacing script ("devpi") is interesting, but I don't think we want it installed on all the boxes I'd need it on. Thanks.
1
3
0
Is it possible to use "pip wheel" to upload a binary wheel on Linux, to a local devpi server? Or do I need to get to a setup.py and do an upload from there? It seems a shame to build the wheel without need of a setup.py (it's taken care of behind the scenes), only to need a setup.py to upload the result. This makes me wonder: C extensions PyPI currently only allows uploading platform-specific wheels for Windows and Mac OS X. It is still useful to create wheels for these platforms, as it avoids the need for your users to compile the package when installing. I'm doing "pip -v -v -v wheel numpy" (for example), and I have a pip.conf and .pypirc (both pointing at our local devpi). Thanks!
Can I upload a binary wheel to a local devpi on Linux?
1.2
0
0
2,736
29,311,124
2015-03-27T22:18:00.000
0
0
1
0
python,multithreading,nonce
29,322,085
2
false
0
0
Your answer will depend heavily on how costly a rejection from the foreign API is. Avoiding all errors from your multiple independent clients might be impossible. Your threads would have to co-ordinate between themselves when creating each nonce, so that they are created in increasing order. Also when using each nonce, so they don't arrive at the far end out of order. And finally, each thread has to inform the others when the nonce it was using has been seen by the remote API, since saying "I'm now sending nonce 1000" lays claim to 1000 and all greater values until that thread is done with 1000, at which point it is safe for some other thread to try 1001. If the cost of a bad API call is really bad, you might have a situation in which only one thread can use that API at a time --- each thread would have to claim some exclusive lock, handle the nonce and API call, and then release the lock. This might defeat your purpose for using threads. I think the better solution is to have each thread handle these rejections by creating a new nonce and retrying the API call. You'll probably need such a function anyway, since even if you created the nonce values perfectly, variations in network speed and routing could cause those requests to reach the API server out of order. In short, I don't think you can eliminate these errors, so focus on reducing their cost.
1
3
0
I'm making API Calls on Threads. The API requires each call to have Nonce greater then the last call. I'm generating Nonce using this code: req['nonce'] = int(time.time()*1000000) I'm getting errors: "{u'error': u'Nonce must be greater than 1427495062551856. You provided 1427495062544266.'}". I believe the cause of the error is slight variations in API request/response times is causing one API request to reach the server ahead of a prior request (that would have a lower Nonce). Does anyone have a solution for this?
Solutions For Nonce Error Caused By Threaded API Calls?
0
0
0
1,296
29,312,005
2015-03-27T23:56:00.000
1
0
0
0
python,r,smoothing,splines
56,953,319
3
false
0
0
From research on google, I concluded that By contrast, the smooth.spline in R allows having knots at all the x values, without necessarily having a wiggly curve that hits all the points -- the penalty comes from the second derivative.
1
18
1
The smooth.spline function in R allows a tradeoff between roughness (as defined by the integrated square of the second derivative) and fitting the points (as defined by summing the squares of the residuals). This tradeoff is accomplished by the spar or df parameter. At one extreme you get the least squares line, and the other you get a very wiggly curve which intersects all of the data points (or the mean if you have duplicated x values with different y values) I have looked at scipy.interpolate.UnivariateSpline and other spline variants in Python, however, they seem to only tradeoff by increasing the number of knots, and setting a threshold (called s) for the allowed SS residuals. By contrast, the smooth.spline in R allows having knots at all the x values, without necessarily having a wiggly curve that hits all the points -- the penalty comes from the second derivative. Does Python have a spline fitting mechanism that behaves in this way? Allowing all knots but penalizing the second derivative?
Is there a Python equivalent to the smooth.spline function in R
0.066568
0
0
4,069
29,312,985
2015-03-28T02:26:00.000
1
0
1
0
python,windows,anaconda,python-ggplot
45,366,940
6
false
0
0
I ran across the same issue when installing ggplot. None of the methods worked, eventually I reinstalled anaconda. Then everything works smoothly.
3
5
1
I want to be able to use geom_smooth in ggplot. However, when I typed conda install ggplot, I get the error no packages found in current win-32 channels matching ggplot. Anyone know what is going on?
Cannot install ggplot with anaconda
0.033321
0
0
19,615
29,312,985
2015-03-28T02:26:00.000
0
0
1
0
python,windows,anaconda,python-ggplot
41,456,234
6
false
0
0
As of Jan 2016, ggplot now comes installed by default if you are using the Anaconda distribution so you can just use install ggplot. New to Python so this is still tripping me up.
3
5
1
I want to be able to use geom_smooth in ggplot. However, when I typed conda install ggplot, I get the error no packages found in current win-32 channels matching ggplot. Anyone know what is going on?
Cannot install ggplot with anaconda
0
0
0
19,615
29,312,985
2015-03-28T02:26:00.000
4
0
1
0
python,windows,anaconda,python-ggplot
29,313,575
6
false
0
0
I think ggplot is simply not packaged for Anaconda as conda search ggplot doesn't find anything. How it can be easily installed via pip -- pip install ggplot.
3
5
1
I want to be able to use geom_smooth in ggplot. However, when I typed conda install ggplot, I get the error no packages found in current win-32 channels matching ggplot. Anyone know what is going on?
Cannot install ggplot with anaconda
0.132549
0
0
19,615
29,314,745
2015-03-28T07:23:00.000
0
0
0
0
python,qt,pyside
29,314,800
1
false
0
0
Use setFocus() on your username lineEdit in the appropriate slot, ie after the new user has been added.
1
0
0
This is what i am trying to achieve... user inputs username -> then password -> user can either click or press enter to add the account to a list -> the cursor goes back to username lineEdit box. however, when the user clicks add account or enter, the cursor stays in the password lineEdit box which forces the user to click on username lineEdit box again to add another account.
How to place the input cursor back on the previous QlLineEdit box?
0
0
0
33
29,314,987
2015-03-28T08:03:00.000
1
0
0
0
python,pygame,python-2.x
67,557,797
4
false
0
1
pygame.display.flip() updates the whole screen. pygame.display.update() updates only specific section but with no arguments works similar to the pygame.display.flip().
2
42
0
Just like the title implies, is there any difference? I was using pygame.display.flip and I saw on the Internet that instead of using flip they used pygame.display.update. Which one is faster?
Difference between pygame.display.update and pygame.display.flip
0.049958
0
0
55,985
29,314,987
2015-03-28T08:03:00.000
9
0
0
0
python,pygame,python-2.x
29,316,190
4
false
0
1
Flip will always update the entire screen. Update also update the entire screen, if you don't give argument. But if you give surface(s) as arguments, it will update only these surfaces. So it can be faster, depending on how many surfaces you give it and their width and height.
2
42
0
Just like the title implies, is there any difference? I was using pygame.display.flip and I saw on the Internet that instead of using flip they used pygame.display.update. Which one is faster?
Difference between pygame.display.update and pygame.display.flip
1
0
0
55,985
29,315,955
2015-03-28T10:16:00.000
0
0
0
0
python,diffie-hellman
29,883,118
3
false
0
0
DH is fine for this purpose, just make to sure to use 2048 bit keys or more. However for VoIP the standards are TLS with SRTP/zrtp so it would be better if you would implement these. With DH you loose compatibility and will introduce a lot of complications. Also note that DH is only for key exchange, so you will need something also for the encryption itself. With TLS you could handle all these in one step by using a well know implementation instead to write your own encryption stack from scratch.
1
0
0
I Want to create my own safe connection for a VOIP app. Now I am looking into key exchange which seems to be much more Tricky than encrypting/decrypting. Are there any better approaches than Diffie-Hellman in practice ? I understand the concept of Diffie-Hellman but I think it needs the right values to be safe since with natural numbers it could be easily be guessed. How can I get those values using python, what are they and is it really safe from key guessing? Please help me with some background informations / inspiring.
Diffie-Hellman Parameters and safety
0
0
1
474
29,317,107
2015-03-28T12:24:00.000
0
0
0
0
python,vim
29,332,655
3
false
0
0
Thanks everyone who replied. I hoped .swp would be documented, maybe even code available to access it, seems not. The suggestion to write a plugin in Python probably makes the most sense, I bet it's possible to hook to something like 'on_keystroke' and maintain a mirror I can understand. 'shell out' as in 'write this chunk of text to a temp file, open that file in vim, when vim exits, write the temp file contents to a replacement chunk of text' PS: $100 is way too much to shell out for those tickets
2
3
0
An application wants to shell text out to vim and know what edits are being made, in real time. The .swp file provides this information. Can anyone provide guidance on how to read this binary file, say, with Python?
What is the structure of a vim .swp file?
0
0
0
2,549
29,317,107
2015-03-28T12:24:00.000
1
0
0
0
python,vim
29,321,744
3
false
0
0
I wouldn't rely on the swapfile contents to get real-time updates. Its format is geared towards Vim's uses, and its format isn't documented other than by its implementation. You would have to duplicate large parts of the algorithm, and maintain that whenever the internal format changes (without prior notice). Alternatively, I would use one of the embedded languages (e.g. Python) to interface with the outside program that wants to get real-time updates. A Python function could periodically send along the entire buffer contents on a socket, for example.
2
3
0
An application wants to shell text out to vim and know what edits are being made, in real time. The .swp file provides this information. Can anyone provide guidance on how to read this binary file, say, with Python?
What is the structure of a vim .swp file?
0.066568
0
0
2,549
29,319,546
2015-03-28T16:27:00.000
0
0
1
0
python,visual-studio,ptvs
47,253,726
2
false
0
0
Use the Python Interactive Window (CTRL-ALT-F8 or Debug Menu). You will have the code output on the python interactive shell (where you can obviously interact). The win terminal will not appear anymore.
1
12
0
In PTVS the default behavior is for the program to print to the Python console window and the Visual Studio Debug Output window. Realizing that it won't be able to accept user input, how do I suppress the Python console window?
How do I suppress the console window when debugging python code in Python Tools for Visual Studio (PTVS)?
0
0
0
9,244
29,322,083
2015-03-28T20:15:00.000
1
0
1
0
python
29,322,584
1
false
0
0
if you consider subprocess.Popen as an example. If you call a command that outputs a lot of data to subprocess.PIPE then calling proc.stdout.readlines() will wait until the command completely finishes. Where if you were to use iter with for line in iter(proc.stdout.readline,""), you would see the output in real time and also avoid having to store all the output in memory. If you had to process each line of the output it would make more sense to process line by line as the input came in which using iter allows you to do as opposed blocking until the command terminates using readlines.
1
2
0
I'm reading Programming Python by Mark Lutz, and I came across this bit: For pipe objects, the effect of iterators may be even more useful than simply avoiding loading the entire result into memory all at once: readlines will always block the caller until the spawned program is completely finished, whereas the iterator might not. What does this mean?
readlines will always block the caller
0.197375
0
0
572
29,322,142
2015-03-28T20:20:00.000
0
0
1
0
python,list,timestamp
29,323,092
2
false
0
0
Assuming the hours, minutes and seconds will always be two digits each (which they should be), it's as easy as: timestamp = timestamp[:12]
1
0
0
I have a list of time stamps with milliseconds like 10:35:08.23562515422. Now in the milliseconds, I want to have only first 3 values in the list like 10:35:08:235. Is there a way to do it?
How to approximate timestamp
0
0
0
230
29,322,442
2015-03-28T20:48:00.000
1
0
0
0
python,django,django-apps
29,322,694
1
true
1
0
Unsurprisingly, the general recommendation would be to put your view code in views.py, your model code in models.py and your form code in forms.py. You have the ability to put code more or less wherever you want it, but you are better off sticking with these recommendations as a beginner. Since you want to be sure that an added user isn't already in the database that would best be handled in the view code, but there's nothing in principle wrong with using a model method to check new save()s for duplication. It's a matter of whether the functionality is required anywhere else. Matters of application architecture can be difficult for newcomers. The recommendations in the book "Two Scoops of Django" embody many best practices.
1
1
0
I have just started learning Django and I am having confusion regarding the architecture of a django project. Basically what I want to know is the recommended way to design a django application ie: what type of code do I put in the models file, the views file and where do I write the validators etc. As an example, suppose that while creating a registration form to add a new user I want to make sure that the user does not register with a username that is already present in the database. As per my observation there are three ways to do it. I could define a method in the models.py file and call it after getting data from the form. I could define a method in the views.py file and call the method. I could write a custom validator or a clean method in the forms.py file. As a beginner I am confused as per what approach would be best. So a basic set of rules to follow that can help me decide what type of code is written where will greatly help me. Thanks
Architecture of a Django project
1.2
0
0
889
29,324,947
2015-03-29T02:20:00.000
1
0
1
0
python,django,virtualenv,pycharm
29,325,014
2
false
1
0
virtualenv is not just a list of dependencies! It actually has all the modules under its umbrella. Think of a virtualenv as a space which isolates all the packages used by your project from the rest of the other packages that were installed previously or at a later time.Yes, there is an option to have the virtualenv make use of packages that are "outside" of the environment but that's just an option. The main purpose of having an virtualenv is to enable the user to use packages versions of his choice and keep them isolated from the rest of the space. Usually, the list of packages belonging to a specific virtualenv are captured into a file, requirements.txt. If you want to run the project on a different machine or share it with someone, having requirements.txt will make it easy to recreate the environment via pip install -r requirement.txt from within virtualenv
1
0
0
I am newbie using VirtualEnv and recently try to create one using PyCharm. During the process, PyCharm ask me to specify the project location, application name and VirtualEnv name and location. My doubt is, after I specify the name and location of the VirtualEnv the location of the Django project files must be inside the VirtualEnv? or it's possible to have the VirtualEnv files in a different location than the Django project files? Maybe I am not understanding the purpose of the VirtualEnv. Perhaps, VirtualEnv it's just a list of the dependencies of my project, Python version, Django version, Pip version, Jinja2 version and all other required files, but not necessarily the Django application files (the website that is being developed). Thanks in advance.
Virtualenv, Django and PyCharm. File structure
0.099668
0
0
473
29,325,838
2015-03-29T05:10:00.000
0
0
1
0
python,python-2.7,cygwin,pip
29,434,636
2
false
0
0
You didn't paste your code, but I'm guessing that you wrote import Enum with a capital E. Try again with a lower-case "e": import enum
1
4
0
I'm trying to run a script using the backport of Enum for python 2.7.8, through Cygwin. When the script is run, it outputs the generic error of Import Error: No module named Enum. pip-2.7 install enum34 says that it's already installed pip-2.7 install enum34 --upgrade gave the same error python --version shows 2.7.8 pip freeze shows enum=1.0.4 pip uninstall enum34 / pip install enum34 produced no difference What can I try next?
Import Error for module that pip reports as installed
0
0
0
595
29,329,425
2015-03-29T13:01:00.000
1
0
1
1
python,cassandra,datastax,opscenter
29,364,698
1
true
0
0
The problem was due to missing symbolic links between the bundled python libraries. In particular, in /lib/py-debian/2.7/amd64/twisted the symoblic links to the contents of the py-unpure directory for the files _version.py, plugin.py, init.py and copyright.py were missing. Originally, I used gradle's copy from tarTree to extract the archive, which resulted in the missing symoblic links. Using tar -xzf instead resolves the issue and opscenter starts up as expected.
1
0
0
Trying to start a tarball installation of OpsCenter 5.1.0 on Ubuntu 14.04 64-bit by running ./opscenter in /opt/opscenter-5.1.0/bin fails with the following error: Traceback (most recent call last): File "./bin/twistd", line 28, in <module> from twisted.scripts.twistd import run ImportError: cannot import name run My version of python is 2.7.6: $ python --version Python 2.7.6 And trying to import twisted results in: $ python -c "import twisted; print twisted" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named twisted The value of PYTHONPATH from opscenter looks as follows: PYTHONPATH: ./src:/usr/lib/python2.7/site-packages:./src/lib/python2.7/site-packages:./lib/python2.7/site-packages:./lib/py:./lib/py-debian/2.7/amd64:: What is going wrong here and can someone suggest a workaround that is worth trying to a Python newbie?
DataStax OpsCenter 5.1.0 fails to start due to python 'ImportError'
1.2
0
0
334
29,332,851
2015-03-29T18:08:00.000
22
0
1
0
python,nlp,nltk,text-parsing,pos-tagger
54,869,627
3
false
0
0
Even though the above links have all kinds. But hope this is still helpful for someone, added a few that are missed on other links. CC: Coordinating conjunction CD: Cardinal number DT: Determiner EX: Existential there FW: Foreign word IN: Preposition or subordinating conjunction JJ: Adjective VP: Verb Phrase JJR: Adjective, comparative JJS: Adjective, superlative LS: List item marker MD: Modal NN: Noun, singular or mass NNS: Noun, plural PP: Preposition Phrase NNP: Proper noun, singular Phrase NNPS: Proper noun, plural PDT: Pre determiner POS: Possessive ending PRP: Personal pronoun Phrase PRP: Possessive pronoun Phrase RB: Adverb RBR: Adverb, comparative RBS: Adverb, superlative RP: Particle S: Simple declarative clause SBAR: Clause introduced by a (possibly empty) subordinating conjunction SBARQ: Direct question introduced by a wh-word or a wh-phrase. SINV: Inverted declarative sentence, i.e. one in which the subject follows the tensed verb or modal. SQ: Inverted yes/no question, or main clause of a wh-question, following the wh-phrase in SBARQ. SYM: Symbol VBD: Verb, past tense VBG: Verb, gerund or present participle VBN: Verb, past participle VBP: Verb, non-3rd person singular present VBZ: Verb, 3rd person singular present WDT: Wh-determiner WP: Wh-pronoun WP: Possessive wh-pronoun WRB: Wh-adverb
1
29
1
when I chunk text, I get lots of codes in the output like NN, VBD, IN, DT, NNS, RB. Is there a list documented somewhere which tells me the meaning of these? I have tried googling nltk chunk code nltk chunk grammar nltk chunk tokens. But I am not able to find any documentation which explains what these codes mean.
What does NN VBD IN DT NNS RB means in NLTK?
1
0
0
25,538
29,332,868
2015-03-29T18:10:00.000
2
0
0
0
python,kivy
61,815,101
3
false
0
1
I believe you can create muliple .kv files and can include at one place (root file) by this way only you can distribute/branch your code Kivy documentation clearly says "A kv file must contain only one root widget at most" means only one kv main file. even if you run multiple instances of Mainapp class I'm newer to the Kivy, so please correct me if I'm wrong. Thank you !
1
21
0
I realize the short answer may be 'no,' but perhaps this is worth asking again. If I am witting a Kivy app with a couple thousand of lines - then would it be possible to write some classes in another kv file? This would make it so much easier to edit, correct errors, make changes... etc. Just to clarify - the .KV files would be a continuation of each other - not pointing to a parallel app. Some expert insight would be greatly appreciated - Thank you.
Is it possible to read from more than one .kv file in Kivy app?
0.132549
0
0
11,529
29,337,928
2015-03-30T03:25:00.000
3
0
1
1
python,windows,anaconda
50,202,529
14
false
0
0
It looks that some files are still left and some registry keys are left. So you can run revocleaner tool to remove those entries as well. Do a reboot and install again it should be doing it now. I also faced issue and by complete cleaning I got Rid of it.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.042831
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
18
0
1
1
python,windows,anaconda
45,360,960
14
false
0
0
If a clean re-install/uninstall did not work, this is because the Anaconda install is still listed in the registry. Start -> Run -> Regedit Navigate to HKEY_CURRENT_USER -> Software -> Python You may see 2 subfolders, Anaconda and PythonCore. Expand both and check the "Install Location" in the Install folder, it will be listed on the right. Delete either or both Anaconda and PythonCore folders, or the entire Python folder and the Registry path to install your Python Package to Anaconda will be gone.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
1
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
3
0
1
1
python,windows,anaconda
61,464,989
14
false
0
0
For windows- In the Control Panel, choose Add or Remove Programs or Uninstall a program, and then select Python 3.6 (Anaconda) or your version of Python. Use Windows Explorer to delete the envs and pkgs folders prior to Running the uninstall in the root of your installation.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.042831
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
7
0
1
1
python,windows,anaconda
48,980,402
14
false
0
0
To use Uninstall-Anaconda.exe in C:\Users\username\Anaconda3 is a good way.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
1
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
1
0
1
1
python,windows,anaconda
58,889,740
14
false
0
0
Uninstall Anaconda from control Panel Delete related folders, cache data and configurations from Users/user Delete from AppData folder from hidden list To remove start menu entry -> Go to C:/ProgramsData/Microsoft/Windows/ and delete Anaconda folder or search for anaconda in start menu and right click on anaconda prompt -> Show in Folder option. This will do almost cleaning of every anaconda file on your system.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.014285
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
3
0
1
1
python,windows,anaconda
63,536,711
14
false
0
0
there is a start item folder in C:\ drive. Remove ur anaconda3 folder there, simple and you are good to go. In my case I found here "C:\Users\pravu\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.042831
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
3
0
1
1
python,windows,anaconda
56,087,895
14
false
0
0
On my machine (Win10), the uninstaller was located at C:\ProgramData\Anaconda3\Uninstall-Anaconda3.exe.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.042831
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
1
0
1
1
python,windows,anaconda
54,453,907
14
false
0
0
Go to C:\Users\username\Anaconda3 and search for Uninstall-Anaconda3.exe which will remove all the components of Anaconda.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.014285
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
19
0
1
1
python,windows,anaconda
37,898,464
14
false
0
0
In my computer there wasn't a uninstaller in the Start Menu as well. But it worked it the Control Panel > Programs > Uninstall a Program, and selecting Python(Anaconda64bits) in the menu. (Note that I'm using Win10)
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
1
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
184
0
1
1
python,windows,anaconda
39,490,516
14
false
0
0
In the folder where you installed Anaconda (Example: C:\Users\username\Anaconda3) there should be an executable called Uninstall-Anaconda.exe. Double click on this file to start uninstall Anaconda. That should do the trick as well.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
1
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
8
0
1
1
python,windows,anaconda
29,377,301
14
false
0
0
Anaconda comes with an uninstaller, which should have been installed in the Start menu.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
1
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
15
0
1
1
python,windows,anaconda
29,377,433
14
true
0
0
Since I didn't have the uninstaller listed - the solution turned out to be to reinstall Anaconda and then uninstall it.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
1.2
0
0
368,077
29,337,928
2015-03-30T03:25:00.000
4
0
1
1
python,windows,anaconda
56,794,491
14
false
0
0
Method1: To uninstall Anaconda3 go to the Anaconda3 folder, there u will be able to find an executable called Uninstall-Anaconda3.exe, double click on it. This should uninstall ur application. There are times when the shortcut of anaconda command prompt,jupyter notebook, spyder, etc exists, so delete those files too. Method2 (Windows8): Go to control panel->Programs->Uninstall a Program and then select Anaconda3(Python3.1. 64-bit)in the menu.
13
102
0
I installed Anaconda a while ago but recently decided to uninstall it and just install basic python 2.7. I removed Anaconda and deleted all the directories and installed python 2.7. But when I go to install PyGTK for Windows it says it will install it to the c:/users/.../Anaconda directory - this doesn't even exist. I want to install it to the c:/python-2.7 directory. Why does it think Anaconda is still installed? And how can I change this?
How to remove anaconda from windows completely?
0.057081
0
0
368,077
29,341,688
2015-03-30T08:38:00.000
0
1
0
0
python,authentication,pyramid
32,814,226
1
true
1
0
There are two broad ways to do integrate custom auth with Pyramid: - write your own authentication policy for Pyramid (I haven't done this) - write your own middleware to deal with your auth issues, and use the RemoteUserAuthenticationPolicy in Pyramid (I have done this) For the second, you write some standard wsgi middleware, sort out your custom authentication business in there, and then write to the wsgi env. Pyramid authorization will then work fine, with the Pyramid auth system getting the user value from the wsgi env's 'REMOTE_USER' setting. I personally like this approach because it's easy to wrap disparate apps in your middleware, and dead simple to turn it off or swap it out. While not really the answer to exactly what you asked, that might be a better approach than what you're trying.
1
1
0
Context My app relies on external service for authentication, python API has function authentiate_request witch takes request instance as a param, and returns result dict: if auth was successful, dict contains 3 keys: successful: true username: alice cookies: [list of set-cookie headers required to remember user] if unsuccessful: successful: false redirect: url where to redirect user for web based auth Now, call to this function is relatively expensive (is does HTTP POST underneath). Question I'm new to Pyramid security model, and I'm struggling how to use existing/properly write AuthenticationPolicy for my app, so it uses my auth service, and does not call it's API more than once per session (In auth success scenario)?
How to use external Auth system in Pyramid
1.2
0
0
201
29,341,708
2015-03-30T08:39:00.000
1
0
1
0
python,python-2.7,ipython,anaconda
29,360,942
3
true
0
0
What was required was just a clean install of IPython : pip install ipython pip install 'ipython[all]' Works like a charm :)
1
2
0
I am a newbie to python and needed to set up IPython for some project-work. I followed the Anaconda Installation Directions . Currently I am having a lot of problem in running IPython : First I installed Anaconda in my home directory : \home\pranav Next I ran the command conda just to check if the installation was correct - it turned out to be prefectly fine When I type in ipython OR ipython notebook , I get the following error : Traceback (most recent call last): File "/usr/local/bin/ipython", line 7, in <module> from IPython import start_ipython ImportError: No module named IPython Can someone help me out ? Changing / Adding the PATH Variable is not working as suggested elsewhere on Stack Overflow
Anaconda : IPython not running
1.2
0
0
4,432
29,345,617
2015-03-30T11:56:00.000
0
0
0
0
python,pyside,benchmarking
29,354,758
1
false
0
1
Conversion processes the ui file once and creates a static module. Loading the ui file at runtime processes it every time the application is run. So obviously any difference in performance is going to be roughly equal to the overhead of processing the ui file. Having said that, runtime performance is probably not a good reason for choosing between them. Most people prefer one over the other simply because it provides a better fit for their development process.
1
0
0
I saw that there are 2 ways for use the ui file with pyside. It's possible to convert or to load file. What is the best performance between this 2 solutions ? Thanks in advance
performance between converted and loaded file with pyside
0
0
0
38
29,346,545
2015-03-30T12:42:00.000
0
0
1
1
python,python-2.7,cmd
29,346,753
1
true
0
0
Pip is not in C:\Python27. It's in C:\Python27\Scripts. Check that folder to make sure there is a pip.exe, if there is then it should have installed fine, and make sure that C:\Python27\Scripts is in your PATH.
1
0
0
I installed python 2.7.9 instead of 3.4.3 due to module xlutils not working on 3.4.3 and from the time I installed python 2.7.9 and I just can't install the related modules to it by using pip install and I added the ;C:\Python27 to the system path. what am I missing here coz it keeps on telling me this error: 'pip is not recognized as an internal or external command
Installed python 2.7.9 instead of 3.4.3 and can't run pip install in cmd anymore
1.2
0
0
517
29,347,790
2015-03-30T13:42:00.000
0
0
1
0
python,exception,python-2.x
63,873,489
2
false
0
0
There's no difference between IOError and OSError cause they mostly appear on similar commands like opening a file or removing one.
1
45
0
I am always getting confused on whether a function would raise an IOError or OSError (or both?). What is the principle rule behind these exception types, what is the difference between them and when is which raised? I've initially thought OSError is for things like permission denial, but opening a file without permissions will raise an IOError.
Difference between IOError and OSError?
0
0
0
40,142
29,347,981
2015-03-30T13:51:00.000
1
0
0
1
python,linux,date,time
37,574,931
2
false
0
0
You did a lower case -s it is meant to be -S so that is why it isn't working.
1
1
0
I tried using date command to change the system time in debian linux: os.system("echo passwd | "sudo date -s \"Thu Aug 9 21:31:26 UTC 2012\") and I set the python file permission to 777 and also chown as root. But it does not work and says date: cannot set date: Operation not permitted. Any Ideas? Thanks
change date/time using python in linux
0.099668
0
0
6,022
29,351,650
2015-03-30T16:40:00.000
2
0
0
0
python,ms-access,visual-c++,tkinter,visio
29,352,732
1
true
0
1
I don't think you can embed ActiveX controls like the one provided by Visio (it's probably what you refer to as "visio canvas") in tkinter. Even with Qt, this may be not that straightforward. The second thing is, "visio canvas" won't work without Visio installed - not sure if that's okay with you. Means, your users first would have to install Visio (and provide a license) and then your .exe which uses Visio as "canvas". If you want a sand-alone exe, I would recommend you to use whatever is available in your framework instead of Visio.
1
0
0
As I am more familiar with tkinter than Qt, is it possible to have a tkinter frame populate with a C++ application to enable the manipulation of visio files. The end result would hopefully be to have a portable .exe that would connect to an access database for line item tracking, and the Visio "canvas" to manipulate visual layouts of work spaces. I am very new to programming, and learning as I go...
C++ "canvas" inside of tkinter frame to manipulate MS visio files
1.2
0
0
96
29,353,557
2015-03-30T18:29:00.000
0
0
0
1
python
29,353,947
2
false
0
0
Assumptions: You're running on Windows and installed the basic python for windows (which includes idle) and probably stuck with the defaults (so you should have python in c:\python35) Related assumptions: Windows doesn't have an out of the box loopback interface and trying to enable one is going to be more painful than working around it. Recommendations: You might want to try to sneakernet (i.e. download on a friend's computer to a USB stick and then copy over) pycharm or another IDE, but I don't know if they won't have the same problem If that doesn't work, you should be able to (as an interim step while you wait for a new computer): Use Idle (with the -n flag) to edit your python program(s) [because trying to edit python programs in Wordpad is cruel], save your program as myprogram.py Open up cmd (dos prompt), cd to your save directory, do c:\python35\python.exe myprogram.py Repeat 1+2 as needed
2
2
0
I need some help. Im trying to run Python IDLE on my computer but I get the following error: IDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subprocess and refer Help/IDLE Help 'Running without a subprocess' for further details. My networking card just fried a couple days ago so I think this might be the problem, I dont know. I also tried refer to IDLE Help but I couldn't understand a thing. Is there anyway I can get by this problem. I need this program operational for my programming class' a least until my new computer arrives.
Python 3.5 Port Binding Error
0
0
0
1,571
29,353,557
2015-03-30T18:29:00.000
0
0
0
1
python
58,263,324
2
false
0
0
By using -n flag, you can use it for one time only. It means closing python idle, I'll have to redo -n flag process whenever I want to open .
2
2
0
I need some help. Im trying to run Python IDLE on my computer but I get the following error: IDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subprocess and refer Help/IDLE Help 'Running without a subprocess' for further details. My networking card just fried a couple days ago so I think this might be the problem, I dont know. I also tried refer to IDLE Help but I couldn't understand a thing. Is there anyway I can get by this problem. I need this program operational for my programming class' a least until my new computer arrives.
Python 3.5 Port Binding Error
0
0
0
1,571
29,354,362
2015-03-30T19:14:00.000
0
0
1
0
python,compilation
29,398,078
1
false
0
0
CPython will re-generate the bytecode for an altered source file from scratch. There is no 'partial' compilation option for just the lines that you changed. Recompilation is transparent and automatic. I'm not aware of any Python implementation that would behave otherwise. I'd not be worried about speed here though; compiling a 5000 line module doesn't take all that long. But from a maintenance point of view you should still look into refactoring your module into a smaller separate modules.
1
0
0
I have a Python script around 5,000 lines long. If I make a single change in the file, do I have to recompile the entirety of the file, or is it possible to compile only that part or particular code?
Compiling only the modified code in a file
0
0
0
143
29,355,581
2015-03-30T20:22:00.000
0
0
1
0
python,python-3.x,installation,64-bit
35,999,386
6
false
0
0
I had the same symptoms as OP. In my case, i had two separate installs, one of 2.7 and one of 3.4.3 and when i checked the PATH variable, there were 2 lines about PYTHONPATH pointing to the 2.7 version. I removed the lines and then the repair funciton of the MSI did work. I uninstalled both versions and proceeded to reinstall. Done :) On a Win7 box: Startup/ right click on Computer / Properties / Advanced system settings / Environment variables then check both sub-windows for paths related to python.
3
5
0
Trying to install Python 3.4.3 64-Bit and it gives me the following error: 'There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support or package vendor' I have no bloody idea what this means so please help. Thanks in advance I'm the admin on my computer and have all permissions My windows is 64bit and is Windows 8.1
python 3.4.3 64bit a program required for this install could not be run
0
0
0
6,196