python show .

2020-09-23 Thread pascal z via Python-list
, f_size/1048576, f_size/1073741824) fp = open(output_file, "w") fp.write(csv_contents) fp.close() ### END OF SCRIPT### When I run this script, I get files in subfolders. For now, I need to keep using "os.walk" because the script includes functions that I didn't include to make thing simple. Pascal -- https://mail.python.org/mailman/listinfo/python-list

Re: python show folder files and not subfolder files

2020-09-23 Thread pascal z via Python-list
%.2f \n" % (path, f_size, f_size/1024, f_size/1048576, f_size/1073741824) fp = open(output_file, "w") fp.write(csv_contents) fp.close() -- https://mail.python.org/mailman/listinfo/python-list

Re: python show folder files and not subfolder files

2020-09-23 Thread pascal z via Python-list
ok, i came up with if os.path.isfile(path) following path = os.path.join(Lpath, f) and it seems to be ok, no dupplicates or wrong sizes... thanks -- https://mail.python.org/mailman/listinfo/python-list

Use of a variable in parent loop

2020-09-25 Thread Stephane Tougard via Python-list
{}".format(name)) The exact same code in Python works fine, the variable name is used outside of the if block even it has been declared inside. This does not look right to me. Can we change this behavior or is there any point to keep it this way ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-26 Thread Stephane Tougard via Python-list
and not strict. Anyway, there's no perfect language, the point is to know it. It's just confusing I still have to declare or not declare an object depending on the action I have with it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
it does not answer the question. In many non declarative language, if I do print($var), it just prints and undefined value with returning an error. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
m asking if there is way to do things. -- https://mail.python.org/mailman/listinfo/python-list

RE: Use of a variable in parent loop

