Questions tagged [python]

Python is a dynamically typed, high-level interpreted programming 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 and exceptions, and has an extensive standard module library. Python is general-purpose and thus used widely, from the web to embedded systems.

Filter by
Sorted by
Tagged with
-2
votes
1answer
1k 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 ...
-2
votes
1answer
73 views

Packages with only __init__.py - Possible issues?

Considering a Python Project structure such as the following, where there are "empty" packages with __init__ files simply pulling code from the lib folder: . ├── foo │   ├── fred │   │   └── __init__....
-2
votes
1answer
216 views

Calculating longest trip [closed]

I have been stuck on this question for some time. Could you guys direct me or point me to the right direction for solving this problem ? We would like to encourage passengers to experience the joy of ...
-2
votes
1answer
348 views

Auto test with random keys from dict with added values equal to a certain number

I have a list (23 items) of choices and I've transformed it into a dictionary in order to have a value for each choice. I need to select 3 random choices from that dictionary each time I run the test ...
-2
votes
1answer
197 views

What Is the Best (Conventional) Way to Format Code for PyQt5

I was looking into PyQt5 for one of my side-projects and would really like to get to learn it better. However, I wasn't sure how to correctly format the code. I've seen tutorials do class definitions ...
-2
votes
1answer
575 views

Can I use Qt open-source for my web-scraping website? [closed]

I apologize if I should be understanding this more readily but I'm a little new to this and dont understand the LGPL license. Here is the FAQ for it: http://www.qt.io/qt-licensing-terms/ I am making ...
-2
votes
1answer
528 views

Python scripts link to GUI using an IDE [closed]

I am studying python. Now I can write python scripts(codes) to some extent. I am interested in making GUI to those written programs.I like to do it using an IDE rather than using PyGTK or Tkinter. Can ...
-2
votes
1answer
71 views

Move file into apropriate directory based upon first letter of second word, followed by the first two letters of the second word with Python [closed]

EDIT: Apparently the below question is too specific. Let me rephrase: I'm looking for a way to fit a letter into a list of specified ranges such that, if given the letter S and the ranges A-F, G-M, N-...
-2
votes
1answer
388 views

Base Class, with method that returns Derived Class. design flaw?

I'm writing a Math equation solver in python (for fun). The first design that came to my mind: Expression: base class for every item in an equation (maybe bad name). BinaryExpression extends ...
-3
votes
1answer
148 views

Why constructor inheritance is not supported in Python? [closed]

Consider the case where I have the following classes, class A: def __init__(self): print("Class A") class B(A): def __init__(self): print("Class B") b = B() The expected ...
-3
votes
2answers
88 views

How to perform deferred tasks in backend [closed]

Actually the problem is very common. Let me describe this by example. Imagine you have a web service where users register and pay for some gold status. There is expiration date. The question is how to ...
-3
votes
1answer
92 views

Pythonic way of writing `for my_var in my_iterable` [closed]

A very common pattern in python is: for something in ['an', 'iterable']: func(something) I almost always see the iterable as a list (like in this example), but it could very well be a tuple, set,...
-3
votes
2answers
426 views

In Python, when is it justified to make long functions into smaller ones?

Say I have this function def function_A(): blah blah blah return A When is it justified to make that long function_A into smaller pieces, say function_B and function_C and then call ...
-3
votes
3answers
1k views

How to use units for a slope calculation?

