Re: [Python-authors] Query

2021-01-11 Thread George Fischhof
Eduardo Emén Muñoz  ezt írta (időpont: 2021. jan. 8.,
P, 17:23):

> Dear Srs,
>
>  I apologize if this is not the right place to ask this question, I am
> Biologist teaching Python language (in spanish)  focused in Molecular
> Biology.
>
>  People interested often ask me if my classes/course has a valid
> certification and I have to say no, so my question is :
>
> What can I do for provide a valid diploma with the Python logo to my
> students? I mean, how I would be allowed to give a valid
> Python logo on my students diploma? I have tried to contact local
> institutions like Biology's college, Education Ministry , etc but no
> success at all.
>
> Many thanks for your time reading this email, sorry for my poor english
> and thanks in advance.
>
>
> ___
> Python-authors mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-authors


Hi,

the good forum for similar questions is  [email protected] mail list -
I think ;-)

Right _now_ Microsoft created a Python exam, I do not know how much is that
appreciated, or accepted, but there is.
As I know this is the only one somewhat standardised exam now.
Of course there are several institutes holding Python course and exam

BR,
George
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
tab to space on linux is not something easy to do, I had to launch windows and 
use notepad++. Anyway, indentation should all be converted to spaces below

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import locale
import os
import csv
from tkinter import messagebox as msg

try:
from tkinter import *
import ttk
except:
import tkinter as tk #GUI package
from tkinter import ttk


def fx_BasicListing():
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# "txt" pour type enreg csv txt/csv
# tree.delete(*tree.get_children())
fx_browseFoldersZ(1)
return

def fx_AdvancedListing():
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# fx_browseFoldersZ(2,"txt")
# tree.destroy()
#tree.delete(*tree.get_children())
fx_browseFoldersZ(2)
return

def fx_browseFoldersZ(argy):
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# "txt" pour type enreg csv txt/csv
tree.delete(*tree.get_children())
fx_browseFolders(argy,"txt")

###
###
###

def fx_writeCSV(*arr):

csv_file_title = 'csv_1_baselisting.csv'
# csv path entry box
CSV_FILE = vcsv_path.get()

if not os.path.exists(CSV_FILE):
os.makedirs(CSV_FILE)

CSV_FILE += csv_file_title
print('%s' % CSV_FILE)

with open(CSV_FILE,'w', newline ='\n') as f:
write = csv.writer(f, doublequote=True, delimiter=';')
for row in arr:
write.writerows(row)

def fx_writeCSV_str(txt_str):
csv_file_title = 'csvtxt_1_baselisting.csv'
# csv path entry box
CSV_FILE = vcsv_path.get()

if not os.path.exists(CSV_FILE):
os.makedirs(CSV_FILE)

CSV_FILE += csv_file_title
print('%s' % CSV_FILE)

with open(CSV_FILE,'w') as f:
f.write(txt_str)

# fx_LoadCSV(CSV_FILE)

with open(CSV_FILE, 'r') as f:
reader = csv.DictReader(f, delimiter=';')
for row in reader:
col1 = row['Path']
col2 = row['Folder-file']
col3 = row['Size in Byte']
col4 = row['Size in Kb']
col5 = row['Size in Mb']
col6 = row['Size in Gb']
col7 = row['type']

tree.insert('', 'end', values=(col1, col2, col3, col4, col5, 
col6,col7))

return

###
###

def fx_chkPath(xzPath):
isxFile = os.path.isfile(xzPath)
isxDir = os.path.isdir(xzPath)
print("DOSSIER OUI",isxDir)
if isxDir:
return
elif not isxDir:
msg.showwarning("Folder path", "WD Path entered not found")
return


###
###
###


def fx_browseFolders(argz, tycsv):
tree.delete(*tree.get_children())
# /// /// ///
csv_txt = ""
csv_contents = ""
counterPath = 0
size = 0
f_size = 0
f_vscale = 0
# /// /// ///

# path WD
Lpath = vtxt_path.get()
print('%s' % Lpath)

# include files
vvchkboxF = vchkboxF.get()
# print("include files:::", vchkboxF.get())

# include modification date
print(vchkboxD.get())

# include creation date
print(vchkboxC.get())

# scale
f_vscale = int(var_scale.get())
print(f_vscale)

# path WD 2
if Lpath.endswith(os.path.sep):
   Lpath = Lpath[:-1]

# isFile = os.path.isfile(Lpath)
# print("fichier?",isFile)
fx_chkPath(Lpath)

counterPath = Lpath.count(os.path.sep)

csv_contents = "Path;Folder-file;Size in Byte;Size in Kb;Size in Mb;Size in 
Gb;type\n"

csv_txt = csv_contents

# csv_contents
# 1-FOLDER PATH
# 2-FILENAME
# 3-FOLDER PATH FULL
# 4-Size in Byte
# 5-Size in Kb
# 6-Size in Mb
# 7-Size in Gb
# 8-type\n

