Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.

learn more… | top users | synonyms (2) | python jobs

0
votes
0answers
14 views

How to use Python to start a query from a static website?

The problem I have the following question: I need to search for some information about a company using the following link: http://corp.sec.state.ma.us/CorpWeb/CorpSearch/CorpSearch.aspx I need to ...
0
votes
0answers
2 views

Tracing IDA route python script

I am very new doing IDA scripts so I want to start doing something very easy. I just want to log all the instructions that has been accesed in a specific time period. I have a binary that I am ...
-1
votes
0answers
9 views

How do you tell if a user actually downloaded a file from your Pyramid Python server?

I am trying to track all activities of users on my site and I want to be able to tell if someone actually downloaded a file from my server, which is made with Python Pyramid, opposed to "Canceling" it ...
0
votes
0answers
13 views

Perl to Python hash sort

I am trying to translate a line of Perl code to Python, but I came to a roadblock on Python's sorted() method. Python does not have native hash support like in Perl, so i used autodict() to replicate ...
0
votes
0answers
4 views

How to route form errors to another view using Flask, FlaskWTF

I'm trying to create two views using Flask. The first view show_entries displays a list of entries in a table. It also includes a form to create new entries. The form gets submitted to a second view ...
0
votes
3answers
17 views

Python: How to try again when experiencing a timeout

I have a python program that connects to a server to send it some commands but occisonally I get this error TimeoutError: [WinError 10060] A connection attempt failed because the connected party did ...
0
votes
1answer
14 views

Argparse“ArgumentError: argument -h/--help: conflicting option string(s): -h, --help”

Recently, I am learning Argparse module, Argument error occured below the code import argparse import sys class ExecuteShell(object): def create(self, args): """aaaaaaa""" print ...
-2
votes
2answers
31 views

Properties of boolean operators in Python

If I have an if statement that uses and and or, can I do something like: if (a=0 or x=2) and y=1: or do I have to repeat myself and do: if a=0 and y=1 or x=2 and y=2:
1
vote
2answers
20 views

Union of many Counters

What's the best way (in terms of readability and efficiency) of finding the union of a list of Counters? For example, my list might look like this: counters = [Counter({'a': 6, 'b': 3, 'c': 1}), ...
0
votes
2answers
42 views

Python how to detect \n in input

I am trying to force a binary input on the user and all is working expect when a user inputs a \n. The program just skips over that input thus throwing a out of index error on a list latter on. ...
-3
votes
1answer
32 views

Python Comparing Integers and floats

this is the question. Write python code to test whether an integer n equals 10 and wheter a floating-point number x is approximately equal to 10. n = 10 m = int(input("enter an integer") if m*m == ...
0
votes
1answer
34 views

Bad Argument Handling in C: “Expected ” + str(status) + “ got ” + str(child.returncode))"

I have the following code: while ((c = getopt(argc, argv, "i:o:")) != -1) { switch (c) { case 'i': inFile = strdup(optarg); break; case 'o': outFile = ...
2
votes
2answers
37 views

Python library for latitude/longitude calculations?

Is there a standard library for latitude/longitude calculations in Python? I'd like to calculate things such as 2.6 km away from -122.28,37.90 at 30 degrees
0
votes
1answer
13 views

python tkinter - want to call a function when scrollbar clicked in ScrolledText widget

[Edits noted:] I want to hook into the ScrolledText widget so that when a user clicks anywhere in the scrollbar (or even scrolls it with the mouse, hopefully) I can have it call a callback function ...
0
votes
0answers
11 views

PyQT: LineEdit over QTextEdit

Okay, I really need help with this... I have a dockwidget, and in that dockwidget I have a textedit. Ok, all is fine so far, and here is the code for that: # -*- coding: utf-8 -*- # Form ...

15 30 50 per page