Re: tkinter global variable

2020-11-13 Thread Richard Damon
k. I got the point. So what do I need to do access the variable? How do > I return a value from that function? > > Thanks. The problem is that you are accessing the variable BEFORE the box has been put up and the user clicking on it. That doesn't happen until the mainloop() call. You need to delay the opening and reading of the file till the filedialog has been used and returned. Perhaps on_openfile could open and read the file. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter global variable

2020-11-13 Thread Richard Damon
On 11/13/20 12:12 PM, ChalaoAdda wrote: > On Fri, 13 Nov 2020 12:04:53 -0500, Richard Damon wrote: > >> On 11/13/20 11:42 AM, ChalaoAdda wrote: >>> On Fri, 13 Nov 2020 16:04:03 +, Stefan Ram wrote: >>> >>>> ChalaoAdda writes: >>>>

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

2020-12-28 Thread Richard Damon
it meets the SYNTAX of an email address isn't THAT hard, but there are a number of edge cases to worry about. Validating that it is a working email address (presumably after verifying that it has a proper syntax) is much harder, and basically requires trying to send to the address, and to really conf

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

2020-12-28 Thread Richard Damon
in comments or display names, but just a base email address isn't that hard). Many people do still get it wrong. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

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

2020-12-28 Thread Richard Damon
terns is probably beyond what a regex could handle. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: A random word from one of two lists

2021-01-01 Thread Richard Damon
> kangaroo > > -- > Thanks random.choice doesn't return 'a variable' but an object. Which is the same object that one of the variables that you used. IF you wanted to use words, then you could have made kinds = {'animals', 'fruits'} and

Re: A random word from one of two lists

2021-01-03 Thread Richard Damon
't really need to do this as a two-level selection: > > import random > animal = ['koala', 'kangaroo'] > fruit = ['banana', 'apple'] > result = random.choice(animal + fruit) > print(result) It depends on what distribution of

Re: dayofyear is not great when going into a new year

2021-01-05 Thread Richard Damon
out on Dec 30, 2019, which was the first day of the ISO week bsed 2020, and he ended it with a comment that if 2019 wasn't going so well, you could always just use ISO to get an early start on 2020. Apparently a lot of people were getting this recommended a number of months later, and people were commenting how that line just was not aging well. And we couldn't use that te get out of 2020, as 2020 is a long year, and ISO 2021 didn't start until Jan 4th. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter: creating/attaching menubar to top level window

2021-01-08 Thread Richard Damon
tax. It could be either: self.menu = menubar or self['menu'] = menubar -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread Richard Damon
On 1/8/21 6:10 PM, pascal z via Python-list wrote: > any way to attach a file because I loose indentation? Don't post via googlegroups, it thinks the world is HTML, which treats spaces in a funny matter. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Why Python 3?

2014-04-20 Thread Richard Damon
On 4/20/14, 5:40 PM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Mon, Apr 21, 2014 at 2:22 AM, Ian Kelly wrote: >>> When I'm writing a generic average function, I probably don't know whether >>> it will ever be used to average complex numbers. >> >> This keeps coming up in t

Re: cx_freeze and temporary files - security related question

2014-07-06 Thread Richard Damon
On 5/21/14, 12:42 PM, Nagy László Zsolt wrote: I need to create an application for Windows 7 that runs from a flash drive. This program would be used to create remote backups of the pendrive. The pendrive contains sensitive data, so when I plug in the pendrive and run the program to make a backup

Re: cx_freeze and temporary files - security related question

2014-07-06 Thread Richard Damon
like you probably do all the backups. Then you can know that there aren't any traces left behind that you didn't think of. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Help with os.spawnv

2006-03-04 Thread Damon Pettitt
py" to '"E:\Documents and Settings\Administrator\Desktop\Ian\GIS\Python\subProcess2.py"' (this basically uses a single backslash and a single quote preceding the first double quote and a single quote just after the last double quote). your script would work. D

issues simply parsing a whitespace-delimited textfile in python script

2008-05-21 Thread Damon Getsman
s: ---- dgetsman pts/3:0.0 Wed May 21 10:21 still logged in dgetsman pts/2:0.0 Wed May 21 09:04 still logged in dgetsman pts/1:0.0 Wed May 21 08:56 - 10:21 (01:24) dgetsman pts/0:0.0 Wed May 21 08:56 still logged in I would really appreciate any pointers or suggestions you can give. http://www.zoominfo.com/people/Getsman_Damon_-214241.aspx";> *Damon Getsman Linux/Solaris System Administrator -- http://mail.python.org/mailman/listinfo/python-list