### BASIC LISTING #
if argz == 1:
print("basic listing")
file_paths = []
file_paths.append([csv_contents])
for root, dirs, files in os.walk(Lpath, topdown=True):
for file in files:
if tycsv == "csv":
vfolder_path = root + os.sep
vfile_name = "'" + file + "'"
vfolder_path_full = root + os.sep + file
csv_contents = "%s;%s;%s;%s;%s;%s;%s" % (vfolder_path, 
vfile_name , 'na', 'na', 'na','na', "folder")
file_paths.append([csv_contents])
elif tycsv == "txt":
vfolder_path = root + 

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
tab to space on linux is not something easy to do, I had to launch windows and 
use notepad++. Anyway, indentation should all be converted to spaces below 

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import locale
import os
import csv
from tkinter import messagebox as msg

try:
from tkinter import *
import ttk
except:
import tkinter as tk #GUI package
from tkinter import ttk


def fx_BasicListing():
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# "txt" pour type enreg csv txt/csv
# tree.delete(*tree.get_children())
fx_browseFoldersZ(1)
return

def fx_AdvancedListing():
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# fx_browseFoldersZ(2,"txt")
# tree.destroy()
#tree.delete(*tree.get_children())
fx_browseFoldersZ(2)
return

def fx_browseFoldersZ(argy):
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# "txt" pour type enreg csv txt/csv
tree.delete(*tree.get_children())
fx_browseFolders(argy,"txt")

###
###
###

def fx_writeCSV(*arr):

csv_file_title = 'csv_1_baselisting.csv'
# csv path entry box
CSV_FILE = vcsv_path.get()

if not os.path.exists(CSV_FILE):
os.makedirs(CSV_FILE)

CSV_FILE += csv_file_title
print('%s' % CSV_FILE)

with open(CSV_FILE,'w', newline ='\n') as f:
write = csv.writer(f, doublequote=True, delimiter=';')
for row in arr:
write.writerows(row)

def fx_writeCSV_str(txt_str):
csv_file_title = 'csvtxt_1_baselisting.csv'
# csv path entry box
CSV_FILE = vcsv_path.get()

if not os.path.exists(CSV_FILE):
os.makedirs(CSV_FILE)

CSV_FILE += csv_file_title
print('%s' % CSV_FILE)

with open(CSV_FILE,'w') as f:
f.write(txt_str)

# fx_LoadCSV(CSV_FILE)

with open(CSV_FILE, 'r') as f:
reader = csv.DictReader(f, delimiter=';')
for row in reader:
col1 = row['Path']
col2 = row['Folder-file']
col3 = row['Size in Byte']
col4 = row['Size in Kb']
col5 = row['Size in Mb']
col6 = row['Size in Gb']
col7 = row['type']

tree.insert('', 'end', values=(col1, col2, col3, col4, col5, 
col6,col7))

return

###
###

def fx_chkPath(xzPath):
isxFile = os.path.isfile(xzPath)
isxDir = os.path.isdir(xzPath)
print("DOSSIER OUI",isxDir)
if isxDir:
return
elif not isxDir:
msg.showwarning("Folder path", "WD Path entered not found")
return


###
###
###


def fx_browseFolders(argz, tycsv):
tree.delete(*tree.get_children())
# /// /// ///
csv_txt = ""
csv_contents = ""
counterPath = 0
size = 0
f_size = 0
f_vscale = 0
# /// /// ///

# path WD
Lpath = vtxt_path.get()
print('%s' % Lpath)

# include files
vvchkboxF = vchkboxF.get()
# print("include files:::", vchkboxF.get())

# include modification date
print(vchkboxD.get())

# include creation date
print(vchkboxC.get())

# scale
f_vscale = int(var_scale.get())
print(f_vscale)

# path WD 2
if Lpath.endswith(os.path.sep):
   Lpath = Lpath[:-1]

# isFile = os.path.isfile(Lpath)
# print("fichier?",isFile)
fx_chkPath(Lpath)

counterPath = Lpath.count(os.path.sep)

csv_contents = "Path;Folder-file;Size in Byte;Size in Kb;Size in Mb;Size in 
Gb;type\n"

csv_txt = csv_contents

# csv_contents
# 1-FOLDER PATH
# 2-FILENAME
# 3-FOLDER PATH FULL
# 4-Size in Byte
# 5-Size in Kb
# 6-Size in Mb
# 7-Size in Gb
# 8-type\n

### BASIC LISTING #
if argz == 1:
print("basic listing")
file_paths = []
file_paths.append([csv_contents])
for root, dirs, files in os.walk(Lpath, topdown=True):
for file in files:
if tycsv == "csv":
vfolder_path = root + os.sep
vfile_name = "'" + file + "'"
vfolder_path_full = root + os.sep + file
csv_contents = "%s;%s;%s;%s;%s;%s;%s" % (vfolder_path, 
vfile_name , 'na', 'na', 'na','na', "folder")
file_paths.append([csv_contents])
elif tycsv == "txt":
vfolder_path = root +

Re: learning python building 2nd app, need advices

2021-01-11 Thread Loris Bennett
pascal z  writes:

> tab to space on linux is not something easy to do

I would argue that you are mistaken, although that depends somewhat on
your definition of 'easy'.

> , I had to launch windows and use notepad++.

There is the Linux command 'expand' , which I have never used, but which
sounds like it will do what you want:

  $ expand --help
  Usage: expand [OPTION]... [FILE]...
  Convert tabs in each FILE to spaces, writing to standard output.

As an Emacs user, personally I would use the command 

  M-x untabify

within Emacs.  I assume that Vim has something similar.

Cheers,

Loris

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import locale
import os
import csv
from tkinter import messagebox as msg

try:
from tkinter import *
import ttk
except:
import tkinter as tk #GUI package
from tkinter import ttk


def fx_BasicListing():
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# "txt" pour type enreg csv txt/csv
# tree.delete(*tree.get_children())
fx_browseFoldersZ(1)
return

def fx_AdvancedListing():
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# fx_browseFoldersZ(2,"txt")
# tree.destroy()
#tree.delete(*tree.get_children())
fx_browseFoldersZ(2)
return

def fx_browseFoldersZ(argy):
#argx mode = 1 pour basic listing
#argx mode = 2 pour adv listing
# "txt" pour type enreg csv txt/csv
tree.delete(*tree.get_children())
fx_browseFolders(argy,"txt")

###
###
###

def fx_writeCSV(*arr):

csv_file_title = 'csv_1_baselisting.csv'
# csv path entry box
CSV_FILE = vcsv_path.get()

if not os.path.exists(CSV_FILE):
os.makedirs(CSV_FILE)

CSV_FILE += csv_file_title
print('%s' % CSV_FILE)

with open(CSV_FILE,'w', newline ='\n') as f:
write = csv.writer(f, doublequote=True, delimiter=';')
for row in arr:
write.writerows(row)

def fx_writeCSV_str(txt_str):
csv_file_title = 'csvtxt_1_baselisting.csv'
# csv path entry box
CSV_FILE = vcsv_path.get()

if not os.path.exists(CSV_FILE):
os.makedirs(CSV_FILE)

CSV_FILE += csv_file_title
print('%s' % CSV_FILE)

with open(CSV_FILE,'w') as f:
f.write(txt_str)

# fx_LoadCSV(CSV_FILE)

with open(CSV_FILE, 'r') as f:
reader = csv.DictReader(f, delimiter=';')
for row in reader:
col1 = row['Path']
col2 = row['Folder-file']
col3 = row['Size in Byte']
col4 = row['Size in Kb']
col5 = row['Size in Mb']
col6 = row['Size in Gb']
col7 = row['type']

tree.insert('', 'end', values=(col1, col2, col3, col4, col5, 
col6,col7))

return

###
###

def fx_chkPath(xzPath):
isxFile = os.path.isfile(xzPath)
isxDir = os.path.isdir(xzPath)
print("DOSSIER OUI",isxDir)
if isxDir:
return
elif not isxDir:
msg.showwarning("Folder path", "WD Path entered not found")
return


###
###
###


def fx_browseFolders(argz, tycsv):
tree.delete(*tree.get_children())
# /// /// ///
csv_txt = ""
csv_contents = ""
counterPath = 0
size = 0
f_size = 0
f_vscale = 0
# /// /// ///

# path WD
Lpath = vtxt_path.get()
print('%s' % Lpath)

# include files
vvchkboxF = vchkboxF.get()
# print("include files:::", vchkboxF.get())

# include modification date
print(vchkboxD.get())

# include creation date
print(vchkboxC.get())

# scale
f_vscale = int(var_scale.get())
print(f_vscale)

# path WD 2
if Lpath.endswith(os.path.sep):
   Lpath = Lpath[:-1]

# isFile = os.path.isfile(Lpath)
# print("fichier?",isFile)
fx_chkPath(Lpath)

counterPath = Lpath.count(os.path.sep)

csv_contents = "Path;Folder-file;Size in Byte;Size in Kb;Size in Mb;Size in 
Gb;type\n"

csv_txt = csv_contents

# csv_contents
# 1-FOLDER PATH
# 2-FILENAME
# 3-FOLDER PATH FULL
# 4-Size in Byte
# 5-Size in Kb
# 6-Size in Mb
# 7-Size in Gb
# 8-type\n

