Posts by Vinicius Mesel • 821 points
36 posts
-
0
votes5
answers714
viewsA: I want to turn a text into a list of dictionaries
Hello, To solve your problem you would have to develop an algorithm "similar" to the diff, on it you will need to check a dictionary to see if the tweet you have already made is inside it, if yes,…
-
1
votes1
answer84
viewsA: Python - How to make a Packet logger from a server?
Your question is very broad, so let’s go in pieces. If you just want a logger, you can run Python 2.7/3.X logging lib to capture these details and put them in a log file. Can you already print and…
pythonanswered Vinicius Mesel 821 -
0
votes2
answers1377
viewsA: How to start a Python application with Windows?(cx_freeze)
You could make a bat and add it together to the PC startup. So you would make your bat have the following content: C:/Caminho/Do/python.exe C:/Caminho/Do/Seu/Arquivo And if you run it you can run…
-
2
votes3
answers2556
viewsA: How to join multiple lists in a matrix
There is a command called zip that is from the native Python library, it takes as argument the name of the variable that stores the lists. For example: from itertools import zip_longest a =…
pythonanswered Vinicius Mesel 821 -
2
votes2
answers936
viewsA: Chained list: how to modify data from a list without changing the others?
The only way to do this that you are describing here would be by iterating your list with one for and one for the list that is chained within the list. a = [["a","a","a","a"],["a","a","a","a"]] for…
-
1
votes1
answer256
viewsA: Dictionary in python
You must save this value in a variable and then print it or return its value. In case, as you are using a generator, you need to have a "receiver" in order to be able to Handling these values. To…
-
2
votes1
answer212
viewsA: How to include contents of a page . py on another page . py
In fact, you didn’t even have to go as far back as Paulo mentioned above. You can make a function that stores these values and in the other file you pull it: from arquivo1 import funcao a,b,c =…
-
-2
votes2
answers380
viewsA: Algorithmic complexity of map
Map is a part of functional programming that can be done in Python. In it we can apply the regression algorithm in smaller code space. In this case, on its first line, the first map takes the Dice 0…
pythonanswered Vinicius Mesel 821 -
4
votes2
answers3669
viewsQ: Decoding of file in Python
I have a file that is completely written like this after my Crawler also written in Python has saved the data in it: b'N\xc3\xa3o n\xc3\xa3o n\xc3\xa3o, n\xc3\xb3s iremos sim!' I wonder if there is…
-
0
votes2
answers1150
viewsA: Pass pythonic form parameters
Matheus, just as @Gomiero said in the previous reply, you can do the following: def Pessoa(self, nome, idade, flag): return("Nome: {}\n\rIdade: {}\n\rFlag: {}".format(nome, idade, flag)) And to call…
-
1
votes1
answer484
viewsA: Google follows URL from data-href?
The data-href is a variable that was created for HTML to be able to trigger Java Script events, so this is extremely normal and no, Google does not follow as if it were a <a href=""> since it…
-
0
votes1
answer709
viewsA: Django-admin.py execution error on Django 1.9
You can spin django-admin startproject mysite (Note that it is not Django-admin.py), because if Django was installed by Pip, there is an executable in C:/Python34/Scripts that is already in its…
-
1
votes2
answers526
viewsA: Python 3.5 + Django + Postgresql on Windows
Adapters that refer to version 3 will very rarely be incompatible with more current versions. But if you are running Python 2.X you should look for one for it! I already say that this adapter…
-
1
votes3
answers2753
viewsA: Solution to scan documents by browser
There is no simple way to develop such a project! Only if you rely on the camera of a smartphone instead of a scanner actually said! You, in such a project, will have problems with scanner drivers…
-
0
votes2
answers526
viewsA: Python 3.5 + Django + Postgresql on Windows
You can try to force the adapter, but it might have some version differences bugs (which should be minimal but exist) or even test another type of database like sqlite in conjunction with another…
-
0
votes1
answer198
viewsA: How to run a code outside a directory in Python?
Install the numpy through the Miniconda, using the command conda install numpy After that, include the directory of numpy in the folder of Miniconda using the command sys.path.append(DIRETÓRIO) From…
-
1
votes7
answers8821
viewsA: Regular expression for phones?
Buddy, take a look at this: ^(\(11\) [9][0-9]{4}-[0-9]{4})|(\(1[2-9]\) [5-9][0-9]{3}-[0-9]{4})|(\([2-9][1-9]\) [5-9][0-9]{3}-[0-9]{4})$
-
5
votes1
answer192
viewsA: System of real estate sites and redirection to each domain pointed
You can use only one directory and make a change, but in it you should check 2 things: First of all you will need to take the URL that your customer used to access the site and make the following…
-
1
votes2
answers1697
viewsA: Ackerman function - Python
Here is your function! This function is the origin of the recursive function. In it you have to have two parameters that follow those rules that you passed in the mathematical formula, after that,…
-
2
votes2
answers2646
viewsQ: Python installed but Environment Variables (Environment Variables) does not contain the information
I installed Python 3.5 and in its installer comes with the option to put it automatically in Environment Tables, but it didn’t work, as I do to add it so it can compile?
-
2
votes2
answers2646
viewsA: Python installed but Environment Variables (Environment Variables) does not contain the information
In order to install it in this area of your Windows you will have to go to: Painel de Controle > Sistema e Segurança > Sistema > Configurações Avançadas de Sistema By clicking on this part,…
-
0
votes1
answer125
viewsA: Error importing xml.parsers.Expat in Python 2.7 only works with Python3
Izabel, you already tried to change the name of your file? Sometimes python 2.X recognizes it as the same function file! The part where you say your code runs normally with python 3 and not with 2…
-
2
votes1
answer63
viewsA: Nameerror in get_special_folder_path
Dear friend Pythonista, thank you so much for the language preference hehehe! This script you are making would be for a post-installer? Otherwise, the get_special_folder_path(csidl_string) function…
-
0
votes2
answers104
viewsA: Change Wordpress functionality
There are two ways to do this, if you take your text and the image that is the first is the thumbnail of the post you can do the form 1, if it is an image in the text and not the highlighted you can…
-
-2
votes3
answers544
viewsA: Open php file in ascending order
Friend, besides you can do by a TXT file, if you have a base numbering you can do by this method: Assembling an Array You would mount an array with the filename manually or with some PHP directory…
-
11
votes9
answers12451
viewsA: How to prevent SQL code injection into my PHP code?
In addition to stopping using deprecated libraries as already stated in response, you should check your queries to see if any of them are passing something sensitive without encryption, if any of…
-
0
votes2
answers1139
viewsA: PHP - How to fill a field using Curl?
Bruno, you first have to join the two in an array, so you know that always an odd number is an email and an even number is a name. After that, you must validate the data on Ubmit and print whether…
-
0
votes2
answers1612
viewsA: Import module from another folder
First, in both folders you must have a file __init__.py, after this, some module must be in a previous directory to each other, or you import the two into a python in the root directory of both!…
-
1
votes3
answers2021
viewsA: How to connect Mariadb with python3?
Since Mariadb is the same core as Mysql, you can use the same Mysql module to access DB. Access this link and see…
-
0
votes2
answers158
viewsA: How to use Kivy with Python 3.4.3 on Mac
Unfortunately, you can only use it on Mac with version 2.7 of Python!
-
0
votes2
answers2351
viewsA: mysql file download
Technically it’s simple, you just need to request on DB and do a while writing: <a href="<? echo $row[link_conteudo']?>"><? echo $row[titulo']?></a>…
-
3
votes1
answer77
viewsA: Count Values with PHP and SQL
I don’t know much about PHP, but you can put with the following SQL implementations: SELECT count(*) FROM nometabela WHERE Resposta = "1"; With this code you can echo your PHP and find out how many…
-
5
votes4
answers545
viewsA: File Subdomain, Site Optimization
If it is on the same server Subdomain will not help at all, as it will continue downloading from the same location! The interesting thing for you would be to hire a CDN(Content Distribution…
-
1
votes1
answer290
viewsA: Is it possible to add non-native libraries to python?
Is there a way for you to add it directly to your project code and get it, in a way, already embedded. Or you can use a folder in your project with a name you want and in python you put: from modulo…
-
6
votes1
answer2821
viewsQ: How to modify a Label when writing in Entry on Tkinter?
I would like to make a program that detects the change in the Entry text and changes the Label to the same Entry text, as I can do this? from tkinter import * # Configurações da Tela window = Tk()…
-
5
votes1
answer6374
viewsQ: Python 3.4 and Python 2.7: How to remove the preinstalled Macbook Version?
I am currently migrating from a mac to a Windows and today I discovered, when installing all the resources I needed, that there was already a Python 2.X in it and I need to run Python 3.4.3. How can…