2018-06-30         Madge

How to take screenshots in Python with certain pixel range?

Does anyone know of any modules or any way in Python to take a screenshot of a certain pixel range on the screen? I have been looking but couldn’t find anything online. try This oneimport pyscreenshot as ImageGrabimg=ImageGrab.grab()img=ImageGrab.grab(bbox=(10,10,500,500))ImageGrab.grab_to_file('img.jpg') [XXX]

 python                     1 answers                     7 view
 2018-06-30         Berton

Pandas interpolation not interpolating with certain methods

I have a dataframe like so:[5232 rows x 2 columns] 0 20 2018-02-01 00:00:00 2018-02-01 00:00:00 435.242018-02-01 00:30:00 2018-02-01 00:30:00 NaN2018-02-01 01:00:00 2018-02-01 01:00:00 301.322018-02-01 01:30:00 2018-02-01 01:30:00 256.682018-02-01 02:00:00 2018-02-01 02:00:00 245.52And I'm trying to interpolate it. I've found that the basic panda's methods work fine (e.g. time or linear), but if I try and use a scipy method like krogh or barycentric I find that the interpo...

 python                     1 answers                     9 view
 2018-06-30         Edith

Django shell script definition error

I have a file test.py with this code:def getTrue(): return Truedef getSome(): return getTrue()somevar = getSome()print(somevar)When I run the script usingpython manage.py shell < test.pyI get the errorNameError: name 'getTrue' is not definedAfter addingimport unicodedataTo the top of the file and then try using some function from unicodedata I get this error:NameError: name 'unicodedata' is not definedI don't see how the answer to the question that my question is marked as a possible duplicate of is answering this part. When I run the file normally withpython3 /pat...

 python                     1 answers                     13 view
 2018-06-30         Hannah

How do I import modules in pycharm?

In PyCharm, I've added the Python environment /usr/bin/python. However,from gnuradio import grfails as an undefined reference. However, it works fine in the Python interpreter from the command line. GNURadio works fine with python outside of Pycharm. Everything is installed and configured how I want it.Gnuradio is located at /usr/local/lib/python2.7/site-packages/gnuradioAlso: PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages/gnuradio Adding a PathGo into File → Settings → Project Settings → Project Interpreter.Then press configure...

 python                     8 answers                     26 view
 2018-06-30         Parker

Install MySQLdb with Anaconda

I "successfully" installed MySQLdb using:pip install mysql-pythonBut when I use the terminal to check, "import MySQLdb" throws this error: Traceback (most recent call last): File "", line 1, in File "//anaconda/lib/python2.7/site-packages/MySQLdb/init.py", line 19, in import _mysql ImportError: dlopen(//anaconda/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libssl.1.0.0.dylib Referenced from: //anaconda/lib/python2.7/site-packages/_mysql.so Reason: image not foundI'm assuming this is due to some issue with linking, but I don't know what...

 python                     1 answers                     27 view
 2018-06-30         Jocelyn

python cannot import opencv because it can't find libjpeg.8.dylib

Trying to get opencv for python working on Mac OSX - Mavericks but keep getting an image not found for libjpeg.8.dylib when doing import cv from python(Recently updated from Mountain Lion)This is what I did:brew tap homebrew/sciencebrew install opencv-so far everything is fine python import cv -got the following error:Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv.py", line 1, in from cv2.cv import *ImportError: dlopen(/usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv...

 python                     4 answers                     28 view
 2018-06-30         Rory

Problems using psycopg2 on Mac OS (Yosemite)

Currently I am installing psycopg2 for work within eclipse with python.I am finding a lot of problems: The first problem sudo pip3.4 install psycopg2 is not working and it is showing the following message Error: pg_config executable not found.FIXED WITH:export PATH=/Library/PostgreSQL/9.4/bin/:"$PATH”When I import psycopg2 in my project i obtein: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/psycopg2/_psycopg.so Library libssl.1.0.0.dylib Library libcrypto.1.0.0.dylibFIXED WITH: sudo ln -s /Library/PostgreSQL/9.4/lib...

 python                     7 answers                     28 view
 2018-06-30         Riva

About Python pygame font.SysFont

font = pygame.font.Font.render(None, 25)def message_to_screen(msg, color): screen_text = font.render(msg, True, color) screen.blit(screen_text, [display_width/2, display_height/2])while not game_exit: for event in pygame.event.get(): if event.type == QUIT: game_exit = True if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: lead_x_change = -moving_speed if event.key == pygame.K_RIGHT: lead_x_change = moving_speed if event.key == pygame.K_UP: lead_y_cha...

 python                     1 answers                     29 view
 2018-06-30         Calvin

can not import cx_oracle in OS X

I have successfully installed cx_oracle using pip, but when error ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cx_Oracle.so, 2): Library not loaded: libclntsh.dylib.11.1 Referenced from: /usr/local/lib/python2.7/site-packages/cx_Oracle.so Reason: unsafe use of relative rpath libclntsh.dylib.11.1 in /usr/local/lib/python2.7/site-packages/cx_Oracle.so with restricted binaryoccurred when I import cx_Oracle with ipython console. What's more another error ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cx_Oracle.so, 2): Library not loaded: libclnts...

 python                     1 answers                     31 view

Page 10095 of 10095  |  Show More Pages:  Top Prev Next Last