Questions tagged as 'python'

1
answer

Scrapy for login

I got this code from the internet and I changed a little, to log in to the cpfl website, but when I use the command scrapt crawl myproject nothing happens and the command scrapy runspider items.py gives the error error:    No el...
asked by 08.08.2018 / 15:44
1
answer

What is the Python function equivalent to Crypt in PHP

I have a program in PHP that encrypts a password with the crypt method: $crypt = '$1$/E0xe3/3$yPzJElk.aVSd5JoQTopDZ/'; if($crypt == crypt($_POST['key'],$crypt)) And with that I generate the following hash of this password: *...
asked by 07.08.2018 / 20:39
1
answer

Creating a multi-value dictionary for a key

I'm trying to create a code to register with input , as exercise. dic = {} ... def cadastrar(): nome = input('Nome: ') variavel1 = input('variavel 1,: ') variavel2 = input('Variavel 2: ') dic.update({'nome': 'variavel1',...
asked by 07.07.2018 / 17:51
2
answers

Python and Access

Help please, my class does not connect in Access at all .. I'm using: PyCharm, win10 (x64), office 2007 and 2016, python 3.6 (x86). I thank the attention. follows the class example: class Banco(object): def __init__(self): conStr = "DRIVER...
asked by 05.07.2018 / 22:25
1
answer

Python - Doubt about imports in creating libraries

If I'm creating a library, and I put import json , in my main (my main file) would I have to import json or just give import from my same library? Thanks in advance for your help.     
asked by 07.09.2018 / 16:50
1
answer

How to copy files preserving your metadata?

I am making a script that identifies the changed files in two folders and then copies (if changed on the modification date) from one to another, synchronization. To copy the files already tried to use: shutil.copy() shutil.copy2() shutil....
asked by 30.06.2018 / 14:00
1
answer

How to create a local network (intranet) with django? [closed]

I'm breaking my head, I have tried several and different gringos tutorials and nothing works with excellence. I have a django system on a regular computer (windows 10) and I'm trying to leave the localhost open for other network computers to acc...
asked by 03.07.2018 / 21:16
1
answer

Increase Spirograph loop speed in turtle

Using these references: Spirograph Patterns and python 3.4 spirograph error The following code was created: Code import turtle import math import random def Xcord(R,r,p,t): return (R-r) * math.cos(t) - (r+p) * math.cos((R-r)//r*t)...
asked by 04.07.2018 / 19:42
1
answer

Exception XML-RPC class (Python)

I'm trying to create a class in XML-RPC, but it's giving an Exception, but I do not understand why. It's just a simple example:    server.py from xmlrpc.server import SimpleXMLRPCServer import pickle class Animal: def __init__(self, numb...
asked by 25.06.2018 / 15:52
1
answer

REGEX to remove sites, emails [closed]

I want to remove the addresses of sites, emails, etc ... url_regex = re.compile(r'(?i)(<|\[)?(https?|www)?(.*)?\.(.*){2,4}') mail_regex = re.compile(r'(?i)(<|\[)?@(.*)\.(.*){2,3}') In this way, I could remove for example:    link...
asked by 11.07.2018 / 15:59