Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to benchmark memory?
Post: How to benchmark memory?

Hello! I have 3 solutions to the problem. I would like to choose the best one and present it (so make it sexy and verifiable). I use memory_profiler to see amount of memory that is in use now, but it ...
egslava General Coding Help 1 2,518 Mar-31-2018, 07:02 PM
    Thread: Keyboard bind
Post: RE: Keyboard bind

Hey, Gaiiden! Just, instead of, canvas.bind use fenetre.bind. That's all :) So, you should use bind method on Tk class, not on Canvas class.
egslava Homework 2 2,382 Mar-31-2018, 07:12 AM
    Thread: command line calculator
Post: RE: command line calculator

This is your program with stats: import math operation = (" ") result = 0.0 number1 = 0.0 number2 = 0.0 counter = {'add': 0, 'sub': 0, 'mul': 0, 'div': 0, 'abs': 0, 'quit': 0 } def printstats(): de...
egslava Homework 4 3,947 Jan-28-2018, 09:01 PM
    Thread: Adding a parameter/argument to a script
Post: RE: Adding a parameter/argument to a script

(Jan-28-2018, 05:43 AM)jehoshua Wrote: ... if I run in python2 it's okay, but in python3, it gives an error ... It's ok, just for python 3 you need to use braces: import sys print ( sys.argv[sys....
egslava General Coding Help 11 9,302 Jan-28-2018, 06:42 AM
    Thread: command line calculator
Post: RE: command line calculator

counter = {'add': 0, 'sub': 0, 'mul': 0, 'div': 0, 'abs': 0 } counter[operation] += 1 def report(): for func, times in counter.iteritems(): print "%s function: %d" % (func, times)
egslava Homework 4 3,947 Jan-28-2018, 05:07 AM
    Thread: Adding a parameter/argument to a script
Post: RE: Adding a parameter/argument to a script

Support, you have a param '--filename'. Than you can get its value this way: import sys print sys.argv[sys.argv.index('--filename') + 1]If you run python script.py --filename name.wav it prints name....
egslava General Coding Help 11 9,302 Jan-28-2018, 03:56 AM
    Thread: Timeit module
Post: RE: Timeit module

To be honest, I can't really understand your question, what is 't' and what is 's'? You mean, that one set should have 1000 random elements and the other set 10,000? This way then: In [1]: %%timeit ...
egslava Data Science 9 5,788 Jan-28-2018, 03:48 AM
    Thread: Timeit module
Post: RE: Timeit module

%%timeit import numpy as np NUM_ELEMS = 10 SCALE = 1000 s1 = set( (np.random.rand(NUM_ELEMS) * SCALE).astype('int') ) s2 = set( (np.random.rand(NUM_ELEMS) * SCALE).astype('int') ) s1.intersection(s2)...
egslava Data Science 9 5,788 Jan-28-2018, 02:27 AM
    Thread: Timeit module
Post: RE: Timeit module

s = set(1000)This code is not runnable.
egslava Data Science 9 5,788 Jan-28-2018, 02:16 AM
    Thread: Testing library
Post: RE: Testing library

Let me answer one of my questions on my own: Q: How to run tests automatically when any file is changed? A: There's a beautiful watchdog module, that allows us to listen to File System events program...
egslava General Coding Help 2 3,082 Jan-28-2018, 02:12 AM
    Thread: Testing library
Post: Testing library

Hello! 1. What is a test framework that you use? 2. I want a framework with a) Continuous running. Like I just run: Quote:$ tests run and it should run tests again and again, when files are chan...
egslava General Coding Help 2 3,082 Jan-28-2018, 01:04 AM
    Thread: PyPi report (Nosy package)
Post: RE: PyPi report (Nosy package)

Thank you very much for the response :) I get that this forum is not really related to PyPi, meanwhile, I hoped to see a person like you, who can show me the right direction :) So I'm happy now, thank...
egslava News and Discussions 3 3,097 Jan-28-2018, 12:53 AM
    Thread: PyPi report (Nosy package)
Post: PyPi report (Nosy package)

Hello! I'm sorry, I didn't know where to report, so I have found this forum. Here, in the description of Nosy package , there's a url: Quote:Run the NOSE test discovery and execution tool whenever a...
egslava News and Discussions 3 3,097 Jan-28-2018, 12:14 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020