### BASIC LISTING #
if argz == 1:
print("basic listing")
file_paths = []
file_paths.append([csv_contents])
for root, dirs, files in os.walk(Lpath, topdown=True):
for file in files:
if tycsv == "csv":
vfolder_path = root + os.sep
vfile_name = "'" + file + "'"
vfolder_path_full = root + os.sep + file
csv_contents = "%s;%s;%s;%s;%s;%s;%s" % (vfolder_path, 
vfile_name , 'na', 'na', 'na','na', "folder")
file_paths.append([csv_contents])
elif tycsv == "txt":
vfolder_path = root + os.sep
vfile_name = file
vfolder_path_full = root + os.sep + file
f_size = os.path.getsize(vfold

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 12:00:28 PM UTC, Loris Bennett wrote:
> pascal z  writes: 
> 
> > tab to space on linux is not something easy to do 
> 
> I would argue that you are mistaken, although that depends somewhat on 
> your definition of 'easy'. 
> 
> > , I had to launch windows and use notepad++. 
> 
> There is the Linux command 'expand' , which I have never used, but which 
> sounds like it will do what you want: 
> 
> $ expand --help 
> Usage: expand [OPTION]... [FILE]... 
> Convert tabs in each FILE to spaces, writing to standard output. 
> 
> As an Emacs user, personally I would use the command 
> 
> M-x untabify 
> 
> within Emacs. I assume that Vim has something similar. 
> 
> Cheers, 
> 
> Loris 
> 
> -- 
> This signature is currently under construction.


Thanks, I'm going to try

As alternative, I pasted it into github and pasted it back into this page, it's 
ok when pasting but when posting it fails keeping spaces... Until I can find a 
way to do it, this is the github link 

https://github.com/barpasc/listfiles/blob/main/pyFilesGest_6B18.py
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread Greg Ewing

On 12/01/21 1:12 am, pascal z wrote:

As alternative, I pasted it into github and pasted it back into this page, it's 
ok when pasting but when posting it fails keeping spaces...


The indentation in your last three posts looks fine here in
the comp.lang.python newsgroup. If it doesn't look right to
you, it may be the fault of whatever you're using to read
the group.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote:
> On 12/01/21 1:12 am, pascal z wrote: 
> > As alternative, I pasted it into github and pasted it back into this page, 
> > it's ok when pasting but when posting it fails keeping spaces...
> The indentation in your last three posts looks fine here in 
> the comp.lang.python newsgroup. If it doesn't look right to 
> you, it may be the fault of whatever you're using to read 
> the group. 
> 
> -- 
> Greg

@Greg, then if you want, you can post these from what you're using. I tried 
sending a few times and it seemed it didn't work when refreshing the google 
group discussion page. However, just looking now at the discussion through 
emails, shows indentation right. I'm using firefox. I'll try using chromium for 
later posts if that makes things easier.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-authors] Query

2021-01-11 Thread Chris Angelico
On Mon, Jan 11, 2021 at 10:36 PM George Fischhof  wrote:
>
> Eduardo Emén Muñoz  ezt írta (időpont: 2021. jan. 8.,
> P, 17:23):
>
> > Dear Srs,
> >
> >  I apologize if this is not the right place to ask this question, I am
> > Biologist teaching Python language (in spanish)  focused in Molecular
> > Biology.
> >
> >  People interested often ask me if my classes/course has a valid
> > certification and I have to say no, so my question is :
> >
> > What can I do for provide a valid diploma with the Python logo to my
> > students? I mean, how I would be allowed to give a valid
> > Python logo on my students diploma? I have tried to contact local
> > institutions like Biology's college, Education Ministry , etc but no
> > success at all.
> >
> > Many thanks for your time reading this email, sorry for my poor english
> > and thanks in advance.
> >
> >
> > ___
> > Python-authors mailing list
> > [email protected]
> > https://mail.python.org/mailman/listinfo/python-authors
>
>
> Hi,
>
> the good forum for similar questions is  [email protected] mail list -
> I think ;-)
>
> Right _now_ Microsoft created a Python exam, I do not know how much is that
> appreciated, or accepted, but there is.
> As I know this is the only one somewhat standardised exam now.
> Of course there are several institutes holding Python course and exam
>

Sounds like a legal question regarding the use of the trademark? If
so, contact [email protected] - they should be able to help
you.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 1:01 AM pascal z via Python-list
 wrote:
>
> On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote:
> > On 12/01/21 1:12 am, pascal z wrote:
> > > As alternative, I pasted it into github and pasted it back into this 
> > > page, it's ok when pasting but when posting it fails keeping spaces...
> > The indentation in your last three posts looks fine here in
> > the comp.lang.python newsgroup. If it doesn't look right to
> > you, it may be the fault of whatever you're using to read
> > the group.
> >
> > --
> > Greg
>
> @Greg, then if you want, you can post these from what you're using. I tried 
> sending a few times and it seemed it didn't work when refreshing the google 
> group discussion page. However, just looking now at the discussion through 
> emails, shows indentation right. I'm using firefox. I'll try using chromium 
> for later posts if that makes things easier.
>

