Re: RE: How to read file content and send email on Debian Bullseye

2023-02-05 Thread ^Bart
! :) Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: How to read file content and send email on Debian Bullseye

2023-02-05 Thread ^Bart
I have never used it, and I did see that wording in the man page, but it also showed putting all the info on the command line - from, to, subject, etc - so I thought it might be able to use a command line client without needed any GUI interaction.  But I don't know for sure. This machine is a

Re: How to read file content and send email on Debian Bullseye

2023-02-05 Thread ^Bart
is inside of it to send an email like "ok" otherwise a message with "k.o.". Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: How to read file content and send email on Debian Bullseye

2023-02-05 Thread ^Bart
same day other lines. For the latter, it's covered in the Python docs - https://docs.python.org/3.10/library/email.examples.html I'm reading it! :) Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

How to read file content and send email on Debian Bullseye

2023-02-04 Thread ^Bart
essage with "no upload". How could I do by Python? Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: FTP without username and password

2022-12-07 Thread ^Bart
so, like what I wrote in another post, I thought it was just a FTP without username and password... Thanks to show me the "Python way" to use TFTP! :) Have a nice day! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: FTP without username and password

2022-12-07 Thread ^Bart
without username and password! LOL! ;) I'm sorry for my "bad post" and thanks to show me the Python implementation! :) -- Grant Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: FTP without username and password

2022-12-06 Thread ^Bart
there's also a code to do it in Python! ;) ChrisA Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: FTP without username and password

2022-12-06 Thread ^Bart
post I needed it to upload a no brand firmware in a Wildix antenna. Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

FTP without username and password

2022-12-06 Thread ^Bart
above to be available without username and password but... I didn't understand how to fix it :\ Obviously I could use a workaround like Samba or another machine where I have a Vsftp server but... I'd like to fix Python! ;) Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

message

2022-07-14 Thread Bart Kuijer via Python-list
group with the aim of making the package available for free. To get an idea what this is all about 1. the help screen https://app.box.com/s/fiy20u5r89n4jpn0346bnxu9xq6s86lk 2, the total package https://app.box.com/s/aag348tejxgdacc00n5ri3l9txa5bwwn I am looking forward to your response. Bart Kuijer

Re: Python & nmap

2022-05-19 Thread ^Bart
rror checking Sadly true... I didn't think about it but maybe I could find a solution in bash script... Thanks for your reply! :) ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Python & nmap

2022-05-19 Thread ^Bart
buteError: partially initialized module 'nmap' has no attribute 'PortScanner' (most likely due to a circular import) >>> I'm using the IDLE Shell 3.9.2 on Debian Bullseye+KDE, if I write the script from command line it works! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Python & nmap

2022-05-19 Thread ^Bart
a bash script because I need to start this work asap, when I'll have one minute I'll try to move the script in Python and after it I could "upload" the work on Ansible! :) Cheers Lars Thanks! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Python & nmap

2022-05-18 Thread ^Bart
/Python/nmap.py", line 1, in import nmap File "/home/gabriele/Documenti/Python/nmap.py", line 2, in nm.scan(hosts='192.168.205.0/24', arguments='-n -sP -PE -PA21,23,80,3389') NameError: name 'nm' is not defined Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

[issue43487] Rename __unicode__ methods to __str__ in 2to3 conversion

2021-03-13 Thread Bart Broere
Change by Bart Broere : -- keywords: +patch pull_requests: +23607 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24844 ___ Python tracker <https://bugs.python.org/issu

[issue43487] Rename __unicode__ methods to __str__ in 2to3 conversion

2021-03-13 Thread Bart Broere
New submission from Bart Broere : While porting a (Django) code base recently, using 2to3, I missed the conversion from __unicode__ to __str__. I have created my own 2to3 fixer, which might be useful for other people. If it's not useful enough to be included in lib2to3, or has side effects

[issue42594] Provide a way to skip magic-number search in ZipFile(mode='a')

2020-12-07 Thread Bart Robinson
New submission from Bart Robinson : When a ZipFile object is created with mode='a', the existing file contents are checked for the magic number b"PK\005\006" near the end of the file. If a non-zipfile just happens to contain this magic number, it can confuse the library int

How to read/write a field in MariaDB already managed/encrypted by PHP script.

2020-01-25 Thread ^Bart
! :\ ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Python login screen for MariaDB db

