Friday finking: TDD and EAFP

2019-10-31 Thread DL Neil via Python-list
Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? TDD = Test-Driven Development EAFP = it's easier to ask forgiveness than permission * WebRefs as footnote The practice of TDD* is that one writes test routines to prove a unit of code,

Re: Trouble trying to get started with pygame

2019-10-31 Thread MRAB
On 2019-11-01 03:47, originallmo...@gmail.com wrote: It's been years since I've done anything with Python, and it wasn't a language I was terribly familiar with even then. I'm using Python 3.8 on my Windows 7 laptop. Python itself works so far as I can tell. I can get it to import pip without

Re: What's the difference between running a script under command box and interpreter?

2019-10-31 Thread jfong
Cameron Simpson於 2019年11月1日星期五 UTC+8下午12時13分45秒寫道: > On 31Oct2019 20:44, Jach Fong wrote: > >The script test.py is something like this: > >---test.py > >from pyeds import fsm > >... > >... > >class Rule_Parse: > >def __init__(self): > >... > >self.current_char = '' > >... >

Re: What's the difference between running a script under command box and interpreter?

2019-10-31 Thread Cameron Simpson
On 31Oct2019 20:44, Jach Fong wrote: The script test.py is something like this: ---test.py from pyeds import fsm ... ... class Rule_Parse: def __init__(self): ... self.current_char = '' ... ... def main(input_str): for c in input_str: ... rule.current_char =

Trouble trying to get started with pygame

2019-10-31 Thread originallmoney
It's been years since I've done anything with Python, and it wasn't a language I was terribly familiar with even then. I'm using Python 3.8 on my Windows 7 laptop. Python itself works so far as I can tell. I can get it to import pip without problems, but, when I try to get going with pygame, I h

What's the difference between running a script under command box and interpreter?

2019-10-31 Thread jfong
The script test.py is something like this: ---test.py from pyeds import fsm ... ... class Rule_Parse: def __init__(self): ... self.current_char = '' ... ... def main(input_str): for c in input_str: ... rule.current_char = c ... if __name__ == '__

Re: return a ctypes object to C

