Questions tagged as 'python'

1
answer

Extracting data from a calendar with Python and Beautifulsoup (under Linux Ubuntu-like)

Friends, I would like to get data in a calendar: link The first step would be to have the program choose time zone (-3: 00 Buenos Aires) and click Submit Time Zone. After clicking on Submit Time Zone, select the city (Rio de Janeir...
asked by 22.02.2017 / 12:27
1
answer

Application form with Python and Django

I'm starting my studies with Python and Django. After creating several simple CRUDS, I tried to create a more complex form using several classes, but I was not successful. I want to create a screen for typing orders with the customer informat...
asked by 07.03.2017 / 02:36
1
answer

How to do a "time-slice" in packages in a network dump with Python?

I'm trying to "catch" source IPs and destination IPs inside a network dump (PCAP) file. The idea is to save all source IPs and all destination IPS by scanning the file every 10 minutes ("time-slice"), for example. The code below opens the dum...
asked by 03.03.2017 / 01:43
2
answers

Import CSV and convert date in dd / mm / yyyy format to yyyy-mm-dd

I'm totally new to programming, both in Python and Sql, so I have some questions that may seem basic. I get a .CSV file that comes with lots of information not compatible with Sql so I always have to manually change and import using the followin...
asked by 19.05.2017 / 17:38
1
answer

Python chart does not display all desired values

I would like the graph to show only the values of the x, y coordinates corresponding to the points. But it's not like this: Forexample:ThepointwhoseXcoordinateis04/10/201709:41:00doesnotdisplaythevalueofitsYcoordinate.Thenextdotdoesnotdispla...
asked by 02.07.2017 / 19:57
3
answers

JSON does not return utf-8

I'm using freegeoip to know my location and use it in my program, but when I make a call using: r = requests.get(location_url, headers={"content-type":"application/json;charset=UTF-8"}) The return looks like this: { ip: "0.0.0.0", cou...
asked by 10.07.2017 / 18:10
1
answer

join method is not working

Good! I'm creating the battleship game and I encountered a problem creating the board. Code: board = [] for x in range(15): board.append(["O"] * 15) def print_board(board): for row in board: print (" ").join(row) And wh...
asked by 17.12.2016 / 19:39
3
answers

Any help in the function exercise (python)

The exercise says the following: "Write a function that receives a positive integer m and returns 1 if m is prime, 0 otherwise." My attempt: edit: Then, if the modifications are made, the program is not yet returning values of 1 or 0 (...
asked by 21.06.2017 / 06:08
2
answers

Add a new value at the beginning of a pandas series

How do I add a new value to a pandas series? I made the copy of the dataframe series and now I need to add a new value to the swap_hoje series, however, instead of being at the end of the series, I need it to be at the beginning, at...
asked by 21.06.2017 / 18:51
1
answer

Check index in dict

I have a function that returns 2 results, None or dict however I am trying to check if a key specifies this in the result of this function. def get_language(card): if not card.foreign_names == None: for c in card.foreign_name...
asked by 21.01.2017 / 13:17