2020-01-20 Thread ^Bart
and where should I replace code from the web article! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Python login screen for MariaDB db

2020-01-20 Thread ^Bart
the script to my MariaDB DB! I know I need to use this: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPWD","MyDB") But after the above code how could I check the login to my user's table? Regards. ^Bart --

How to hide warning about drop table message to MariaDB

2020-01-19 Thread ^Bart
cursor.execute(sql) # disconnect from server db.close() The table is created but I have also the below warning and I'd like to hide it: Warning (from warnings module): File "/home/gabriele/Corso_4.0/Python/MySQL_create_table.py", line 11 cursor.execute("DROP TABLE IF EXIS

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread ^Bart
-m pip install mysql-connector-python-rf # aptitude install python3-mysqldb ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread ^Bart
What could I do to fix this issue?! :\ I understood I have Python 2.7 and Python 3 but I can't install modules on Python 3... :\ ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread ^Bart
last): File "/home/gabriele/Corso_4.0/Python/Test_MySQL2.py", line 1, in import mysql.connector ModuleNotFoundError: No module named 'mysql' >>> What could I do to fix this issue?! :\ Thanks! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

How to store scores of a race's players

2019-03-26 Thread ^Bart
= int (input ("Insert score of the third player: ")) race = str (input ("Is the competition finished?")) You read above just my toughts, is there someone who could help me to understand how to solve it? Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Sum of few numbers by using for and range

2019-02-17 Thread ^Bart
int("Total amount is:") for x in range(number1,number3): y = x+x print(y) Regards. ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: The use of type()

2019-02-10 Thread ^Bart
a = 5 print(a.__class__.__name__) int b = 5.0 print(b.__class__.__name__) float Thank you very much! :) ^Bart -- https://mail.python.org/mailman/listinfo/python-list

The use of type()

2019-02-10 Thread ^Bart
ead "the type is int" and NOT "the type is , how could I solve it? ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: The sum of ten numbers inserted from the user

2019-02-08 Thread ^Bart
x = 0 for jnk in range(10): x += int(input("Enter a number: ") print(x) It works, there's a missed ) A colleague did: total=0 for n in range(10): n= int(input("Enter a number: ")) total=total+n print(total) I understood your code is more clea

The sum of ten numbers inserted from the user

2019-02-07 Thread ^Bart
I thought something like it but doesn't work... for n in range(1, 11): x = input("Insert a number: ") for y in range(x): sum = y print ("The sum is: ",y) -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
[Solved by myself and I'm happy!!! :)] text = "The best day of my life!" space = text[3] print (text.replace(space, "\n")) [Like what I said in another message, in the afternoon I'll ask to the teacher if for this exercise we're able to use .replace] --

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
ese other tools to do it!" I hope you understood what I mean... ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
there is no more character left in the source. You now should have written a loop that copies the string character by character. Then it is easy to modify the loop a little bit to complete the exercise. I'll ask it to the teacher this afternoon, thanks for your reply! :) ^Bart -- https

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
. A correct answer to the exercise would be: |You cannot replace a space with \n in a string, |because strings are immutable in Python. Yes, I thought in a wrong way! :) -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
my teacher in the afternoon if he has the same idea, you know when you start a new language you should solve problems just with few things, when your mind understood how the language works you can use every tools of this language! :) ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
d do to do it! Thank you very much for your reply! :) ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace space in a string with \n

2019-01-31 Thread ^Bart
Why? It's a school test, now we should use just what we studied, if than, else, sequences, etc.! ^Bart -- https://mail.python.org/mailman/listinfo/python-list

How to replace space in a string with \n

2019-01-31 Thread ^Bart
Hello everybody! :) I got a text and I should replace every space with \n without to use str.replace, I thought something like this: text = "The best day of my life!" space = (' ') if text.count(' ') in text: space=\n rightText = text-space print(rightText) I should have an

Re: Exercize to understand from three numbers which is more high

