Questions tagged as 'python-2.7'

0
answers

Constant error in using strptime

Expensive, I've always worked on strptime without major problems, but an error began to appear that I did not find in any citation: from datetime import datetime a = "20160228" date = datetime.strptime(a, "%Y%m%d") This is just the examp...
asked by 08.05.2018 / 21:55
1
answer

Get data from a specific column in CSV

I have a question in an exercise. I have a table where I need to get results from only one column. The data is as follows: ['2017-01-01 00:27:45', '2017-01-01 00:31:13', '208', 'Damen Ave & Chicago Ave ',' Damen Ave & Division St ',' Subscrib...
asked by 04.05.2018 / 20:45
1
answer

Get email content

I'm using the following: import imaplib import email m = imaplib.IMAP4_SSL("imap.gmail.com", 993) m.login("myemail","mypass") m.select("Inbox") result, data = m.uid('search', None, "ALL") # search all email and return uids if result == 'OK':...
asked by 09.04.2018 / 21:07
0
answers

How can I use OpenCL to use the GPU for processing?

A program I wrote in python has required a lot of CPU processing, leaving it somewhat slow. How could I do to use the GPU for processing with opencl (or other media)?     
asked by 09.04.2018 / 21:23
0
answers

How do I install the discord.py library on the unbutu terminal?

How do I install the discord.py library on the unbutu terminal? The discord is already installed, I want to install the library now, through the terminal.     
asked by 03.04.2018 / 21:40
0
answers

Write data to a mysql table in phpAdmin

I'm a beginner in python and I'm trying to develop my first application in this language and I'm having trouble writing information to a mysql table inside the phpMyAdmin tool, the situation is as follows, I created a form in PYQT4 DESIGNER and...
asked by 03.04.2018 / 22:27
1
answer

How to run Python scripts with .txt entry in Windows?

Hello, I am a beginner here in Stack Overflow and Python, and I need help to run a file from my class whose input is written a .txt file. I know that in the Linux terminal, for Python 2.7, the command is something like this: python arqu...
asked by 31.03.2018 / 21:35
0
answers

Problems to use the library requests

I'm having trouble using the python2 requests library. I have already done the installation and when I run pip install requests I see that it is already installed. Could someone help? Python 2.7.14 (default, Sep 17 2017, 18:50:44) [GCC...
asked by 22.03.2018 / 22:48
0
answers

Python2.7 + Google BigQuery + HTTPLIB2 - Proxy Error

Good afternoon, I'm using google BigQuery for python2.7. I need to set the proxy for such access and so I use the httplib2 library as per the code below: # Imports the Google Cloud client library from google.cloud import bigquery import uui...
asked by 08.03.2018 / 17:57
0
answers

Changing specific positions of a vector, determining random and equal values

I have the following vector: [**17, 17**, 1954, 909, **17, 17**, 411, 844, **17, 17**, 1954, 909, **17, 17**, 411, 844] As can be seen, the indices [0,1]; [4,5]; [8, 9] and [12, 13] are equal. I need to assign a random value, but equa...
asked by 10.03.2018 / 03:32