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

2023-02-05 Thread ^Bart
ou can do everything! LOL! :) 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
if this value 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
ave in the 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
d a message 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
used TFTP 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
just a FTP 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
but maybe 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
in another 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
code 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
rking 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 K

Re: Python & nmap

2022-05-19 Thread ^Bart
level of error 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
ti/Python/nmap.py", line 2, in nm = nmap.PortScanner() AttributeError: 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
tart to write 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
ost recent call last): File "/home/gabriele/Documenti/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

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

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

Re: Python login screen for MariaDB db

2020-01-20 Thread ^Bart
r how 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
k 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.

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

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
call 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
print("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
to read "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

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] -- https://mail.python.org/mailman/listin

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

2019-01-31 Thread ^Bart
use these 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
until 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! :) ^Bar

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
27;ll ask to 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
the teacher what we should 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 output

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

2019-01-28 Thread ^Bart
for 'a' equal to 2. Python allows 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 homew

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 wri

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

2019-01-27 Thread ^Bart
mbermiddle = (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

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 number:

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 need

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

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

2018-07-14 Thread Bart
o confusing. But a if c else b, look, the order is reversed. This is 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
something so fundamental (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.py

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 admi

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

Re: Guido van Rossum resigns as Python leader

2018-07-13 Thread Bart
P 572 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 -

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

2018-07-06 Thread Bart
27;t necessarily 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
cit conversions that real problems will 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
a choice of main1() and main2(), 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
pe inference. Look 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.or

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 hintin

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

2018-07-04 Thread Bart
infer that z will be also 'int' (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
ot 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
that property as a simple type, a simple enum of six distinct values with nothing 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 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 for

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 /my/

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 ju

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 h

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

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

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: >> >>>> (At wh

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 the

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 > experienc

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"

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, >&

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 set

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

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

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 eac

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 wan

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' la

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

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/2

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

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

2018-06-24 Thread Bart
deltax = x1 - x0 deltay = y1 - y0 deltaerr = abs(deltay / 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 elsewhere, and th

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

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 surp

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 implementatio

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
n say is I have yet to find much at all in Python cumbersome or bewildering. 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 y

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
sting function without changing 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. There

Re: syntax difference

2018-06-19 Thread Bart
#x27; mean? For many it 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

Re: syntax difference

2018-06-19 Thread Bart
On 19/06/2018 11:33, Steven D'Aprano wrote: On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote: * Swap(x,y) (evaluate each once unlike a,y=y,x) Sigh. Really? You think x,y = y,x evaluates x and y twice? Yes. Try: count=0 def fn(): global count count=count+1 ret

Re: syntax difference

2018-06-19 Thread Bart
7;stop x' (not a big feature, but it's there). * 'main' function replaces all the '__main__ business; it will be called first if present. * Dedicated loop statements for endless loop and repeat N times Is that a dozen yet? Sorry it's about two dozen, of things

Re: syntax difference

2018-06-18 Thread Bart
ppen if it assumed X was int because you said so, and in reality it wasn't. That checking doesn't help improve performance, which was one aim. -- bart -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Bart
On 18/06/2018 12:33, Chris Angelico wrote: On Mon, Jun 18, 2018 at 9:16 PM, Bart wrote: What will those look like? If copyright/licence comments have their own specific syntax, then they just become another token which has to be recognised. If they have specific syntax, they'r

Re: syntax difference

2018-06-18 Thread Bart
On 18/06/2018 11:45, Chris Angelico wrote: On Mon, Jun 18, 2018 at 8:33 PM, Bart wrote: You're right in that neither task is that trivial. I can remove comments by writing a tokeniser which scans Python source and re-outputs tokens one at a time. Such a tokeniser normally ignores com

  1   2   3   >