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
30,367,000
2015-05-21T07:17:00.000
1
0
0
0
rethinkdb,rethinkdb-python
45,435,979
2
false
0
0
Note that a NoSQL-Database does increase the amount of storage required massively, so be sure to have enough disk space on your nodes. But some terabytes are no issue for RethinkDB, it's designed to handle a nearly infinite amount of data if your nodes have a lot of RAM it also provides nearly Memory-alike performance ...
1
2
0
How scalable is rethinkdb? Can it be used for TB's of data? I have around 400 GB's of data, which are bound to increase by 10-25 GB's per week. Any suggestions, would be of great help.
Rethinkdb Scalability
0.099668
0
0
1,047
30,367,194
2015-05-21T07:26:00.000
0
0
0
0
python,django,python-2.7,debugging,ptvs
30,482,731
1
true
1
0
Managed to fix the error myself. What I had done was create a project "From Existing Python code". Instead I created a new Django Web Project in Visual Studio and then deleted all files that Visual Studio automatically added. Then I included my old Django-files in the project and the breakpoints started working. Don't ...
1
0
0
I get the following errors when I try to set a breakpoint for html files in a Django project: "A breakpoint could not be inserted at this location" "This is not a valid location for a breakpoint" In .py files I can set breakpoints but they will not get hit. If I make a new Djnago project the breakpoints can be set ...
Breakpoints not working for Django Project with python environment 2.7 in Visual Studio with PTVS
1.2
0
0
627
30,367,541
2015-05-21T07:43:00.000
3
0
1
0
python,pycharm
30,636,214
2
false
0
0
Just put the hello.py file in a subdirectory of your project directory. All the files in the project directory essentially provides relevant "system information" of the project. One project may contains couple of applications. Each application should be put in one subdirectory. set: "Settings/Editor/File Encodings/Proj...
1
0
0
I just started to us Python and Pycharm today. I installed Python 3.4.3 and pycharm 4.5, and I'm using Windows 7 OS on a acer TravelMate 8471 laptop. When I try to print("hello"), the error is: "Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: x-windows-950" Do...
Issue with pycharm:(Pycharm:Py_Initialize: can't initialize sys standard streams)
0.291313
0
0
4,364
30,368,271
2015-05-21T08:22:00.000
2
1
0
0
python,django
30,369,384
3
false
1
0
Another way to look at it: send the mail to your backup email account ex: backup@yourdomain.com. So you can store the email, check if the email is sent or not. Other than that, having an extra model for logged emails is a way to go.
2
3
0
I was wondering how can I store sent emails I have a send_email() function in a pre_save() and now I want to store the emails that have been sent so that I can check when an email was sent and if it was sent at all.
Python / Django | How to store sent emails?
0.132549
0
0
559
30,368,271
2015-05-21T08:22:00.000
5
1
0
0
python,django
30,368,302
3
true
1
0
I think the easiest way before messing up with middleware or whatever is to simply create a model for your logged emails and add a new record if send was successful.
2
3
0
I was wondering how can I store sent emails I have a send_email() function in a pre_save() and now I want to store the emails that have been sent so that I can check when an email was sent and if it was sent at all.
Python / Django | How to store sent emails?
1.2
0
0
559
30,369,641
2015-05-21T09:23:00.000
0
0
1
0
python,csv
30,369,767
2
false
0
0
For a variable that holds multiple values I would use an array and loop through that with a foreach loop or something similar. That way every value stays properly seperated regardless of punctuation.
1
2
1
How do I write a variable that includes multiple values and commas to a CSV file? for example the variable might hold jimmy,5,250,james and I want to write this to a CSV file then start a new line and write the next batch of variables in the loop again in the same fashion. outFile = open('outputfile.csv','w') csvFi...
How do I write a variable that includes multiple values and commas to a csv file?
0
0
0
1,136
30,377,127
2015-05-21T14:45:00.000
1
0
1
0
python,matplotlib,spyder
30,377,236
1
true
0
0
You likely are running in iPython with Spyder. iPython automatically runs plt.show(). Press f6 (default), and see if "execute in current python or iPython console" is selected. If so, check the console, the 'tab' should show a blue icon with "iP" and have 'kernal' (or similar) following it. Simple fix: switch to "execu...
1
0
1
I actually know a problem in Spyder. When I Work with matplotlib.pyplot, it automatically shows the figure without any kind of plt.show(). So when I make many different figures, it always shows them all on the same. I've recently made a program, which is saving one figure by iteration in an for loop, it also opens a fi...
.Spyder opens a figure instead of absence of plt.show()
1.2
0
0
441
30,379,512
2015-05-21T16:33:00.000
2
0
1
0
python,time,python-3.4,psychopy
30,387,049
2
true
0
0
Python's time functions are not the limiting factor here. Depending on your particular computer and OS, you can get microsecond resolution (subject to all sorts of caveats about multitasking and so on). The real issue is hardware. There is no point worrying about millisecond time resolution if you are collecting respon...
1
1
0
I am going to program a response time experiment in Python 3.4 with Pygame and PIL. Will Python's builtin time functions be accurate enough for a millisecond level accuracy of response times? Is PyParallel necessary, or is it necessary only for EEG or eye-tracking experiments?
Response Time Accuracy
1.2
0
0
170
30,381,287
2015-05-21T18:09:00.000
0
0
1
0
python,rotation,expression,nuke
30,383,381
1
false
0
0
You need to calculate the third point in an orthonormal frame. It's easy: take the cross product of the vectors defined by the points you're given. Then the rotation will be related to the orthonormal matrix whose rows (or columns) are the three vectors.
1
1
0
I'm working in nuke and trying to stabilize a spherical panorama shot on a drone with 6 gopros. I have been able to 2Dtrack 2 points on the image (supplied to me as an equirectangular map) and convert them to xyz co-ordinates for nukes 3d space. Now I have to work out either an expression or python script to compute th...
Working out the rotation of a sphere from two points on it's surface
0
0
0
209
30,381,642
2015-05-21T18:29:00.000
0
1
1
0
python,string,unicode,utf-8
30,392,673
2
false
0
0
Is the windows sys.stdin.encoding different from Windows console encoding? Yes. There are two locale-specific codepages: the ANSI code page, aka mbcs, used for strings in Win32 ...A APIs and hence for C runtime operations like reading the command line; the IO code page, used for stdin/stdout/stderr streams. These do...
1
0
0
I am always perplexed with the whole hi-ascii handling in python 2.x. I am currently facing an issue in which I have a string with hiascii characters in it. I have a few questions related to it. How can a string store hiascii characters in it (not a unicode string, but a normal str in python 2.x), which I thought can ...
hi-ascii characters python string
0
0
0
766
30,383,356
2015-05-21T20:05:00.000
0
0
0
0
python,linux,firefox,browser
30,383,779
1
true
0
0
Practically speaking, no, for a couple of reasons. First, multiple connections: when you open, say, http://www.example.com/, 99.9% of the time, the first page will have HREFs to other pages, often more than one. Firefox will typically open multiple additional connections to simultaneously pull down those different pag...
1
0
0
Is there any way to find the port firefox url listens to when we open a url. platform - ubuntu or any other linux distro
Python script to dynamically find the port to which firefox listens on opening a url?
1.2
0
1
78
30,387,974
2015-05-22T03:38:00.000
3
0
0
0
python,django,django-models,django-syncdb
30,392,918
2
true
1
0
Thanks Amyth for the hints. btw the commands is a bit different, i will post a 10x tested result here. Using south 1. setup the model python manage.py schemamigration models --initial dump data if you have to python manage.py dumpdata -e contenttypes -e auth.Permission --natural > data.json syncdb python manage....
1
1
0
How to do syncdb in django 1.4.2? i.e. having data in database, how to load the models again when the data schema is updated? Thanks in advance
How to do django syncdb in version 1.4.2?
1.2
1
0
2,775
30,388,599
2015-05-22T04:52:00.000
3
0
1
0
python,datetime
30,388,655
2
false
0
0
%I can be used only for 12 hour clock For 24 hour clock Try this datetime.datetime.strptime('00:00AM', '%H:%M%p').time()
1
0
0
I am getting format error when changing time in python. This works fine datetime.datetime.strptime('01:00AM', '%I:%M%p').time() but this gives error datetime.datetime.strptime('00:00AM', '%I:%M%p').time() time data '00:00AM' does not match format '%I:%M%p'
Getting error with time format in python
0.291313
0
0
48
30,391,105
2015-05-22T07:45:00.000
3
0
0
0
python,django,django-views,django-urls
30,391,339
2
false
1
0
You could run each each domain site independently using their own settings. This way you can control how much they share using the same codebase. Create separate settings for both sites. Where each of the settings specify a different ROOT_URLCONF and any extra setting required such as ALLOWED_HOSTS. Create two separa...
1
1
0
I have django project with consist of multiple apps. One app contains all core functions and code (common models etc). I serve it on one domain. Now I want to add new app which will use some of the other app's models BUT all URLS of this app should be served on different domain. Is it possible?
Django project - serve one of the apps on different domain
0.291313
0
0
1,601
30,396,430
2015-05-22T12:12:00.000
2
0
1
1
linux,python-2.7,terminal,virtualenv
30,397,334
1
true
0
0
You have to activate the virtualenv in every shell, or, as 0range suggested, activate it in your .bashrc or any script running before your shell displays the prompt. To add it to your .bashrc : Edit /home/youruser/.bashrc and add the line : source /path/to/bin/activate Open a new shell or source ~/.bashrc Everything ...
1
1
0
I activate python virtualenv in one bash and tries to use in another bash shell. virtualenv simply does not work. I opened a terminal, activate the virtualenv through sourcing activate file. It got activated in my terminal it shows () in front of terminal address. I opened a new terminal. The effect is not visible in...
virtualenv does not get activated in new bash shell
1.2
0
0
580
30,397,550
2015-05-22T13:07:00.000
2
0
0
0
python,data-visualization,lda,topic-modeling
36,701,858
5
false
0
0
Word clouds are popular ways of visualizing topic distributions. To generate a word cloud in python consider cloning the wordcloud library.
1
11
1
I have a LDA model with the 10 most common topics in 10K documents. Now it's just an overview of the words with corresponding probability distribution for each topic. I was wondering if there is something available for python to visualize these topics?
Visualizing an LDA model, using Python
0.07983
0
0
12,860
30,405,350
2015-05-22T20:25:00.000
0
0
0
0
python,django
30,767,919
1
false
1
0
From your description, you will need to use (something like) django-guardian. Default Django permissions only apply to models(/tables). You cannot give someone permission to edit a specific article, category, comment or tag (only all articles, all categories, etc).
1
0
0
I'm starting to use django and read a lot of documentation in the last days. I also read about the permission system as well as about other systems like django guardian package. I'm trying to implement a multi-user blogging system and I'm not sure if I shall use django permissions or something else, like django guardia...
Future migration of djangos permission system
0
0
0
22
30,406,945
2015-05-22T22:48:00.000
1
0
0
0
python,libtorrent
30,408,824
1
false
0
0
If the magnet link doesn't have any trackers in it, then the client needs to have the DHT active and get peers that way instead.
1
1
0
I'm using libtorrent in Python, but it doesn't recognize magnet link, which looks like magnet:?... with only sha1 hash, it needs to get &dn parameter to parse specific torrent-tracker. By the way, qBitTorrent, which does use the same libtorrent lib can recognize only magnet link.
I can't receive magnet-link metadata via libtorrent-python, without specifying udp-protocol of tracker
0.197375
0
1
310
30,407,446
2015-05-22T23:54:00.000
12
0
1
0
python-3.x,virtualenv,pyenv
36,550,830
4
true
1
0
Short answer: You can’t, as far as I know. It wouldn’t really work either, right? If you use pyenv virtualenv to install a virtualenv into a repo, and you clone that repo to another machine… how would pyenv on the new machine know to take control of the virtualenv in the repository? Also, “you probably shouldn’t do t...
1
16
0
I just began to use pyenv to manage my python versions, and began to use the pyenv virtualenv plugin to manage my virtualenvs, and so far, I have loved it. One thing I miss however, is that with virtualenv, you could actually place virtual environments in repository directories so that your repository was a completely ...
Pyenv choose virtualenv directory
1.2
0
0
12,162
30,408,098
2015-05-23T01:50:00.000
0
0
0
0
python,algorithm,dijkstra,libtcod
54,982,870
2
false
0
1
As far as I understand, what you want to achieve is very well possible with tcod's built-in pathfinding function. path_new_using_function will call your path_func with adjacent cells, so you can simply have it return the values you listed above depending on the terrain below (xFrom, yFrom) and/or (xTo, yTo).
1
2
0
I am building a turn-based strategy game using Libtcod and Python. The game map has variable terrain and each tile can be 1 of 5 types: Plains - Costs 1 to move over Forest - Costs 2 River - Costs 4 Hill - Costs 3 Mountain - Impassable Each type has its own movement cost, so that it costs less "move points" to move t...
Python Libtcod: How to do pathfinding with variable move cost terrain?
0
0
0
965
30,408,127
2015-05-23T01:57:00.000
1
0
0
1
python,macos
30,408,184
3
false
0
0
python command will open a Python interpreter, where you can't run the python hello.py command so you got the syntax error (to run hello.py in python shell you need execfile(hello.py)) to quit the Python interpreter, type ctrl+d and than python hello.py to execute your hello world script.
1
3
0
I'm extremely new to programming, in fact I'm trying to learn Python now as a first language. I found that Google has a python course and it said to download python 2 from python's website, which I did, and I now realize that python was already installed on my mac by apple. Anyways, I also had to download some exercise...
How can I run python in terminal on a mac?
0.066568
0
0
35,838
30,408,568
2015-05-23T03:19:00.000
0
1
0
1
python,apache
30,408,643
1
false
0
0
Here is how I would take the approach based on what you just asked. Server: Apache + mod_wsgi for front-end web server (allows for using flask or django); there's not much here, it's a pretty easy configuration. I would use Django for the web framework. Client: Client would poll the server at some kind of interval (...
1
1
0
I am trying to make a program (well more like two programs that work together) A. The server(host): which is connected to the Apache server and sends commands to it and B. The Client(client): which is also connected but cant send commands only receive them. Example: If I typed in the server(host). Log time it would se...
Python/ Apache Help needed
0
0
0
28
30,409,076
2015-05-23T05:05:00.000
20
0
0
0
python,django,django-rest-framework
30,409,455
3
false
1
0
I finally understand how the .create() and .update() work in Serializer (especially ModelSerializer) and how they are connected to Viewsets (especially ModelViewSet). I just want clarify the concept more clearly if someone comes to this question. Basically, the 4 methods CRUD in ModelViewSet: .create(), .retrieve(), .u...
1
33
0
I'm currently implementing djangorestframework for my app RESTful API. After playing around with it, I still do not clearly understand what .create(self, validated_data) and .update(self, validated_data) used for in the serializer. As I understand, CRUD only calls the 4 main methods in viewsets.ModelViewSet: create(), ...
When are create and update called in djangorestframework serializer?
1
0
0
20,210
30,412,458
2015-05-23T12:06:00.000
0
1
0
1
python,eclipse,debugging,ant,pydev
30,913,800
1
false
1
0
When dealing with multiple languages, the way for debugging is regular debugging in one and remote debugging in the other... I'm guessing the ant debug uses the regular java debug which supports remote debugging, so, you can probably try that (although I haven't tried it here to confirm).
1
0
0
I have a set of Python scripts that sets up various parameters/properties for ANT script based on various conditions that are checked in the Python scripts and then invokes/executes the appropriate ANT build script. I initiate the Python script from my Eclipse IDE. I have the PyDev plug-in installed in Eclipse. I am ab...
Debugging ANT script initiated via a Python script
0
0
0
112
30,415,925
2015-05-23T17:59:00.000
4
0
1
0
python,list,dictionary
30,415,941
3
true
0
0
The first list only has 47 unique items; the older items are being replaced by the newer ones.
2
0
0
I have a list of lists, containing 50 items: print(len(per_column[0])) returns 50 items, and print(len(per_column[1])) also returns 50 items. I would like to make this into a dictionary. So I do: HashDict = dict(zip(per_column[0], per_column[1])) but this results in a dictionary containing 47 items only, not 50 (as ver...
Mapping two lists in Python to a dictionary results in fewer items?
1.2
0
0
35
30,415,925
2015-05-23T17:59:00.000
0
0
1
0
python,list,dictionary
30,415,954
3
false
0
0
If you lose items, it will be because of duplicate keys in per_column[0].
2
0
0
I have a list of lists, containing 50 items: print(len(per_column[0])) returns 50 items, and print(len(per_column[1])) also returns 50 items. I would like to make this into a dictionary. So I do: HashDict = dict(zip(per_column[0], per_column[1])) but this results in a dictionary containing 47 items only, not 50 (as ver...
Mapping two lists in Python to a dictionary results in fewer items?
0
0
0
35
30,421,373
2015-05-24T08:12:00.000
2
0
1
0
python,ipython,jupyter
37,065,235
3
false
0
0
For me to resolve this issue, I had to stop my anti-virus program.
3
59
0
I use Windows 7, Python 2.7.9 plus latest version of IPython 3.1. I ran %python inside an IPython Notebook and ran the cell, instead of returning the Python version, it did not run and jumped to a new line and printed a In [*] instead of a line number. Now no line is running in ipython everything is ignored when I try ...
What does In [*] in IPython Notebook mean and how to turn it off?
0.132549
0
0
114,689
30,421,373
2015-05-24T08:12:00.000
7
0
1
0
python,ipython,jupyter
54,258,699
3
false
0
0
The issue causing your kernel to be busy can be a specific line of code. If that is the case, your computer may just need time to work through that line. To find out which line or lines are taking so long, as mentioned by Mike Muller you need to restart the program or interrupt the kernel. Then go through carefully...
3
59
0
I use Windows 7, Python 2.7.9 plus latest version of IPython 3.1. I ran %python inside an IPython Notebook and ran the cell, instead of returning the Python version, it did not run and jumped to a new line and printed a In [*] instead of a line number. Now no line is running in ipython everything is ignored when I try ...
What does In [*] in IPython Notebook mean and how to turn it off?
1
0
0
114,689
30,421,373
2015-05-24T08:12:00.000
74
0
1
0
python,ipython,jupyter
30,421,412
3
true
0
0
The kernel is busy. Go to the menu Kernel and click Interrupt. If this does not work click Restart. You need to go in a new cell and press Shift + Enter to see if it worked.
3
59
0
I use Windows 7, Python 2.7.9 plus latest version of IPython 3.1. I ran %python inside an IPython Notebook and ran the cell, instead of returning the Python version, it did not run and jumped to a new line and printed a In [*] instead of a line number. Now no line is running in ipython everything is ignored when I try ...
What does In [*] in IPython Notebook mean and how to turn it off?
1.2
0
0
114,689
30,425,150
2015-05-24T15:23:00.000
1
0
1
0
python-3.x
32,926,420
1
false
0
0
Py-ART now works in Python 3. You should be good to go now
1
0
0
This is a little strange for me as I never post these questions. In many years of learning a few different languages this is the first time I have not been able to find the answers I am looking for. I have looked everywhere for a Python module that can open and read level II radar data files. I have found a few that wo...
Read Level II Ridge Radar Data in Python 3
0.197375
0
0
148
30,425,214
2015-05-24T15:30:00.000
52
0
0
0
python,flask,sqlalchemy,alembic
30,425,438
2
true
1
0
Yes, you are thinking about it in the wrong way. Let's say you don't use Alembic or any other migration framework. In that case you create a new database for your application with the following steps: Write your model classes Create and configure a brand new database Run db.create_all(), which looks at your models and...
1
19
0
I could create tables using the command alembic revision -m 'table_name' and then defining the versions and migrate using alembic upgrade head. Also, I could create tables in a database by defining a class in models.py (SQLAlchemy). What is the difference between the two? I'm very confused. Have I messed up the concep...
What is the difference between creating db tables using alembic and defining models in SQLAlchemy?
1.2
1
0
10,088
30,425,239
2015-05-24T15:32:00.000
0
0
1
0
python,multithreading
30,426,009
3
false
0
0
You can't abort a thread, or raise an exception into it asynchronously, in Python. The standard Unix solution to this problem is to use a non-blocking socket, create a pipe with pipe, replace all your blocking sock.recv calls with a blocking r, _, _ = select.select([sock, pipe], [], []), and then the other thread can w...
2
0
0
I've tried lately to write my own Socket-Server in python. While i was writing a thread to handle server commands (sort of command line in the server), I've tried to implement a code that will restart the server when the raw_input() receives specific command. Basically, i want to restart the server as soon as the "Run...
Is there anyway to terminate a running function from a thread?
0
0
0
57
30,425,239
2015-05-24T15:32:00.000
0
0
1
0
python,multithreading
30,425,294
3
true
0
0
Communication between threads can be done with Events, Queues, Semaphores, etc. Check them out and choose the one, that fits your problem best.
2
0
0
I've tried lately to write my own Socket-Server in python. While i was writing a thread to handle server commands (sort of command line in the server), I've tried to implement a code that will restart the server when the raw_input() receives specific command. Basically, i want to restart the server as soon as the "Run...
Is there anyway to terminate a running function from a thread?
1.2
0
0
57
30,427,300
2015-05-24T19:12:00.000
0
1
0
0
javascript,php,python,email
30,427,829
1
false
1
0
What you're describing would be handled largely by your backend. If this were my project, I would choose the following simple route: Store the messages the buyers/sellers send in your own database, then simply send notification emails when messages are sent. Have them reply to each other on your own site, like Faceboo...
1
0
0
I'm looking into what it would take to add a feature to my site so this is a pretty naive question. I'd like to be able to connect buyers and sellers via an email message once the buyer clicks "buy". I can see how I could do this in java script, querying the user database and sending an email with both parties involv...
Email API for connecting in a marketplace?
0
0
1
74
30,428,292
2015-05-24T21:01:00.000
0
0
0
1
python,sublimetext3,sublimetext,sublime-text-plugin
30,431,423
1
false
0
0
After another 5 hours of reading, I figured it out. As I assumed, it was a lack of Python knowledge on my part. All I needed to do was create a module level variable to use as a flag.
1
0
0
I'm creating a plugin in sublime Text 3, and I've hit a snag that I can't figure out. This is my first using python, and the first time I've done even driven desktop development in over a decade, so hopefully this is just a lack of knowledge on my part. The plugin I'm writing uses text commands to gather data and then ...
how do you disable a text command from another text command in Sublimetext
0
0
0
65
30,429,084
2015-05-24T22:43:00.000
1
0
0
0
python,facebook,facebook-graph-api
30,502,981
1
true
1
0
Facebook aggregates all your friend birthday posts in a single post. Once the posts are aggregated there is no way to retrieve the individual post as they don't longer exist.
1
0
0
I'm using Facebook Graph API to get all the posts on my own timeline. There is a problem. Because it was my birthday yesterday and all of the posts were done on my profile by others(my friends), these posts are shown as clubbed into one. This is the response I get in one of the posts when I make an API call at /v2.1/me...
How to get Facebook posts of same type grouped into one, separately?
1.2
0
1
67
30,430,162
2015-05-25T01:35:00.000
1
0
0
0
python,sockets,p2p
30,430,588
1
true
0
1
Sounds like a threading issue. I'm unfamiliar with TK graphics, but I'd imagine what you need to do is start the window showing the "waiting for player" message. That window then loops waiting for something to happen. When the message box displays you need to have the "listening" done on another thread, which signals ...
1
4
0
Making a very simple tic-tac-toe game in Python using a P2P architecture with sockets. Currently my GUI has button that says 'Create' that will open up and draw a new game board window, create a socket, bind, listen, and accept a connection. The 'Join' button will open and draw a new gameboard and connect to that 'serv...
Python: Show message 'Waiting for player...' while socket listens for connection
1.2
0
1
339
30,434,106
2015-05-25T08:31:00.000
2
1
1
1
python,linux,django,dependencies,pip
30,434,337
1
true
0
0
For god's sake, please do not fall back to using the distribution's package manager just because your hosting guys do not understand what pip+virtualenv is good for. Python packages in Linux distribution repositories are often outdated and may come with quirks that other Python package authors did not plan for. This is...
1
1
0
I work on a system and the hosting guys don't want to use an install script that uses pip. Now we have a large pip requirements file that install the dependencies. Is there any other way to do it than using pip? Can it be done using yum or apt-get ? We are using Linux.
Is there a more efficient way to satisfy project dependencies than pip?
1.2
0
0
55
30,434,228
2015-05-25T08:39:00.000
1
0
0
0
python,django
30,434,626
2
false
1
0
On the item's model, add two datetime fields, for example "bookedStart" and "bookedEnd". And have a function isBooked() that checks if a given datetime or the current datetime is in that time frame, and return True if it is, or False otherwise. If the users should be able to add multiple time frames (at once) when an i...
1
0
0
I'm developing a sample application to book items from other users. I have hit a road block as I can't seem to figure out how to model when item is available to be rented. Requirements: Users can rent item per day or per hour. Owner is able to select dates, hour an item is available. Any ideas?
Django model for datetime availability
0.099668
0
0
1,007
30,436,329
2015-05-25T10:34:00.000
1
0
0
0
python,excel
30,436,742
2
false
0
0
I think you should consider win32Com for excel operation in python instead of Openpyxl,XlsxWriter. you can read/write excel, create chart and format excel file using win32com without any limitation. And creating chart you can consider matplotlib, in that after creating chart you can save it in pdf file also.
1
1
0
My problem is rather simple : I have an Excel Sheet that does calculations and creates a graph based on the values of two cells in the sheet. I also have two lists of inputs in text files. I would like to loop through those text files, add the values to the excel sheet, refresh the sheet, and print the resulting graph ...
Automatic input from text file in excel
0.099668
1
0
226
30,437,566
2015-05-25T11:41:00.000
3
0
1
0
python,string
56,108,440
3
false
0
0
Split string on consecutive whitespace† at most maxsplit times†† † Resulting list will contain no leading or trailing empty strings ("") if the string has leading or trailing whitespace †† Splits are made left to right. To split the other way (right to left), use the str.rsplit() method (requires Python 2.4+) Python 2...
1
14
0
I want to split a string on whitespaces (default behavior), but I want it to split it only once - I.e. I want it to return an array with 2 items at most. If it is not possible - i.e. if for specifying the limit I have to also specify the pattern - could you please tell how to specify the default one?
Python: str.split() - is it possible to only specify the "limit" parameter?
0.197375
0
0
17,995
30,441,107
2015-05-25T14:57:00.000
0
0
0
0
python,file,memory,merge
30,441,330
3
false
0
0
As @Marc B said, reading one row at a time is the solution. About the join I would do the following (pseudocode: I don't know python). "Select distinct Model from A" on first file A.csv Read all rows, search for Model field and collect distinct values in a list/array/map "Select distinct Model from B" on second file...
1
0
1
I have a large A.csv file (~5 Gb) with several columns. One of the columns is Model. There is another large B.csv file (~15 Gb) with Vendor, Name and Model columns. Two questions: 1) How can I create result file that combines all columns from A.csv and corresponding Vendor and Name from B.csv (join on Model). The trick...
Concatenate large files in sql-like way with limited RAM
0
1
0
862
30,443,490
2015-05-25T17:45:00.000
-3
1
1
0
python,raspberry-pi
30,443,607
2
false
0
0
Short answer: Yes. Just keep in mind that your code must be OS-aware too. And use the same version of python in both platforms.
1
11
0
I recently started python development on raspberry pi. While reading about .pyc file to speed up the start up, I was wondering if I test a .pyc file on PC, given that same python modules are available on Rpi, will it work directly ? Please also include what happens if python version or any of module version differs on ...
Is .pyc platform independent?
-0.291313
0
0
5,632
30,443,495
2015-05-25T17:45:00.000
0
0
0
0
python,orange
30,534,011
1
false
0
0
Update Orange-Bioinformatics add-on to the latest version.
1
0
0
I am a new user to the Orange Data Mining and I was taking the BioInformatics tutorial as a means to do some initial exploring on the platform. Going directly to the problem at hand when I put the GEO Datasets widget into my Canvas I apparently get an error downloading the datasets that is described as the following P...
GEO Datasets in Orange
0
0
0
294
30,447,083
2015-05-25T23:03:00.000
-2
0
0
0
python,pandas,missing-data
61,126,661
6
false
0
0
If you are looking for a quicker way to find the total number of missing rows in the dataframe, you can use this: sum(df.isnull().values.any(axis=1))
1
57
1
While working in Pandas in Python... I'm working with a dataset that contains some missing values, and I'd like to return a dataframe which contains only those rows which have missing data. Is there a nice way to do this? (My current method to do this is an inefficient "look to see what index isn't in the dataframe wi...
Python, Pandas : Return only those rows which have missing values
-0.066568
0
0
100,635
30,448,027
2015-05-26T01:20:00.000
1
0
0
0
python,web,scrapy
30,448,526
1
false
1
0
Item refers to an item of data that it's scraped. You can also call it a record or an entry. Spider is the thing that does crawling (starting requests and following links) and scraping (extracting data items from responses). They can schedule whatever amount of requests and extract whatever amount of items as you want,...
1
1
0
New to scrapy.There are something confused me:what's the relationship between spiders,pipelines and items? 1.should one pipeline handle only one specific item or it can handle multiple items? 2.how to use one spider to crawl multiple items or I should use one spider just to crawl one item?
can one spider handle multiple items and multiple pipelines?
0.197375
0
0
722
30,449,183
2015-05-26T03:53:00.000
1
0
1
0
python,module,spotipy
30,449,940
1
false
0
0
As James said, you need to place empty file __init__.py in your folder. Then Python will think of this folder as of a package and you will be able to do your imports.
1
1
0
I have spotipy installed on python3, and when I run it, it calls the __init__.py file, but then that file attempts to import from client, and it says that client can not be found, although client.py is in the same folder as __init__.py. I'm wondering if the issue lies in the fact that I have multiple versions of python...
Python cannot find module in the same folder
0.197375
0
0
2,041
30,449,860
2015-05-26T05:05:00.000
0
1
0
0
python,audio
50,763,111
3
false
0
0
You can read sph files via audioreadwith ffmpeg codecs.
1
6
1
I am working on a project where I need to extract the Mel-Cepstral Frequency Coefficients (MFCC) from audio signals. The first step for this process is to read the audio file into Python. The audio files I have are stored in a .sph format. I am unable to find a method to read these files directly into Python. I would l...
Read .sph files in Python
0
0
0
3,923
30,458,394
2015-05-26T12:19:00.000
0
1
0
1
python,cgi,pexpect
32,283,501
1
false
0
0
ExceptionPexpect(\'Error! pty.fork() failed: \' + str(e))\npexpect.ExceptionPexpect: Error! pty.fork() failed: out of pty devices\')') your system has reached the max # of pty devs. your should increase those according to your needs. keep in mind, for resource & security reasons it shall be useful to limit access ...
1
1
0
I am using pexpect with cgi to ssh into remote machine, Whenever i run a script which does ssh using pexpect from the linux terminal it gives me the correct result, but when i call the script using commands module from the cgi program i am getting the following error. (0, '(256, \'Traceback (most recent call last):\n...
pty.fork() error python pexpect
0
0
0
731
30,459,398
2015-05-26T13:03:00.000
2
0
0
0
python,scipy,statistics,probability,statistical-test
30,470,049
1
true
0
0
(1) "Is it from distribution X" is generally a question which can be answered a priori, if at all; a statistical test for it will only tell you "I have a large sample / not a large sample", which may be true but not too useful. If you are trying to classify new data into one distribution or another, my advice is to loo...
1
4
1
I have a few large sets of data which I have used to create non-standard probability distributions (using numpy.histogram to bin the data, and scipy.interpolate's interp1d function to interpolate the resulting curves). I have also created a function which can sample from these custom PDFs using the scipy.stats package....
Comparing datasets to nonstandard probability distributions in Python
1.2
0
0
452
30,462,481
2015-05-26T15:13:00.000
1
0
1
0
python,linux,bioinformatics,pythonanywhere
30,502,344
1
false
0
0
Virtualenv works for Python packages. However if you're trying to use non Python packages/libraries it won't be of much use. Since the tools don't have easyinstall or pip compatibility I don't think using virtualenv will work out. Download and compile from source should work though. Note that if Biopython is installab...
1
0
0
I am trying to use Pythonanywhere to run some of my scripts. Eventually I would like to turn the entire code into a webapp, but I am not there yet. Anyway, I would like to install a couple of bioinformatics packages on Pythonanywhere. Biopython has wrappers for these tools, but you still need the actual tools instaled....
Install tool from source on pythonanywhere
0.197375
0
0
112
30,464,163
2015-05-26T16:32:00.000
12
0
0
0
python,haskell,functional-programming,ocaml,sml
30,464,615
4
false
0
0
You have to keep track of the nodes you visit. Lists are not king in the ML family, they're just one of the oligarchs. You should just use a set (tree based) to track the visited nodes. This will add a log factor compared to mutating the node state, but is so much cleaner it's not funny. If you know more about your nod...
2
26
0
Functional depth first search is lovely in directed acyclic graphs. In graphs with cycles however, how do we avoid infinite recursion? In a procedural language I would mark nodes as I hit them, but let's say I can't do that. A list of visited nodes is possible, but will be slow because using one will result in a linea...
Functional Breadth First Search
1
0
0
5,901
30,464,163
2015-05-26T16:32:00.000
3
0
0
0
python,haskell,functional-programming,ocaml,sml
30,465,604
4
false
0
0
It is pretty OK to have a mutable state hidden inside the function. If it is not visible, then it doesn't exist. I usually use hash sets for this. But in general, you should stick to this if your profiling pinpointed that. Otherwise, just use set data structure. OCaml has an excellent Set based on eagerly balanced AVL ...
2
26
0
Functional depth first search is lovely in directed acyclic graphs. In graphs with cycles however, how do we avoid infinite recursion? In a procedural language I would mark nodes as I hit them, but let's say I can't do that. A list of visited nodes is possible, but will be slow because using one will result in a linea...
Functional Breadth First Search
0.148885
0
0
5,901
30,464,980
2015-05-26T17:18:00.000
4
1
0
1
python,linux,macos,centos,version
30,465,953
12
false
0
0
As someone mentioned in a comment, you can use which python if it is supported by CentOS. Another command that could work is whereis python. In the event neither of these work, you can start the Python interpreter, and it will show you the version, or you could look in /usr/bin for the Python files (python, python3 etc...
4
75
0
I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my mac and found that I had...
How to check all versions of python installed on osx and centos
0.066568
0
0
184,308
30,464,980
2015-05-26T17:18:00.000
4
1
0
1
python,linux,macos,centos,version
58,172,493
12
false
0
0
COMMAND: python --version && python3 --version OUTPUT: Python 2.7.10 Python 3.7.1 ALIAS COMMAND: pyver OUTPUT: Python 2.7.10 Python 3.7.1 You can make an alias like "pyver" in your .bashrc file or else using a text accelerator like AText maybe.
4
75
0
I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my mac and found that I had...
How to check all versions of python installed on osx and centos
0.066568
0
0
184,308
30,464,980
2015-05-26T17:18:00.000
20
1
0
1
python,linux,macos,centos,version
56,606,519
12
false
0
0
we can directly use this to see all the pythons installed both by current user and the root by the following: whereis python
4
75
0
I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my mac and found that I had...
How to check all versions of python installed on osx and centos
1
0
0
184,308
30,464,980
2015-05-26T17:18:00.000
7
1
0
1
python,linux,macos,centos,version
30,466,232
12
true
0
0
Use, yum list installed command to find the packages you installed.
4
75
0
I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my mac and found that I had...
How to check all versions of python installed on osx and centos
1.2
0
0
184,308
30,465,364
2015-05-26T17:42:00.000
2
0
0
0
android,python,android-developer-api
30,466,179
6
false
0
1
If the question is,can i run python programs on android then by all means yes. But if the intent is to create a mobile app usibg python then please look at kivy which is yet to support python 3. But outside the love of python ,its best to stick to android studio for native android apps.
2
9
0
I am learning python and i don't know that it will be helpful to me if i want to make android apps.I have read somewhere that python can make android app.But I want to ask you that is it a good option or we should always use andriod studio to make android apps because that is developed particularly for creating android...
Can python build android apps?
0.066568
0
0
25,019
30,465,364
2015-05-26T17:42:00.000
0
0
0
0
android,python,android-developer-api
68,053,648
6
false
0
1
Yes you can using 1- Kivy library 2- install Ubuntu on a versatile machine 3- run buildozer to transfer your main.py file into APK file
2
9
0
I am learning python and i don't know that it will be helpful to me if i want to make android apps.I have read somewhere that python can make android app.But I want to ask you that is it a good option or we should always use andriod studio to make android apps because that is developed particularly for creating android...
Can python build android apps?
0
0
0
25,019
30,467,495
2015-05-26T19:42:00.000
13
0
0
0
mysql,python-3.x,installation
39,704,698
12
false
0
0
Just to add to the murkiness, I had the same error with current version of MySql install when attempting with python 3.5 installed (which is the latest python download). Long story short, I uninstalled python 3.5, installed python 3.4.4 (which interestingly didn't update PATH so I updated it manually) and reran instal...
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
1
1
0
35,704
30,467,495
2015-05-26T19:42:00.000
10
0
0
0
mysql,python-3.x,installation
35,611,377
12
false
0
0
just in case anyone else has this issue in future. Look at what bit version you have for Python 3.4. When I installed 64 bit version of Python 3.4, this issue went away.
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
1
1
0
35,704
30,467,495
2015-05-26T19:42:00.000
8
0
0
0
mysql,python-3.x,installation
54,292,906
12
false
0
0
I ran into a similar issue with Python 3.7.2. In my case, the problem was that I tried to install the 64 bit MySQL connector, but had the 32 bit version of Python installed on my machine. I got a similar error message: Python v3.7 not found. We only support Python installed using the Microsoft Windows Installer (MSI) ...
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
1
1
0
35,704
30,467,495
2015-05-26T19:42:00.000
2
0
0
0
mysql,python-3.x,installation
30,468,759
12
false
0
0
From my experience if you have both Py2.7 and Py3.4 installed when installing the mysql connector for py3.4 you will run into this issue. Not sure of the WHY but for some reason if you have py2.7 installed, the py3.4 mysql connector recognizes that version first and just assumes that you have py2.7 installed and does n...
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
0.033321
1
0
35,704
30,467,495
2015-05-26T19:42:00.000
0
0
0
0
mysql,python-3.x,installation
53,574,430
12
false
0
0
I had this problem until I discovered I had installed python based in another architecture (32b). MySQL required 64 bit.
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
0
1
0
35,704
30,467,495
2015-05-26T19:42:00.000
1
0
0
0
mysql,python-3.x,installation
50,449,146
12
false
0
0
I was looking for an similar answer. The correct answer is that there is a bug in the mysqlconnector MSI. When python installs, it creates a registry entry under HKLM Software\Python\PythonCore\3.6-32\InstallPath however, the MSI for mysqlconnector is looking for installation path in the registry Software\Python\Pyt...
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
0.016665
1
0
35,704
30,467,495
2015-05-26T19:42:00.000
0
0
0
0
mysql,python-3.x,installation
61,068,804
12
false
0
0
Here is a much simpler work around: pip install mysql-connector-python Is the same package that MySQL is having trouble installing. Just use pip to install it. Next, go back to the installation style and select "Manual" instead of "Developer". They are identical, but "Manual" allows you to remove packages. Just remove ...
7
26
0
I'm trying to istall mysql server on a windows 7 machine - that has python 3.4.3 installed. However, when trying to install the python connectors for 3.4, the installer fails to recognize the python installation, saying python 3.4 is not installed. Has anyone solved this issue before? I'ts driving me nuts...
mysql installer fails to recognize python 3.4
0
1
0
35,704
30,472,884
2015-05-27T03:56:00.000
0
0
1
0
python,sandbox,pypy
30,538,684
1
false
0
0
There are probably some hacky ways to do this. One I can think of off the top of my head is to edit the pypy sandbox script (the one that is trusted and actually accesses the files) to only read your module's file the first time, where it is (hopefully) being imported, and block reads after that. Keep in mind, howeve...
1
0
0
I have a project that allows users to their python files on an environment. For safety purpose, the environment is done by PyPy's sandbox. I also have some library code for users to use. However, I don't want them to see the source code. Is there a way to be able to import the module, but not be able to see the module ...
Including my python library files in pypy sandbox
0
0
0
66
30,477,109
2015-05-27T08:31:00.000
0
0
1
0
python,django,virtualenv,virtualenvwrapper,pyenv
35,180,548
2
false
0
0
Two ideas: The obvious one: Try the pyenv-virtualenvwrapper plugin to pyenv? You can add hooks for a specific pyenv command in $PYENV_ROOT/pyenv.d/<command>. You can do this even for for pyenv’s “porcelain” commands which aren’t normally called directly by the user. You could write a hook for activate that changes s...
1
7
0
with virtualenvwrapper, I could setup separate virtualenvs and calling workon venv have them link to specific settings files (ex. test_settings.py or dev_settings.py) I preset using hooks in the virtualenv's bin - preactivate, postactivate, predeactivate and postdeactivate. Is there something equivalent for pyenv? pyen...
triggering different app environments with pyenv-virtualenv
0
0
0
1,082
30,478,647
2015-05-27T09:39:00.000
0
1
0
1
python,google-app-engine,twilio
30,514,752
3
true
1
0
Thanks for the input. I had already tried all of these things. When I ran the app on a local host I saw in the console that the error I was facing was with 'pytz' Turns out that Twilio requires the Pytz dependency to be in the root directory of Google App Engine. They have not updated the documentation yet. Hope that...
1
0
0
I've seen other similar questions but none of the solutions are working for me. I am trying to get Twilio working with Google App Engine. I am using the python API and can't seem to get it to work. I tried a few tactics: used pip install twilio downloaded the twilio file directly into my root directory sym linked the...
importing Twilio on google app engine
1.2
0
0
275
30,481,279
2015-05-27T11:34:00.000
5
0
0
0
python,django
30,481,509
2
false
1
0
This is to be expected. The login operation rotates the CSRF token, otherwise it would be possible to use the token from outside the authenticated session. Hence what happens in your case: Retrieve login page in Tab 1 (with unauthenticated "form" CSRF token) Retrieve login page in Tab 2 (with unauthenticated "form" CS...
1
7
0
Here is what I did: I have two tabs open on my browser, and I have the login form loaded in both the tabs. I login with the required credentials on first tab. I again try to login by providing the credentials on the second tab. I get an error on the second tab : CSRF verification failed. Request aborted. I have used ...
CSRF verification fails when trying to login in an already logged in application Django
0.462117
0
0
1,581
30,483,649
2015-05-27T13:17:00.000
1
0
0
0
python,openpyxl
30,718,077
4
false
0
0
I remember diving into the openpyxl source a while back to try and whittle down some styling issues. If you are opening a pre-existing excel file, cells will only be styled if they contain content. For example, if you have a .xlsx with A:A being highlighted yellow, but only A1 contains any text, then openpyxl will no...
1
19
0
I have tried to print some_cell.font.color.rgb and got various results. For some I got what I want (like "FF000000"), but for others it gives me Value must be type 'basetring'. I assume that the latter is because I haven't actually defined the font color for these cells. I'm using openpyxl 2.2.2
Python: openpyxl how to read a cell font color
0.049958
0
0
12,306
30,483,753
2015-05-27T13:21:00.000
2
0
0
0
python,opencv,anaconda,xcb
30,487,195
2
false
0
1
Okey, I have figured it out. During cmake I set flag -D WITH_QT=OFF since I read somewhere that it doesnt work for Qt5.x
1
1
0
My setting: Python 2.7 with anaconda Recently I have installed OpenCV 3.0 and when I try to do simple image display or I want to run python samples that come with OpenCV, there is a error message: This application failed to start because it could not find or load the Qt platform plugin "xcb". I have read many comment...
python app - xcb plugin fail
0.197375
0
0
1,947
30,485,902
2015-05-27T14:47:00.000
0
0
0
0
python,http,webserver,web.py,circular-reference
30,489,207
1
true
0
0
Your approach should work. Might be faster to check if the server sees itself on the request list - that means it already processed that request thus all the other servers it has in its list should already be in the response list - no need to check each and every one of them. Or maybe use it as a redundant sanity chec...
1
0
0
I have a web.py program acting as a web service, delivering responses according to the files in its directory. Now I want to build a network of servers, each running an instance of the program. Additionally, each server has a list of addresses to other servers. The motivation behind this is to allow different servers t...
How can I prevent circular http requests in a network of servers?
1.2
0
1
155
30,486,773
2015-05-27T15:25:00.000
2
0
0
1
python,celery
34,818,641
1
true
0
0
For anyone who has this problem and finds their way here from google, I can't explain why rdb drops you into the middle of contextlib but I have found that if you execute the r(eturn) command a couple times you'll work your way back into the function you made your rdb.set_trace() call from.
1
1
0
I'm trying to do some debuging on celery task using rdb but despite the fact that I can connect to the socket using telnet it doesn't give me any data, looks like Pdb is broken and doesn't have any data to inspect It starts with this lane c:\python27\lib\contextlib.py(21)exit()-> def exit(self, type, value, traceback)...
Remote Debug of Celery using rdb
1.2
0
1
666
30,490,625
2015-05-27T18:42:00.000
5
0
0
0
python,opencv,computer-vision,coordinates,stereo-3d
30,506,462
1
true
0
0
1) Case of no rotation, only translation parallel to the horizontal axis of the image plane, cameras with equal focal lengths. Denote with "f" the common focal length. Denote with "b" the baseline of the stereo pair, namely the distance between the cameras' optical centers. Given a 3D point P, visible in both cameras ...
1
4
1
I'm working on calculating the real world coordinates of an object in a scene by using a pair of stereo images. The images are simulations of perfect pinhole cameras so there is no distortion to correct and there is no rotation. I know OpenCV has a bunch of functions to calibrate stereo cameras and create disparity map...
Calculating real world co-ordinates using stereo images in Python and OpenCV
1.2
0
0
1,838
30,490,654
2015-05-27T18:43:00.000
0
0
1
0
python
30,490,831
3
false
0
0
Have you tried writing an additional script that imports what's needed from these separate programs and runs them in the manner that you designate?
1
0
0
I have a few .py programs I run in my IDE separately (I guess they just run as separate processes, right). Each of them has a couple of classes, some global variables etc and the main function. How can I achieve the same effect programmatically, i.e. run these scripts in particular order? I've tried several methods, bu...
Running several Python scripts with from one function
0
0
0
83
30,490,795
2015-05-27T18:50:00.000
2
0
0
0
python,python-3.x,tkinter,cx-freeze
30,491,828
1
true
0
1
For tkinter applications, the preferred way to exit is name_of_application.destroy(). Using exit() can give unpredictable results.
1
3
0
I have a program in which I use a tkinter button to exit the program with the exit() command. However, when I compile the program through cx_freeze, it doesn't work anymore. I also tried with sys.exit() but then the button doesn't work at all (with or without cx_freeze). Any hint would be appreciated, thanks!
exit() doesn't work with cx_freeze
1.2
0
0
628
30,491,507
2015-05-27T19:31:00.000
2
0
0
0
python,node.js,machine-learning,sentiment-analysis
30,491,984
2
false
1
0
Flask is a relatively simple web framework. It will suit your need to get the user-submitted text into a python function, without too much boilerplate code or complexity. There are alternatives, most notably Tornado. I do wonder why you would stack two REST interfaces on top of eachother. Do you need the node.js applic...
1
2
0
I'm trying to build a sentiment classifier web app, but I don't understand who to connect the machine learning component with the web app. I've built the client-side web app that's running on a NodeJS server, and I've trained a sentiment classifier that saved as a Python script. My goal is to have users submit text on ...
How to connect a Machine Learning classifier to a Web App?
0.197375
0
0
1,275
30,491,955
2015-05-27T19:54:00.000
1
0
1
0
ipython,ipython-notebook
30,516,923
2
false
0
0
In this case the issue seemed to be that setuptools was outdated. By updating setuptools pip install "ipython[notebook]" went through flawlessly and I am able to work in the interactive shell nicely. Thanks to all that helped track this down.
1
0
0
I'm having issues installing ipython with sudo pip install "ipython[notebook]". The error that I am seeing is Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Jzcy1W/terminado Any ideas on how I can resolve this?
egg_info errors installing ipython
0.099668
0
0
521
30,493,289
2015-05-27T21:16:00.000
3
0
0
0
python,django
30,493,396
2
true
1
0
This seems like a bad idea. Out of the box, the information architecture presented by the admin interface is going to be very flat where views essentially mirror what's in the database 1:1. I can imagine a slim subset of users in internal IT apps or similar where that may be appropriate but the compromises in usability...
1
0
0
I am about to begin work on a project that will use Django to create a system with three tiers of users. Each user will login into the dashboard type interface (each user will have different types of tools on the dashboard). There will be a few CRUD type interfaces for each user tier among other things. Only users with...
Django 1.8, Using Admin app as the main site
1.2
0
0
165
30,494,067
2015-05-27T22:18:00.000
1
0
0
0
python,machine-learning,scikit-learn
30,640,900
2
false
0
0
Depends on your data Memory consumption. If your data is dense, a dense representation needs d*sizeof(double) bytes for your data (i.e. usually d * 8 bytes). A sparse representation usually needs sparsity*d*(sizeof(int)+sizeof(double)). Depending on your programming language and code quality, it can also be much more d...
2
2
1
I have a large but sparse train data. I would like to use it with ExtraTreeClassifier. I am not sure considering computational time whether I need to use sparse csr_matrix or the raw data. Which version of the data runs faster with that classifier and can we generalize its answer to all sparse capable models?
Does using sparse matrices make an algorithm slower or faster in Sklearn?
0.099668
0
0
982
30,494,067
2015-05-27T22:18:00.000
1
0
0
0
python,machine-learning,scikit-learn
30,640,578
2
false
0
0
If your data are sparse, the extra tree classifier will be faster with a csc_matrix. In doubt, I would suggest you to benchmark with both version. All algorithms should benefit from using the appropriate sparse format if your data are sufficiently sparse. For instance, algorithms based on dot product will be a lot fas...
2
2
1
I have a large but sparse train data. I would like to use it with ExtraTreeClassifier. I am not sure considering computational time whether I need to use sparse csr_matrix or the raw data. Which version of the data runs faster with that classifier and can we generalize its answer to all sparse capable models?
Does using sparse matrices make an algorithm slower or faster in Sklearn?
0.099668
0
0
982
30,494,157
2015-05-27T22:26:00.000
2
0
1
0
python
30,494,215
1
true
0
0
There is no notion of an image as smalltalk had it (only heard, never worked with it) in standard python. Depending on your actual use-case, I can see several approaches: use configuration-files, reading on start and writing them in intervals. pickle your relevant data-structures explicitly, and restore whatever graph...
1
0
0
I would like to create something like a permanent storage using Python. What I mean is that I will have some variables coming into my code, and every time I execute my script it might be a different input. Let's imagine I am reading some website that is updating in real time. I want to be able to create a permanent sto...
Retaining/hardcoding data in Python
1.2
0
0
58
30,495,055
2015-05-27T23:56:00.000
0
1
1
1
python,powershell
30,516,327
2
false
0
0
I got it to work finally, I had it in a folder under the path C:\Users\MyUser\PythonTest\ex1.py This was wrong, however when I made it C:\Users\MyUser\ex1.py It worked, thanks for all the help!
1
1
0
I am using Zed Shaw's "Learn Python the Hard Way" and have gotten Python to work. I made a file and saved it as ex1.py. I type the command python ex1.py This does not recognize the file like it should and instead gives me this can't open file 'ex1.py': [Errno 2] No such file or directory I have checked and double-che...
Powershell not finding a file with a .py extension
0
0
0
173
30,495,979
2015-05-28T01:59:00.000
0
0
0
0
python,django,authentication
60,831,884
2
false
1
0
You should need just use Groups Django mechanism - you need to create four groups like userA and let say common and check whether user is in first or second group - then show him appropriate view
1
22
0
I am creating a Django site that will have 4 types of users; Super Admin: Essentially manages all types of users UserTypeA: Can login to site and basically will have a CRUD interface for some arbitrary model. Also has extra attributes (specific info that only pertains to TypeA users) UserTypeB: Can login to site a...
Django 1.8, Multiple Custom User Types
0
0
0
14,610
30,498,106
2015-05-28T05:44:00.000
0
1
1
1
python,windows,exe
30,521,807
2
false
0
0
I fixed the issue. Apparently I accidentally installed 32-bit Python on a 64-bit machine. So I have to use the 32-bit installer because it installs the registry key in a different place. Thanks for the help anyways.
1
0
0
I am trying to convert a python script to an executable file. I have tried cxFreeze and py2exe, but both told me that Python27 are not in the registry. I found several other questions that tell me to go to regedit and find the python folder, but it is not there. I tried going to HKEY_CURRENT_USER/Software and Python27 ...
Convert script to executable, python not in registry
0
0
0
297
30,498,719
2015-05-28T06:24:00.000
-1
0
1
0
python,range,python-2.x
30,498,834
4
false
0
0
you can treat [x:y:z] stands for [start:stop:jumps] in the range of 5 it will iterate over 0-4 both inclusive and since your z is negative it will iterate from 4 to 0 with 2 jumps 4---3---2(--- represents jumps)so the output is 4---(3)---2---(1)---0 . ------> -------> Happy Coding
1
7
0
Not sure what the arguments inside the [ ] really do after the range() function. Exp: print ( range(5)[::-2]) Output: [4, 2, 0] But if [x:y:z] stands for [start:stop:step], then when I put print(range(5)[4:-2:-2]), the output list is [4] instead of [4, 2, 0], not sure how that works.
range(n)[x:y:z]
-0.049958
0
0
3,644
30,500,311
2015-05-28T07:47:00.000
1
0
0
0
python,numpy,optimization,scipy
30,553,182
2
false
0
0
l-bfgs-b does a bounded optimisation. Like any quasi-Newton method it approximates the Hessian. But this is often better than using the real Hessian.
1
0
1
I am trying to optimize a function of a small number of variables (somewhere from 2 to 10). What I am trying to do is calculate the minimum of the function on a bounded hypercube [0,1] x [0,1] x ... x [0,1] The calculation of the function, its gradient and its hessian is al relatively simple, quick and accurate. Now, ...
Bounded optimization using the Hessian matrix (scipy)
0.099668
0
0
923
30,503,356
2015-05-28T10:04:00.000
-4
0
1
0
python,json,python-2.7,data-modeling,ietf-netmod-yang
30,657,742
2
false
0
0
Yang is a modeling language, not a data generation language. What you are asking for is a simulator that will contain the same or pseudo logic as your application to generate data.
1
5
0
How do I convert "YANG" data model to "JSON"? As there is many many docs available in web, in that they changed in YANG synatx to JSON but how the value for the leaf or leaf list they are getting? from where and how it will get actual data in JSON from YANG?
how to convert YANG data model to JSON data?
-1
0
1
13,938
30,503,358
2015-05-28T10:04:00.000
3
0
0
0
python,sqlalchemy
30,504,339
2
true
0
0
You can add an index sorted by the column you want. The data will be presorted according to that index.
1
2
0
I'm not sure if this has been answered before, I didn't get anything on a quick search. My table is built in a random order, but thereafter it is modified very rarely. I do frequent selects from the table and in each select I need to order the query by the same column. Now is there a way to sort a table permanently by ...
SQLAlchemy: how can I order a table by a column permanently?
1.2
1
0
344
30,503,761
2015-05-28T10:21:00.000
0
0
1
0
python,python-2.7,queue
30,504,215
1
false
0
0
Keep the required execution times in a sorted list.Wait till the time present at the beginning of the list.Remove the first item from the list and execute the task.Repeat.
1
2
0
Let us assume that I have n different number of tasks and a stream of tasks are coming with different given time(t). Is there a way to ensure that each task gets executed after their given time(t)? I'm using python to create and execute these tasks.
Is there a way to execute task from a queue after a particular timeout in python?
0
0
0
52
30,507,243
2015-05-28T12:56:00.000
2
1
0
0
python,shell,raspberry-pi,raspbian
39,902,403
2
false
0
0
You can use the Linux crontab to run the Python script. Let's go to root and create a shell script. sudo -i nano startup.sh Then type your python script on this bash script. navigate to home directory, then to this directory, then execute python script, then back home. cd / cd home/pi/your directory sudo python yourpy...
1
1
0
I have a python program which posts to my local web server. The script runs on a raspberry pi running the latest version of raspbian 3.18. How can I make the Python script run at startup? Raspbian has a login password which is the first thing I have to remove. If the power ever goes out I want the pi to reboot and star...
Start shell script on Raspberry Pi startup
0.197375
0
0
4,531
30,507,853
2015-05-28T13:23:00.000
2
0
0
0
python,migration,alembic
62,187,440
4
false
1
0
Alembic is keeping track of the migrations in the alembic_version table on your database. Simple drop the table to start from scratch using the following command: DROP TABLE alembic_version; And then try to run your migration again!
1
4
0
How I can clear history using alembic? I couldn't find this option in alembic history. I want to run from the first migration rather than the last applied.
How to clear history and run all migrations from the beginning?
0.099668
0
0
7,131
30,509,152
2015-05-28T14:14:00.000
0
0
1
0
python,osx-mavericks,enthought,pybrain
30,511,851
1
true
0
0
pip install pybrain in a Canopy Terminal suffices for me. After that, import pybrain succeeds.
1
0
0
I'm trying to setup Pybrain on my Mac for the past couple of days but to no avail. I downloaded the Enthought Canopy and I have made sure that it is my default python. I also tried the suggestions given on the Pybrain documentary page but I did not find a solution to my problem. I'm a beginner to installing other files...
Problems with setting up pybrain on Mac through Enthought Canopy
1.2
0
0
103
30,516,510
2015-05-28T20:28:00.000
0
1
0
0
python,python-2.7,python-unittest
30,516,764
2
false
0
0
unittest.shortDescription() takes no arguments. You would have to override it to get the entire docstring.
1
1
0
unittest.shortDescription() returns only the first line of the test method's docstring. Is there a way to change this behavior, e.g. to display the entirety of the docstring, or to display another message ? Would I need to override shortDescription() ? EDIT: I did know that shortDescription() takes no arguments (beside...
How to extend/customize unittest's shortDescription()?
0
0
0
291
30,517,002
2015-05-28T20:59:00.000
3
0
0
0
django,python-3.x,django-queryset,models
30,517,111
3
false
1
0
You are looking into request.POST, even if the request.method is not equal to 'POST'. This will not work, because when the request is not an HTTP-post, the POST-member of your request is empty.
1
1
0
i have two models, when i do request.POST.get('room_id') or ('id') i'm getting an error Room matching query does not exist. how to solved this problem? help me class Room(models.Model): status = models.BooleanField('Status',default=True) name = models.CharField('Name', max_length=100, unique=True...
django models request get id error Room matching query does not exist
0.197375
1
0
1,484
30,518,362
2015-05-28T22:52:00.000
1
0
0
0
python,apache-spark,pyspark
63,025,280
19
false
0
0
I had the same problem, just forgot to activate my virtual environment.
4
95
1
I'm using spark 1.4.0-rc2 so I can use python 3 with spark. If I add export PYSPARK_PYTHON=python3 to my .bashrc file, I can run spark interactively with python 3. However, if I want to run a standalone program in local mode, I get an error: Exception: Python in worker has different version 3.4 than that in driver 2...
How do I set the driver's python version in spark?
0.010526
0
0
165,951
30,518,362
2015-05-28T22:52:00.000
6
0
0
0
python,apache-spark,pyspark
46,797,446
19
false
0
0
I came across the same error message and I have tried three ways mentioned above. I listed the results as a complementary reference to others. Change the PYTHON_SPARK and PYTHON_DRIVER_SPARK value in spark-env.sh does not work for me. Change the value inside python script using os.environ["PYSPARK_PYTHON"]="/usr/bin/p...
4
95
1
I'm using spark 1.4.0-rc2 so I can use python 3 with spark. If I add export PYSPARK_PYTHON=python3 to my .bashrc file, I can run spark interactively with python 3. However, if I want to run a standalone program in local mode, I get an error: Exception: Python in worker has different version 3.4 than that in driver 2...
How do I set the driver's python version in spark?
1
0
0
165,951
30,518,362
2015-05-28T22:52:00.000
9
0
0
0
python,apache-spark,pyspark
50,399,085
19
false
0
0
I just faced the same issue and these are the steps that I follow in order to provide Python version. I wanted to run my PySpark jobs with Python 2.7 instead of 2.6. Go to the folder where $SPARK_HOME is pointing to (in my case is /home/cloudera/spark-2.1.0-bin-hadoop2.7/) Under folder conf, there is a file called sp...
4
95
1
I'm using spark 1.4.0-rc2 so I can use python 3 with spark. If I add export PYSPARK_PYTHON=python3 to my .bashrc file, I can run spark interactively with python 3. However, if I want to run a standalone program in local mode, I get an error: Exception: Python in worker has different version 3.4 than that in driver 2...
How do I set the driver's python version in spark?
1
0
0
165,951
30,518,362
2015-05-28T22:52:00.000
34
0
0
0
python,apache-spark,pyspark
30,518,974
19
true
0
0
You need to make sure the standalone project you're launching is launched with Python 3. If you are submitting your standalone program through spark-submit then it should work fine, but if you are launching it with python make sure you use python3 to start your app. Also, make sure you have set your env variables in ./...
4
95
1
I'm using spark 1.4.0-rc2 so I can use python 3 with spark. If I add export PYSPARK_PYTHON=python3 to my .bashrc file, I can run spark interactively with python 3. However, if I want to run a standalone program in local mode, I get an error: Exception: Python in worker has different version 3.4 than that in driver 2...
How do I set the driver's python version in spark?
1.2
0
0
165,951