Python is a dynamic, high-level language. Its design focuses on clear syntax, an intuitive approach to object-oriented programming, and making the right way to do things obvious. Python supports modules, exceptions, had an extensive standard module library. Python can also be embedded in other ...

learn more… | top users | synonyms (1)

-3
votes
0answers
83 views

Why should one learn Python? [on hold]

I'm an prospective developer that has about 12 months experience in Java / C# / and little knowledge in other programming languages. I'm pretty interested in learning Python but as I wanted to start I ...
-5
votes
1answer
51 views

Python rock, paper, scissors code help [on hold]

I had to create a game in Python for school so decided to make a text-based rock, paper, scissors game. The code seems to look correct but the variable or flow of things isn't correct. Here's the ...
-3
votes
0answers
22 views

Python Assignment of a Variable By Looping through a Range [migrated]

The first two if statements should be identical... The first one works, the second does not work. What is wrong with the second if statement? row=0 tsig=0 InTrade=[] for data_buy ...
-1
votes
0answers
13 views

problem re-associating .py from Python26 to 27 on Windows 7

I needed to re-associate python .py file from Python26 to Python27 on Windows7. New association now works but at first when I ran test python script it failed. I had to re-run same script 3 or 4 times ...
-1
votes
0answers
49 views

Python beginner advice [on hold]

About myself: I'm coming from a non programming background, nor mathematics; I was learning foreign foreign languages (still am) but I started doing some basic coding and I really like it, therefore ...
0
votes
0answers
33 views

Algorithm for Multiple Choice Test Prep App

I'm working on app that helps students prepare for a specific exam. I have a database of 1000 questions, question categories, multiple choice options, hints and correct answers. Today, the app simply ...
0
votes
2answers
58 views

Literals versus instantiating by name lists and dicts in Python?

In Python, what is the difference in these declarations… my_list = [] my_list = list() …and in these? my_dict = {} my_dict = dict() Are they interpreted the same, and why would you use one over ...
0
votes
0answers
25 views

Place of a threading module in a MVP design pattern in Python

I am working on a GUI that displays images, 1 image or many (a video). Some processing is needed before displaying an image. Hence, I would like to do some threading in order to keep the GUI ...
-1
votes
0answers
57 views

Is it legal to distribute a Python commercial and closed source application together with QtPy or PyQtGraph linked to PySide? [closed]

This question is a twin brother of the following question: Am I rigth that anyone can use PyQt free of charge for commercial and closed source applications?. But it still differs in important details. ...
0
votes
0answers
88 views

Am I right that anyone can use PyQt free of charge for commercial and closed source applications? [closed]

This is a question about licensing mechanics of PyQt, GPL and optional Riverbank GPL Exception. The whole point of the question: Am I right that anyone can use PyQt free of charge for commercial and ...
-4
votes
0answers
37 views

Picking a random word in Python [closed]

I have a tuple which contains three lists in python and I want the interpreter to pick a random word from each list to make a sentence. How do I do this? An example of what I'm saying is this: Tuple ...
0
votes
0answers
16 views

Difference between RAISE and RETURN HTTPResponse in bottle framwork

I am using Bottle framework to implement API's. There is code return before I started, and they use from bottle import HTTPResponse @api.get('/some/api/url') def some_method(...): ... ... ...
1
vote
2answers
180 views

Python build system

Currently our Python application is deployed like this: Development team work on issues, commit code and create a Pull request Pull request is integrated to Development branch QA and Operations team ...
3
votes
1answer
44 views

Importing large data sets into a database over the web

I need to import 100,000 products from one database to another using the results from a RESTful API. But I can only do this overnight. So if I can't get the job done in one day, I need to spread it ...
0
votes
1answer
44 views

Most Pythonic way to remove first match of potential leading strings?

This is a bit difficult to describe, but I'll do my best. In Python, I can use string.startswith(tuple) to test for multiple matches. But startswith only returns a boolean answer, whether or not it ...
5
votes
1answer
42 views

How do I scale up a bot/service?

I have this bot that I've created for Twitter. It's written in Python. It lives on my Raspberry Pi and I've set up a cronjob to run it every 60 seconds. Part 2 of the project is to build a web app ...
1
vote
1answer
100 views

