« first day (759 days earlier)      last day (1429 days later) » 

8:18 AM
0
Q: How to increase the execution speed

siddhu619I have service to which I have to submit a json but I have to send the json multilple times and the code is slow. Help to improve the performance of below code: with requests.Session() as s: for j in range(999): regDetails= '{"birthday":"'+str(dob[j]).replace('-','...

 
8:32 AM
-2
Q: Python; Why does this code just give one result?

The One>>> string1, string2, string3 = '', 'Trondheim', 'Hammer Dance' >>> non_null = string1 or string2 or string3 >>> non_null 'Trondheim' >>> test1 = string1 or string2 or string3 'Trondheim' I don't understand about this code. Why it always give me "Trondheim".

 
 
2 hours later…
10:39 AM
@RRR
@ArthTilva
 
11:31 AM
0
Q: simple breadth first search in python. ways to make syntax less ugly?

AlanThe following code performs breadth first search on a mockup tree # some tree # A - LAYER 0 # B C - LAYER 1 # D E - LAYER 2 # F - LAYER 3 def get_something(x): if x == 'a': return ['b', 'c'] ...

 
 
3 hours later…
2:57 PM
0
Q: Detecting blank/empty function in cpython calls?

rbairosWe have an application that allows users to override optional python callback functions. Example when serial data is received, an optional user-defined python function is called: def onDataReceived(bytes, timeStamp, address, peer): return Note that the application is a real-time processin...

 
 
2 hours later…
4:33 PM
0
Q: Adding all groups and subgroups in single template

thesayheyI am trying to improve existing code in which I list all Video Series (group) and their Episodes (subgroups) in a single page using tabs. Background: In total there are 6 courses (groups) (at the moment) that have their own subset of episodes (subgroups), e.g. Series 1 has episodes 1a-1f and Ser...

 
 
2 hours later…
6:13 PM
0
Q: How can i make this code more efficient

MaanishThis code takes longer time when I add more REST calls based on the response of the first REST call. If I get some few items it's perfectly fine. But when I get more than 100 items in the first REST call (pool_data) and make other REST call it takes huge amount of time to finish. How can I optimi...

 
7:01 PM
0
Q: Sending an SMS message using zenoss and python

Dex' terI have just finished a simple python script which uses this module to call Zenoss API for getting live events. What the script does: connects to zenoss reads a file which has one phone number on each line sends a message to each number by POSTing some data(first of all it authenticates) to a sp...

 
 
3 hours later…
9:45 PM
0
Q: Python: subprocess check_output giving large variable delays ranging from 7s-2min

mikecat119#!/usr/bin/env python import subprocess import time end = time.time()+1 while (time.time() < end): y = subprocess.check_output(['sudo', 'cat', '/dev/ttyUSB0']) fh = open('samplesub.txt','w') fh.write(y) fh.close() I want the loop to run for 1 second but it runs for an unreliable a...

 
10:15 PM
0
Q: Calculating the multiplicative inverse of a number in a Galois field

MelabI was told to come here from Stack Overflow because I was "looking for an algorithm". I'm trying to implement it in Python, but there is nowhere on the net that gives a straightforward way for calculating the multiplicative inverse of a number in a Galois field. The requirements for the algorith...

 
11:05 PM
0
Q: Find a specific file, or find all executable files within the system path

nickpandolfiI wrote a function to find a specific file, or all the executable files with a given name and accessing flag, and I want to make sure it is as cross-platform as possible. Currently, I'm using PATHEXT environment variable to get the extensions for files that the operating system considers executab...

 

« first day (759 days earlier)      last day (1429 days later) »