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
42,525,463
2017-03-01T07:17:00.000
0
0
1
1
python,python-3.x,ubuntu
42,525,853
2
false
0
0
You can use sudo dpkg panda3d1.9_1.9.3-xenial_amd64.deb it won't affect your default package.
2
0
0
I downloaded a deb package panda3d1.9_1.9.3-xenial_amd64.deb and I want to install it for Python 3. My OS is Linux Ubuntu 16.04. The default python is 2.7.12 and I would prefer to keep it as default, but Python 3 is installed too and available to use. How do I install this package for Python 3 only? I am not sure pip m...
How do I install a python deb package for Python3 on Ubuntu?
0
0
0
1,157
42,525,463
2017-03-01T07:17:00.000
1
0
1
1
python,python-3.x,ubuntu
42,528,081
2
true
0
0
If the package was built to only support Python 2, there is no straightforward way to install it for Python 3. You will want to ask the packager to provide a package built for Python 3 if there isn't one already. (This replaces my earlier answer, which was incorrect or at least misleading. Thanks to @Goyo in particul...
2
0
0
I downloaded a deb package panda3d1.9_1.9.3-xenial_amd64.deb and I want to install it for Python 3. My OS is Linux Ubuntu 16.04. The default python is 2.7.12 and I would prefer to keep it as default, but Python 3 is installed too and available to use. How do I install this package for Python 3 only? I am not sure pip m...
How do I install a python deb package for Python3 on Ubuntu?
1.2
0
0
1,157
42,526,695
2017-03-01T08:27:00.000
0
0
0
0
python,openerp,open-source,erp,odoo-10
44,158,222
3
false
1
0
the funciton that change the tilte_part is : _title_changed in the js file : addons/web/static/src/js/abstract_web_client.js it uses this.set('title_part', {"zopenerp": "Odoo"}); so you can change the word odoo by something that you need. and costumize the order of the title in _title_changed to display it like what ev...
1
1
0
I have changed the Odoo 10 login page title by using website builder app but it does not work on the other pages after login. After login when I access different installed apps then the page title shows Odoo with apps name like "Products - Odoo" or "Customers - Odoo".
How to change the title in Odoo 10?
0
0
0
5,989
42,527,324
2017-03-01T08:59:00.000
0
0
0
0
python,html,mysql,beautifulsoup
42,529,552
3
false
1
0
If you are using the data for normal use you can store it in sqlite db instead of mysql which has inbuilt support from python. If your site is mostly static then you can use Beautifulsoup for scraping and there are lot of python libraries like numpy for statistical analysis. If your target site has dynamically generate...
3
0
0
I have coded python to scrape a webpage and retrieve listing prices. I want to store the data and conduct a statistical analysis on the dataset. Would this work? Python -> beautifulsoup -> mySQL -> html Data set: $10 , $20, $10 I want to be able to calculate averages and then display them on the html page.
Scrape and store data for html display
0
0
0
475
42,527,324
2017-03-01T08:59:00.000
1
0
0
0
python,html,mysql,beautifulsoup
42,527,517
3
false
1
0
You could stay in Python for the analysis (for example with Python Pandas dataframes) before storing in mySQL: Python -> Beautifulsoup -> pandas -> mySQL -> html
3
0
0
I have coded python to scrape a webpage and retrieve listing prices. I want to store the data and conduct a statistical analysis on the dataset. Would this work? Python -> beautifulsoup -> mySQL -> html Data set: $10 , $20, $10 I want to be able to calculate averages and then display them on the html page.
Scrape and store data for html display
0.066568
0
0
475
42,527,324
2017-03-01T08:59:00.000
1
0
0
0
python,html,mysql,beautifulsoup
42,527,571
3
false
1
0
Beautifulsoup is an HTML parser. You can feed it an HTML page using Python, and extract the data you need from it. Then you can post-process the data in Python, and load it into MySQL once you're ready. I'm a bit confused about the step MySQL -> HTML, since neither is a programming language (HTML is a markup language t...
3
0
0
I have coded python to scrape a webpage and retrieve listing prices. I want to store the data and conduct a statistical analysis on the dataset. Would this work? Python -> beautifulsoup -> mySQL -> html Data set: $10 , $20, $10 I want to be able to calculate averages and then display them on the html page.
Scrape and store data for html display
0.066568
0
0
475
42,533,392
2017-03-01T13:43:00.000
0
0
1
0
python,python-2.7
42,533,424
2
false
0
0
Extract the .egg/.tar to *python_installation_path*\Lib\site-packages using 7-Zip
1
0
0
How to import modules from self created packages(wheel,eggs,tar.gz etc) local/or in artifactory in another python package? (Possibly a code snippet would be helpful) Requirement - There is a developed Python Package abc.whl located on local intranet repository, and another file in second python project /xyz/def.py need...
How to import modules from self created packages(wheel,eggs,tar.gz etc) local/or in artifactory in another python package?
0
0
0
1,100
42,539,906
2017-03-01T19:02:00.000
0
0
1
0
python,scikit-learn
52,912,100
3
false
0
0
If someone is working with via bash here are the steps : For ubunutu : sudo apt-get install python-sklearn
2
0
1
Why am I not able to import sklearn? I downloaded Anaconda Navigator and it has scikit-learn in it. I even pip installed sklearn , numpy and scipy in Command Prompt and it shows that it has already been installed, but still when I import sklearn in Python (I use PyCharm for coding) it doesn't work. It says 'No module n...
Why can i not import sklearn
0
0
0
7,012
42,539,906
2017-03-01T19:02:00.000
0
0
1
0
python,scikit-learn
42,574,660
3
false
0
0
Problem solved! I didn't know that I was supposed to change my interpreter to Anaconda's interpreter(I am fairly new to Python). Thanks for the help!
2
0
1
Why am I not able to import sklearn? I downloaded Anaconda Navigator and it has scikit-learn in it. I even pip installed sklearn , numpy and scipy in Command Prompt and it shows that it has already been installed, but still when I import sklearn in Python (I use PyCharm for coding) it doesn't work. It says 'No module n...
Why can i not import sklearn
0
0
0
7,012
42,540,201
2017-03-01T19:19:00.000
3
0
1
0
python,c++
42,540,332
1
true
0
1
There are many ways two executables can exchange data. Some examples: write/read data to/from a shared file (don't forget locking so they don't stumble on eachother). use TCP or UDP sockets between the processes to exchange data. use shared memory. if one application starts the other you can pass data via commandline ...
1
0
0
I'm relatively inexperienced with C++, but I need to build a framework to shuffle some data around. Not necessarily relevant, but the general flow path of my data needs to go like this: Data is generated in a python script The python object is passed to a compiled C++ extension The C++ extension makes some changes and...
Pass Data from One .exe to Another
1.2
0
0
636
42,541,297
2017-03-01T20:21:00.000
15
0
1
0
python,go,utf-8,language-comparisons
42,541,495
2
false
0
0
In Python, str.encode('utf8') converts a string to bytes. In Go, strings are utf-8 encoded already, if you need bytes, you can do: []byte(str).
1
5
0
How can I convert a string in Golang to UTF-8 in the same way as one would use str.encode('utf8') in Python? (I am trying to translate some code from Python to Golang; the str comes from user input, and the encoding is used to calculate a hash) As far as I understand, the Python code converts unicode text into a string...
Equivalent of python's encode('utf8') in golang
1
0
0
10,999
42,542,214
2017-03-01T21:17:00.000
1
1
1
0
python,python-module,python-importlib
42,545,218
3
false
0
0
I studied importlib's source code and since I don't intend to make a reusable Loader, it seems like a lot of unnecessary complexity. So I just settled on creating a module with types.ModuleType, adding bld to the module's __dict__, compiling and caching the bytecode with compile, and executing the module with exec. At ...
1
3
0
I'm trying to put together a small build system in Python that generates Ninja files for my C++ project. Its behavior should be similar to CMake; that is, a bldfile.py script defines rules and targets and optionally recurses into one or more directories by calling bld.subdir(). Each bldfile.py script has a correspondin...
How do I load a Python module with custom globals using importlib?
0.066568
0
0
1,152
42,544,689
2017-03-02T00:22:00.000
2
0
0
0
python,django,django-models,syntax
42,545,133
2
true
1
0
Thanks to answers below I found the answer to my question: Django have a const LOOKUP_SEP = '__' then using split to split the param to a key value pair
1
4
0
I noticed that Django use double under score to define a lookup in Model.objects.filter instance. For example: Room.objects.filter(width__lte = 10) How does it work? How can I create my own function like Django and know that width__lte is actually separated for width and lower then or equal to 10.
How does django implement double underscore in filter?
1.2
0
0
2,764
42,546,031
2017-03-02T02:58:00.000
1
0
1
0
python,anaconda,spyder
42,579,694
1
true
0
0
This was fixed in Spyder 3.2, which was released in July of 2017.
1
1
0
Spyder Variable explore only show variables when i run a python script. But while debugging, there is nothing in Spyder Variable explore. how to set?
how to show variable in Spyder Variable explore while debugging?
1.2
0
0
1,166
42,546,701
2017-03-02T04:09:00.000
1
0
1
0
python,python-3.x,ipython-notebook,jupyter-notebook
42,558,220
2
true
0
0
A link to a gist is by far the superior option from those you have listed as that means helpers can run your code pretty easily and debug it from there. An alternative option is to post the code that creates your DataFrame (or at least a minimal example of it) so that we can recreate it. This is advantageous over a gis...
1
1
1
I just run across a problem when trying to ask help using Pandas DataFrames in Jupyper notebook. More specifically my problem is what is the best way to embed iPython notebook input and output to StackOverflow question? Simply copy&paste breaks DataFrame output formatting so bad it becomes impossible to read. Which ...
Best way to embed Jupyter/IPython notebook information
1.2
0
0
432
42,548,500
2017-03-02T06:41:00.000
0
0
1
0
python,python-3.x
42,549,604
1
false
0
0
Is attribute reference a bottom-up or top down I wouldn't classify it as bottom-up or top-down. Pythons __getattribute__ first searches in the class dictionary in order to first find data descriptors if they exist, it then also searches the instance dictionary for instance variables (if no data descriptors have been f...
1
0
0
I have some doubts regarding attribute reference in Python. I used to think attribute reference as in instance.attribute is bottom-up approach. First that attribute is looked up in instance dictionary. But I was reading some article where it claims that attribute lookup is top-down approach i.e. when an attribute is re...
Attribute reference in Python
0
0
0
843
42,550,180
2017-03-02T08:23:00.000
0
0
1
0
python-3.x,python-idle
49,953,050
3
false
0
0
I developed the bad habit of writing/editing python files with IDLE from watching intro videos when I was still relatively new to programming. I have since learned that file editors like Sublime or IDE's like PyCharm are a significantly better way to go and would highly recommend anyone reading this.
2
1
0
I have a number of python files with .py extensions that I was working on, closed, and tried to come back to later. When I tried to open them by right clicking and selecting “Edit with IDLE,” instead of opening a pycache folder was created. I have a work around in which I go to edit the file with Notepad++, copy the t...
Trying to open a python file in IDLE. Instead, a pycache folder is created. How do I fix this?
0
0
0
1,584
42,550,180
2017-03-02T08:23:00.000
2
0
1
0
python-3.x,python-idle
47,170,350
3
false
0
0
What did you name the .py file as? If you named it something like "string.py", Python might interpret the file as one of those in the "Lib" folder. Why you can resave it with the same name and have it working afterwards is anyone's guess. I suggest just renaming the python file to something else.
2
1
0
I have a number of python files with .py extensions that I was working on, closed, and tried to come back to later. When I tried to open them by right clicking and selecting “Edit with IDLE,” instead of opening a pycache folder was created. I have a work around in which I go to edit the file with Notepad++, copy the t...
Trying to open a python file in IDLE. Instead, a pycache folder is created. How do I fix this?
0.132549
0
0
1,584
42,550,910
2017-03-02T09:02:00.000
0
0
0
0
python,csv,hyperlink
42,551,702
1
false
0
0
For HYPERLINK you need use only absolute url
1
0
1
I am creating a csv file in which i need to give hyperlinks to files in the same folder of csv file. I have tried with absolute url like =HYPERLINK("file:///home/user/Desktop/myfolder/clusters.py") and its working fine.But can i given the relative path like =HYPERLINK("file:///myfolder/clusters.py") because that is wha...
Give relative path of file in csv python
0
0
0
215
42,552,096
2017-03-02T09:55:00.000
0
0
0
0
python,windows,tkinter,size,display
42,555,744
1
true
0
1
This is one of the reasons why place is a poor choice. You should switch to using grid and/or pack. They are specifically designed to handle different screen sizes, different resolutions, different widget styles, and different fonts.
1
0
0
My problem is when somebody runs my tkinter gui (in Windows 7) and has larger display settings (125%), the gui doesn't look well (buttons are closer to each other, end of text cannot be seen, etc.). I use place method with x - y coordinates to place the widgets. Maybe using pack method could solve this, but it is easie...
Python tkinter - windows larger display settings
1.2
0
0
213
42,552,650
2017-03-02T10:18:00.000
1
0
0
0
python,django,database
42,555,104
2
true
1
0
When doing a bulk delete, neither the models delete() methods nor the eventual pre_delete and post_delete signals are invoked, so if your code relies on either of those you are in trouble. Hence the very sensible choice to loop over instances and call their delete() method individually. No need to report it as a bug (n...
1
0
0
I have been adding items from a txt to my database in a djago-view - with and without the @transaction.atomic-decorator, i.e. with a loop over db-writes or one db-write -- the performance difference is near infinite!^^ Now my observation: the default delete-action in the admin panel clearly does the (inferior) loop ove...
django built-in admin action delete - reason for bad performance?
1.2
0
0
299
42,553,676
2017-03-02T11:04:00.000
1
0
0
1
python,ibm-cloud,iot-for-automotive,iot-driver-behavior
42,668,207
1
true
0
0
I think your procedure is OK. There are following possibilities not to get valid analysis result. (1) In current Driving Behavior Analysis, it requires at least 10 valid gps points within a trip (trip_id) on a vehicle (trip_id). Please check your data which is used on "sendCarProbe" API. (2) Please check "sendJobReq...
1
0
0
I want to explore and use the driver behavior service in my application. Unfortunately I got stuck as I'm getting empty response from getAnalyzedTripSummary API instead Trip UUID. Here are the steps I've followed. I've added the services called Driver behavior and Context Mapping to my application @Bluemix. Pushed mul...
IBM Bluemix IoT Watson service Driver Behaviour
1.2
0
0
114
42,556,596
2017-03-02T13:19:00.000
1
0
1
0
python-2.7,readline
42,571,573
1
false
0
0
I tried the following and it worked. Navigate to ncurses directory that contains configure and run the following ./configure --with-shared --without-debug make make install Then install readline again. The error desappeared. The module was successfully installed.
1
0
0
I am trying to install readline using the command "python setup.py install" by navigating to the directory where i untarred readline 6.2.4.1. ncurses-6.0 is currently installed in the server. I have tried recompiling with -fPIC but that also doesnt seem to solve the problem Command: sudo CFLAGS="-fPIC" python setup.py ...
relocation R_X86_64_32 against `_nc_globals' can not be used when making a shared object; recompile with -fPIC while installing readline
0.197375
0
0
755
42,558,294
2017-03-02T14:38:00.000
0
0
0
0
python,python-2.7,request,timeoutexception,http-status-code-504
42,558,358
1
false
1
0
The gateway timeout means the connected server had some sort of timeout after receiving your request(i.e. you did make a connection). However, the requests timeout exception means your script never connected to the server and timed out waiting on a response from the server (i.e. you did not make a connection).
1
1
0
requests.exceptions.Timeout VS requests.models.Response.status_code = 504 [gateway timeout] what is the actual difference between the two as both deals with saying timeout has occurred? Let us say Service s1 makes call to S2 In s1: request.post( url=s2,..., timeout=60 ) when will requests.exceptions.Timeout be rais...
python: requests.exceptions.Timeout vs requests.models.Response.status_code 504 ( gateway timeout )
0
0
1
1,354
42,560,179
2017-03-02T16:01:00.000
1
0
1
0
python,pyinstaller
53,063,002
1
false
0
1
Had the same issue, pyinstaller -F script.py without the build on the command prompt worked for me.
1
3
0
I am having some problems with using PyInstaller to package a project. I have used it successfully in the past for simpler scripts, but I am attempting to package a larger project (pyqt4 gui that calls multiple scrips and modules) and I get the following error: IOError: [Errno 13] Permission denied: 'C\Users\username\...
Permissions Error with PyInstaller (running as admin)
0.197375
0
0
2,161
42,563,683
2017-03-02T18:56:00.000
0
0
0
0
python,bash,curl,sed,web-scraping
42,564,318
2
false
0
0
With Python you can also scrape sites rendered with JavaScript using selenium und a headless browser like PhantomJS. Maybe this is possible with bash scripting too, but the more complext your code gets the bigger the advantage of the clarity of python IMHO.
1
0
0
I am trying to get more information from experienced people doing web scraping in general, I am getting into web scraping using Python libraries. At the same time, I noticed some people are using simple Bash, and using commands for web scraping such as wget, curl, sed, grep, awk. These commands seem to be much cleaner...
Using Bash scripting for web scraping over python libraries?
0
0
1
707
42,564,069
2017-03-02T19:17:00.000
1
0
0
0
python,apache-spark,pyspark
50,958,242
1
false
0
0
I don't think it's feasible during an interactive session. You will have to restart your session to use the modified module.
1
8
1
Within an interactive pyspark session you can import python files via sc.addPyFile('file_location'). If you need to make changes to that file and save them, is there any way to "re-broadcast" the updated file without having to shut down your spark session and start a new one? Simply adding the file again doesn't work....
How can you update a pyfile in the middle of a PySpark shell session?
0.197375
0
0
1,140
42,568,374
2017-03-03T00:14:00.000
5
0
1
0
python,command-line
58,019,890
2
false
0
0
raw_input() was renamed to input() in Python 3.0.
1
7
0
Say I have python script, call it "script.py". Normally, in the command line, file executes when user types "python script.py". What I want is to add an "are you sure? (y/n)" prompt after user types "python script.py". And only after typing y [enter] should the script execute.
Add "are you sure? (y/n)" prompt before executing python script
0.462117
0
0
6,392
42,570,494
2017-03-03T04:07:00.000
-1
1
0
1
python,import,sshfs,fedora-25,remote-host
43,487,256
1
false
0
0
In my case it were the Cern ROOT libraries import. When importing, they look in the current directory, no matter what I do. So the solution is to store the current directory cd to some really local directory, like "/" or "/home" before imports come back to the stored directory after imports
1
0
0
I have trouble running my a little bit complex python program in a remote directory, mounted by SSHFS. It takes a few seconds to perform imports when executing in a remote directory and a fraction of a second in a local directory. The program should not access anything in the remote directory on its own, especially in ...
Python script very slow in a remote directory
-0.197375
0
0
1,102
42,573,079
2017-03-03T07:29:00.000
0
1
0
0
php,python
42,573,390
1
false
0
0
if you can see a page witch contains your needed data with your eyes. you can use web scraping to gather them.
1
0
0
I've read the API documentation and there seem to be no way to get user email.
Is there any way to extract a list of users and their email ids from wattpad?
0
0
1
67
42,579,614
2017-03-03T13:03:00.000
2
0
0
0
python,tkinter
42,579,716
1
false
0
1
It is not possible to add buttons to the titlebar of a window in Tkinter.
1
0
0
I am creating a game as a school project with tkinter.I got a 800 lines long code, and I want to add a 4rd button in the title bar of one of my windows(not the main one). Is it possible and ,if yes, how can I manage to do it ?
Add a button in the title bar in Tkinter
0.379949
0
0
328
42,580,176
2017-03-03T13:28:00.000
1
0
0
0
python,pyqt4,qpixmap
42,604,577
1
false
0
1
When you load image into QPixmap or QImage, it is converted from file format to internal representation. Because of that, QImage.byteCount() returns number of bytes used to store image. As you already mentioned, it is equals to width*height*4. Here, digit 4 is color depth (bytes per pixel). You can get it via QImage.de...
1
0
0
I get images from aws and assign them to QPixmap variables. I want to show their information as width height and file size. However I could not find a way to get file size of them. I converted them to QImage and used byteCount method however, although the file size of the image is 735 byte, it returns 3952 byte which i...
How can I find the file size of image which is read as QPixmap?
0.197375
0
0
985
42,580,235
2017-03-03T13:31:00.000
0
0
1
0
python-2.7,python-3.x,digital-signature
45,190,212
2
false
0
0
There are many packages presents. pdfrw: Read and write PDF files; watermarking, copying images from one PDF to another. Includes sample code. slate : Simplifies extracting text from PDF files. Wrapper around PDFMiner. PDFQuery : PDF scraping with Jquery or XPath syntax. Requires PDFMiner, pyquery and lxml libraries. ...
1
4
0
How to add a digital signature to any given file using python and verify the same . That is input a file and output a digitally signed file and giving a digitally signed file with a key verify the digital signature. How to do this using python?
How to add a digital signature to any given file using python
0
0
0
2,588
42,582,335
2017-03-03T15:09:00.000
3
0
0
0
python,python-2.7,tkinter,listbox
42,582,872
1
true
0
1
The way to get the line number of the active line of the listbox is to use the index method: listbox.index(tk.ACTIVE).
1
1
0
Let's get the formalities out of the way: This is about Python 2.7.x running on Windows 7. I'm creating a subclass of the Tkinter listbox widget, and one of the things I need the subclass to provide is a property containing the index (line number) of the line that is currently active (i.e. has the focus). I know that...
"Convert" tk.ACTIVE to the index (line number) in a listbox
1.2
0
0
717
42,582,399
2017-03-03T15:11:00.000
0
0
0
0
python-3.x,python-3.4
55,909,536
2
false
1
0
you could try this: app.PostCommand("exit")
2
2
0
I am new to Python scripting and I am currently trying to get acquainted with python scripting and DigSILENT Powerfactory. I have managed thus far to execute powerfactory, activate projects and execute a load flow but after my code ends, when I try to rerun it, it wont run. In order for it to run I need to close Spyde...
How can I exit powerfactory using Python in Unattended mode?
0
0
0
826
42,582,399
2017-03-03T15:11:00.000
0
0
0
0
python-3.x,python-3.4
43,653,385
2
false
1
0
I had the same problem. But faster than shutdown/reopen spyder is to restart the kernel with ctrl + .
2
2
0
I am new to Python scripting and I am currently trying to get acquainted with python scripting and DigSILENT Powerfactory. I have managed thus far to execute powerfactory, activate projects and execute a load flow but after my code ends, when I try to rerun it, it wont run. In order for it to run I need to close Spyde...
How can I exit powerfactory using Python in Unattended mode?
0
0
0
826
42,582,938
2017-03-03T15:39:00.000
0
0
1
0
python,image,photo,editing
42,583,042
2
false
0
0
Online photo editor means that most of the processing will be done on the client side (i.e. in browser). Python is mostly a server-side language, so I would suggest using some other, more browser-friendly, language (perhaps, JavaScrip?)
1
0
0
I am going to build an online photo editor using python, but I don't know how to start. My plan is to create a platform online. Users can upload their photos and the system can transform their photos into a style like Ukioyoe from Japan, the ancient wood printing, so the photo outcomes are similar to that. Is there any...
Creating a online photo editor in Python
0
0
0
2,065
42,583,082
2017-03-03T15:46:00.000
0
0
1
1
python,python-2.7,python-3.x
42,583,156
7
false
0
0
In my case, /usr/bin/python is a symlink that points to /usr/bin/python2.7. Ususally, there is a relevant symlink for python2 and python3. So, if you type python2 you get a python-2 interpreter and if you type python3 you get a python-3 one.
5
0
0
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
0
0
0
10,377
42,583,082
2017-03-03T15:46:00.000
0
0
1
1
python,python-2.7,python-3.x
42,583,347
7
false
0
0
It depends on OS (and the way Python has been installed). For most current installations: on Windows, Python 3.x installs a py command in the path that can be used that way: py -2 launches Python2 py -3 launches Python3 On Unix-likes, the most common way is to have different names for the executables of different ve...
5
0
0
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
0
0
0
10,377
42,583,082
2017-03-03T15:46:00.000
0
0
1
1
python,python-2.7,python-3.x
71,958,209
7
false
0
0
As has been mentioned in other answers to this and similar questions, if you're using Windows, cmd reads down the PATH variable from the top down. On my system I have Python 3.8 and 3.10 installed. I wanted my cmd to solely use 3.8, so I moved it to the top of the PATH variable and the next time I opened cmd and used p...
5
0
0
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
0
0
0
10,377
42,583,082
2017-03-03T15:46:00.000
0
0
1
1
python,python-2.7,python-3.x
42,583,188
7
false
0
0
Usually on all major operating systems the commands python2 and python3 run the correct version of Python respectively. If you have several versions of e.g. Python 3 installed, python32 or python35 would start Python 3.2 or Python 3.5. python usually starts the lowest version installed I think. Hope this helps!
5
0
0
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
0
0
0
10,377
42,583,082
2017-03-03T15:46:00.000
0
0
1
1
python,python-2.7,python-3.x
42,583,177
7
false
0
0
If you use Windows OS: py -2.7 for python 2.7 py -3 for python 3.x But first you need to check your PATH
5
0
0
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
0
0
0
10,377
42,584,551
2017-03-03T16:58:00.000
0
0
1
1
python,linux,nano
70,208,117
3
false
0
0
Try just "M-I" (Esc-I) to switch off autoindent before pasting with Ctrl-Ins (or right mouse click)
1
7
0
I am a beginner programmer as well as linux user. Before, I was using windows and the python IDLE was so good. I need not needed to press tab button after the "If" statement or any other loops. Now, I am using Linux and started to write programs through the command line text editor of ubuntu called as "nano". Here, I n...
How to make auto indention in nano while programming in python in linux?
0
0
0
18,957
42,589,584
2017-03-03T22:32:00.000
11
0
1
1
python,subprocess
42,589,699
1
true
0
0
Processes that produce color output do it by sending escape codes to the terminal(-emulator) intermixed with the output. Programs that handle the output of these programs as data would be confused by the escape codes, so most programs that produce color output on terminals do so only when they are writing to a termina...
1
11
0
I'm trying to run a process within another python process. The program I run normally has colored output when run in an ANSI terminal emulator. When I have my controlling python program print the output from the sub-process, I don't see any color. The color from the subprocess is lost when I read from it and print t...
ANSI color lost when using python subprocess
1.2
0
0
2,656
42,590,945
2017-03-04T01:12:00.000
0
0
0
0
python,python-2.7,cx-oracle
42,602,641
2
false
0
1
Make sure that your Python, cx_Oracle and Oracle Client are all 64-bit or all 32-bit. If one of them is different you can get this error.
1
0
0
ImportError: DLL load failed: %1 is not a valid Win32 application. I have researched for 2 days but unable to resolve. Need help!!
ImportError when importing cx_Oracle python
0
0
0
99
42,592,803
2017-03-04T06:12:00.000
0
0
1
0
python,dictionary,data-structures,heap
42,592,884
3
false
0
0
If your data will not fit in memory, you need to be particularly mindful of how it's stored. Is it in a database, a flat file, a csv file, JSON, or what? If it is in a "rectangular" file format, you might do well to simply use a standard *nix sorting utility, and then just read in the first k lines.
1
2
1
I have a very large dictionary with entries of the form {(Tuple) : [int, int]}. For example, dict = {(1.0, 2.1):[2,3], (2.0, 3.1):[1,4],...} that cannot fit in memory. I'm only interested in the top K values in this dictionary sorted by the first element in each key's value. If there a data structure that would allow ...
Data structure: Top K ordered dictionary keys by value
0
0
0
698
42,596,399
2017-03-04T13:09:00.000
0
0
1
1
python-3.6
42,596,435
1
false
0
0
You need to add the location of the python.exe to your $PATH variable. This depends on your installation location. In my case it is C:\Anaconda3. The default is C:\Python as far as I know. To edit your path variable you can do the following thing. Go to your Control Panel then search for system. You should see somethin...
1
1
0
I am trying to install the pyperclip module for Python 3.6 on Windows (32 bit). I have looked at various documentations (Python documentation, pypi.python.org and online courses) and they all said the same thing. 1) Install and update pip I downloaded get-pip.py from python.org and it ran immediately, so pip should be...
Installing Python modules
0
0
0
614
42,597,497
2017-03-04T15:05:00.000
0
0
0
1
twitter-bootstrap,python-2.7,google-app-engine,google-cloud-datastore,app-engine-ndb
43,709,266
1
false
1
0
When rendering the page just check if the assessment exists by retrieving it from the Consult (I imagine you store the assessment key inside the Consult). That's it
1
0
0
I have a page View-Consult with 4 bootstrap tabs. There are two entities retrieved from the Datastore on this page (Consult and Assessment). The consult is created first and the assessment later (by a different user). Note: Consults have a property called "consult_status" that is PENDING before the Assessment is added,...
Appengine Python - How to filter tab content depending if entity has been created
0
0
0
29
42,597,646
2017-03-04T15:20:00.000
3
0
1
0
ipython
43,457,170
1
true
0
0
To run configuration commands at iPython startup locate the following line in your .ipython/profile_default/ipython_config.py c.InteractiveShellApp.exec_lines = ['%alias echo show'] You can also have a file loaded with a bunch of iPython commands using c.InteractiveShellApp.exec_files = [] Hope this helps
1
1
0
I use IPython 5.1.0 with Python 3.5.2 at the command line on OSX 10.11.6. I would like to define bookmarks and command aliases to be loaded when I start the IPython interactive shell. I thought I would be able to run magic commands in the ipython_config.py configuration file (such as %bookmark FOLDERS /Users/tbaker/fol...
Defining bookmarks and aliases in ``ipython_config.py`` configuration file
1.2
0
0
324
42,600,500
2017-03-04T19:38:00.000
0
0
1
1
python,macos,exe,software-distribution,dmg
46,517,871
1
false
0
0
This is a pretty broad question. The "best way" to distribute any software is to use a software distribution/systems management suite. It takes time to implement but once done the time savings is enormous. There are several suites that will do this; I believe that AirWatch will work as will ThingWorx, Helix Device Cl...
1
1
0
What could be the best way to distribute a python application to both windows and mac user without scaring them away during the installation process? I'm writing a software which will be of help to my university's students. This software will be used by student of various discipline, a lot from those which have little...
User friendly way to distribute Python Application
0
0
0
75
42,602,039
2017-03-04T22:17:00.000
2
0
0
0
qt,python-3.x,user-interface,pyqt5,qmediaplayer
42,602,957
1
true
0
1
Your question is a bit broad, bit in general this is what you should do: Create a QProgressBar Create your QMediaPlayer Listen to the currentMediaChanged() signal of your QMediaPlayer module; in your handler fetch the duration of the current media, divide by 1000 to get the length in seconds, set this as the maximum v...
1
1
0
I want to know how to get a progress-bar/seeker for the QMediaPlayer module on PyQt5... So on my music player application I can have a progress bar for the songs. Thank You in Advance
Connect QProgressBar or QSlider to QMediaPlayer for song progress
1.2
0
0
1,095
42,602,059
2017-03-04T22:20:00.000
4
0
1
0
python,python-2.7,python-3.x,remote-access
57,720,826
4
false
0
0
Depending on your python interpreter environment variable path, you need to either py -m pip install win32api or Use python -m pip install win32api In my case, py -m pip install win32api worked but python -m pip install win32api didn't
1
21
0
I have tried using pip -m install win32api, but I still get the error "can't open file 'pip': [Errno 2] No such file or directory" Can anyone help me on this? Note: I have renamed the python.exe file as python2 and python3, since I have both versions installed on my pc.
pip install gives me this error "can't open file 'pip': [Errno 2] No such file or directory"
0.197375
0
0
76,715
42,602,126
2017-03-04T22:28:00.000
0
0
1
1
python,cygwin,anaconda,python-module,pythonpath
43,129,047
1
false
0
0
Python at the startup builds the sys.path using site.py available in the PYTHONHOME directory. I appended to the file, addsitedir(). That worked for me. If there exists a space in the path, use double quotes around the path.
1
0
0
This might be trivial, but I can't identify the reason for not being able to import user-defined python modules into my python environment. I use Ananconda installation of python in cygwin. I have made entries in bash_profile to append module directory path to PYTHONPATH in this format. export PYTHONPATH=$PYTHONPATH:"<...
How to import user-defined python modules in cygwin?
0
0
0
378
42,603,373
2017-03-05T01:22:00.000
0
0
1
1
python,linux,encoding,utf-8
42,617,322
2
false
0
0
I think you're overdoing it. Python comes with batteries included; just use them. A correctly configured terminal session has the LANG environment variable set; it describes which encoding the terminal expects as output from programs running in this session. Python interpreter detects this setting and sets sys.stdout.e...
2
1
0
I'm writing a script in python that generates output that contains utf-8 characters, and even though most linux terminals use utf-8 by default, I'm writing the code presuming it isn't in utf-8 (in case the user changed it, for some reason). From what I tested, os.environ["LANG"] = "en_US.utf-8" does not change the syst...
How do I change the environment variable LANG from within a Python script?
0
0
0
2,637
42,603,373
2017-03-05T01:22:00.000
0
0
1
1
python,linux,encoding,utf-8
42,617,801
2
false
0
0
It is not clear what you want to see happen when you change the LANG environment. If you want to test your Python code with other character encodings, you will need to set LANG before starting the Python code, as I believe LANG is read when Python first starts. There might(?) be a function call you can call to change t...
2
1
0
I'm writing a script in python that generates output that contains utf-8 characters, and even though most linux terminals use utf-8 by default, I'm writing the code presuming it isn't in utf-8 (in case the user changed it, for some reason). From what I tested, os.environ["LANG"] = "en_US.utf-8" does not change the syst...
How do I change the environment variable LANG from within a Python script?
0
0
0
2,637
42,605,931
2017-03-05T08:00:00.000
0
0
1
0
python,c++,boost,memory-leaks,shared-libraries
42,615,864
1
false
0
0
I have finally found the segfault. The header I was using for compiling the program was different from the one used by the library. One class member was not declared and so no memory was allocated to this member.
1
0
0
I'm develloping the backend of an app and I try to wrap my c++ code in python. I've used Boost Python3 to link c++ to python. I'm able to get a shared library and call it from python. For the moment, everything is working. The problem arises when I'm trying to export this library. I would like to be able to use it from...
Memory leak in c++ python wrapper
0
0
0
742
42,606,584
2017-03-05T09:22:00.000
0
0
0
0
python,opencv
42,611,673
2
false
0
0
There is no way that your camera or software will be able to look at a flat image and decide what is foreground and what is background. Is that parrot sitting on a perch and staring at the camera or is it a picture of a parrot on the wall? In the past I've made a collection of frames from the camera and formed a refere...
1
0
1
I'm trying to create a program that removes the background and get the foreground in color. For example if a face appears in front of my webcam i need to get the face only. I tried using BackgroundSubtractorMOG in opencv 3. But that didn't solve my problem. Can anyone tell me where to look or what to use. I'm a newbie ...
Get the Foreground in opencv
0
0
0
713
42,607,012
2017-03-05T10:07:00.000
0
0
1
0
python,file,concurrency,atomic
42,607,066
1
false
0
0
You can try opening file with "w+" option , it will append data if file exist or create new one if file is not there.
1
0
0
I have a Python script that must write a new line (containing a number) to a file each second. I have another program that will regularly need to archive that file, so it will probably move the file to another location (Python can for example re-create the file if it doesn't exist anymore), but any other solution is po...
Proper way to regularly write to file which can be cleared by another process?
0
0
0
34
42,607,360
2017-03-05T10:42:00.000
0
0
1
0
python-2.7,ssl,ssl-certificate,embed
42,621,585
1
false
0
0
Appereantly there isn't any answer to this question... so i figured out something else. I saved the certificate in a variable in my pythonic code :P and then before connecting to the server, the client saves the certificate to a temp file, and at the end delete it.
1
1
0
I am coding a program(server-client) in python 2.7, that exchange data through sockets. I use SSL to secure the connection. But here is the thing. I want to make the client and the server executables with pyinstaller, and i want the SSL certificate and the key to be "hidden" somewhere inside the python code... so i can...
Embed SSL certificates
0
0
1
228
42,608,100
2017-03-05T11:58:00.000
0
0
0
0
python,python-2.7,selenium,click,element
42,665,717
1
false
0
0
Technically speaking, you could set an explicit wait targetting the "presence_of_element_located" or "visibility_of_element_located" condition. However keep in mind that the action fired by the click on the element could be binded in many ways, and some of them could take place after the dom is ready (when the complete...
1
0
0
Can you click on an element, while the page is not fully load but the element is already loaded/visible? If yes then how? If no then is there any other solution?
Python 2.7 Selenium, Click on button while the page isn't fully load
0
0
1
122
42,608,362
2017-03-05T12:28:00.000
0
1
0
1
python,bash,nginx,webserver,cgi
42,608,590
2
false
0
0
Why are you not try to pass the address/location of your file which you want to download as a argument to the class and then use that in the < a href> tag to convert that into the link and implement the download functionality
1
0
0
I have a simple python webserver but I want to use the CGI script for file download and upload according to client-request .But I couldnt find the any way of adjusting the CGI except using apache2 ,nginx or etc... Is there any way to adjust cgi script to my python webserver with Bash script or with other way ? Can...
CGI Script For Python Webserver
0
0
0
74
42,609,943
2017-03-05T15:05:00.000
39
1
1
0
python,pip
68,885,989
3
false
0
0
For those who don't have time: If you install your project with an -e flag (e.g. pip install -e mynumpy) and use it in your code (e.g. from mynumpy import some_function), when you make any change to some_function, you should be able to use the updated function without reinstalling it.
2
113
0
When I need to work on one of my pet projects, I simply clone the repository as usual (git clone <url>), edit what I need, run the tests, update the setup.py version, commit, push, build the packages and upload them to PyPI. What is the advantage of using pip install -e? Should I be using it? How would it improve my wo...
What is the use case for `pip install -e`?
1
0
0
71,689
42,609,943
2017-03-05T15:05:00.000
89
1
1
0
python,pip
59,667,164
3
true
0
0
I find pip install -e extremely useful when simultaneously developing a product and a dependency, which I do a lot. Example: You build websites using Django for numerous clients, and have also developed an in-house Django app called locations which you reuse across many projects, so you make it available on pip and ver...
2
113
0
When I need to work on one of my pet projects, I simply clone the repository as usual (git clone <url>), edit what I need, run the tests, update the setup.py version, commit, push, build the packages and upload them to PyPI. What is the advantage of using pip install -e? Should I be using it? How would it improve my wo...
What is the use case for `pip install -e`?
1.2
0
0
71,689
42,610,000
2017-03-05T15:10:00.000
1
0
0
0
python,machine-learning,scikit-learn
42,610,453
1
false
0
0
You can set random_state parameter to some constant value to reproduce data splits. On the other hand, it's generally a good idea to test exactly what you are trying to know - i.e. run your training at least twice with different randoms states and compare the results. If they differ a lot it's a sign that something is ...
1
0
1
According to the resources online "train_test_split" function from sklearn.cross_validation module returns data in a random state. Does this mean if I train a model with the same data twice, I am getting two different models since the training data points used in the learning process is different in each case? In prac...
model evaluation with "train_test_split" not static?
0.197375
0
0
86
42,610,590
2017-03-05T16:02:00.000
6
0
0
0
python,node.js,scikit-learn,child-process
62,075,227
1
true
1
0
My recommendation: write a simple python web service (personally recommend flask) and deploy your ML model. Then you can easily send requests to your python web service from your node back-end. You wouldn't have a problem with the initial model loading. it is done once in the app startup, and then you're good to go DO ...
1
11
1
I have a web server using NodeJS - Express and I have a Scikit-Learn (machine learning) model pickled (dumped) in the same machine. What I need is to demonstrate the model by sending/receiving data from it to the server. I want to load the model on startup of the web server and keep "listening" for data inputs. When re...
Sklearn Model (Python) with NodeJS (Express): how to connect both?
1.2
0
0
3,643
42,612,439
2017-03-05T18:43:00.000
0
0
0
0
python,math
42,655,243
1
false
0
0
So the solution I have is : linear_closeness = 1 - (difference / max_deviation) exponential_closeness = 10^linear_closeness / 10 This is suitable for me. I am open to better solutions.
1
0
1
I have two, time value series (using pandas) and would like to represent the "closeness" of the last value in each series in regards to each other on a logarithmic scale between 0 and 1. 0 being very far away and 1 being the same. I am not sure how to approach this and any help would be appreciated.
Python - Closeness of two values on a logarithmic scale
0
0
0
101
42,615,538
2017-03-05T23:56:00.000
1
0
0
0
django,python-3.x
42,618,333
1
false
1
0
do I need to deploy it with all the Python 'come-with' modules Never do that. It might conflict with the dependencies on the server. Instead issue the following command to create a dependency file (requirements.txt). pip freeze > requirements.txt (issue this command where manage.py is located) On the server create a n...
1
0
0
Good day. I'm a newbie to Django and I have a slight confusion: When deploying my Django app, do I need to deploy it with all the Python 'come-with' modules, or the hosts already have them installed. Also, I installed PIL for image manipulation. Would they also have it installed or i have to find a way to install it ...
confusion in deploying module's with django
0.197375
0
0
28
42,616,958
2017-03-06T03:13:00.000
1
0
1
0
python
42,618,800
1
true
0
0
Save it in something next to or related to __file__, which is the path to the file the module was loaded from. I believe in some cases it can be a relative path, so you might want to store the memos in that path directly, or turn it into an absolute path or something.
1
0
0
I want to write a decorator that does persistent memoization (memoizing to disk). Since I want to use this decorator for many functions, I have to decide where to save memoizing data for these functions. I googled around and found two solutions: let the functions decide where to store the memoizing data automatically ...
destination of python persistent memoization
1.2
0
0
74
42,617,816
2017-03-06T04:57:00.000
0
1
0
0
python,c++
42,618,540
1
false
0
0
If you are using Linux, & will release bash session and in this case, CollorFlow and fileToXex.py will run in different bash sessions. At the same time, composition ./ColorFollow | python fileToHex.py looks interesting, cause you redirect stdout of ColorFollow to fileToHex.py stdin - it can syncronize scripts by printi...
1
0
0
So this one is a doozie, and a little too specific to find an answer online. I am writing to a file in C++ and reading that file in Python at the same time to move a robot. Or trying to. When I try running both programs at the same time, the C++ one runs first and then the Python one runs. Here's the command I use: ./C...
Simultaneous Python and C++ run with read and write files
0
0
0
281
42,617,832
2017-03-06T04:58:00.000
0
0
0
0
python,python-3.x,opengl,pygame
47,053,412
2
false
0
1
Do not forget: Display objects inherit from Surfaces. So you can blit the screen to another Surface and scale it down! Create a subprocess using the corresponding module, initialize Display with the dummy video driver (as seen in the headless_no_windows_needed.py Pygame example), send the Surface converted to a simple ...
1
1
0
I'm making a lo-fi, low-resolution (1024x576) game and I was hoping I could get away with just doing supersampling (render the game at 2048x1152 then scale down) instead of proper anti-aliasing. Trouble is, I don't see any way to render the OpenGL commands to a memory surface instead of the display surface. Is there a ...
Using Pygame + PyOpenGL, draw to a Surface instead of straight to the display?
0
0
0
1,021
42,619,331
2017-03-06T06:57:00.000
1
0
0
1
php,python,python-2.7,amazon-web-services,ubuntu
42,709,943
1
true
0
0
Finally i resolved the issue. First upgrade the pip and then pip install --upgrade --user awsebcli.
1
3
0
I am trying to install AWS elasticbeanstalk command line tool in my ubuntu machine Installed with pip install --upgrade --user awsebcli But when i try to get the eb version with eb --version i got the following error Traceback (most recent call last): File "/home/shamon/.local/bin/eb", line 6, in from pkg_...
Installing AWS elasticbeanstalk command line tool in ubuntu:error The 'awsebcli==3.10.0' distribution was not found and is required by the application
1.2
0
0
418
42,619,597
2017-03-06T07:13:00.000
0
1
1
0
python,asynchronous,localization,internationalization,gettext
42,623,529
1
true
1
0
Okay, we solved problem using with that provide us with context to all inner function calls.
1
2
0
We have asynchronous python application (telegram bot), and we want to add localization: user selects language when he starts dialog with bot, then bot translates all messages for him. Django allows to change language for every request, it is working normally, because Django create separate process for each request. Bu...
Localization for Async Python Telegram bot
1.2
0
0
703
42,620,942
2017-03-06T08:36:00.000
0
0
0
0
python,web2py
42,701,682
1
false
1
0
If you want to do it manually, just: go to your application admin interface click on the "database admin" button (mighy be translated to your OS language) click on db.auth_user then use the Import/Export feature form at the bottom of the page That's it.
1
0
0
Basically, I would like to deploy a web2py application with a set of default users already registered/created in the application. Can this be accomplished by importing a CSV file containing default username/password and other details into the auth_user table? Any help is welcome. Thanks.
Creating default set of username/password from a csv file in a web2py application
0
0
0
183
42,625,724
2017-03-06T12:30:00.000
0
0
0
0
python,django
42,626,309
2
false
1
0
The CSRF token is rotated after the user logs in. If the user goes back in their browser after logging in and submits a form with the old token, then you will get a CSRF error. If you refresh the page with the form after logging in, then the page will be reloaded with the new token, and CSRF verification should pass.
1
1
0
I am getting CSRF verification failed when i return to back go back after login using django method. It returns the sign in page even after i successfully log in. And it posts the error as CSRF verification failed. Could I use to set anything in Django setting?
Django - CSRF verification failed - after successfully logged in
0
0
0
528
42,625,825
2017-03-06T12:35:00.000
0
0
0
0
python,neural-network,cluster-analysis,image-recognition,self-organizing-maps
47,734,394
2
false
0
0
I have been wondering if there is any mileage to training a separate supervised neural network for the inputs which map to each node in the SOM. You'd then have separate supervised learning on the subset of the input data mapping to each SOM node. The networks attached to each node would perhaps be smaller and more eas...
2
0
1
I am working on a image recognition project in python. I have read in journals that if clustering performed by a self-organizing map (SOM) is input into a supervised neural network the accuracy of image recognition improves as opposed to the supervised network on its own. I have tried this myself by using the SOM to pe...
How to combine a Self-organising map and a multilayer perceptron in python
0
0
0
1,430
42,625,825
2017-03-06T12:35:00.000
1
0
0
0
python,neural-network,cluster-analysis,image-recognition,self-organizing-maps
42,777,643
2
false
0
0
Another way to use SOM is for vector quantisation. Rather than using the winning SOM coordinates, use the codebook values of the winning neuron. Not sure which articles you are reading, but I would have said that SOM into MLP will only provide better accuracy in certain cases. Also, you will need to choose parameters l...
2
0
1
I am working on a image recognition project in python. I have read in journals that if clustering performed by a self-organizing map (SOM) is input into a supervised neural network the accuracy of image recognition improves as opposed to the supervised network on its own. I have tried this myself by using the SOM to pe...
How to combine a Self-organising map and a multilayer perceptron in python
0.099668
0
0
1,430
42,626,496
2017-03-06T13:09:00.000
9
0
0
0
python,python-3.x,button,tkinter
42,626,791
1
true
0
1
You can use anchor="w" when defining the button. However, some platforms may ignore that. For example, on older version of OSX the text will always be centered.
1
3
0
By default text in Button is centered but I want it to be aligned to the left so when I type more text than the button can display it wont cut the start of the sentence/word. Thanks for help.
Align text in tkinter Button
1.2
0
0
8,956
42,628,408
2017-03-06T14:41:00.000
0
0
1
0
python,file-io,byte
42,628,789
2
false
0
0
I'd use mmap for something like this. mmap.mmap() returns an bytearray object you can index.
1
0
0
I have a byte file which consists of integers that take up 4 bytes of space each. I also have function in my python code that is supposed to switch two elements in the file given their indexes. index 0 is the first 4 byte integer, index 1 is the second batch of 4 bytes and so on. How would I implement this in my code?...
How do I swap certain bytes in a file with python?
0
0
0
135
42,628,638
2017-03-06T14:52:00.000
1
0
1
0
python,amazon-web-services,aws-lambda
43,783,169
1
false
0
0
You could use code build, which will build your code on the aws linux envoirnment. Then it wont matter if the envoirnment is windows or linux. code build will put the artifacts directly on s3, from there you can directly upload it to lambda.
1
1
0
I have developed a lambda function which hits API url and getting the data in Json Format. So need to use modules/libraries like requests which is not available in AWS online editor using Python 2.7. So need to upload the code in Zip file, How we can do step by step to deploy Lambda function from windows local server t...
AWS lambda function deployment
0.197375
0
1
614
42,629,891
2017-03-06T15:49:00.000
0
0
1
0
python-3.x,download
42,630,045
2
false
0
0
This should not pose a problem, as long as the directory is specified correctly in you PATH.
2
0
0
I am a 65 year old "newbie" and generally use default options when downloading. Python.org wants to download to an obscure directory such as C:\Users\Facdev\AppData\Local\Programs\Python\Python36-32". Is there anything wrong with downloading instead to "C:"?
Is it OK to modify the default location for Python-3.6.0.exe to just the C drive?
0
0
0
49
42,629,891
2017-03-06T15:49:00.000
0
0
1
0
python-3.x,download
42,631,188
2
false
0
0
It is OK to modify the location where you will download and install Python. However, I would advise against doing so if you are unfamiliar with how system environment variables and PATH locations work in Windows. Why does it matter? Once you have the python executable (in your case Python-3.6.0.exe) on your system, y...
2
0
0
I am a 65 year old "newbie" and generally use default options when downloading. Python.org wants to download to an obscure directory such as C:\Users\Facdev\AppData\Local\Programs\Python\Python36-32". Is there anything wrong with downloading instead to "C:"?
Is it OK to modify the default location for Python-3.6.0.exe to just the C drive?
0
0
0
49
42,630,191
2017-03-06T16:04:00.000
7
0
1
1
python,windows,python-3.x,unicode,console
42,631,022
2
true
0
0
Add /k chcp 65001 to the shortcut launching the cmd window. Alternatively, use Python 3.6 which uses Windows Unicode APIs to write to the console and ignores the code page. You do still need font support for what you are printing, however.
1
4
0
I use a python library that prints out a Unicode character to windows console. If I call a function on the library that prints out Unicode character, it will throw an exception 'charmap' codec can't encode characters. So this is what I tried to solve that error: Call "chcp 65001" windows console command from python usi...
Launch console window pre-activated with chcp 65001 using python
1.2
0
0
4,940
42,632,411
2017-03-06T17:56:00.000
4
0
0
0
python,image,keras,convolution
42,632,755
2
true
0
0
No issues with a rectangle image... Everything will work properly as for square images.
1
2
1
Let's say I have a 360px by 240px image. Instead of cropping my (already small) image to 240x240, can I create a convolutional neural network that operates on the full rectangle? Specifically using the Convolution2D layer. I ask because every paper I've read doing CNNs seems to have square input sizes, so I wonder if w...
Can Convolution2D work on rectangular images?
1.2
0
0
2,468
42,633,643
2017-03-06T19:08:00.000
-1
0
1
0
python
42,633,996
2
false
0
0
You are not doing anything wrong. This is the behavior of virtualenv, it creates a new python environment with the current systemssite-packages`. To avoid that behavior you can use --no-site-packages flag, It removes the standard site-packages directory from sys.path`
1
0
0
I setup a virtualenv and went ahead and activated the virtualenv and when I did a pip freeze for some reason it gave me a list of all global modules installed. What have I done wrong?
Python - newly created virtualenv gives a list of global modules
-0.099668
0
0
32
42,633,892
2017-03-06T19:22:00.000
7
0
0
1
python-3.6,airflow,airflow-scheduler
42,646,246
2
false
0
0
You can run a task independently by using -i/-I/-A flags along with the run command. But yes the design of airflow does not permit running a specific task and all its dependencies. You can backfill the dag by removing non-related tasks from the DAG for testing purpose
1
12
0
I suspected that airflow run dag_id task_id execution_date would run all upstream tasks, but it does not. It will simply fail when it sees that not all dependent tasks are run. How can I run a specific task and all its dependencies? I am guessing this is not possible because of an airflow design decision, but is there ...
How to run one airflow task and all its dependencies?
1
0
0
12,887
42,636,462
2017-03-06T22:02:00.000
11
0
1
0
python
42,636,531
1
false
0
0
In languages like Java, you implement getters and setters so that you do not need to change the class's interface if you want to add additional processing (such as value validation, access control, or logging) when getting or setting an attribute. This is particularly important if your classes will be used by applicati...
1
0
0
I am working on a Python project and since the instance variable names can be directly accessed by specifying class.variablename, I was wondering if it is recommended to implement getter functions for the same. I have not declared the variables as private.
Is it a bad practice in Python to avoid implementing getter functions?
1
0
0
265
42,637,127
2017-03-06T22:54:00.000
0
0
1
1
python,opencv
42,637,351
1
false
0
0
You need to update your environment variables. In search, go to the control panel Click the Advanced system settings link. Click Environment Variables. In the section System Variables, find the PYTHONPATH variable. Click edit, and add the absolute path to your Lib directory
1
0
0
I'm having some trouble installing open-cv I've tried several approaches but only succeeded in installing open-cv by downloading the wheel file from a website which I don't remember and running this command in the command prompt: pip3 install opencv_python-3.2.0-cp35-cp35m-win32.whl; I can now import cv2 ONLY if I'm on...
Installing open-cv on Windows 10 with Python 3.5
0
0
0
591
42,641,657
2017-03-07T06:29:00.000
1
0
0
0
python,mxnet
43,152,282
1
true
0
0
Using "y = mod.predict(val_iter,num_batch=1)" instead of "y = mod.predict(val_iter)", then you can get only one batch labels. For example,if you batch_size is 10, then you will only get the 10 labels.
1
1
1
I am using MXNet on IRIS dataset which has 4 features and it classifies the flowers as -'setosa', 'versicolor', 'virginica'. My training data has 89 rows. My label data is a row vector of 89 columns. I encoded the flower names into number -0,1,2 as it seems mx.io.NDArrayIter does not accept numpy ndarray with string va...
mod.predict gives more columns than expected
1.2
0
0
158
42,646,540
2017-03-07T11:01:00.000
0
1
0
0
python,rabbitmq
42,646,951
1
false
0
0
It depends on the specific details so I'll try to address some example scenarios. I assume messages are not all created equal and the last one is the right one (e.g. updated data). X is fixed, the time delta between first and last message is m seconds 99% of the time, processing a message more than one time is ok In t...
1
1
0
For some reasons, my producer sends at the same time X messages to rabbit MQ. These messages are just notification that say "i update something, do your stuff" But my consumer shall not call his callback for all messages, only one (and not wait all messages indefinitely). Is it possible to do that?
Wait all message and run callback
0
0
0
57
42,648,610
2017-03-07T12:41:00.000
1
0
1
1
python-3.x,jupyter-notebook
49,881,600
12
false
0
0
For me the fix was simply running pip install notebook Somehow the original Jupiter install got borked along the way.
6
123
0
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
0.016665
0
0
125,723
42,648,610
2017-03-07T12:41:00.000
67
0
1
1
python-3.x,jupyter-notebook
47,619,339
12
false
0
0
For me the issue was that the command jupyter notebook changed to jupyter-notebook after installation. If that doesn't work, try python -m notebook, and if it opens, close it, then export PATH=$PATH:~/.local/bin/, then refresh your path by opening a new terminal, and try jupyter notebook again. And finally, if that do...
6
123
0
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
1
0
0
125,723
42,648,610
2017-03-07T12:41:00.000
4
0
1
1
python-3.x,jupyter-notebook
47,279,945
12
false
0
0
Since both pip and pip3.6 was installed and pip install --upgrade --force-reinstall jupyter was failing, so I used pip3.6 install --upgrade --force-reinstall jupyter and it worked for me. Running jupyter notebook also worked after this installation.
6
123
0
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
0.066568
0
0
125,723
42,648,610
2017-03-07T12:41:00.000
5
0
1
1
python-3.x,jupyter-notebook
53,039,574
12
false
0
0
Jupyter installation is not working on Mac Os To run the jupyter notebook:-> python -m notebook
6
123
0
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
0.083141
0
0
125,723
42,648,610
2017-03-07T12:41:00.000
2
0
1
1
python-3.x,jupyter-notebook
54,565,364
12
false
0
0
Deactivate your virtual environment if you are currently in; Run following commands: python -m pip install jupyter jupyter notebook
6
123
0
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
0.033321
0
0
125,723
42,648,610
2017-03-07T12:41:00.000
0
0
1
1
python-3.x,jupyter-notebook
50,421,008
12
false
0
0
I'm trying to get this going on VirtualBox on Ubuntu. Finally on some other post it said to try jupyter-notebook. I tried this and it told me to do sudo apt-get jupyter-notebook and that installed a bunch of stuff. Now if I type command jupyter-notebook, it works.
6
123
0
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
0
0
0
125,723
42,649,784
2017-03-07T13:37:00.000
0
1
0
1
php,python
45,730,408
1
false
0
0
if your python file and php file in same folder: $command_to_run = "test.pyw $arg1 $arg2 , $output, $result"; $response = shell_exec($command_to_run); else: $command_to_run = "<php_folder>/scripts/python/test.pyw $arg1 $arg2 , $output, $result"; $response = shell_exec($command_to_run);
1
0
0
I am trying to run a python script from a webserver(apache) using php. I used the following command exec (python test.py $arg1 $arg2 , $output, $result) It executes successfully when I put the test.py in the document root directory. However, I wanted to run the python script from another subdirectory so that it would ...
From which directory to run python Script in webserver
0
0
0
341
42,650,548
2017-03-07T14:13:00.000
1
0
0
0
python,django,python-3.x
42,651,965
1
true
1
0
Add the app name into installed_apps in Django settings file. Then you can use all the features of the app in django.
1
1
0
I have multiple python apps that are gathering and doing manipulation with data. At this moment I use pewee as a database, but I am considering integrating them with Django, mostly because of the Django admin (more easy to manually check/modify data for me and non-devs) instead of building an interface myself. The ext...
Integrating other python apps in Django
1.2
0
0
68
42,653,958
2017-03-07T16:57:00.000
0
0
0
0
python,html,selenium,iframe,scrapy
42,658,773
2
true
1
0
If you want to find this iframe using selenium try something like driver.find_element_by_xpath('//iframe[@mytubeid="mytube1"]'). For more explicit answer please provide some code and site url.
1
0
0
What does the mytubeid tag(like <iframe src="/portal/corporateEventsCalendarIframe.html" mytubeid="mytube1" width="820" height="1600" frameborder="0"/>) do in an iframe? Note that the iframe do not have an id or as such in it! How can it be referenced in code? I am using python+selenium+scrapy to build a webscraping t...
Referencing mytubeid in iframe using Python Selenium
1.2
0
1
159
42,654,075
2017-03-07T17:04:00.000
0
0
0
0
python,algorithm,dynamic-programming,knapsack-problem,bin-packing
42,657,727
1
true
0
0
This task can be reduced to solving several knapsack problems. To solve them, the principle of greedy search is usually used, and the number of cuts is the criterion of the search. The first obvious step of the algorithm is checking the balance. The second step is to arrange the arrays of bars and chocolate needs, whic...
1
1
1
Here's the problem statement: I have m chocolate bars, of integer length, and n children who want integer amounts of chocolate. Where the total chocolate needs of the children are less than or equal to the total amount of chocolate you have. You need to write an algorithm that distributes chocolate to the chil...
Do I need to use a bin packing algorithm, or knapsack?
1.2
0
0
770
42,656,915
2017-03-07T19:40:00.000
1
0
0
0
python,matplotlib,plot,pyqt4
42,697,952
2
false
0
0
Two possible solutions: Don't show a scatter plot, but a hexbin plot instead. Use blitting. (In case someone wonders about the quality of this answer; mind that the questioner specifially asked for this kind of structure in the comments below the question.)
1
1
1
I want to work with a scatter plot within a FigureCanvasQTAgg. The scatter plot may have 50,000 or more data points. The user wants to draw a polygon in the plot to select the data points within the polygon. I've realized that by setting points via mouse clicks and connect them with lines using Axis.plot(). When the us...
How can I make matplotlib plot rendering faster
0.099668
0
0
1,682