Re: issues simply parsing a whitespace-delimited textfile in python script

2008-05-21 Thread Damon Getsman
ed and I'm at a loss for why that didn't work and this is working. I'd really like to know the why about this issue so that I don't have to use crappy coding practice and kludge around it the next time I have an issue like this. Any ideas much appreciated. Damon G. -- http:/

Re: issues simply parsing a whitespace-delimited textfile in python script

2008-05-21 Thread Damon Getsman
n't exactly appropriate as I'm only going to be using 2 of the fields. I think I will set those to individual variables with a slice of what you mentioned, though, for readability. Thank you for the tips, they were all much appreciated. -Damon -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-21 Thread Damon Getsman
e for $20/hr +. :) http://unix.derkeiler.com/Newsgroups/comp.sys.sun.apps/ 2008-04/msg0.html"> -Damon A. Getsman Linux/Solaris Systems Administrator -- http://mail.python.org/mailman/listinfo/python-list

python library for passwd suitable blowfish hash generation

2008-06-04 Thread Damon Getsman
#x27;ve seen a few of the libraries so far and I'm not sure if I want to use them or not; documentation was rather lacking. I'd appreciate any input you all might be able to give on this. Thanks for your time. -Damon Getsman -- http://mail.python.org/mailman/listinfo/python-list

Re: what is meaning of "@" in pyhon program.

2008-06-27 Thread Damon Getsman
g the script defined a function instead of the standard conditional and loop? I can't imagine that would be the case because, as I said, this was very beginning level documentation. -Damon Getsman -- http://mail.python.org/mailman/listinfo/python-list

Re: what is meaning of "@" in pyhon program.

2008-06-27 Thread Damon Getsman
an example containing '@if' and '@for'. I don't remember what exactly I used to turn it up before, though, and the link isn't in my history, it was probably a month ago that I saw it. Sorry, I tried. On Jun 27, 10:44 am, Bruno Desthuilliers wrote: > Damon Gets

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Richard Damon via Python-list
and then Bottom messes things up by calling Right again. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Richard Damon via Python-list
> On Aug 17, 2023, at 10:02 AM, c.buhtz--- via Python-list > wrote: > > X-Post: https://stackoverflow.com/q/76913082/4865723 > > I want to display one string in its original source (untranslated) version > and in its translated version site by site without duplicating the string in > the pyt

Re: type annotation vs working code

2023-10-01 Thread Richard Damon via Python-list
g (set to True when you initialize), and look it up with getattr() with a default value of False. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Context without manager

2023-11-27 Thread Richard Damon via Python-list
Read the Fine context manager documentation. What “with with_expression as var” does is effectively: ob = with_expression var = ob.__enter__() And then at the end of the with, does a ob.__exit__() (With some parameters to __exit__, that could just be None, None, None for the simplest case). N

Context without manager

2023-11-27 Thread Richard Damon via Python-list
Read the Fine context manager documentation. What “with with_expression as var” does is effectively: ob = with_expression var = ob.__enter__() And then at the end of the with, does a ob.__exit__() (With some parameters to __exit__, that could just be None, None, None for the simplest case). N

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

2023-12-28 Thread Richard Damon via Python-list
On 12/28/2023 12:20 AM EST rbowman via Python-list <[1]python-list@python.org> wrote: On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote: The biggest caveat is that the shared variable MUST exist before it can be examined or used (not surprising).

Re: Python misbehavior

2024-02-08 Thread Richard Damon via Python-list
If you look up the documentation for youtube-dlp, you may find that you can use that module directly, and not need the ClipGrab wrapper at all (though it may provide some benefits if you can get it working again). -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: UTF_16 question

2024-04-29 Thread Richard Damon via Python-list
> On Apr 29, 2024, at 12:23 PM, jak via Python-list > wrote: > > Hi everyone, > one thing that I do not understand is happening to me: I have some text > files with different characteristics, among these there are that they > have an UTF_32_le coding, utf_32be, utf_16_le, utf_16_be all of them

Re: Best use of "open" context manager

2024-07-06 Thread Richard Damon via Python-list
ld modify the last attempt to open the file twice, which would work, but seems like a kludge (subject to race condition, inefficient). Is there a better / more Pythonic solution? Best wishes Rob Cliffe -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4