Easy fix: stop looking at the Google Group page.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote:
> On Tue, Jan 12, 2021 at 1:01 AM pascal z via Python-list 
>  wrote: 
> > 
> > On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: 
> > > On 12/01/21 1:12 am, pascal z wrote: 
> > > > As alternative, I pasted it into github and pasted it back into this 
> > > > page, it's ok when pasting but when posting it fails keeping spaces... 
> > > The indentation in your last three posts looks fine here in 
> > > the comp.lang.python newsgroup. If it doesn't look right to 
> > > you, it may be the fault of whatever you're using to read 
> > > the group. 
> > > 
> > > -- 
> > > Greg 
> > 
> > @Greg, then if you want, you can post these from what you're using. I tried 
> > sending a few times and it seemed it didn't work when refreshing the google 
> > group discussion page. However, just looking now at the discussion through 
> > emails, shows indentation right. I'm using firefox. I'll try using chromium 
> > for later posts if that makes things easier. 
> >
> Easy fix: stop looking at the Google Group page. 
> 
> ChrisA
ok, emails show post fine. 10 years ago or something, I was quite involved to 
comp.lang.c and I don't remember having this issue. Of course, only Python 
needs formatting speficities but from what I can remember, indentation was 
working fine then. One more thing, is that there was a lot less ads than now. 
And comp.lang.python seems to show more ads than other groups like comp.lang.c
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread 2QdxY4RzWzUUiLuE
On 2021-01-11 at 06:34:42 -0800,
pascal z via Python-list  wrote:

> On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote:

> > Easy fix: stop looking at the Google Group page. 
> > 
> > ChrisA
> ok, emails show post fine. 10 years ago or something, I was quite
> involved to comp.lang.c and I don't remember having this issue. Of
> course, only Python needs formatting speficities but from what I can
> remember, indentation was working fine then. One more thing, is that
> there was a lot less ads than now. And comp.lang.python seems to show
> more ads than other groups like comp.lang.c

I read the mailing list.  With an email client.  No ads.

Start at , join the mailing
list, and stop using Google.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread Terry Reedy

On 1/11/2021 6:46 AM, pascal z via Python-list wrote:

tab to space on linux is not something easy to do,


IDLE has a tab to spaces command on the format menu.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread Grant Edwards
On 2021-01-11, pascal z via Python-list  wrote:

> tab to space on linux is not something easy to do,

Nonsense, there's a command _specifically_ for that:

$ man expand

--
Grant

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: learning python building 2nd app, need advices

2021-01-11 Thread Grant Edwards
On 2021-01-11, [email protected] 
<[email protected]> wrote:
> On 2021-01-11 at 06:34:42 -0800,
> pascal z via Python-list  wrote:
>
>> On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote:
>
>> > Easy fix: stop looking at the Google Group page. 
>>
>> ok, emails show post fine. 10 years ago or something, I was quite
>> involved to comp.lang.c and I don't remember having this issue. Of
>> course, only Python needs formatting speficities but from what I can
>> remember, indentation was working fine then. One more thing, is that
>> there was a lot less ads than now. And comp.lang.python seems to show
>> more ads than other groups like comp.lang.c
>
> I read the mailing list.  With an email client.  No ads.
>
> Start at , join the mailing
> list, and stop using Google.

Or point your favorite NNTP client at 
nntp://news.gmane.io/gmane.comp.python.general

Google Groops is definitely the wrong answer.

--
Grant





-- 
https://mail.python.org/mailman/listinfo/python-list


A beginning beginner's question about input, output and . . .

2021-01-11 Thread DonK


Hi, I'm thinking about learning Python but I'm 74 years old and will
very likely not ever have a programming job again. I used to program
in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
languages. It's been about 18-19 years since my last programming job.
I do understand programming concepts but I'm really not up on any of
the more modern programming languages.

I've installed Python 3.7, the PyCharm IDE and watched some Youtube
tutorials but it's been stretched out over about 1.5 years so I'll
probably need to go back to the beginning. My problem is that I don't
understand how Python programs are used. (i.e user input and output)
Is Python mainly used for backends?

I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
look kinda like adding a family room onto a 1986 double wide mobile
home, and they look even more complicated than creating a GUI from
scratch in C++ with a message loop, raising events . . .

So, what do you folks use Python for?

Nowdays I mainly just use programming for rather small utilities for
my personal use. Currently I'd like to write something to iterate
through open windows and save them to different folders depending on
if the titlebar contains certain strings. In the past I would probably
have used Excel's VBA to do this but I no longer have Excel installed
on my main computer. I'd like a bit of a challenge but I don't want to
spin my wheels trying to learn something that will be a dead end for
me.

I know that this probably seems like a stupid post but your input will
be useful.

Thank you.

   Don

I know that Python is a very popular language so I'm sorry if it
sounds like I'm being critical. I really don't know enough about it to
be critical.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 7:41 AM DonK  wrote:
>
>
> Hi, I'm thinking about learning Python but I'm 74 years old and will
> very likely not ever have a programming job again. I used to program
> in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
> languages. It's been about 18-19 years since my last programming job.
> I do understand programming concepts but I'm really not up on any of
> the more modern programming languages.
>
> I've installed Python 3.7, the PyCharm IDE and watched some Youtube
> tutorials but it's been stretched out over about 1.5 years so I'll
> probably need to go back to the beginning. My problem is that I don't
> understand how Python programs are used. (i.e user input and output)
> Is Python mainly used for backends?
>