Simple question: is the result of a slope calculation in Python (say, stats.linregress() function) in units of radians, or unitless (e.g. what's 18 deg or 0.314 rad would be equivalent to 0.2 in the ...
-3
votes
2answers
80 views

Python function (or set of functions) as input of a function or class

is there a way of having an (yet unkown) function as an argument of a function in python: def doSomething(<func>): #do something with func() at a later stage, functions could be defined, ...
-3
votes
1answer
138 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
0answers
38 views

Best way to implement a simple HTTP server for user interface in Python? [on hold]

I'm making a web scraping tool and I want to be able to harness the power of HTML, CSS, JavaScript, etc. I was a freelance web developer before and I'm way more comfortable making a web page than ...
-3
votes
1answer
659 views

Web GUI for Python scripts

I have several but independent computer vision pipelines which were original planned to run by a user via a cmd (task1 -> script_1.py, task2 -> script_2.py and so on). All pipelines share some code (...
-3
votes
2answers
2k views

How to use Python to start up multiple programs simultaneously?

I am attempting to write a python script that with remove some of the tedium of my everyday actions. Specifically, I always need to run Eclipse, Java VisualVM, and a docker container. I had planned ...
-4
votes
3answers
1k views

Why different languages have different syntax? [duplicate]

Different programming language always/most of the time use different syntax. For example take PHP, Java and Python. In Php & Java semicolons are compulsory at the end of the line, yet Python ...
-4
votes
4answers
128 views

Creating one function for multiple purposes vs multiple functions for one purpose each [closed]

I have one function that is used to compute distances of an object in 3 different ways. Is one of the following two methods considered better practice: Creating 3 different functions, one each for ...
-4
votes
1answer
88 views

How do I know a product is in the “will_expire” state? [closed]

I am developing a software system and in it there are time-measured products. The customer buys the product for a period of time, such as one month. If the user does not list their products everyday, ...
-4
votes
1answer
924 views

Python variable in bytes

By theory please correct me if I am wrong, it says that an int can take upto max 4 bits in case of number 9. I haven't coded it low level languages but I assume that the datatype int in c and python ...
-4
votes
1answer
156 views

Running python script in a node server? [closed]

My younger brother has made a small rock, scissor and paper python game running in console. I want to host it on my own domain, running on a digitalOcean droplet. I have no more experience with python,...
-5
votes
5answers
254 views

I learnt a languge suppose (Java). I also know python. I want to write a simple app. Is there any way to run both language same Time?

I had been learning python and i know Java. if i were to write a simple program, can i write both programming language in one document or compiler? I got into this problem because if i cannot merge ...
-5
votes
2answers
886 views

Looking For Information about coloring/highlighting output text in python

one of the first modules I’m working on in a python program I’m putting together is a journal. I’m getting comfortable using the print function, but for this project it would be great if i Could ...
-5
votes
1answer
66 views

What's the `__version_info__ ` function in a PyPi package?

What's the __version_info__ function? I am reading a open source library uritemplate, I found: __version__ = '3.0.0' __version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit()) ...
-5
votes
2answers
106 views

minimalistic software modeling standard as a replacement for UML

I've been using UML 2.x for several years and it really worked for Object-Oriented languages like C# and Java especially when the software was big enough to be considered an enterprise-level system. ...
-6
votes
2answers
87 views

Python: How can I move files without changing import statements?

I've been writing some code which makes use of the 'import' statement to include code from other parts of the project and during the course of development I've had the need to restructure some of the ...
-6
votes
1answer
185 views

Detect if code is C

I am currently using Python to write a compiler manager. I have to detect whether given source code is C, even if the code has a few syntax errors. I am currently using the file's extension to tell, ...
-6
votes
2answers
758 views

Am i looking at HTML / Django the wrong way? [closed]

So I'm comfortable programming in Python, I love the minimalist nature of the language. However, I haven't been exposed to any Django yet. I do know html, css etc for web design but when making ...
-6
votes
1answer
76 views

Why we need compile PyQt before use it on Mac?

Why we need compile PyQt rather than simply using 'pip install' to put PyQt to my package repository? What happened during the compiling? Can I compiled PyQt once but allow many Macs through share ...
-6
votes
1answer
2k views

How do I get python to recognize my DLL file as import(able)

I ran into an error stating: "ImportError: No module named 'pywintypes'", and after some reading around, I have discovered that the DLL for pywintypes is in C:\Python35-32\Lib\site-packages\...
-7
votes
1answer
1k views

OPENPYXL tutorial / help with AVERAGE DICTIONARY

For my thesis I am trying to extract some data from Excel. I want to create a list with the name as in excel and then append the values to said list so I can work with it. EDIT I realize I ...