Q_CreationDate stringlengths 23 23 | Title stringlengths 11 149 | Question stringlengths 25 6.53k | Answer stringlengths 15 5.1k | Score float64 -1 1.2 | Is_accepted bool 2
classes | N_answers int64 1 17 | Q_Id int64 0 6.76k |
|---|---|---|---|---|---|---|---|
2017-11-16 16:08:52.893 | Error reported while running pyomo optimization with cbc solver and using timelimit | I am trying to solve Optimisation problem with pyomo (Pyomo 5.3 (CPython 2.7.13 on Linux 3.10.0-514.26.2.el7.x86_64)) using CBC solver (Version: 2.9.8) and specifying a time limit in solver of 60 sec. The solver is getting a feasible solution (-1415.8392) but apparently not yet optimal (-1415.84) as you can see below.
... | You could try to set the bound gap tolerance such that it will accept the other answer. I'm surprised that the solver status is coming back with error if there is a feasible solution found. Could you print out the whole results object? | 0 | false | 1 | 5,206 |
2017-11-16 18:57:00.430 | How to make tkinter Canvas update only on-demand? | I'm writing a graphics program in Python and I would like to know how to make a Canvas update only on-demand; that is, stop a canvas from updating every run of the event loop and instead update only when I tell it to.
I want to do this because in my program I have a separate thread that reads graphics data from standar... | You can't pause the update of the canvas without pausing the entire GUI.
A simple solution would be for you to not draw to the canvas until you're ready for the update. Instead of calling canvas commands, push those commands onto a queue. When you're ready to refresh the display, iterate over the commands and run them.... | 1.2 | true | 1 | 5,207 |
2017-11-16 22:45:05.130 | How to read private messages with PRAW? | I'm creating a Reddit bot with praw, and I want to have the bot do things based on private messages sent to it. I searched the documentation for a bit, but couldn't find anything on reading private messages, only sending them. I want to get both the title and the content of the message. So how can I do this? | Didn't find it in the docs, but a friend who knows a bit of raw helped me out.
Use for message in r.inbox.messages() (where r is an instance of reddit) to get the messages.
Use message.text to get the content, and message.subject to get the title. | 1.2 | true | 1 | 5,208 |
2017-11-17 08:33:35.720 | generalized ordered logit in R or python | I would like to fit a generalized ordered logit model to some data I have. I first tried to use the ordered logit model using the MASS package from R, but it seems that the proportional odds assumption is violated by the data. Indeed, not all independent variables do exert the same effect across all categories of the d... | Try the 'VGAM' package. There is a function called vglm.
example: vglm(Var2~factor(Var1),cumulative(parallel = F),data) generalized order model
cumulative(parallel=T) will perform a proportional odds model.
parallel=F is the default. | 0 | false | 1 | 5,209 |
2017-11-17 13:20:01.893 | how to obtain predictive posteriors in pystan? | I'm trying to move from using stan in R (I've mainly used the brms package) to pystan, but having trouble locating any methods in pystan that will give me predictive posterior distributions for new data. In R, I've been using brms::posterior_linpred() to do this. Does anyone know if this is possible in pystan?
If not, ... | As far as I know, they are not any Python libraries that do what the brms and rstanarm R packages do, i.e. come with precompiled Stan models that allow users to draw from the predictive distribution in the high-level language. There are things like prophet and survivalstan but those are for a pretty niche set of models... | 1.2 | true | 1 | 5,210 |
2017-11-17 21:38:30.977 | Python cx_Freeze __init__ "no module named codecs" | When I run my compiled program (cx_Freeze) it says __init__line 31. no module named codecs.
I have Python 3.6, does anybody know why it says that, and how to maybe fix it?
I have seen the other questions here on StackOverflow, but they don't seem to solve the problem for me and possibly other too.
Thanks in advance! | If you are using cx_Freeze 5.1, there was a bug that resulted in this error. It has been corrected in the source so if you checkout the latest source and compile it yourself it should work for you. If not, let me know! | 0.386912 | false | 1 | 5,211 |
2017-11-18 03:44:07.510 | Python: upgrade my own package | I created and installed a python package by doing the following: coding a bunch of functions in an init.py file and run 'python setup.py install dist' to create a tar.gz, which was installed through pip.
Everything works well and I can import the package and the functions.
I decided to add a new function in the init f... | As @metatoaster suggested, python setup.py develop reflects changes immediately in the environment, and makes the new functions available.
I haven't tried @Paul H's suggestion which is pip install . -e.
Thank you both for your comments, problem is solved. | 1.2 | true | 1 | 5,212 |
2017-11-18 19:52:36.013 | Django not installing in folder where I want | I am new to python/django/pip. I created a virtualenv and I was in the bin dir when I did a pip install django. It created the django files there which is not what I wanted. So I did pip uninstall django. Then I created a folder called web in my virtualenv root and tried pip install again. This time it said loading fro... | You can't tell pip where to install packages. There's a standard place for packages, and that's where it installs them.
pip makes sure it installs utilities (such as django-admin) in the path, so when the virtual environment is activated you can run it. | 0.386912 | false | 1 | 5,213 |
2017-11-19 04:22:36.790 | How to make a code that alters database in background Django | I'm making an elimination style voting website. People log in, vote for their least favorite participant, and at the end of the day the person with the most votes goes inactive. Almost everything works: The log in, the voting, etc. But I have no idea how to make a program that checks for the most votes and alters the d... | The answer is django celery. Its for any tasks which need to be run with a condition. Look at the beats functionality for your use in celery | 0 | false | 2 | 5,214 |
2017-11-19 04:22:36.790 | How to make a code that alters database in background Django | I'm making an elimination style voting website. People log in, vote for their least favorite participant, and at the end of the day the person with the most votes goes inactive. Almost everything works: The log in, the voting, etc. But I have no idea how to make a program that checks for the most votes and alters the d... | If your scenario is just to update the database based on the number of votes, you can straight away go for cron.
Write a script that checks for the votes and changes the status of the user in the database. Schedule it in cron to run it once at the end of the day / poll.
Place the script in a directory that is not reach... | 0.135221 | false | 2 | 5,214 |
2017-11-20 00:55:02.293 | Do A Limit on the Output of a Function in Python | I know you can probably do a limit of a mathematical operation, say the limit of n + 1 as n approaches infinity, but can I do the limit of a function? For instances the limit of dividing to Fibonacci numbers as their index (and value) gets greater, approaching infinity? For example
lim(func, start, approach)
I have loo... | I didn't need to make my integer a symbol.
The code above works. | 1.2 | true | 1 | 5,215 |
2017-11-21 16:30:37.037 | Ejecting/unmounting random USB flash drive in Raspberry pi / Python | So I'm trying to get a working code in Python that will eject/unmount all USB flash drives attached to the Pi (Running Raspbian) - so that they can be removed safely. The final code will be run from within the python program.
Additionally, I'd like to eject/unmount the USB flash drive even if it's in use.
I've looked... | For udisks --detach the parameter should be the device, not the mounting point.
For example, if the USB Disk is /dev/sdb the command would be udisks --detach /dev/sdb
If the command still doesn't work you could try udiskctl power-off -b <device> which should also work. | 1.2 | true | 1 | 5,216 |
2017-11-21 20:52:14.840 | Store a file insde python file | I am not sure what it is called. I have seen a installer program have stored data at the end of the installer script, looked like just a mess of random text, which then got turn into a seperate file upon running the installer. There was some comand that said something like line xxx -> end | file.txt. Im so sorry if thi... | One reason shell scripts do this is that a shell variable cannot contain arbitrary binary data (namely, null bytes). Python variables have no such limitations; just store the data in a variable. | 0 | false | 1 | 5,217 |
2017-11-23 07:04:50.733 | How to use flask-oauthlib with flask-login together? | For now, I'm trying to use flask-oauthlib with flask-login together.
flask-oauthlib provides a simple way to use oauth, but I want a login manager to automatically redirect all users who are not logged in to /login. In flask-login, I can use login_required to accomplish this. But how could I achieve this by flask-oauth... | So, I've spent some time thinking about this (as I want to do it for my own website), and I've come up with a theoretical solution.
From what I understand in my implementation of Google's OAuth API, OAuth is about sending the user on a link to the server that hosts the OAuth keys, and then returning back to the sender.... | 0 | false | 1 | 5,218 |
2017-11-23 11:06:01.290 | How to run Python 3 when I type "python" in windows CMD | I'm wondering how I could run python3 by default when I type python in windows CMD?
This is not a duplicated question because I've added the C:\Python36 to the path variables, so when I type py in CMD, it gives me python 3.6.2, while if I type py2, then it gives me python 2.7.11.
Since now I need to run python script.... | OK! I figured out the issue - The python36 folder was not placed in the C: location. Now I've corrected it and it's working for me! Thanks! | 1.2 | true | 1 | 5,219 |
2017-11-23 11:41:14.587 | I am using the python django, and i wanted to know to get use thingsboard dashboard, and database as postgresql | I am using the Python3, Django and database as Postgresql, and I wanted to use the Thingsboard dashboard in my web application. can anyone pls guide me how can I use this | ThingsBoard has APIs which you can use. You may also customise it based on your requirements. | 1.2 | true | 1 | 5,220 |
2017-11-24 04:30:41.263 | Split string into individual charactor array in jinja2 | I need to convert a string acbdefrg into an array of individual letters [a,b,c,d,e,f,r,g]. I understand how it's done in python through list(your_string).
Hoever this code does not work in jinja2. Is this possible, or will I have to make the array in python and pass it over to jinja? | If you mean to just iterate through the string, you can explicitly make the array in python and pass it into jinja.
Try to minimise logic in jinja as much as possible. | 1.2 | true | 1 | 5,221 |
2017-11-24 08:56:30.230 | Animating modes in openmodal: roving type | I am asking this for mgx4:
I imported a .uff file containing FRF from Experimental Modal Analysis (EMA). I generated the mesh (geometry) of the tested structure with lines and triangle surfaces. I succeed to realize the analysis and extract eigen frequencies and modal damping. What I am still unable to do is to animate... | in animation tab try a right click on model and under "roving type" select
"response roved". | 0 | false | 1 | 5,222 |
2017-11-26 00:07:34.147 | wxpython make StaticText limit | I have an issue with StaticText, and I do not know how to make it accept only the following data = '0123456789.' . Of course, when you type any letter, the letter is automatically deleted. Can you help me please | You probably mean TextCtrl, don't you? You can use a validator, there is an example in the wxPython demo, which is a part of the Docs and Demo package. | 0 | false | 1 | 5,223 |
2017-11-26 10:48:29.250 | Get tkinter widget size in pixels | If I define for example tkinter.Button widget with parameters (width=10, height=1)(in characters) and then I want to retrieve it's size in pixels, how do I do it?
EDIT:
I tried widget.winfo_height() and widget.geometry(), but all these functions return height defined in number of characters. I think it would be possibl... | Ok, I figured it out. We must call widget.update() first before calling widget.winfo_height(). | 0.999753 | false | 1 | 5,224 |
2017-11-27 11:34:52.067 | How to handle android runtime permission with kivy | I found that kivy is very nice framework to build cross platform application and I am very interested in kivy just to do android application as I think is easy and comfortable in kivy.
After trying few examples, I am interested to know how should handle android run time permission for the kivy app.
Actually I had searc... | i know this answer is a little late, but to get permissions you have to specify them before the build. E.g buildozer uses a buildozer.spec. In this file you can specify the permissions you need. | 0.101688 | false | 2 | 5,225 |
2017-11-27 11:34:52.067 | How to handle android runtime permission with kivy | I found that kivy is very nice framework to build cross platform application and I am very interested in kivy just to do android application as I think is easy and comfortable in kivy.
After trying few examples, I am interested to know how should handle android run time permission for the kivy app.
Actually I had searc... | python-for-android doesn't have any code for handling runtime permissions. I expect to look at it sooner rather than later, but there's no ETA for it.
You can probably add the code for it yourself if you're interested and know how. If you'd like to try it, such contributions would be very welcome. | 0.101688 | false | 2 | 5,225 |
2017-11-27 13:53:55.847 | Pycharm shows interpretor version of 2.7 but I have downloaded 3.6? | I'm a complete newbie trying to use pycharm with python but my interpretor shows a version of 2.7 when i have installed 3.6. Totally confused and need help!
On pycharm I do the following steps:
Preferences > Python Console > Python Interpretor
I only see Python 2.7.8 (/Library/Framework/....) and beneath this I see op... | Go to File > Settings > Project > Project Interpreter (it should take you there automatically as soon as you open Settings) and select the version you want to use from the drop-menu. If it is not there, try restarting PyCharm (if it was active whilst the Python 3 installation) - else, it probably means you didn't insta... | 0.201295 | false | 1 | 5,226 |
2017-11-28 06:36:03.657 | how to make ensure one active session per one user using python flask? | how to make ensure one active session per one user using python flask?
Description: if one user logged in two different machines with same credentials
I want mechanism to force logout earlier active sessions of that user with flask and python. Please help me out in this.
I am currently using flask-login, load_user() a... | One way for ensuring this would be by generating a session id from server. You would need to generate a unique session id every time a user logs in and store it in some database against that user. Apart from this you would need to authenticate user every time an endpoint call, which requires user to be logged in, is ma... | 0.673066 | false | 1 | 5,227 |
2017-11-28 11:22:35.953 | python-pptx font size from hierarchy / template / master | [text element].font.size returns None if the element has inherited its size from a parent text style.
The documentation refers to a style hierarchy but doesn't appear to include documentation about it. Does anyone know how you traverse this hierarchy to determine the actual size of a font element if it has inherited it... | The hierarchy governing the inheritance of font style is knowledge that belongs to the ill-documented black arts of PowerPoint. I don't know of a place where it's clearly described.
If I needed to learn it, I would start with a Google search on "powerpoint style hierarchy" to gather candidate participants and then sett... | 0.386912 | false | 1 | 5,228 |
2017-11-28 15:36:43.550 | How do you pass variables using a HTTP post from a JS file/function to a separate python file/function hosted somewhere else? | I have JS running and essentially getting user entries from my HTML session storage and pushing these to a DB. I also need to use a HTTP request to pass a json object containing the entries to a python file hosted somewhere else.
Does anyone have any idea of documentation I could look at, or perhaps how to get JSON ob... | You have to create some sort of communication channel between the javascript and python code. This could be anything, SOAP, HTTP, RPC, any number of and flavor of message queue.
If nothing like that is in place, it's quite the long way around. A complex application might warrant you doing this, think micro services co... | 1.2 | true | 1 | 5,229 |
2017-11-30 11:54:14.293 | unzipping an html link with python | I have an HTML web page with many download links in a table. I have isolated the path to my desired zips. They all contain an .xlsx file but sometimes other files.
Is there a way to avoid downloading the zips and directly accessing the files inside?
If I do need to download them, how can I track where the zips have b... | Is there a way to avoid downloading the zips and directly accessing the files inside?
Generally speaking : no. A web server serves files in a file system, not in a zip archive.
If I do need to download them, how can I track where the zips have been downloaded to? (So I can extract the .xlsx)
If not specified, the lo... | 0.386912 | false | 1 | 5,230 |
2017-12-01 02:13:52.973 | Load classifier on Heroku Python | I am loading a cascade classifier from a file in OpenCV using python. Since the CascadeClassifier() method requires the filename to be the absolute filename, I have to load the absolute filename.
However, I am deploying and using it on Heroku and I can't seem to get the absolute path of the file. I've tried using os.ge... | I figured it out. All I needed to do was use the os.path.abspath() method to convert the relative path to an absolute path | 0 | false | 1 | 5,231 |
2017-12-01 09:43:23.013 | Debugging pytests in Pycharm with pdb shows annoying console | I have a series of tests that are quite complicated. Unfortunately, the builtin Pycharm Debugger is waaay too slow to handle them. I tried making it faster, but any attempts failed, so I have to resort to using pdb.
My problem is that the command line that appears if I run my tests with pycharm and come across a pdb b... | A few things that might help you with debugging speed are:
using Python 3.5/3.6.
If you're running in linux/macos install the cython extension (you get prompted)
Use the latest Pycharm, 2017.3 at this moment.
Try to simplify tests. If not possible, just run those you need for the debugging process by creating a sp... | 0 | false | 1 | 5,232 |
2017-12-01 22:07:08.593 | How to change interpreter in Visual Studio Code? | I have installed on my system several Python interpreters, 2.x and 3.x versions. I am trying to prepare my work environment to allow easily switch between code written in both Python version. It is really important to have as much flexible setting in Visual Studio Code (VSC).
The problem is that I have no idea how to s... | At the bottom of the MS Code screen is an info bar that lets you know what line, col, text encoding, etc... It also shows the python interpreter you are accessing.
If you click on the text for the version of python that is running, it will open a list of available interpreters on your system. If 2.7 is in your path, yo... | 0.201295 | false | 1 | 5,233 |
2017-12-02 04:44:08.627 | Making items appear from obstacles in game? | I'm making a game using Pygame where there are random obstacles on the screen (like boxes). The boxes can be removed by the player when they place a bomb next to it. I have some items that I would like to have randomly appear in place of the box if it is removed. I'm not sure how to go about this logically. Does anyone... | In order to have the box removed you need to call a ~destructor function on it, which would remove the image of the box and so on correct?
Take advantage of that and create a function that chooses which item to spawn (could be random, up to you) in the position where the box used to be.
Then call this function at the ... | 1.2 | true | 1 | 5,234 |
2017-12-02 08:53:16.947 | YOLO - tensorflow works on cpu but not on gpu | I've used YOLO detection with trained model using my GPU - Nvidia 1060 3Gb, and everything worked fine.
Now I am trying to generate my own model, with param --gpu 1.0. Tensorflow can see my gpu, as I can read at start those communicates:
"name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.6705"
"totalMem... | Problem solved. Changing batch size and image size in config file didn't seem to help as they didn't load correctly. I had to go to defaults.py file and change them up there to lower, to make it possible for my GPU to calculate the steps. | 0 | false | 2 | 5,235 |
2017-12-02 08:53:16.947 | YOLO - tensorflow works on cpu but not on gpu | I've used YOLO detection with trained model using my GPU - Nvidia 1060 3Gb, and everything worked fine.
Now I am trying to generate my own model, with param --gpu 1.0. Tensorflow can see my gpu, as I can read at start those communicates:
"name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.6705"
"totalMem... | Look like your custom model use to much memory and the graphic card cannot support it. You only need to use the --batch option to control the size of memory. | 0 | false | 2 | 5,235 |
2017-12-03 17:40:46.813 | when should I write custom methods in model vs model manager/ queryset | when should I write methods in the model itself and when in the model manager?
is it like all methods to get something should be written in manager and others in model | There's a simple difference. Model methods act on a single instance. Manager methods create queries to act on multiple instances. | 1.2 | true | 1 | 5,236 |
2017-12-04 10:32:39.690 | Is there any way to update zone in specific views using dnspython? | Just like the title. I was struggling to work with that, but I couldn't find any way to make that work.
Is there anyone know how to do that. Please help, thanks! | Finally, this problem has been solved by changing the match-clients dynamically through ssh and then rndc reload. This make the remote server only access to the specific view in which you want to update the zone using dnspython. | 0 | false | 1 | 5,237 |
2017-12-05 15:03:49.557 | Exchangelib - Get meeting organizer mail | I'm currently using the exchangelib library in python. I would like to compare the mail of the account connected to exchangelib and the mail of a meeting organizer. I can have the account mail by typing "account.primary_smtp_address" but I don't know how I could get the meeting organizer mail.
For now i can only get th... | The meeting organizer is available on CalendarItem objects as item.organizer. | 1.2 | true | 1 | 5,238 |
2017-12-06 00:45:48.063 | How to disable stopOnEntry for files that are opened without a workspace? | When I open a python file without a workspace and start debugging it, the debugger breaks on the first line. I would like to change this behaviour, but I don't know how to do it for files that are opened without a workspace. | Open launch.json (gear icon when on debugger tab). Find the section for the python debugger you are using. Change "stopOnEntry" from true to false. Save. | 0 | false | 1 | 5,239 |
2017-12-06 09:37:29.177 | How to convert Python project into executable | I have a Python project that I want to convert into an executable. I have installed Pyinstaller. I only know how to convert one single script into .exe, but I have multiple packages with multiple python scripts. | Converting the main script into .exe should solve the problem, use -onefile to convert it to one exe and rest of the .py files should be included. | -0.135221 | false | 2 | 5,240 |
2017-12-06 09:37:29.177 | How to convert Python project into executable | I have a Python project that I want to convert into an executable. I have installed Pyinstaller. I only know how to convert one single script into .exe, but I have multiple packages with multiple python scripts. | 1) Open the command prompt
2) Install pyinstaller
Pip install pyinstaller
3) Test your python script first just to check python script should work with normal
.py extension. Saurabh is the name of python file
python saurabh.py
4) Convert the python into executable file
pyinstaller --onefile S... | -0.135221 | false | 2 | 5,240 |
2017-12-08 07:09:49.293 | Getting a Linux terminal output of a CLI tool and displaying in Web page | I am trying to create a web application using python which has a HTML form and the form data is used as a command line input to start an application. I know how to initiate the CLI tool from web app, but want a way to get the output of the CLI tool from Linux terminal real time and show it in the web application.
The ... | A quick solution I would do (without any libraries or stuff):
invoke your CLI program and set it up to continuously output to a file on the server. Make sure you know the file name.
use Ajax calls to fetch the output to the client. OR (if you are in for hard stuff) use a webSocket to output to the client. | 0 | false | 1 | 5,241 |
2017-12-08 07:30:50.413 | Regex in Python. How to match a string but not in comments? | I want to match any Chinese character in "", but not in the comment of Lua, i.e: after --.
For example, in string Tips("中文") -- "注释",中文 should be matched, but not 注释.
The regex I write is ur'(?<!--.*?)"([\u4e00-\u9fff]+)"',but Python gives an error: look-behind requires fixed-width pattern.
So how to fix this? | You could just capture all Chinese characters between quotes, capture any comment start ´--´ indicators, and then throw away all the matches after that indicator. | 0 | false | 1 | 5,242 |
2017-12-08 18:23:48.387 | Linux editing privilege over webservice | I'm currently working on a project, which will dynamically fetch some informations of my job and display them in a html page. To accomplish this i wrote a python script, which will be invoked using a PHP webservice. The script needs to edit some files in order to work.
Basically PHP executes the script using
$output ... | As suggested by @wpercy you have figure out which user is executing the file. Usually that user is called www-data !
To find out which user is calling the service use
ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1
After you figured out the user you have to chan... | 1.2 | true | 1 | 5,243 |
2017-12-11 10:43:17.400 | How do I use python 3 on terminal Mac | When I run python someCode.py in my terminal, I am actually using python 2.7
I have installed python 3.6 on my Mac and would like to use it in terminal. how can I do that? | Just type python3 where you would have typed python.
For example open repl type python3 run app.py program with python3.6 type python3 app.py | 1.2 | true | 2 | 5,244 |
2017-12-11 10:43:17.400 | How do I use python 3 on terminal Mac | When I run python someCode.py in my terminal, I am actually using python 2.7
I have installed python 3.6 on my Mac and would like to use it in terminal. how can I do that? | type python3 on command window/ terminal window & press enter
for exit from python type quit() & press enter | 0.201295 | false | 2 | 5,244 |
2017-12-11 17:00:36.693 | Jupyternotebook corrects groupby to groupyouby Python | I don't know how this happens or why,
but I'll be in a jupyter notebook grouping by things and I will very conciously type in dataframe.groupby, write some other code and hit ctrl+ enter
and there will be that damn error. Every single time, I will go back and delete the 'groupyouby' and type in groupby.
I doubt that ... | Grammarly was the cause of this.
If you use jupyter notebooks and have the grammarly extension. It will cause problems. | 1.2 | true | 1 | 5,245 |
2017-12-11 17:36:48.310 | How do I write test cases for my AWS Python-based lambda project? | I have implemented a lambda project which has 4 modules/project inside it. Each module/project has python(s) files which implement module functionality.
I have to write the test cases for each module so that it goes through CircleCI and execute on themselves:
That the module is starting and stopping a stepfunction.
mo... | When it comes to unit testing, there's nothing special you have to do about AWS Lambda projects.
You Lambda handler is a Python function. Therefore, you can import it on your tests, call it with some input, and assert the output. Just like a normal Python function. | 0.386912 | false | 1 | 5,246 |
2017-12-12 03:19:13.457 | how to monitor changes in file without cron job in AIX | I am trying to monitor a file and if there is a change file I need to execute a script but the catch is cron job is not allowed, also this will be executed on AIX system.
Can somebody help me here on how to proceed.Thank You | One way I can think of is to write a daemon (another script perhaps) and keep checking the file for changes.
It is possible to write a script with infinite loop and the loop can contain the file check logic. | 0 | false | 1 | 5,247 |
2017-12-12 13:39:13.707 | Jenkins command to display all file in directory? | I have created a workspace and clone all files in to that. Now, I'm running my code through jenkins. Can anyone assist how to display all the files in my workspace through any command. I tried with ${workspace} dir in Jenkins but it is showing any output.
Basically, if you are at any folder in your system and you open ... | Just dir no ${workspace}
bat 'dir' in a pipeline script.
Select a "execute batch command" option and write the commands you want to execute in there.
Then check the console output of the build which was successful. | 1.2 | true | 1 | 5,248 |
2017-12-13 07:11:08.793 | I am unable to import apiai on pycharm? | I tried import apiai on pycharm, but it didn't work so I ran pip install apiai then freezed to the requirements.txt it still didn't work on pycharm.
I went and tested my code in the prompt after i ran it in the env environment and it worked just fine.
My question is how can i make it work on pycharm too ? | On pycharm go to
File > Settings > project interpreter.. Under this add your env as an interpreter. | 1.2 | true | 1 | 5,249 |
2017-12-13 13:37:35.373 | OpenCV perspective transform with camera roll and pitch correction | I am performing some perspective transforms on camera images, however in certain cases the roll and pitch of the camera are not zero. In other words, the camera is not level and I would like to be able to correct for this.
I have some questions:
1) Can the transformation matrix (from M = cv2.getPerspectiveTransform(...... | If the camera motion is approximately a rotation about its optical center / lens entrance pupil (for example, pan-tilt-roll on a tripod with the subject distance much larger than the translation of the optical center), then images taken from rotated viewpoints are related by a homography.
If you know the 3D rotation (p... | 0 | false | 1 | 5,250 |
2017-12-13 15:50:41.423 | How to find WLST python version | In Weblogic how to find WLST python version. Its known that WLST is made up by python.
And Python 2 and Python 3 is different from one another Architecture wise and bit wise. Python 2 available for 64 bit considering Windows OS. Python 3 is still 32-bit as far I know. Python is well known simplest Higher Level Language... | This command will print the Python version used by WLST :
print (sys.version) | 1.2 | true | 1 | 5,251 |
2017-12-13 19:29:24.153 | How to activate different anaconda environment from powershell | I have two environments in anaconda, namely: root, 2env. When I open anaconda prompt, I can switch from root to 2env by typing: activate 2env. I also have conda in my powershell, but when I open powershell and try to run conda activate 2env it gives the following error:
CommandNotFoundError: 'activate'
Any suggesti... | Here is a work around - start cmd shell . Run - activate . Check - conda env list . Start powershell - powershell . | -0.327599 | false | 4 | 5,252 |
2017-12-13 19:29:24.153 | How to activate different anaconda environment from powershell | I have two environments in anaconda, namely: root, 2env. When I open anaconda prompt, I can switch from root to 2env by typing: activate 2env. I also have conda in my powershell, but when I open powershell and try to run conda activate 2env it gives the following error:
CommandNotFoundError: 'activate'
Any suggesti... | I have been battling this issue for a while. I found a solution by using a batch script and calling call activate %env%. I hope this can help somebody. | 0.067922 | false | 4 | 5,252 |
2017-12-13 19:29:24.153 | How to activate different anaconda environment from powershell | I have two environments in anaconda, namely: root, 2env. When I open anaconda prompt, I can switch from root to 2env by typing: activate 2env. I also have conda in my powershell, but when I open powershell and try to run conda activate 2env it gives the following error:
CommandNotFoundError: 'activate'
Any suggesti... | I found this command while using vs code & cmd /k "activate <env> & powershell" .
It is working | 0.496174 | false | 4 | 5,252 |
2017-12-13 19:29:24.153 | How to activate different anaconda environment from powershell | I have two environments in anaconda, namely: root, 2env. When I open anaconda prompt, I can switch from root to 2env by typing: activate 2env. I also have conda in my powershell, but when I open powershell and try to run conda activate 2env it gives the following error:
CommandNotFoundError: 'activate'
Any suggesti... | Open PowerShell.
Run conda init (not conda init powershell as the accepted answer suggests).
Close and re-open PowerShell.
Use conda normally. | 0 | false | 4 | 5,252 |
2017-12-15 06:44:04.390 | Suggestion on LDA | I am trying to do textual analysis on a bunch (about 140 ) of textual documents. Each document, after preprocessing and removing unnecessary words and stopwords, has about 7000 sentences (as determined by nlkt's sentence tokenizer) and each sentence has about 17 words on average. My job is to find hidden themes in thos... | I have worked on similar lines. This approach can work till 300 such documents. But, taking it to higher scale you need to replicate the approach using spark.
Here it goes:
1) Prepare TF-IDF matrix: Represent documents in terms Term Vectors. Why not LDA because you need to supply number of themes first which you don't ... | 0 | false | 1 | 5,253 |
2017-12-15 12:44:44.497 | Is there a way with python-selenium to wait until all elements of a page has loaded? | I am asking for generally checking if all elements of a page has been loaded. Is there a way to check that basically?
In the concrete example there is a page, I click on some button, and then I have to wait until I click on the 'next' button. However, this 'Next' button is available, selectable and clickable ALL THE T... | Reliably determining whether a page has been fully loaded can be challenging. There is no way to know if all the elements have been loaded just like that. You must define some "anchor" points in each page so that as far as you aware, if these elements has been loaded, it is fair to assume the whole page has been loaded... | 0 | false | 1 | 5,254 |
2017-12-16 00:14:49.453 | Turtle direction in turtle graphics? | How can I tell a turtle to face a direction in turtle graphics?
I would like the turtle to turn and face a direction no matter its original position, how can I achieve this? | You can use:
turtle.right(angle)
or:
turtle.left(angle).
Hope this helps! | 0.058243 | false | 1 | 5,255 |
2017-12-18 07:11:17.497 | how to change bundled data file pyinstaller on execute | I'm making onefile executables with pyinstaller on windows 10. I'm including data files (pickle files) by editing the .spec file...
How can I store changes made to these files during run time? My understanding is that the data files are copied to a temp directory during execution. I can read from the files using the pa... | Do not mention the pickle file to pyinstaller and put the pickle file in the same folder than the bundled onefile. For me this works even if you have two files in the folder instead of one. | 0 | false | 1 | 5,256 |
2017-12-19 01:11:36.147 | MessageBird: How to read a response from consumer | I am evaluating MessageBird service. I got a Virtual Mobile Number. I am able to send message to dummy numbers (until i get approval for sending messages to real USA number)
Unknown: My problem is about reading the messages received by a VMN.
Details: If I as a VMN owner send a message to consumer e.g. +1(111)111-1111... | Messagebird have a feature of forward incoming sms data through webhook(get or post method). if you set an url then Messagebird will forward every incoming sms to you(or your server). You can easily read get/post response. | 0 | false | 1 | 5,257 |
2017-12-20 22:01:51.590 | How to access Anaconda command prompt in Windows 10 (64-bit) | I had to install the 64-bit version of Anaconda with python 3.5 in Windows 10. I followed the default settings (AppData/Continuum/Anaconda3). However, after installation, I am unsure how to access the Anaconda command prompt so that I can use conda to install packages. I also attempted to install Anaconda 64 bit in C:/... | Go with the mouse to the Windows Icon (lower left) and start typing "Anaconda". There should show up some matching entries. Select "Anaconda Prompt". A new command window, named "Anaconda Prompt" will open. Now, you can work from there with Python, conda and other tools. | 1 | false | 4 | 5,258 |
2017-12-20 22:01:51.590 | How to access Anaconda command prompt in Windows 10 (64-bit) | I had to install the 64-bit version of Anaconda with python 3.5 in Windows 10. I followed the default settings (AppData/Continuum/Anaconda3). However, after installation, I am unsure how to access the Anaconda command prompt so that I can use conda to install packages. I also attempted to install Anaconda 64 bit in C:/... | If Anaconda Prompt is missing, you can create it by creating a shortcut file of Command Prompt (cmd.exe) and change its target to:
%windir%\System32\cmd.exe "/K" <Anaconda Location>\anaconda3\Scripts\activate.bat
Example:
%windir%\system32\cmd.exe "/K" C:\Users\user_1\AppData\Local\Continuum\anaconda3\Scripts\activate.... | 0.265586 | false | 4 | 5,258 |
2017-12-20 22:01:51.590 | How to access Anaconda command prompt in Windows 10 (64-bit) | I had to install the 64-bit version of Anaconda with python 3.5 in Windows 10. I followed the default settings (AppData/Continuum/Anaconda3). However, after installation, I am unsure how to access the Anaconda command prompt so that I can use conda to install packages. I also attempted to install Anaconda 64 bit in C:/... | I added "\Anaconda3_64\" and "\Anaconda3_64\Scripts\" to the PATH variable. Then I can use conda from powershell or command prompt. | 0.591696 | false | 4 | 5,258 |
2017-12-20 22:01:51.590 | How to access Anaconda command prompt in Windows 10 (64-bit) | I had to install the 64-bit version of Anaconda with python 3.5 in Windows 10. I followed the default settings (AppData/Continuum/Anaconda3). However, after installation, I am unsure how to access the Anaconda command prompt so that I can use conda to install packages. I also attempted to install Anaconda 64 bit in C:/... | To run Anaconda Prompt using an icon, I made an icon and put:
%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 (The file location would be different in each computer.)
at icon -> right click -> Property -> Shortcut -> Target
I see %HOMEPATH% at icon -> right click ->... | 0.99039 | false | 4 | 5,258 |
2017-12-21 13:06:03.023 | The best way to read a lot of messages from RabbitMQ queue? | I'm writing Python script cron-job, which is periodically get updates from RabbitMQ and process them. Every time I process them I need only to get current snapshot of RMQ queue. I use queue_declare to get number of messages in it.
I know how to get messages one by one with basic_get. Also, I can use basic_consume/start... | The best way to consume the messages is using basic_consume.
basic_get is slow | 1.2 | true | 1 | 5,259 |
2017-12-21 21:08:18.767 | Configuring interpreter in PyCharm: "please use a different SDK name" | I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.
Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new... | I had the same problem while setting up the virtual environment for my project and no matter if I create a new virtual environment or select an existing one, I get the warning:
"Cannot Save Settings please use a different SDK name"
Finally I found the solution:
Click on the project interpreter dropdown and select sho... | 0.998178 | false | 6 | 5,260 |
2017-12-21 21:08:18.767 | Configuring interpreter in PyCharm: "please use a different SDK name" | I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.
Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new... | How fix this in Windows 10:
close Pycharm .
delete this file: C:\Users\<username>\.PyCharmCE2018.3\config\options\jdk.table.xml
open Pycahrm again and load all python interceptors again. | 0.16183 | false | 6 | 5,260 |
2017-12-21 21:08:18.767 | Configuring interpreter in PyCharm: "please use a different SDK name" | I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.
Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new... | In my case, I moved my project to a different location and PyCharm started complaining about Cannot Save Settings please use a different SDK name. At the top of the main editor, it asks me to Configure Project Interpreter. I clicked it, and then ...
My solution
Remove all existing interpreters that are marked as inval... | 0 | false | 6 | 5,260 |
2017-12-21 21:08:18.767 | Configuring interpreter in PyCharm: "please use a different SDK name" | I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.
Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new... | I ran into this issue when trying to get docker up and running with Pycharm 2018.1 and using the container's Interpreter. I would get the error below.
"Cannot Save Settings please use a different SDK name"
The issue I had was due to having multiple python interpreters of the same name.
Under Pycharm || Preferences ... | 0.386912 | false | 6 | 5,260 |
2017-12-21 21:08:18.767 | Configuring interpreter in PyCharm: "please use a different SDK name" | I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.
Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new... | Go to Project > Project Interpreter > Select the dropdown menu > "Show All".
For me, there were several Python environments, two of which were red with an tag. Remove the envs that are red / have an tag, select the remaining valid one, and re-apply settings. | 0.040794 | false | 6 | 5,260 |
2017-12-21 21:08:18.767 | Configuring interpreter in PyCharm: "please use a different SDK name" | I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.
Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new... | You cannot have 2 or more virtual environments with same name. Even if you have projects with same name stored at 2 different places, please give unique name to its venv. This will solve your problem.
To check all the virtual environments:
Go to File >> Settings >> Project: your_project_name >> Project Interpreter
And ... | 0.040794 | false | 6 | 5,260 |
2017-12-22 12:06:23.863 | Able to fetch text with their locations from an image...How can I form sentence? | I am using online library and able to fetch words from an image with their locations.
Now I want to form sentences exactly like which are in image.
Any idea how can I do that?
Earlier i used the distance between two words and if there are pretty close then it means it is a part of a sentence but this approach is not wo... | I don't if I am understanding your problem correctly, but I'm assuming each dictionary in your json is giving you the coordinates for a word.
My approach would be to first find the difference in pixels for the space between any 2 words, and you use this value to detect the sequence of words.
For example:
img1 = {'coord... | 0 | false | 1 | 5,261 |
2017-12-22 12:37:11.323 | Edit boolean and operator | So I've been messing around with the standard operators in classes to try and see what i can make, but i haven't been able to find how to edit the boolean and operator.
I can edit the bitwise &operator by defining __and__(self), but not the way that and behaves. Does anyone know how I can change the behavior of a and b... | The and operator converts the first operands to boolean using __bool__, and then does a predefined action to the booleans (if first.__bool__() is True, return second, else return first). There is no way to change this behavior. | 0.673066 | false | 1 | 5,262 |
2017-12-22 19:34:31.393 | Python fbprophet - export values from plot_components() for yearly | Any ideas on how to export the yearly seasonal trend using fbprophet library?
The plot_components() function plots the trend, yearly, and weekly.
I want to obtain the values for yearly only. | There is a simple solution in the current version of the library. You can use from the predicted model fc. What you want for the value of yearly can be found with fc['yearly'] without using the functions in the above solution.
Moreover, if you want all the other components like trend, you can use fc['trend']. | 0.545705 | false | 1 | 5,263 |
2017-12-23 21:12:04.870 | Call python script from web page and get results | So, my project does a lot of mathematics for the user. It lets them enter equations and then solves them with some fairly complicated items like eigenvalues. I do some of this is javascript, but I have also written a python script utilizing numpy. I would like the user to be able to have the option of having the script... | Short answer is: no, this isn't possible.
Sure, they can download your script and run it themselves if they have a compatible version of Python installed, but you won't be able to run it from the browser (that would be a severe security problem!)
Your options are either to write it in JS, or create an API on your serve... | 0 | false | 1 | 5,264 |
2017-12-23 22:28:26.373 | How do websites detect bots? | I am learning python and i am currently scraping reddit. Somehow reddit has figured out that I am a bot (which my software actually is) but how do they know that? And how we trick them into thinking that we are normal users.
I found practical solution for that, but I am asking for bit more in depth theoretical underst... | There's a large array of techniques that internet service providers use to detect and combat bots and scrapers. At the core of all of them is to build heuristics and statistical models that can identify non-human-like behavior. Things such as:
Total number of requests from a certain IP per specific time frame, for exa... | 1.2 | true | 1 | 5,265 |
2017-12-25 05:57:41.003 | Video embedding | I have a Django site that I want to add videos. Currently users can upload their photos and I want each user to be able to add their videos as well. I am not sure how to do this, since I am a beginner programmer. Can you please direct me to right way? | Handling video files is much more complicated than dealing with images. There are two ways you can do it: you let users embed videos uploaded to other sites (like youtube) or you let them upload photos to your website. The first option is easier: most of the video websites offer some way to copy&paste a code to embed t... | 1.2 | true | 1 | 5,266 |
2017-12-25 08:22:36.043 | When I use pycharm to run code, the error "OSError: [Errno 49] Can't assign requested address" happended. | More details:
Macbook Air 10.12.6 (16G1036);
Python version: python3.6
IDE: Pycharm 2017.3.1
Error:
Users/lrh/PycharmProjects/TensorFlowDemo/venv/bin/python /Applications/PyCharm.app/Contents/helpers/pydev/pydev_run_in_console.py 51562 51563 /Users/lrh/PycharmProjects/TensorFlowDemo/demo1.py
Error starting server with ... | Because the console uses the port 51562 and 51563. So you might didnt exit a program correctly to cause the ports are still using. | 0 | false | 1 | 5,267 |
2017-12-25 11:20:38.770 | Python Pip Install For Specific Version | how do I go about installing for python2.7 version only?
Right now when I run this : python -m pip install requests tweepy python-bittrex
It's only for python 3
I'd like to install for python 2
(I have both versions installed)
THanks | There might be a conflict with environment variables.
Try this
python2.7 -m pip install | 0 | false | 1 | 5,268 |
2017-12-26 13:36:47.167 | Alembic, how do you change the name of the revision database? | I am working with alembic and it automatically creates a table called alembic_revision on your database. How, do I specify the name of this table instead of using the default name? | After you run your init. Open the env.py file and update context.configure, add version_table='alembic_version_your_name as a kwarg. | 1.2 | true | 1 | 5,269 |
2017-12-27 07:48:09.470 | Transparent IMAPs proxy | I would like to implement a transparent IMAPS (SSL/TLS) proxy from zero using python (pySocks and imaplib).
The user and the proxy are in the same network and the mail server is outside (example: gmail servers). All the traffic on port 993 is redirected to the proxy. The user should retrieve his emails using his favori... | You must implement your proxy as a Man In The Middle attack. That means that there are two different SSL/TLS encrypted communication channels: one between the client and the proxy, one between the the proxy and the server. That means that either:
the client explicitely sets the proxy as its mail server (if only few se... | 1.2 | true | 1 | 5,270 |
2017-12-27 08:43:49.883 | How does Keras read input data? | I am using Keras for a project and I don't understand how Keras uses data input, that is to say how Keras reads our input data when creating the first layer.
For example:
model = Sequential()
model.add(Dense(10, activation='sigmoid', input_dim=3,name='layer1'))
In this model, what does it mean to have 10 neurons an... | input_dim=3 means that your data have 3 features which will be used to determine final result eg. if you want to determine what animal data refer to you could put width, height and color as data.
100 examples of different animals widths, heights and colors combinations allow neural network to adjust its parameters (lea... | 1.2 | true | 1 | 5,271 |
2017-12-27 23:15:51.113 | How to create a role for a Discord Bot | I am using discord.py to create my bot and I was wondering how to create roles/permissions specific to the bot?
What that means is when the bot enters the server for the first time, it has predefined permissions and role set in place so the admin of the server doesn't need to set a role and permissions for the bot.
I ... | you want to do this through oath2 using the url parameters | 1.2 | true | 1 | 5,272 |
2017-12-28 13:56:13.273 | Django URLs from different apps in just the base one | So I have 2 apps for my django project. In the default mysite folder, you have the urls.py file. I cant seem to find out how to write all my urls for all the apps in just the one urls.py file.
I have tried this:
from reviews.models import *
however that isnt working.
Thanks for any help! | Just realised that i was importing the models instead of the views.
the code above should be from reviews.views import * | 0 | false | 1 | 5,273 |
2017-12-29 00:40:46.640 | Unable to use pyodbc with aws lambda and API Gateway | I am trying to build a AWS Lambda function using APi Gateway which utlizes pyodbc python package. I have followed the steps as mentioned in the documentation. I keep getting the following error Unable to import module 'app': libodbc.so.2: cannot open shared object file: No such file or directory when I test run the Lam... | Fisrt, install unixODBC and unixODBC-devel packages using yum install unixODBC unixODBC-devel. This step will install everything required for pyodbc module.
The library you're missing is located in /usr/lib64 folder on you Amazon Linux instance.
Copy the library to your python project's root folder (libodbc.so.2 is ju... | 0.067922 | false | 1 | 5,274 |
2017-12-29 01:00:02.973 | Using openpyxl to refresh pivot tables in Excle | I have a file that has several tabs that have pivot tables that are based on one data tab. I am able to write the data to the data tab without issue, but I can't figure out how to get all of the tabs with pivot tables to refresh.
If this can be accomplished with openpyxl that would be ideal. | Currently what I do is in my template I create a dynamic data range that gets the data from the raw data sheet and then I set that named range to the tables data source. Then in the pivot table options there is a "refresh on open" parameter and I enable that. When the excel file opens it refreshes and you can see it ... | 0 | false | 2 | 5,275 |
2017-12-29 01:00:02.973 | Using openpyxl to refresh pivot tables in Excle | I have a file that has several tabs that have pivot tables that are based on one data tab. I am able to write the data to the data tab without issue, but I can't figure out how to get all of the tabs with pivot tables to refresh.
If this can be accomplished with openpyxl that would be ideal. | If the data source range is always the same, you can set each pivot table as "refresh when open". To do that, just go to the pivot table tab, click on the pivot table, under "Analyze" - > Options -> Options -> Data -> select "Refresh data when opening the file".
If the data source range is dynamic, you can set a named... | 0.101688 | false | 2 | 5,275 |
2017-12-29 11:18:23.197 | GLADE & Pygtk: how to split dynamically windows? | I made a GLADE file, a main window of type "GtkNotebook" and there are several pages in it (Window1 = Page1, Page2, Page3, Page4).
a) Is it possible, like a web-browser, to take one of this page and separate it from the main windows? Example Page4 taken away with the cursor would create a Windows2
b) If not (I could n... | I think that is not posible to do dinamically.
As you know on Pygtk we load the glade file by this way wTree = gtk.glade.XML("localize.glade") only once time, and after that we have on scope the access to all tree of controls and componets.
If you have a window loaded, you can load another window, but not pull apart a ... | 0 | false | 1 | 5,276 |
2017-12-30 07:18:04.467 | Debugging htcondor issue running python script | I am submitting a python script to condor. When condor runs it it gets
an import error. Condor runs it as
/var/lib/condor/execute/dir_170475/condor_exec.exe. If I manually copy
the python script to the execute machine and put it in the same place
and run it, it does not get an import error. I am wondering how to
debug ... | You can simply run an interactive job (basically just a job with sleep or cat as command) and do ssh_to_job to run it.
Generally you need to set-up your python environment on the compute node, it is best to have a venv and activate it inside your start script. | 0.386912 | false | 1 | 5,277 |
2017-12-30 18:28:00.883 | Acceptance-rate in PyMC3 (Metropolis-Hastings) | Does anyone know how I can see the final acceptance-rate in PyMC3 (Metropolis-Hastings) ? Or in general, how can I see all the information that pymc3.sample() returns ?
Thanks | Let step = pymc3.Metropolis() be our sampler, we can get the final acceptance-rate through
"step.accepted"
Just for beginners (pymc3) like myself, after each variable/obj. put a "." and hit the tab key; you will see some interesting suggestions ;) | 0 | false | 1 | 5,278 |
2017-12-31 03:12:10.067 | How to take only positive values in a list in Python? | I am wondering how I can take only positive values in a list in Python.
For example, if I have A = [1, 2, 3], it should return [1, 2, 3]
If I have A = [-1, 2, 3], it should return [2, 3]
if I have A = [-1, -2], it should return None
Thank you very much! | You can try newlist = filter(lambda a: a > 0, [1, 2, 3]) or None or [i for i in original_list if i > 0] or None | 0.265586 | false | 1 | 5,279 |
2017-12-31 06:45:24.493 | How to install pip for a total newbie | I have read a bunch of posts here and on Google, but my question is far more basic than the answers: If Python(2.7) came pre-installed on my MacBook Pro (High Sierra), can I just do sudo easy_install pip (as suggested) from the command line--withOUT causing issues? I have a vague understanding of global/local installat... | Well although I am no Mac expert I've given it a shot anyway:
Yes you could but do you really want to risk it (or even do it)?
Mac-OS must rely on Python to fulfill something in the OS otherwise it would not come inbuilt. This means two things:
The Python installation will be minimal. By that I mean it will have thi... | 0.135221 | false | 1 | 5,280 |
2017-12-31 08:40:16.540 | Coding mental block with specific Django task | I've been thinking of this for a LONG time the past few days and can't figure out with my current toolset how to implement this in Django.
What I want is something that can be implemented trivially in Java for example, but how I'd do that on the web is much more difficult
The problem
I want to send data to a HTML templ... | A pure django solution would be:
create a form with three integer fields (say, num1, num2 and result)
in your view, populate num1 and num2 with the numbers to be added
render the form in your template (num1 and num2 fields should be read only)
the user enters the answer in the result field and submits the form
in your... | 1.2 | true | 1 | 5,281 |
2017-12-31 10:03:50.110 | pyinstaller -- script not found. | I'm trying to learn how to use pyinstaller to make an executable. I wrote a little script in 2.7 as a test. Print 'test" and named it test-print. When I click on the executable in the Build folder a cmd screen flashes, and that all she wrote. I tried adding a x = raw_input('input something: ') hoping that would cause ... | In pyinstaller the actual executable is located in the dist folder. I assume you did not use pyinstallers "--onefile" switch so once you finish compiling, navigate to dist then test-print. Afterwards look for test-print.exe in that folder. That is your executable. | 0 | false | 2 | 5,282 |
2017-12-31 10:03:50.110 | pyinstaller -- script not found. | I'm trying to learn how to use pyinstaller to make an executable. I wrote a little script in 2.7 as a test. Print 'test" and named it test-print. When I click on the executable in the Build folder a cmd screen flashes, and that all she wrote. I tried adding a x = raw_input('input something: ') hoping that would cause ... | First try running the command from a command line (terminal) so you can see what happens. Not from inside any IDE.
If you created the script in a MSWindows environment, be sure your PATH includes the executable (or explicitly give the path to the script).
In Linux/Unix, be sure to enable execute permission for the scr... | 0 | false | 2 | 5,282 |
2017-12-31 11:13:44.060 | Making a x86 .exe on a x64 machine | and thank you for your answer in advance. I am making a python program to automate something for my friend, and converted it into a .exe file with cx_Freeze so I could give it to him. But I have a x64 machine and he has a x86 machine. Can anyone please tell me how to make a x86 .exe file on my PC. I'm using Win 10 x64 ... | The .exe output actually depends on the installation you are using (I'm assuming x64) so if you used an x86bit or x32bit Python installation it will output the bit version your installation is (I know both will run on x64 computers) and just freeze in the normal way.
Bear in mind that x32 works on x86, x64 as well so... | 0 | false | 1 | 5,283 |
2017-12-31 14:20:36.053 | Using 32-bit and 64-bit Python - "NameError: global name 'numpy' etc. is not defined" | I was having a memory error in Python with a program, I found out I had to upgrade my Python to 64 bit. I did that. I then copied all the files from the Lib/site-packages folder of the Python 32 bit and pasted it in the 64 bit folder. I did this so I wouldn't have to install the modules again for my program.
I ran the... | In Windows I use always this:
Rename the pip.exe to pip64.exe for example
Add python folder to Sys path if not exists.
You can use "pip64 install package_name" | 0 | false | 3 | 5,284 |
2017-12-31 14:20:36.053 | Using 32-bit and 64-bit Python - "NameError: global name 'numpy' etc. is not defined" | I was having a memory error in Python with a program, I found out I had to upgrade my Python to 64 bit. I did that. I then copied all the files from the Lib/site-packages folder of the Python 32 bit and pasted it in the 64 bit folder. I did this so I wouldn't have to install the modules again for my program.
I ran the... | I then copied all the files from the Scripts folder of the Python 32
bit and pasted it in the 64 bit folder. I did this so I wouldn't have
to install the modules again for my program.
That wasn't a good idea. There are executables in the Scripts folder that are not the same for 32-bit and 64-bit Python. You have t... | 0.135221 | false | 3 | 5,284 |
2017-12-31 14:20:36.053 | Using 32-bit and 64-bit Python - "NameError: global name 'numpy' etc. is not defined" | I was having a memory error in Python with a program, I found out I had to upgrade my Python to 64 bit. I did that. I then copied all the files from the Lib/site-packages folder of the Python 32 bit and pasted it in the 64 bit folder. I did this so I wouldn't have to install the modules again for my program.
I ran the... | For windows Shift-Right-Click on your 64-bit installation folder that has python.exe and select Open command window here. Then type python.exe -m pip install numpy in there and press Enter.
What this does is that it calls 64-bit python's pip to install numpy instead. | 0 | false | 3 | 5,284 |
2018-01-03 21:28:09.170 | Plotly - How to remove the rangeslider | By default, candlestick and ohlc charts display a rangeslider.
It seems like there's no parameter to change the setting. So I've looked at javascript code in html file but was not able to find a clue to remove it.
Can someone explain how to remove the rangeslider from candlestick chart? | I found the solution..
Following code hides the rangeslider graph on the bottom of candle stick chart..
xaxis : {fixedrange: true, rangeslider: {visible: false}} | 1.2 | true | 1 | 5,285 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.