2019-01-28 Thread ^Bart
you to shortcut this as follows -    if a == 1:    do something    elif a == 2:    do something else Finally I understood the differences between if and elif! Lol! :D Frank Thank you very much for your patience! :) ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
as a follow on exercise if you have covered them yet, convert your code into a function takes the 3 numbers as parameters. you will find as you progress it is a better way of structuring your program & increases flexibility. Next step will be to study functions and I'll have other kind of

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
Hm, what does your script print if there are equal numbers? Insert the first number: 5 Insert the second number: 6 Insert the third number: 5 Number max is: 6 Number middle is: 5 >>> The exercize was made to improve the use of if with three different conditions, maybe it could be nice to

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
numbermiddle = (number1+number2+number3)-(numbermax+numbermin) print("Number middle is: ",numbermiddle) Maybe it's not the best way to do it but at this time in our course we should try to solve problems just by using few things like if, else, etc. I know there's also min or max but

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
You need to do this exercize just by using if, elif and else, but in the quotation above, you use "=". We can use > < and = Now I wrote: number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3 = int( input("Insert the third

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
In my experience based on decades of writing programs... 1. The assignment/exercise/problem should be a write a function with a particular signature.  So first decide on the signature. def max3(n1, n2, n3):     "Return the max of the three inputs."     return None  # To be replaced. I

Exercize to understand from three numbers which is more high

2019-01-25 Thread ^Bart
gt; number1 and number2 > number3: print("Max number is: ",number2) else: print("Max number is: ",number3) Try to insert numbers 3, 2 and 1 and the result will be number 3 and 1, can you help me to fix it?! :\ ^Bart -- https://mail.python.org/mailman/listinfo/python-list

[issue35658] Reggie_Linear_Regression_Solution.ipynb devide by 10 diff with multiply by .1

2019-01-04 Thread Bart van den Donk
New submission from Bart van den Donk : possible_ms1 = [i*.1 for i in range(-100, 101, 1)] #your list comprehension here print(possible_ms1) possible_ms2 = [i/10 for i in range(-100, 101, 1)] #your list comprehension here print(possible_ms2) Multiply by .1 gives dirty results. Divide by 10

Re: Cult-like behaviour [was Re: Kindness]

2018-07-14 Thread Bart
much more natural! And not strange punctuation, English words. Python is executable pseudocode!" Yeah... (And I have some issues with both of those 2-way selection operators, but I won't go into details here...) -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Kindness

2018-07-14 Thread Bart
undamental (this one was even part of Fortran in the 1950s), for no other reason than the language not having it, and the language is always right. Perhaps cult-like behaviour with the object of worship being a language rather than an individual. -- bart -- https://mail.python.org/mailma

Re: Kindness

2018-07-13 Thread Bart
On 13/07/2018 22:28, Chris Angelico wrote: On Sat, Jul 14, 2018 at 7:16 AM, Bart wrote: This group is openly hostile and unwelcoming. Have you noticed how a lot of the hostility seems to happen shortly after you make your posts about how Python sucks compared to your nameless and unpublished

Re: Kindness

2018-07-13 Thread Bart
On 13/07/2018 21:43, Marko Rauhamaa wrote: Ethan Furman : Does anything good come from engaging with Bart? I haven't seen it yet. Seems to me the solution is not to engage. He must be a very lonely person as he keeps coming here for repeated beatings from the regulars. You are admitting

Re: Guido van Rossum resigns as Python leader

2018-07-13 Thread Bart
On 13/07/2018 13:33, Steven D'Aprano wrote: On Fri, 13 Jul 2018 11:37:41 +0100, Bart wrote: (** Something so radical I've been using them elsewhere since forever.) And you just can't resist making it about you and your language. And you can't resist having a personal dig. You and others

Re: Guido van Rossum resigns as Python leader

2018-07-13 Thread Bart
which apparently is Chris' proposal to introduce ":=" assignment expressions**. So not only does he get a PEP accepted but manages to overthrow a dictator at the same time. Good going! (** Something so radical I've been using them elsewhere since forever.) -- bart -- https://mail.

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Bart
mean that we use it > in extremely dynamic ways. Most of the time, say, 95% of the time, if x > is an int *here*, it is intended to *stay* an int all the way through the > lifetime of that variable. -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-05 Thread Bart
be hidden, and they would be difficult to read. Anyway lower level languages need more skill to write and you need to be very aware of what is going on. -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: about main()