2020-09-27 Thread Avi Gross via Python-list
es are often made for other reasons such as how easy the creators can implement things even if the result is harder to program some things in. Avi -Original Message- From: Python-list On Behalf Of [email protected] Sent: Sunday, September 27, 2020 8:17 AM To: python-li

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Chris Angelico wrote: > If you MUST use a block-end marker, try "# end" instead - at least > then everyone *knows* it's nothing more than a comment. Damn, you could not say that earlier !!! -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
ady thinking about it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
't do it" or "it's not expected to be done this way". Anyway, thanks for your help. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
is arguing as if I said any blasphem because I asked how can we change the behavior of the language. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
ever happens. In some languages Totally agree, it's not an acceptable behavior. I would not do some Perl without 'use strict' -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
So it's logic for it to indent one level up after a 'pass' because the people who made it did not see any other usage to 'pass' than that. if True: pass print("It's true") The 'pass' is totally useless by itself, it can be replaced by a comment. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
. #include int main(int argc, char * argv[]) { if(1 == 1) ; printf("Hello\n"); return 0; } > while process_next_item(): > # Do nothing. > pass while p(): # do nothing continue -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
ChrisA and StefanR and others here I am >> > also a Python beginner) >> >> To give me a pointer on your localhost, I could guess. > > Don't understand this sentence. The URL you gave is pointing to your localhost, your own computer if you prefer. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
stated otherwise. Using goto() may make the code much simpler to understand when you encounter a lot of error cases in a code. The try: except: of Python, as I understand it, is never more than a goto() in disguise (at least, that's the way I use goto() in Perl). -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
I live with it since 20 years. But I've seen some Perl code that is total gebbiresh to me, still doing the job correctly. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
g/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
r. And FYI, I've done this way since 25 years and I count a few good success in my career. Practically, my way of doing things works is at least as well as any. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
ython.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-28 Thread Stephane Tougard via Python-list
ets as well an empty line or a comment as a breaking point of a block, it's not as good as the use of pass because I still have to indent up manually, but at least the indent-region does not break it. -- https://mail.python.org/mailman/listinfo/python-list

python if and same instruction line not working

2020-09-29 Thread pascal z via Python-list
tmpstr == "file\n": csv_contentsC += x -- https://mail.python.org/mailman/listinfo/python-list

Problem

2020-09-29 Thread Ron Villarreal via Python-list
Tried to open Python 3.8. I have Windows 10. Icon won’t open. -- https://mail.python.org/mailman/listinfo/python-list

Re: Hot reload Flask app?

2020-10-01 Thread Roland Müller via Python-list
rg/mailman/listinfo/python-list

Re: python if and same instruction line not working

2020-10-04 Thread pascal z via Python-list
On Tuesday, September 29, 2020 at 5:28:22 PM UTC+2, MRAB wrote: > On 2020-09-29 15:42, pascal z via Python-list wrote: > > I need to change the script commented out to the one not commented out. Why? > > > > # for x in sorted (fr, key=str.lower): > > # t

Re: python show folder files and not subfolder files

2020-10-04 Thread pascal z via Python-list
On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote: > On 9/23/2020 7:24 PM, pascal z via Python-list wrote: > > Please advise if the following is ok (i don't think it is) > > > > #!/usr/bin/env python3 > > # -*- coding: utf-8 -*- > >

Trying to Download PygameZero

2020-10-10 Thread Tom Hedge via Python-list
ygame\buildconfig\download_win_prebuilt.py", line 302, in ask        reply = raw_input(    EOFError: EOF when reading a line    ----ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Please let me know ASAP how to fix this. Ive spent countless hours trying to fix this, ive tried my changing my Path becasue thats what everyone told me. I have also tried some other means to fix this and non have been sucsussful. Please Help me, -- https://mail.python.org/mailman/listinfo/python-list

RE: Python's carbon guilt

2020-10-10 Thread Avi Gross via Python-list
long commutes, does it matter if your remote work is much more carbon friendly than the costs to travel and then still use other energy there for lighting and more computers and ... -Original Message- From: Python-list On Behalf Of Peter Pearson Sent: Saturday, October 10, 2020 11:58

Simple question - end a raw string with a single backslash ?

2020-10-13 Thread Tony Flury via Python-list
teral backslash characters The only solution I have found is to do this : >>> a = r'end' + chr(92) >>> a 'end\\' >>> list(a) ['e', 'n', 'd', '\\'] or >>> a = r'end\\'[:-1] >>> list(a) ['e', 'n', 'd', '\\'] Neither of which are nice. -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple question - end a raw string with a single backslash ?

2020-10-15 Thread Roland Müller via Python-list
On 10/13/20 4:14 PM, Serhiy Storchaka wrote: 13.10.20 11:52, Tony Flury via Python-list пише: I am trying to write a simple expression to build a raw string that ends in a single backslash. My understanding is that a raw string should ignore attempts at escaping characters but I get this

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Karen Shaeffer via Python-list
question. Ask its support mailing lists >> or have a look at its source. >> >> -- > Samuel Marks > Charity <https://sydneyscientific.org <https://sydneyscientific.org/>> | > consultancy > <https://offscale.io <https://offscale.io/>> | open-source

Subprocess Connection Error

2020-10-17 Thread Dave Dungan via Python-list
g. Any help would be appreciated. One more thing, the book says to save it as "types.py". Thank you, Dave Dungan -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple question - end a raw string with a single backslash ?

2020-10-17 Thread Mladen Gogala via Python-list
a="abcd" >>> b=re.sub('$',chr(28),a) >>> b 'abcd\x1c' >>> b=re.sub('$',chr(0x41),a) >>> b 'abcdA' >>> b=re.sub('$','Z',a) >>> b 'abcdZ' >>> b=re.sub('$',chr(0x1C),a) >>> b 'abcd\x1c' >>> Any other character is shown as it should be, except backslash. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: File Name issue

2020-10-17 Thread Mladen Gogala via Python-list
tor Try this: with open("HOURLY\-LOG.txt", 'r') as infile: -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: File Name issue

2020-10-17 Thread Mladen Gogala via Python-list
._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd8 in position 897: invalid continuation byte However, that doesn't have anything to do with your problem. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedding version in command-line program

2020-10-17 Thread Tony Flury via Python-list
m not sure if that helps in your .toml file though - is it executed or does it have the ability to read files when it creates the distributable ? -- https://mail.python.org/mailman/listinfo/python-list

Re: MERGE SQL in cx_Oracle executemany

2020-10-17 Thread Mladen Gogala via Python-list
already have NULL values in the PROJECT column than use "add constraint" with NOVALIDATE option. Other than that, allowing NULL values in key columns is a sign of bad design. Namely, Oracle cannot index NULL columns, so PROJECT IS NULL predicate cannot be resolved by an index. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: File Name issue

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 21:00:18 +1300, dn wrote: > On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: >> On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: >>> On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: >>> >>>> with open("HOURLYLOG.

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
than to write Perl scripts. I do sort of miss $_, @_ and $!. Python's argparse is supreme and much better than Getopt::Long. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
s://mail.python.org/mailman/listinfo/python-list

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
ules which are not compatible with Perl6 or "Roku" as it is known. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Debugging a memory leak

2020-10-22 Thread Karen Shaeffer via Python-list
ens when dt.update() is executed. It seems to me that any memory consumed when dt.update() is executed will not be released when the leak function returns. humbly, Karen -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a log file that tracks every statement that is being executed when a program is running?

2020-10-25 Thread Mladen Gogala via Python-list
but YMMV. > > Maxime Thank you. I am a YAPN (yet another Python newbie) and this helps me a lot. -- Mladen Gogala Database Consultant http://mgogala.byethost5.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Live Write to File with Code That is Reading File and Writing to Serial Port

2020-10-28 Thread Karen Shaeffer via Python-list
>ser.write(send_str.encode('utf-8')) >time.sleep(send_pause) >reply_str = ser.readline().decode('utf-8').strip() >file_result.write("reply:" + reply_str + "\n") #<---(*) >file_result.write('\n') #<---(*) file_result.flush() os.fsync() Karen -- https://mail.python.org/mailman/listinfo/python-list

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Jon Ribbens via Python-list
s, when they do. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Jon Ribbens via Python-list
On 2020-10-31, Chris Angelico wrote: > On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list > wrote: >> >> On 2020-10-31, Stefan Ram wrote: >> > Siddhharth Choudhary writes: >> >>I want to know why x+=1 does not return the value of the variable.

RE: Find word by given characters

2020-11-03 Thread Avi Gross via Python-list
three also has overhead. -Original Message----- From: Python-list On Behalf Of Chris Angelico Sent: Tuesday, November 3, 2020 12:35 PM To: Python Subject: Re: Find word by given characters On Wed, Nov 4, 2020 at 1:11 AM Bischoop wrote: > Let me clarify what I want to do: > We all kn

RE: Find word by given characters

2020-11-03 Thread Avi Gross via Python-list
h to speed something like that up 5%? Maybe, but often not. And if you add in the typical costs in a large organization of various kinds of testing needed for a more complex or subtle approach, ... Avi -- https://mail.python.org/mailman/listinfo/python-list

RE: Find word by given characters

2020-11-04 Thread Avi Gross via Python-list
My comments at end: -Original Message- From: Python-list On Behalf Of duncan smith Sent: Wednesday, November 4, 2020 1:09 PM To: [email protected] Subject: Re: Find word by given characters On 04/11/2020 04:21, Avi Gross wrote: > Duncan, my comments below yours at

Re: Is there a conflict of libraries here?

2020-11-08 Thread SMOA BLX via Python-list
inter import ttk     ttk = sys.modules['tkinter'].ttk All of these 3 things set local variables/names in your script to some value. The "*" import sets a bunch of variables. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

io.TextIOWrapper.readlines

2020-11-11 Thread Karen Shaeffer via Python-list
? The builtin ‘open’ function is defined in the io streams module. I presume the builtin open(‘file’, ‘r’) returns an io.TextIOWrapper object. And maybe the readlines method just isn’t documented? Just curious and lazy. thanks, Karen -- https://mail.python.org/mailman/listinfo/python-list

Cannot update parso

2020-11-21 Thread Cecil Westerhof via Python-list
ion is active. Why is jedi not updated. (I cannot uninstall jedi, because it is used by ipython.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Error issue - Kindly resolve

2020-11-22 Thread sheetal chavan via Python-list
api-ms-win-crt-runtime-|1-1-0.dll is missing from  your computer. Try reinstalling the program to fix this problem.Kindly resolve this issue and suggest the solution.Thanks and regardsSheetal M Chavan   -- https://mail.python.org/mailman/listinfo/python-list

Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
; has no attribute 'OpenWrapper' Current thread 0x9d44 (most recent call first): Regards,Mayukh -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
install but it didn't solve the issue. Regards,Mayukh On Monday, November 23, 2020, 06:17:00 PM GMT, Barry Scott wrote: > On 23 Nov 2020, at 14:10, Mayukh Chakraborty via Python-list > wrote: > > Hi, > I had uninstalled and installed Python in Windows 10 but I am

Re: Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
nstall but it didn't solve the issue. Regards,MayukhOn Monday, November 23, 2020, 06:34:43 PM GMT, Terry Reedy wrote: On 11/23/2020 9:10 AM, Mayukh Chakraborty via Python-list wrote: > Hi, > I had uninstalled and installed Python in Windows 10 but I am getting the > error be

Re: Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
: Python3.9 from "C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The NumPy version is: "1.19.4" and make sure that they are the versions you expect.Please carefully study the documentation linked above for further help. Original error was: No module na

Re: Python Error

2020-11-24 Thread Mayukh Chakraborty via Python-list
ith the command: > >    py -0 When was that '-0' feature added? I have Python 3.6 from Python.org and here a 'py.exe -0' gives:   Requested Python version (0) not installed But using 'py.exe -0' from Python 3.9 correctly gives:   -3.6-32 *   -2.7-32 -- --gv -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Error

2020-11-24 Thread Mayukh Chakraborty via Python-list
09:27:00 PM GMT, Barry wrote: Two observations. Python.exe is not on your PATH. But that does not matter as you can use the py command instead And nymph may not be available for python 3.9 yet. Check on pypi to see if there is a build for 3.9. Maybe use 3.8 for the time being. Barry &

Re: Fw: See example

2020-12-04 Thread DL Neil via Python-list
On 05/12/2020 09:17, Dan Stromberg wrote: On Fri, Dec 4, 2020 at 12:01 PM dn via Python-list mailto:[email protected]>> wrote: On 05/12/2020 07:57, Arthur R. Ott wrote: ... >     Microsoft Windows [Version 10.0.19042.630] >     (c) 2020 Microsoft Corp

Error

2020-12-06 Thread Barry Fitzgerald via Python-list
ptions on custom install. Any Suggestions? -- https://mail.python.org/mailman/listinfo/python-list

Re: Letter replacer - suggestions?

2020-12-07 Thread Jon Ribbens via Python-list
t;notes.err", "a") as err: > traceback.print_exc(file=err) > raise > > since print_exc() can go fetch the exception via sys.exc_info(). ... but even if you do think you want "except BaseException:" or "except:", you almost never actually do - you almost certainly want "except Exception:", because the former two will stop sys.exit() from working, or the user from pressing ctrl-C. -- https://mail.python.org/mailman/listinfo/python-list

RE: Returning from a multiple stacked call at once

2020-12-12 Thread Avi Gross via Python-list
s, it unwinds easily and only in low probability cases look for an abrupt exit. And for a really abrupt exit, there is a way to shut down the program very abruptly perhaps even too abruptly. -Original Message----- From: Python-list On Behalf Of Dieter Maurer Sent: Saturday, December 12, 2020

dict.get(key, default) evaluates default even if key exists

2020-12-15 Thread Mark Polesky via Python-list
else default.  Nothing in that docstring suggests that the default value is evaluated even if the key exists, and I can't think of any good reason to do so. Am I missing something? Thanks, Mark -- https://mail.python.org/mailman/listinfo/python-list

Re: dict.get(key, default) evaluates default even if key exists

2020-12-15 Thread Mark Polesky via Python-list
Storchaka wrote: 15.12.20 19:07, Mark Polesky via Python-list пише: > # Running this script > > D = {'a':1} > def get_default(): >     print('Nobody expects this') >     return 0 > print(D.get('a', get_default())) > >

RE: How do you find what exceptions a class can throw?

2020-12-20 Thread Avi Gross via Python-list
allow problems to seep through. -- https://mail.python.org/mailman/listinfo/python-list

RE: How do you find what exceptions a class can throw?

2020-12-21 Thread Avi Gross via Python-list
can change your code to specifically handle only those you have some idea what to do about. As mentioned, you have traceback info that may help you figure out where the exceptions come from or even why. Good luck. -Original Message- From: Python-list On Behalf Of Chris Green Sent

RE: Which method to check if string index is queal to character.

2020-12-28 Thread Avi Gross via Python-list
strings but, of course, as noted by Chris, to really validate that an address works might require sending something and validating a human replied and that can be quite task. -Original Message- From: Python-list On Behalf Of Chris Angelico Sent: Monday, December 28, 2020 2:24 PM To

RE: Which method to check if string index is queal to character.

2020-12-28 Thread Avi Gross via Python-list
. Dropping out, ... -Original Message- From: Python-list On Behalf Of Chris Angelico Sent: Monday, December 28, 2020 8:02 PM To: Python Subject: Re: Which method to check if string index is queal to character. On Tue, Dec 29, 2020 at 10:08 AM Avi Gross via Python-list wrote: > > This

Re: Funny error message

2020-12-31 Thread DL Neil via Python-list
chardet/chardet Author: Mark Pilgrim Author-email: [email protected] License: LGPL Location: /usr/lib/python3.9/site-packages Requires: Required-by: html5-parser, requests --- Name: urllib3 Version: 1.25.8 Summary: HTTP library with thread-safe connection pooling, file post, and more. Home-page: https://urllib3.readthedocs.io/ Author: Andrey Petrov Author-email: [email protected] License: MIT Location: /usr/lib/python3.9/site-packages Requires: Required-by: requests -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
em-software and 'other stuff' under a different method (I took the same approach with the Chromium browser) - how long will it be before such 'cleverness' is forgotten/trips me up? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 9:39 AM, Bob van der Poel wrote: > > > On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list > mailto:[email protected]>> wrote: > > On 1/2/21 6:35 AM, Bob van der Poel wrote: > > Found it! > > Well done! > > > &

learning python building 2nd app, need advices

2021-01-08 Thread pascal z via Python-list
ay5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm22.place(width=150, height=40, x=820, y=220) ### button btn_FileRen = tk.Button(frm22, text="Files rename", bg='lightblue4', font=("Verdana", 10,"normal")) btn_FileRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FileRen['command'] = fx_FileRen ### ### FRAME 23 LABEL FOLDERS RENAME frm23 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm23.place(width=775, height=100, x=20, y=320) # Top label title tk.Label(frm23,text ="Rename folders only from csv file below", font=("Tahoma", 14, "normal"), fg='gray80', bg='gray5').place(x=20, y=10) ### LABEL PATH entry box tk.Label(frm23, text="CSV file path", fg='gray80', bg='gray5').place(x=20, y=55) # TEST FOLDER full_path = os.path.realpath(__file__) new_text = os.path.dirname(full_path) + os.sep + 'csv_folder' + os.sep + "csvtxt_1_foldernamelisting.csv" # vtxt_path2.set(new_text) ### PATH ENTRY BOX vtxt_path3=tk.StringVar(root, value=new_text) # Value saved here txt_path3 = tk.Entry(frm23,width=43, textvariable=vtxt_path3, fg='brown').place(width=620, height=30, x=140, y=50) # TEST FOLDER zzz ### ### FRAME 24 BUTTON FOLDERS RENAME frm24 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm24.place(width=150, height=40, x=820, y=345) ### button btn_FoldRen = tk.Button(frm24, text="Folders rename", bg='brown', font=("Verdana", 10,"normal")) btn_FoldRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FoldRen['command'] = fx_FoldRen ###///...///...///...///...///### # TAB 3 # ###///...///...///...///...///### ###///...///...///...///...///### # zZZZz # ###///...///...///...///...///### if __name__ == '__main__': root.mainloop() -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread pascal z via Python-list
any way to attach a file because I loose indentation? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread pascal z via Python-list
n.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
ray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm22.place(width=150, height=40, x=820, y=220) ### button btn_FileRen = tk.Button(frm22, text="Files rename", bg='lightblue4', font=("Verdana", 10,"normal")) btn_FileRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FileRen['command'] = fx_FileRen ### ### FRAME 23 LABEL FOLDERS RENAME frm23 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm23.place(width=775, height=100, x=20, y=320) # Top label title tk.Label(frm23,text ="Rename folders only from csv file below", font=("Tahoma", 14, "normal"), fg='gray80', bg='gray5').place(x=20, y=10) ### LABEL PATH entry box tk.Label(frm23, text="CSV file path", fg='gray80', bg='gray5').place(x=20, y=55) # TEST FOLDER full_path = os.path.realpath(__file__) new_text = os.path.dirname(full_path) + os.sep + 'csv_folder' + os.sep + "csvtxt_1_foldernamelisting.csv" # vtxt_path2.set(new_text) ### PATH ENTRY BOX vtxt_path3=tk.StringVar(root, value=new_text) # Value saved here txt_path3 = tk.Entry(frm23,width=43, textvariable=vtxt_path3, fg='brown').place(width=620, height=30, x=140, y=50) # TEST FOLDER zzz ### ### FRAME 24 BUTTON FOLDERS RENAME frm24 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm24.place(width=150, height=40, x=820, y=345) ### button btn_FoldRen = tk.Button(frm24, text="Folders rename", bg='brown', font=("Verdana", 10,"normal")) btn_FoldRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FoldRen['command'] = fx_FoldRen ###///...///...///...///...///### # TAB 3 # ###///...///...///...///...///### ###///...///...///...///...///### # zZZZz # ###///...///...///...///...///### if __name__ == '__main__': root.mainloop() -- 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
ray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm22.place(width=150, height=40, x=820, y=220) ### button btn_FileRen = tk.Button(frm22, text="Files rename", bg='lightblue4', font=("Verdana", 10,"normal")) btn_FileRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FileRen['command'] = fx_FileRen ### ### FRAME 23 LABEL FOLDERS RENAME frm23 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm23.place(width=775, height=100, x=20, y=320) # Top label title tk.Label(frm23,text ="Rename folders only from csv file below", font=("Tahoma", 14, "normal"), fg='gray80', bg='gray5').place(x=20, y=10) ### LABEL PATH entry box tk.Label(frm23, text="CSV file path", fg='gray80', bg='gray5').place(x=20, y=55) # TEST FOLDER full_path = os.path.realpath(__file__) new_text = os.path.dirname(full_path) + os.sep + 'csv_folder' + os.sep + "csvtxt_1_foldernamelisting.csv" # vtxt_path2.set(new_text) ### PATH ENTRY BOX vtxt_path3=tk.StringVar(root, value=new_text) # Value saved here txt_path3 = tk.Entry(frm23,width=43, textvariable=vtxt_path3, fg='brown').place(width=620, height=30, x=140, y=50) # TEST FOLDER zzz ### ### FRAME 24 BUTTON FOLDERS RENAME frm24 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm24.place(width=150, height=40, x=820, y=345) ### button btn_FoldRen = tk.Button(frm24, text="Folders rename", bg='brown', font=("Verdana", 10,"normal")) btn_FoldRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FoldRen['command'] = fx_FoldRen ###///...///...///...///...///### # TAB 3 # ###///...///...///...///...///### ###///...///...///...///...///### # zZZZz # ###///...///...///...///...///### if __name__ == '__main__': root.mainloop() -- 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
e').place(width=620, height=30, x=140, y=50) # TEST FOLDER zzz ### ### FRAME 22 TOP BUTTON FILE RENAME frm22 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm22.place(width=150, height=40, x=820, y=220) ### button btn_FileRen = tk.Button(frm22, text="Files rename", bg='lightblue4', font=("Verdana", 10,"normal")) btn_FileRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FileRen['command'] = fx_FileRen ### ### FRAME 23 LABEL FOLDERS RENAME frm23 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm23.place(width=775, height=100, x=20, y=320) # Top label title tk.Label(frm23,text ="Rename folders only from csv file below", font=("Tahoma", 14, "normal"), fg='gray80', bg='gray5').place(x=20, y=10) ### LABEL PATH entry box tk.Label(frm23, text="CSV file path", fg='gray80', bg='gray5').place(x=20, y=55) # TEST FOLDER full_path = os.path.realpath(__file__) new_text = os.path.dirname(full_path) + os.sep + 'csv_folder' + os.sep + "csvtxt_1_foldernamelisting.csv" # vtxt_path2.set(new_text) ### PATH ENTRY BOX vtxt_path3=tk.StringVar(root, value=new_text) # Value saved here txt_path3 = tk.Entry(frm23,width=43, textvariable=vtxt_path3, fg='brown').place(width=620, height=30, x=140, y=50) # TEST FOLDER zzz ### ### FRAME 24 BUTTON FOLDERS RENAME frm24 = tk.Frame(frm20, bg="gray5",highlightbackground="HoneyDew3", highlightcolor="HoneyDew3", highlightthickness=1) frm24.place(width=150, height=40, x=820, y=345) ### button btn_FoldRen = tk.Button(frm24, text="Folders rename", bg='brown', font=("Verdana", 10,"normal")) btn_FoldRen.pack(expand = 1, fill ="both",padx=0, pady=0) ### BUTTON BROWSE entry fx BASIC LISTING btn_FoldRen['command'] = fx_FoldRen ###///...///...///...///...///### # TAB 3 # ###///...///...///...///...///### ###///...///...///...///...///### # zZZZz # ###///...///...///...///...///### if __name__ == '__main__': root.mainloop() -- 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
ks, 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 pascal z via Python-list
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: 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: > >

Re: on writing a number as 2^s * q, where q is odd

2023-11-29 Thread Alan Bawden via Python-list
c = (n ^ (n - 1)).bit_count() - 1 return bc, n >> bc -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a number as 2^s * q, where q is odd

2023-12-03 Thread Julieta Shem via Python-list
owers_of_2_in(n // 2) return 1 + s, r --8<---cut here---end--->8--- -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a number as 2^s * q, where q is odd

2023-12-03 Thread Julieta Shem via Python-list
>> --8<---cut here---end--->8--- > > for n = 0 your function get stack overflow That's right. Let's say ``assert n > 0'' before we say ``if''. -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a number as 2^s * q, where q is odd

2023-12-03 Thread Oscar Benjamin via Python-list
On Sun, 3 Dec 2023 at 10:25, Julieta Shem via Python-list wrote: > > Alan Bawden writes: > > > > def powers_of_2_in(n): > > bc = (n ^ (n - 1)).bit_count() - 1 > > return bc, n >> bc > > That's pretty fancy and likely the fastest. It might b

Request: inspect: signature & getfullargspec & getcallargs

2023-12-03 Thread Dom Grigonis via Python-list
without `bound_arg` * `getfullargspec` to `follow_wrapper_chains` * `signature` to include `bound_arg`. Regards, DG -- https://mail.python.org/mailman/listinfo/python-list

Re: Request: inspect: signature & getfullargspec & getcallargs

2023-12-04 Thread Barry Scott via Python-list
> On 4 Dec 2023, at 02:29, Dom Grigonis via Python-list > wrote: > > Hello, > > I have a request. > > Would it be possible to include `follow_wrapper_chains` and `skip_bound_arg` > arguments to higher level functions of `inspect` module? > > Would expos

Re: on writing a number as 2^s * q, where q is odd

2023-12-05 Thread Alan Bawden via Python-list
en.wikipedia.org/wiki/Hacker%27s_Delight>. - Alan -- https://mail.python.org/mailman/listinfo/python-list

How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread Chris Green via Python-list
does make retrieving the values different from getting all other (nearly) constant values. Are there any Python modules aimed specifically at this sort of requirement? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread Mats Wichmann via Python-list
On 12/5/23 07:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a calibration program and used by lots of programs which d

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread Barry Scott via Python-list
> On 5 Dec 2023, at 14:37, Chris Green via Python-list > wrote: > > Are there any Python modules aimed specifically at this sort of > requirement? I tend to use JSON for this type of thing. Suggest that you use the options to pretty print the json that is saved so that a hu

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread DL Neil via Python-list
On 12/6/23 03:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a calibration program and used by lots of programs which d

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread DL Neil via Python-list
Apologies: neglected suggested web.refs: https://datagy.io/python-environment-variables/ https://pypi.org/project/json_environ/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread Thomas Passin via Python-list
On 12/5/2023 11:50 AM, MRAB via Python-list wrote: On 2023-12-05 14:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a c

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Chris Green via Python-list
Thomas Passin wrote: > On 12/5/2023 11:50 AM, MRAB via Python-list wrote: > > On 2023-12-05 14:37, Chris Green via Python-list wrote: > >> Is there a neat, pythonic way to store values which are 'sometimes' > >> changed? > >> > >> My part

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Chris Green via Python-list
ourse there is also sqlite but that is probably overkill. It's what my current code uses but does feel a bit OTT and it isn't particularly convenient to view when debugging. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Chris Green via Python-list
Thank you everyone for all the suggestions, I now have several possibilities to follow up. :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Dan Sommers via Python-list
On 2023-12-06 at 09:32:02 +, Chris Green via Python-list wrote: > Thomas Passin wrote: [...] > > Just go with an .ini file. Simple, well-supported by the standard > > library. And it gives you key/value pairs. > > > My requirement is *slightly* more complex t

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Barry Scott via Python-list
> On 6 Dec 2023, at 09:32, Chris Green via Python-list > wrote: > > My requirement is *slightly* more complex than just key value pairs, > it has one level of hierarchy, e.g.:- > >KEY1: > a: v1 > c: v3 > d: v4 >KEY2: >

<    35   36   37   38   39   40   41   42   43   44   >