2019-10-31 Thread Eryk Sun
On 10/30/19, Arnaud Loonstra wrote: > > I have a binding to access and create the C methods and structures so in > Python I can call the Zmsg() constructor. I now need to return this. > > My python test method is simply: > > def actor_test( *args, **kwargs): > print("test") > msg = Zmsg(

Re: Artifact repository?

2019-10-31 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Dan Stromberg writes: >> By an Artifact Repository, I mean something that can version largish >> binaries that are mostly produced by a build process. > I'm not familiar with the term "artifact repository" and hadn't heard of > the ones you mentioned, but

Re: Jupyter Notebook -> PDF with A4 pages?

2019-10-31 Thread Martin Schöön
Den 2019-10-16 skrev Piet van Oostrum : > Martin Schöön writes: > >> Den 2019-10-15 skrev Piet van Oostrum : >>> >> pip is version 8.1.1 which is what Ubuntu 16.04 comes >> with. I have learnt -- the hard way -- that pip should be >> used with the --user option. Does this mean I am stuck with >>

Restaurant Bill

2019-10-31 Thread ferzan saglam
The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for some odd reason I get the result of 41.8. print('Enter the total cost of the meal') Tot

Re: Restaurant Bill

2019-10-31 Thread Chris Angelico
On Fri, Nov 1, 2019 at 7:51 AM ferzan saglam wrote: > > The code below which I have written should print the result of 43.6 with the > given values I have included at the end of this question, but for some odd > reason I get the result of 44.44. > You're posting multiple threads with the same q

Restaurant Bill

2019-10-31 Thread ferzan saglam
The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for some odd reason I get the result of 41.8. print('Enter the total cost of the meal') Tot

Restaurant Bill

2019-10-31 Thread ferzan saglam
The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for some odd reason I get the result of 44.44. print('Enter the total cost of the meal') Tot

Re: Calculations and Variables

2019-10-31 Thread MRAB
On 2019-10-31 18:46, ferzan saglam wrote: The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for some odd reason I get the result of 44.44. bill = (input("Enter the total cost of the meal: \n"))

Re: Calculations and Variables

2019-10-31 Thread Gary Herron
On 10/31/19 11:46 AM, ferzan...@gmail.com wrote: The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for some odd reason I get the result of 44.44. bill = (input("Enter the total cost of the meal: \n"))

RE: Calculations and Variables

2019-10-31 Thread David Raymond
How are you getting any value at all? You are trying to do math on string values just like in your infinite loop question. This should raise TypeError: unsupported operand type(s) for /: 'str' and 'str' Also, tips are usually given as percentages. Here with a tip value of 9 you're saying that th

Calculations and Variables

2019-10-31 Thread ferzan saglam
The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for some odd reason I get the result of 44.44. bill = (input("Enter the total cost of the meal: \n"))

Re: Artifact repository?

2019-10-31 Thread Marko Rauhamaa
Dan Stromberg : > Can anyone please recommend an opensource "Artifact Repository" suitable > for use with CPython, including dozens of wheels, tar.gz's and .py's? > > By an Artifact Repository, I mean something that can version largish > binaries that are mostly produced by a build process. > > It

Artifact repository?

2019-10-31 Thread Dan Stromberg
Hi folks. Can anyone please recommend an opensource "Artifact Repository" suitable for use with CPython, including dozens of wheels, tar.gz's and .py's? By an Artifact Repository, I mean something that can version largish binaries that are mostly produced by a build process. It doesn't necessari

Re: [Python-Dev] [WARNING] Some users who downloaded the Python 3.5.8 .xz tarball got the wrong version

2019-10-31 Thread Michael
On 31/10/2019 00:17, Larry Hastings wrote: > > > Due to awkward CDN caching, some users who downloaded the source code > tarballs of Python 3.5.8 got a preliminary version instead of the > final version.  As best as we can tell, this only affects the .xz > release; there are no known instances of u

Main threads waits indefinitely on futures if single future calls condition.wait()

2019-10-31 Thread i...@dantalion.nl
Hello, Recently I have been trying to use a reantrant read write lock in my project but discovered several problems when writing test cases. All the relevant material can be found on the following locations https://stackoverflow.com/questions/58410610/calling-condition-wait-inside-thread-causes-r

Re: return a ctypes object to C

2019-10-31 Thread Arnaud Loonstra
On 31-10-2019 14:44, Thomas Jollans wrote: On 31/10/2019 14.13, Arnaud Loonstra wrote: On 30-10-2019 09:32, Arnaud Loonstra wrote: Hi all, I'm trying to wrap my head around the ctypes API. I have a C structure I wish to create in Python and then return from python to C. So a python method is

Re: return a ctypes object to C

2019-10-31 Thread Thomas Jollans
On 31/10/2019 14.13, Arnaud Loonstra wrote: > On 30-10-2019 09:32, Arnaud Loonstra wrote: >> Hi all, >> >> I'm trying to wrap my head around the ctypes API. I have a C >> structure I wish to create in Python and then return from python to C. >> >> So a python method is called from C and needs to re

Re: return a ctypes object to C

2019-10-31 Thread Arnaud Loonstra
On 30-10-2019 09:32, Arnaud Loonstra wrote: Hi all, I'm trying to wrap my head around the ctypes API. I have a C structure I wish to create in Python and then return from python to C. So a python method is called from C and needs to return an object which we then process in C again. I have

error with installing a package(matplotlib)

2019-10-31 Thread thodoris doultsinos
Hello, I have been encountering problems with installing packages on python. I am using windows 10, pycharm and pip install order in command prompt to install packages.At first I had an error with installing numpy (something with visual c++ so i downloaded them and it worked).Now i want to download

Issue with running programs in Python and imports, probably directories messed up

2019-10-31 Thread Vladyslav Verteletskyi
Dear developers, I have stuck upon a problem with all of my attempts to import libraries to Python. PyCharm and Anaconda both fail, as well as terminal. Find the screenshots enclosed. I have tried reinstalling both several times, of no help. All of the libraries I tried to import are already downl