Is using __import__('module_name') an antipattern in Python?

I'm currently refactoring a Python 2 project which includes the ability to add or remove plugins, which are Python modules implementing a given API. The main app accesses add/remove/update hooks in ...
0
votes
0answers
39 views

Modeling a cookbook recipe with django

I'm trying to model recipes in a cookbook. Here's what I have so far: class Recipe(models.Model): title = models.CharField(max_length=255) class Ingredient(models.Model): class Meta: ...
-1
votes
0answers
17 views

Why are my tuple values changing (Python)? [migrated]

I have a tuple. The first element is a float and the second is a list with more nested lists containing floats (don't worry about what these values mean). (0.2742965753780876, [[[33.119], [-8.326]], ...
-1
votes
2answers
98 views

How to write code for different versions of linux

So, I've written some fairly big code for cent OS 7.1. The code essentially makes use of different command line tools by parsing the text output and shoving it in a database... pretty straight ...
-1
votes
0answers
9 views

Can't install the “Boost” prerequisite for Caffe [migrated]

I'm getting into machine learning, and I recently happened upon this: Wide-Area Image Geolocalization with Aerial Reference Imagery . It's a net that predicts the GPS location of an image, from ...
-3
votes
1answer
76 views

Which license should I choose so I can open source my Botnet and not get sued?

I have been working on a Botnet for a high school project in Python and would like to open source it and share it on GitHub without getting sued. I need help with choosing a license such that I am ...
1
vote
1answer
40 views

Best structuring for IRC message decoding (Python)

I am writing a simple IRC chatbot in Python and, in an effort to get more into OOP, made a basic "connection" class that manages all the backing-and-forthing involved. But IRC protocol is rather ...
0
votes
0answers
36 views

Dynamic programming vs branch-and-bound for the knapsack problem

I have to implement a program that solves the 0-1 knapsack problem, where the weights and values of all items are nonnegative integers. We went over two methods in class: dynamic algorithms ...
1
vote
1answer
138 views

Is calling the superclass constructor in a subclass really important?

The following piece of Python code uses a superclass solely as the repository of functions that one of more subclasses may draw from: class Class(object): ''' A trivial repository for functions to be ...
-3
votes
0answers
30 views

Trying To Make Second Window on Tkinter (code included) [on hold]

New to programming in general and this is my first program. I want to be ablke to click one of the buttons to show a new window on the screen as well as carry the variable for PriceGrabber which is ...
-2
votes
2answers
117 views

Are there coding standards for whether procedural programs should have source code listed top-down or bottom-up? [closed]

Let's say I have a basic procedural program which is well structured into decomposed functions. For example, a main() function which calls functions a and b, which in turn each call functions c and d, ...
-1
votes
1answer
76 views

Parsing a string with multiple levels of key value pairs

I need to write a part of the program which will work with a string, find in it some substrings and copy they to dictionary. Example of the string: thestring ='\ #: somethings\nchars0 ...
-3
votes
0answers
89 views

PyPy vs. Cython pure python mode vs. CPython for Django

Cython has a pure Python mode and PyPy is an implementation of Python with a JIT compiler. How do Cython, PyPy, or CPython compare for a Django application's speed if I use type annotations in 90% of ...
-2
votes
1answer
75 views

In what way does programming help towards cyber security [closed]

I've been studying the cyber security field with great interest. I understand how networking can help cyber security but I am not sure how advanced programming knowledge can help fight cyber crime or ...
1
vote
0answers
49 views

Choosing Between Ruby and Python for a FS Microservice Backend in Node App [closed]

I have been working on a application that up until now has been pure Node. However I am concerned about performance and overhead since the application performs a lot of file system operations (Copy ...
-2
votes
1answer
125 views

Is this unprofessional when “Wappalyzer” sees all my technology? [closed]

After I installed "Wappalyzer", extension wich display technology, wich site using. I checked many sites and in most of cool projects, like "Youtube", "Github","stackoverflow" etc, wappalyzer display ...
-1
votes
0answers
54 views

How to decompose strings into a list of its spelling in an efficent way?

I have the problem where I'm taking as input a string, for example "table python desk" and I wish to decompose the string in terms of its spelling. So I want to output "t ta tab tabl table p py pyt ...
0
votes
0answers
42 views

How and where should I put a version number in my Django project?

I'm making a Django project consisting of several apps and I want to use a version number for the whole project, which would be useful for tracking the status of the project between each time it comes ...
-3
votes
0answers
32 views

Notification feed in Python for Android app

I am working on writing backend (REST API using Flask) for a Android app (simple content posting app). I need advice in implementing a notification feed where a user can see all the activities related ...
1
vote
1answer
96 views

python: detecting if my method is called with 0 or 1 args

I want to write a suite of methods that act as getters when passed zero arguments and as setters when passed a single argument. I have two two reasonable implementations, shown below. Is one better ...
4
votes
1answer
52 views

Common imports between many scripts in Python project

I'm writing an automated installation script for a bunch of software, in Python. The purpose is for the script to fetch compressed files from a directory and install/configure each utility or ...
2
votes
2answers
44 views

Accomodating a LGPL Python module into a BSD project

I have a program written in Python that I would like to make available to the public under a three-clause BSD license. My program has an import blah statement, where blah is a Python module that is ...
0
votes
0answers
29 views

How would I identify a gap in a set of curve data, and get its value?

I have a set of 2-D data (x,y) and it produces a set of curves, and sometimes the set of curves do not overlap, and there is a distinct separation between the groups of curves, how would I identify ...
0
votes
1answer
108 views

Is there any simpler way to check the strong level of password?

So i found out this following code used to check the strong level of password. I was kind of confused about the part: score = len([x for x in password_strength.values() if x]) I know that it was used ...
1
vote
1answer
37 views

Pyinstaller EXEs license

I'd like to know about licenses in Python program distributions. This is the scenario: let's say one would distribute a Python program for Windows, created with PyInstaller as a single executable ...
-3
votes
1answer
120 views

Returning a variable or a return code from a function

Let assume that we have a main() function in which we call a createDirectory() function. In Python for instance, the code would be: def main(): # Do some stuff createDirectory(myPath) # ...
-3
votes
1answer
76 views

When I am doing a GET request to any website, how do I prevent that website from seeing my IP address? [closed]

I'm new with programming. I was wondering if, when I am doing a GET request to any website from my python application, they will see my IP in their logs. And if so, will enabling a VPN be able to ...
0
votes
2answers
45 views

Modelling a REST Object Question (Python)

I have a REST API that I want to model in a class so I can access the properties using the dot notation (JS list notation). I explicately defined the properties on my class using the @property tags ...
6
votes
4answers
231 views

Is using nested function calls a bad thing?

In a recent homework assignment I ended up calling my functions in an ugly way uglyReceipt(cashParser(cashInput())) the program itself worked perfectly but I still felt like I was doing something ...
4
votes
3answers
100 views

Microservices and shared libraries

We are designing a system based on independent microservices (connected via a RabbitMq bus). The code will (for the first components at least) be written in python (both python2 and python3). We have ...
0
votes
1answer
13 views

Shortest route between wikipedia articles in python

I have a python program which collects links from wikipedia, and stores the article names in one file, and the links between them in another. For the first file, every article name is stored, and ...
1
vote
1answer
78 views

Cross-platform unicode support for Python command line tool

I am working on a large command line tool, written for Python 2.6+ and supported for Windows, OS X and Linux. The target users are developers but it is also being auto-invoked by CI-systems etc. In ...
0
votes
2answers
68 views

Why is the _replace method of Python namedtuple classes protected?

In the section Method Names and Instance Variables, the Python Style Guide (aka PEP 0008) says, "Use one leading underscore only for non-public methods and instance variables." Why then, does the ...
-2
votes
2answers
77 views

When using an if statement with or in Python, is there a way to identify which variable exactly triggered the statement?

If I have something like this: var1 = input("Enter a number lower than or equal to 100") var2 = input("Enter a number greater than or equal to 1.") if var1 > 100 or var2 < 1: ...