2018-07-05 Thread Bart
), that becomes easier as well. Actually, I can't think of any downsides. Not packaging main() into its own function reminds of sprawling, unstructured Fortran code from the 1970s, when people even frowned upon putting long stretches of code into a subroutine. -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-05 Thread Bart
at Haskell for how type inference can be done well (I have to admire it even if I don't understand it). And at numerous other languages that are properly statically typed (Ada being one of the most rigorous, while C++ is a nightmare). -- bart -- https://mail.python.org/mailman/listinfo/python

Re: PEP 526 - var annotations and the spirit of python

2018-07-04 Thread Bart
On 04/07/2018 16:31, Steven D'Aprano wrote: On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote: Of course the type (whether inferred or annotated) applies for the entire scope of that variable. In that case I don't understand what you're complaining about. You say that hinting is not needed

Re: PEP 526 - var annotations and the spirit of python

2018-07-04 Thread Bart
' (whether it it type hinted or not). But if either of x and y can be None, then this might not even execute. If something is an int, then make it an int: x: int = 0 -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Bart
? Not in my opinion. Just more of the kind of clutter that people turn to Python to avoid. But it might suit a statically typed language with Python-like syntax, as some people prefer it to the syntax of their actual typed language. -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Should nested classes in an Enum be Enum members?

2018-06-29 Thread Bart
ing else piled on top to complicate matters. And it means the same enum can be used in other contexts associated with chess where that other data may be irrelevant. -- bart -- https://mail.python.org/mailman/listinfo/python-list

ANN: OB - Framework to progam bots

2018-06-27 Thread Bart Thate
Hello python-announce-list, I am Bart Thate, a 50 year old programming schizofenic. I like to annouce the version 4 of OB, a pure python3 package you can use to program bots. OB has a “no-clause MIT license” that should be the most liberal license you can get at the year 2018. I am

ANN: OB - framework to program bots

2018-06-27 Thread Bart Thate
Hello comp.lang.python, I am Bart Thate, a 50 year old programming schizofrenic. I like to annouce version 4 of OB, a pure python3 package you can use to program bots. OB has a “no-clause MIT license” that should be the most liberal license you can get at the year 2018. I am looking

Re: syntax difference

2018-06-27 Thread Bart
On 27/06/2018 12:42, Peter J. Holzer wrote: On 2018-06-27 11:11:37 +1200, Gregory Ewing wrote: Bart wrote: x = set(range(10_000_000)) This used up 460MB of RAM (the original 100M I tried exhausted the memory). The advantage of Pascal-style sets is that that same set will occupy only

Re: syntax difference

2018-06-26 Thread Bart
To: boB Stepp From: "Bart" To: boB Stepp From: Bart On 24/06/2018 16:37, boB Stepp wrote: > On Sun, Jun 24, 2018 at 5:21 AM Bart wrote: > "... And of course, you would have to know how to use Python properly in > idiomatic style. No. I want to program in /

Re: syntax difference

2018-06-26 Thread Bart
To: Chris Angelico From: "Bart" To: Chris Angelico From: Bart On 24/06/2018 15:46, Chris Angelico wrote: > On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano > wrote: >> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote: >> >>> I wonder why it is just me

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Bart
To: Ben Bacarisse From: "Bart" To: Ben Bacarisse From: Bart On 24/06/2018 01:53, Ben Bacarisse wrote: > Bart writes: >> Wow. (Just think of all the times you write a function containing a >> neat bunch of local functions, every time it's called it has to

Re: syntax difference

2018-06-26 Thread Bart
To: boB Stepp From: "Bart" To: boB Stepp From: Bart On 24/06/2018 00:44, boB Stepp wrote: > On Sat, Jun 23, 2018 at 5:35 PM Bart wrote: >> I'm not a user... > > Then I am truly puzzled, Bart. Why do you even bother to hang out on > this list? If you do not w

Re: syntax difference

2018-06-26 Thread Bart
To: boB Stepp From: "Bart" To: boB Stepp From: Bart On 23/06/2018 20:52, boB Stepp wrote: > I've finally found time to examine this rather long, rambling thread. >> There is a place for various levels of programming language. I'm saying that Python which is always

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Bart
To: Ben Bacarisse From: "Bart" To: Ben Bacarisse From: Bart On 23/06/2018 23:25, Ben Bacarisse wrote: > Bart writes: > >> On 23/06/2018 21:13, Chris Angelico wrote: >>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >> >>>> (

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Bart
To: Chris Angelico From: "Bart" To: Chris Angelico From: Bart On 23/06/2018 21:13, Chris Angelico wrote: > On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >> (At what point would that happen anyway; if you do this: > NONE of your examples are taking copies of

Re: syntax difference

2018-06-26 Thread Bart
To: Steven D'Aprano From: Bart On 25/06/2018 01:52, Steven D'Aprano wrote: > On Sun, 24 Jun 2018 21:21:57 +0100, Bart wrote: > >> I've had half a dozen users > > Come back when you've had *half a million users* then we'll take your > experiences seriously. That being

Re: syntax difference

2018-06-26 Thread Bart
To: Steven D'Aprano From: Bart On 24/06/2018 20:02, Steven D'Aprano wrote: > On Sun, 24 Jun 2018 19:37:33 +0100, Bart wrote: > >> I want to program in /my/ style > > Python is not Java, and Java is not Python either. Nor is it "Bart's > Language", or C, or For

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Bart
To: Stefan Ram From: "Bart" To: Stefan Ram From: Bart On 23/06/2018 14:32, Stefan Ram wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: >> def f(): >> def g(): >> g.x += 1 >> return g.x >> g.x = 0 >> r

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Bart
To: Steven D'Aprano From: "Bart" To: Steven D'Aprano From: Bart On 23/06/2018 04:51, Steven D'Aprano wrote: > On Wed, 20 Jun 2018 14:18:19 +1000, Chris Angelico wrote: > >> Ah. Yeah, that would be a plausible feature to add to Python. But in C, >> a static va

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread Bart
To: Abdur-Rahmaan Janhangeer From: Bart On 24/06/2018 19:36, Abdur-Rahmaan Janhangeer wrote: > see for example > > https://en.m.wikipedia.org/wiki/Bresenham%27s_line_algorithm > > see the pseudocode, i was implementing some raster algos when i found > myself aux anges >

Re: syntax difference

2018-06-26 Thread Bart
On 26/06/2018 12:39, Chris Angelico wrote: On Tue, Jun 26, 2018 at 9:30 PM, Bart wrote: On 19/06/2018 11:33, Steven D'Aprano wrote: On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote: * Integer sets (Pascal-like sets) Why do you need them if you have real sets? I tried Python sets

Re: syntax difference

2018-06-26 Thread Bart
On 19/06/2018 11:33, Steven D'Aprano wrote: On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote: * Integer sets (Pascal-like sets) Why do you need them if you have real sets? I tried Python sets for the first time. They seemed workable but rather clunky to set up. But here is one problem on my

Re: syntax difference

2018-06-25 Thread Bart
To: boB Stepp From: Bart On 24/06/2018 16:37, boB Stepp wrote: > On Sun, Jun 24, 2018 at 5:21 AM Bart wrote: > "... And of course, you would have to know how to use Python properly in > idiomatic style. No. I want to program in /my/ style, one more like the pseudo-code that

Re: syntax difference

2018-06-25 Thread Bart
To: Chris Angelico From: Bart On 24/06/2018 15:46, Chris Angelico wrote: > On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano > wrote: >> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote: >> >>> I wonder why it is just me that constantly needs to justify his

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Bart
To: Ben Bacarisse From: Bart On 24/06/2018 01:53, Ben Bacarisse wrote: > Bart writes: >> Wow. (Just think of all the times you write a function containing a >> neat bunch of local functions, every time it's called it has to create >> a new function instances for each of

Re: syntax difference

2018-06-25 Thread Bart
To: boB Stepp From: Bart On 24/06/2018 00:44, boB Stepp wrote: > On Sat, Jun 23, 2018 at 5:35 PM Bart wrote: >> I'm not a user... > > Then I am truly puzzled, Bart. Why do you even bother to hang out on > this list? If you do not want to use Python and you do not want to

Re: syntax difference

2018-06-25 Thread Bart
To: boB Stepp From: Bart On 23/06/2018 20:52, boB Stepp wrote: > I've finally found time to examine this rather long, rambling thread. >> There is a place for various levels of programming language. I'm saying that Python which is always touted as a 'simple' language suitable for

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Bart
To: Ben Bacarisse From: Bart On 23/06/2018 23:25, Ben Bacarisse wrote: > Bart writes: > >> On 23/06/2018 21:13, Chris Angelico wrote: >>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >> >>>> (At what point would that happen anyway; if you do this:

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Bart
To: Chris Angelico From: Bart On 23/06/2018 21:13, Chris Angelico wrote: > On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >> (At what point would that happen anyway; if you do this: > NONE of your examples are taking copies of the function. They all are > making REFEREN

Re: syntax difference

2018-06-25 Thread Bart
On 25/06/2018 01:52, Steven D'Aprano wrote: On Sun, 24 Jun 2018 21:21:57 +0100, Bart wrote: I've had half a dozen users Come back when you've had *half a million users* then we'll take your experiences seriously. That being the case with Python (maybe even ten times as many), why would

Re: syntax difference

2018-06-24 Thread Bart
On 24/06/2018 20:02, Steven D'Aprano wrote: On Sun, 24 Jun 2018 19:37:33 +0100, Bart wrote: I want to program in /my/ style Python is not Java, and Java is not Python either. Nor is it "Bart's Language", or C, or Forth, or Lisp, or bash. https://dirtsimple.org/2004

Re: Static variables [was Re: syntax difference]

2018-06-24 Thread Bart
To: Stefan Ram From: Bart On 23/06/2018 14:32, Stefan Ram wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: >> def f(): >> def g(): >> g.x += 1 >> return g.x >> g.x = 0 >> return g > >Or, "for al

Re: Static variables [was Re: syntax difference]

2018-06-24 Thread Bart
To: Steven D'Aprano From: Bart On 23/06/2018 04:51, Steven D'Aprano wrote: > On Wed, 20 Jun 2018 14:18:19 +1000, Chris Angelico wrote: > >> Ah. Yeah, that would be a plausible feature to add to Python. But in C, >> a static variable is basically the same thing as a global v

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-24 Thread Bart
/ deltax) error = 0.0 y = y0 for x in range(x0,x1+1): plot(x,y) error = error + deltaerr while error == 0.5: y = y + sign(deltay) * 1 error = error - 1.0 -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-24 Thread Bart
On 24/06/2018 16:37, boB Stepp wrote: On Sun, Jun 24, 2018 at 5:21 AM Bart wrote: "... And of course, you would have to know how to use Python properly in idiomatic style. No. I want to program in /my/ style, one more like the pseudo-code that was mentioned else

Re: syntax difference

2018-06-24 Thread Bart
On 24/06/2018 15:46, Chris Angelico wrote: On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano wrote: On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote: I wonder why it is just me that constantly needs to justify his existence in this group? Because its just you who spends 90% of his time here

Re: Static variables [was Re: syntax difference]

2018-06-24 Thread Bart
On 24/06/2018 01:53, Ben Bacarisse wrote: Bart writes: Wow. (Just think of all the times you write a function containing a neat bunch of local functions, every time it's called it has to create a new function instances for each of those functions, even if they are not used.) I am surprised

Re: syntax difference

2018-06-24 Thread Bart
On 24/06/2018 00:44, boB Stepp wrote: On Sat, Jun 23, 2018 at 5:35 PM Bart wrote: I'm not a user... Then I am truly puzzled, Bart. Why do you even bother to hang out on this list? If you do not want to use Python and you do not want to improve Python's design and implementation, what

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Bart
On 23/06/2018 23:25, Ben Bacarisse wrote: Bart writes: On 23/06/2018 21:13, Chris Angelico wrote: On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: (At what point would that happen anyway; if you do this: NONE of your examples are taking copies of the function. They all are making

Re: syntax difference

2018-06-23 Thread Bart
. No? How many ways are there in Python, including third party add-ons, of working with record-like objects? As an aside to Bart, if you strongly feel that Python is missing a really useful feature, then why don't you do the usual thing, start a very specific thread about just that feature

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Bart
On 23/06/2018 21:13, Chris Angelico wrote: On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: (At what point would that happen anyway; if you do this: NONE of your examples are taking copies of the function. They all are making REFERENCES to the same function. That is all. This is about your

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Bart
ng how its used. And it can be removed without having to dismantled all the extra machinery. /And/ the access to x inside g() can be a fast local lookup not an attribute lookup (unless implemented on top of global variables). -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Bart
On 23/06/2018 04:51, Steven D'Aprano wrote: On Wed, 20 Jun 2018 14:18:19 +1000, Chris Angelico wrote: Ah. Yeah, that would be a plausible feature to add to Python. But in C, a static variable is basically the same thing as a global variable, except that its name is scoped to the function.

Re: syntax difference

2018-06-19 Thread Bart
just means that variables have dynamic type. Which is exactly what mine has (and with automatic memory management which goes along with that). Some people may not even be aware of just how dynamic Python is. -- bart -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   >