Python is used in many different ways. I'd recommend focusing first on
the simple console input and output, which are available as the
input() and print() built-in functions; those are sufficient for a
vast majority of situations. Beyond that, you run into what's best
described as "inherent complexity"; building a good user interface is,
by its nature, not simple.

If it's easier, you can look into using a web browser as your user
interface. Python is superb at building web servers and web
applications, so you can easily design your app so the user interacts
with it using a very simple browser-based front end - either with
JavaScript or as a really easy form fill-out.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread dn via Python-list
On 12/01/2021 09.37, DonK wrote:
> 
> Hi, I'm thinking about learning Python but I'm 74 years old and will
> very likely not ever have a programming job again. I used to program
> in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
> languages. It's been about 18-19 years since my last programming job.
> I do understand programming concepts but I'm really not up on any of
> the more modern programming languages.
> 
> I've installed Python 3.7, the PyCharm IDE and watched some Youtube
> tutorials but it's been stretched out over about 1.5 years so I'll
> probably need to go back to the beginning. My problem is that I don't
> understand how Python programs are used. (i.e user input and output)
> Is Python mainly used for backends?
> 
> I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
> look kinda like adding a family room onto a 1986 double wide mobile
> home, and they look even more complicated than creating a GUI from
> scratch in C++ with a message loop, raising events . . .
> 
> So, what do you folks use Python for?
> 
> Nowdays I mainly just use programming for rather small utilities for
> my personal use. Currently I'd like to write something to iterate
> through open windows and save them to different folders depending on
> if the titlebar contains certain strings. In the past I would probably
> have used Excel's VBA to do this but I no longer have Excel installed
> on my main computer. I'd like a bit of a challenge but I don't want to
> spin my wheels trying to learn something that will be a dead end for
> me.


Your question is very broad. Python is used for an incredibly wide
variety of purposes.

Frankly, why worry about my uses for Python, the only important stuff is
what you want to do with it!

There are plenty of articles 'out there' which discuss using Excel
[data] with Python, why one should prefer Python to Excel, etc. Try:
https://info.cambridgespark.com/latest/python-vs-excel (BTW with Python
and appropriate libraries, the Excel package itself is not required)

One way to learn is to ask the question: how do I do xyz in Python? You
have some background, so will be able to ask reasonably 'educated' and
valid questions. This will feel faster, but is by definition a
piece-meal approach.

Us 'silver surfers' often prefer a more structured (and complete)
approach, and preferably one which looks at the semantics of the
language (in Python we talk of idioms and the "Zen of Python") not
merely the syntax. Thus, I recommend (free or $) MOOCs on the edX or
Coursera platforms (amongst others).

As you say, the profession has 'moved on' and there are fresh approaches
and new angles to get one's head around... So, it's not just "Python" then!

PS you will likely find the Python-Tutor mailing list solid assistance.
-- 
Regards =dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Cameron Simpson
On 11Jan2021 15:37, DonK  wrote:
>Hi, I'm thinking about learning Python but I'm 74 years old and will
>very likely not ever have a programming job again. I used to program
>in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
>languages.

Therefore you're happy with classes, and are presumably with a Windows 
background. (And, of course, the mainframe world.)

>I've installed Python 3.7, the PyCharm IDE and watched some Youtube
>tutorials but it's been stretched out over about 1.5 years so I'll
>probably need to go back to the beginning. My problem is that I don't
>understand how Python programs are used. (i.e user input and output)
>Is Python mainly used for backends?

My personal Python use is almost all backend, and on a personal basis I 
spend most of my time at a command prompt in a terminal window.

However, you can write fully fledged GUI applications in Python.

Without a GUI Python programmes tend to work off their input and write 
to their output (or other files) like any other command line programme.

Chris mentioned input() for reading input and print() for writing 
output. input() is an interactive function (it accepts a prompt string 
and reads a single line of text). If you're writing something batchy, 
which might be in a pipeline or reading from a text file, then the 
standard input is sys.stdin and can be read in various ways - when that 
is text the typical way is just to iterate over it in a for-loop, which 
gets your lines of text.

Trite example:

import sys


lineno = 0
for line in sys.stdin:
lineno += 1
print("line number", lineno, "text =", line)

>I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
>look kinda like adding a family room onto a 1986 double wide mobile
>home, and they look even more complicated than creating a GUI from
>scratch in C++ with a message loop, raising events . . .

They aren't really. I've not use Tkinter, but I have used PyQt. You 
still have the usual framework:

- contruct widgets (windows and other GUI elements) with the associated 
  code which runs when you interact with them

- an event loop (usually simply entered after constructing the main GUI 
  component(s)) - it will run until told to stop

- raising events - in PyQt these are called "signals" - you issue a 
  signel/event with whatever information it uses and the event loop runs 
  its handler in due course

Part of the difficulty with PyQt (for me) is that it is a Python shim 
onto a quite large C++ widget library. Most of the actual doco seems to 
be the C++ side, and you need to infer some stuff to use it from Python.  
The shim is very one-to-one, so that works pretty well.

I gather that Tkinter is easier to get off the ground with.

>So, what do you folks use Python for?

Personally, almost entirely command line stuff, and making 
libraries/modules/packages which implement what I need.

>Nowdays I mainly just use programming for rather small utilities for
>my personal use.

Me too.

>Currently I'd like to write something to iterate
>through open windows and save them to different folders depending on
>if the titlebar contains certain strings. In the past I would probably
>have used Excel's VBA to do this but I no longer have Excel installed
>on my main computer. I'd like a bit of a challenge but I don't want to
>spin my wheels trying to learn something that will be a dead end for
>me.

This requires Windows specific knowledge, which I lack. Saving to 
folders etc is standard stuff, but the "iterate through open windows" 
and consulting their titlebar strings is platform, and maybe app, 
specific. I'm not a Windows person, alas.

>I know that this probably seems like a stupid post but your input will
>be useful.

No, it's entirely reasonable. Getting off the ground with a 
useful-to-you task is always the first hurdle with a new language.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 7:41 AM DonK  wrote:
> Hi, I'm thinking about learning Python but I'm 74 years old and will
> very likely not ever have a programming job again. I used to program
> in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
> languages.

BTW, from my experience, there's very very few languages so obscure
that not one person on this list has heard of them :)

For example, I've used REXX, which is an IBM language found on some of
the mainframes and also on OS/2, and I'm not the only person here who
has.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Dan Stromberg
On Mon, Jan 11, 2021 at 2:22 PM Cameron Simpson  wrote:

> >I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
> >look kinda like adding a family room onto a 1986 double wide mobile
> >home, and they look even more complicated than creating a GUI from
> >scratch in C++ with a message loop, raising events . . .
>
> They aren't really. I've not use Tkinter, but I have used PyQt.
>

Maybe compared to Java or C# they are, which come with almost the only GUI
toolkit that gets used.  But there's also a version of Qt for Java.  Not
sure about C#.

I've mostly used GTK for GUI's and a little Tkinter for turtle graphics,
both in Python.  Both felt natural.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Cameron Simpson
On 11Jan2021 15:52, Dan Stromberg  wrote:
>On Mon, Jan 11, 2021 at 2:22 PM Cameron Simpson  wrote:
>> >I've seen some Python gui frameworks like Tkinter, PyQt, etc. but 
>> >they
>> >look kinda like adding a family room onto a 1986 double wide mobile
>> >home, and they look even more complicated than creating a GUI from
>> >scratch in C++ with a message loop, raising events . . .
>>
>> They aren't really. I've not use Tkinter, but I have used PyQt.
>
>Maybe compared to Java or C# they are, which come with almost the only GUI
>toolkit that gets used.  But there's also a version of Qt for Java.  Not
>sure about C#.

Hmm, in the distant past I did write a small GUI app using Java. It was 
a little simpler than (current) Qt to my (fuzzy) recollection, but that 
might be partly because the toolkit itself was smaller. Unsure now.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Greg Ewing

On 12/01/21 9:37 am, DonK wrote:


I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
look kinda like adding a family room onto a 1986 double wide mobile
home, and they look even more complicated than creating a GUI from
scratch in C++ with a message loop, raising events . . .


I'm surprised you find any of those toolkits more complicated
to use than the raw Windows API, which last time I dabbled in it
seemed fairly horrendous.

Unfortunately there doesn't seem to be a really good way to
easily make GUIs in Python. I tried to fill that gap a few years
back with PyGUI:

https://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

You might like to check that out, but be warned that a few bits
of it are broken at the moment. It's badly in need of an overhaul,
and I don't have time to devote to it right now.


So, what do you folks use Python for?


Personal uses I can think of in recent times:

* Command line tools for various small tasks, often parts of
build systems for other projects.

* Games, using pygame, pyopengl, numpy and various other libraries.


Currently I'd like to write something to iterate
through open windows and save them to different folders depending on
if the titlebar contains certain strings.


That sounds like it should be doable if you can get access to the
right Windows API functions. Check out the pywin32 package. If that
doesn't provide what you need, there's always ctypes (part of the
standard python distribution, gives low-level access to C library
functions).

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 3:16 PM Greg Ewing  wrote:
> > Currently I'd like to write something to iterate
> > through open windows and save them to different folders depending on
> > if the titlebar contains certain strings.
>
> That sounds like it should be doable if you can get access to the
> right Windows API functions. Check out the pywin32 package. If that
> doesn't provide what you need, there's always ctypes (part of the
> standard python distribution, gives low-level access to C library
> functions).
>

Sounds like an awful lot of work. On Linux, I'd just subprocess out to
wmctrl and parse its output - way easier.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Abdur-Rahmaan Janhangeer
Greetings,

Web with Python is really easy to get started with, here
is a simple endpoint with a framework called Flask

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
   return 'Hello World’

if __name__ == '__main__':
   app.run()

As for Tkinter, it's really annoying.
PyQt5 and others are a lot better.
PyQt5 follows the Cpp function namings

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius


On Tue, Jan 12, 2021 at 12:43 AM DonK  wrote:

>
> Hi, I'm thinking about learning Python but I'm 74 years old and will
> very likely not ever have a programming job again. I used to program
> in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
> languages. It's been about 18-19 years since my last programming job.
> I do understand programming concepts but I'm really not up on any of
> the more modern programming languages.
>
> I've installed Python 3.7, the PyCharm IDE and watched some Youtube
> tutorials but it's been stretched out over about 1.5 years so I'll
> probably need to go back to the beginning. My problem is that I don't
> understand how Python programs are used. (i.e user input and output)
> Is Python mainly used for backends?
>
> I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
> look kinda like adding a family room onto a 1986 double wide mobile
> home, and they look even more complicated than creating a GUI from
> scratch in C++ with a message loop, raising events . . .
>
> So, what do you folks use Python for?
>
> Nowdays I mainly just use programming for rather small utilities for
> my personal use. Currently I'd like to write something to iterate
> through open windows and save them to different folders depending on
> if the titlebar contains certain strings. In the past I would probably
> have used Excel's VBA to do this but I no longer have Excel installed
> on my main computer. I'd like a bit of a challenge but I don't want to
> spin my wheels trying to learn something that will be a dead end for
> me.
>
> I know that this probably seems like a stupid post but your input will
> be useful.
>
> Thank you.
>
>Don
>
> I know that Python is a very popular language so I'm sorry if it
> sounds like I'm being critical. I really don't know enough about it to
> be critical.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread songbird
DonK wrote:
>
> Hi, I'm thinking about learning Python but I'm 74 years old and will
> very likely not ever have a programming job again. I used to program
> in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
> languages. It's been about 18-19 years since my last programming job.
> I do understand programming concepts but I'm really not up on any of
> the more modern programming languages.

  hi Don,

  you sound like you have a similar perspective to my own
except i'm a bit younger.  :)


> I've installed Python 3.7, the PyCharm IDE and watched some Youtube
> tutorials but it's been stretched out over about 1.5 years so I'll
> probably need to go back to the beginning. My problem is that I don't
> understand how Python programs are used. (i.e user input and output)
> Is Python mainly used for backends?

  it can be used for pretty much anything except perhaps
high pressure real time things, but i bet someone else will
know that is being done too, i've just not heard of it.  :)


> I've seen some Python gui frameworks like Tkinter, PyQt, etc. but they
> look kinda like adding a family room onto a 1986 double wide mobile
> home, and they look even more complicated than creating a GUI from
> scratch in C++ with a message loop, raising events . . .

  i tried pyglet just because it was the first one that i
could figure out without it being too complicated.


> So, what do you folks use Python for?

  for me i used it to learn python and wrote a simple game
which adapted an already existing game written in C to python.
since i don't really understand python and have issues with
some concepts it hasn't gone much further lately and i'm
ok with that.


> Nowdays I mainly just use programming for rather small utilities for
> my personal use. Currently I'd like to write something to iterate
> through open windows and save them to different folders depending on
> if the titlebar contains certain strings. In the past I would probably
> have used Excel's VBA to do this but I no longer have Excel installed
> on my main computer. I'd like a bit of a challenge but I don't want to
> spin my wheels trying to learn something that will be a dead end for
> me.

  i am so familiar with Bash shell script language and C 
that either of those would normally be my first choice
because i already have tools done for enough things and
i know what i'm doing.

  for python i just spend too much time fumbling around
and i don't really know what is current and if i'm using
something that will be kept up for the future or if the
project is going away or in a direction that i won't like
(both KDE and Gnome desktops messed me up with what they
did after i spent a lot of time finding them, getting
them set up and then they changed and i switched only to
have the other do the same to me so i switched again to
Mate and that at least has been more stable to my style of
doing things).

  uh, so, i think i do understand your aims and perspective
and hope you can get further in your goals.  :)


> I know that this probably seems like a stupid post but your input will
> be useful.
>
> Thank you.
>
>Don
>
> I know that Python is a very popular language so I'm sorry if it
> sounds like I'm being critical. I really don't know enough about it to
> be critical.

  heh, well, if you go back and read some of my previous posts
here you'd see a lot of dumb things i've said too.  don't worry.
i'm sure i'll make other dumb posts too, but at the moment i'm
mostly in a holding pattern for a while.  i have a few other
big projects i need to finish before i get back to python again.


  songbird
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 5:26 PM songbird  wrote:
>   for python i just spend too much time fumbling around
> and i don't really know what is current and if i'm using
> something that will be kept up for the future or if the
> project is going away or in a direction that i won't like
> (both KDE and Gnome desktops messed me up with what they
> did after i spent a lot of time finding them, getting
> them set up and then they changed and i switched only to
> have the other do the same to me so i switched again to
> Mate and that at least has been more stable to my style of
> doing things).

That's not really something Python can ever control, but I can say
with some confidence that the big libraries like Qt and GTK are going
to adapt, one way or another. And perhaps more importantly: Neither
input()/print() nor web applications is going *anywhere*. You are
ALWAYS going to have those two as options.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list