Is this a safe use of eval?

2011-02-24 Thread Frank Millman
lt = eval('my_inst.{0}'.format(my_string)) This will only work if the string contains a valid method name with valid arguments. Can anyone see anything wrong with this? Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

question on logging module

2010-05-18 Thread frank zhu
Hi, >From the python 2.6.4 tutorial, refer to http://docs.python.org/release/2.6.4/tutorial/stdlib2.html#logging The above example doesn't work for me. Here is script log # o...@oem-desktop ~ $ python -V Python 2.6.4 o...@oem-desktop ~ $ python Python

Fwd: question on logging module - solved

2010-05-19 Thread frank zhu
FYI. -- Forwarded message -- From: Cameron Simpson Date: Wed, May 19, 2010 at 6:18 PM Subject: Re: question on logging module To: frank zhu On 19May2010 11:55, frank zhu wrote: | Thanks Cameron. That was the problem. I copied the sample code and named it | logging.py. which

logging: AttributeError: 'module' object has no attribute 'getLogger'

2010-05-23 Thread Frank GOENNINGER
rc/pib/logging.py", line 33, in main mylogger = PIBLogger('/tmp/pib.log') File "/...src/pib/logging.py", line 23, in __init__ self.logger = logging.getLogger('PIBLogger') AttributeError: 'module' object has no attribute 'getLogger' I

Re: logging: AttributeError: 'module' object has no attribute 'getLogger'

2010-05-24 Thread Frank GOENNINGER
Simon Brunning writes: > On 23 May 2010 14:46, Frank GOENNINGER wrote: >> Traceback (most recent call last): >>  File "/.../src/pib/logging.py", line 37, in >>    main() > > Here's a clue - looks like your own module is called logging. That'

Re: logging: AttributeError: 'module' object has no attribute 'getLogger'

2010-05-24 Thread Frank GOENNINGER
Philip Semanchuk writes: > On May 23, 2010, at 9:46 AM, Frank GOENNINGER wrote: >> >> I double checked and yes, getLogger is there. Why is the interpreter >> asking for an "attribute" here ? Any hints on what I am doing wrong ? > > > Short answer:

Circular imports (again)

2010-08-09 Thread Frank Millman
here other techniques to get around the problem. Any suggestions will be appreciated. Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Circular imports (again)

2010-08-10 Thread Frank Millman
"Frank Millman" wrote in message news:[email protected]... Hi all I know the problems related to circular imports, and I know some of the techniques to get around them. However, I find that I bump my head into them from time to time, which means, I guess, that I have

Paramiko Help

2009-06-24 Thread Frank Ruiz
Apologies.. Python newb here.. switching from perl to python.. so please forgive if this is a dumb question. I am using the paramiko module and have some global variables defined. i.e. hostname = ' 10.10.10.10' sshport = '22' I am then trying to pass this variable into the client connect method

Paramiko help - processing multiple commands

2009-06-24 Thread Frank Ruiz
Greetings, I am trying to process multiple commands using paramiko. I have searched other threads, and I think my use case is a little different. I am trying to login to a storage node that has a special shell, and as such I cant execute a script on the storage node side. I am also trying to avoi

Re: Paramiko help - processing multiple commands

2009-06-24 Thread Frank Ruiz
once I review it a few more times. Thanks! On Wed, Jun 24, 2009 at 4:34 PM, Jon Clements wrote: > On Jun 24, 11:22 pm, Frank Ruiz wrote: >> Greetings, >> >> I am trying to process multiple commands using paramiko. I have >> searched other threads, and I think my use

logging module and binary strings

2009-07-01 Thread Frank Aune
cted code byte snip Is there any way to log the above value of x "properly" using the python logging module? By properly I mean logging the value displayed when entering just x in the python shell and pressing enter. Regards, Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Frank Buss
roductive programmers: http://www.artima.com/intv/speedP.html (of course, an interview with Van Rossum might be a bit biased :-) -- Frank Buss, [email protected] http://www.frank-buss.de, http://www.it4-systems.de -- http://mail.python.org/mailman/listinfo/python-list

Re: Final Project

2009-07-19 Thread Frank Buss
27;t forget to limit the access to the webpage or the size of the output image, to avoid trouble with your hosting provider, if you don't have your own server and anything slows down because of your rendering task :-) -- Frank Buss, [email protected] http://www.frank-buss.de, http://www.it4-

Re: If Scheme is so good why MIT drops it?

2009-07-19 Thread Frank Buss
cases, like embedded systems, the most installed and used operating systems might be Unix-like systems and Windows. But looks like Python even runs on more native operating systems for mainframes. -- Frank Buss, [email protected] http://www.frank-buss.de, http://www.it4-systems.de -- http://

Re: If Scheme is so good why MIT drops it?

2009-07-20 Thread Frank Buss
I think it's usable). I didn't tried it myself, but looks like it is not very stable: http://www.mail-archive.com/[email protected]/msg01069.html -- Frank Buss, [email protected] http://www.frank-buss.de, http://www.it4-systems.de -- http://mail.python.org/mailman/listinfo/python-list

Re: any suggestions to synchronize typed text and speech ?

2009-07-20 Thread Frank Buss
nd some special key > is pressed, > the sound starting 10 or 20seconds earlier should be playbacked. You could use some screen recording tools, e.g. http://www.techsmith.com/camtasia.asp on Windows. Most tools allows you to record speech while recording the screen. -- Frank Buss, f.

Re: ignore special characters in python regex

2009-07-20 Thread Frank Buss
Astan Chee wrote: > I'm reading text from a file (per line) and I want to do a regex using > these lines but I want the regex to ignore any special characters and > treat them like normal strings. > Is there a regex function that can do this? Maybe re.escape helps? -- Frank

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Frank Buss
so this is something where Lisp distributions could be improved. -- Frank Buss, [email protected] http://www.frank-buss.de, http://www.it4-systems.de -- http://mail.python.org/mailman/listinfo/python-list

Re: How to launch a function at regular time intervals ?

2009-08-12 Thread Frank Millman
erval, plus any other parameters required, as arguments. HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: How to launch a function at regular time intervals ?

2009-08-14 Thread Frank Millman
n argument to each function, it is probably better to call datatime.now() within the function itself. Based on these thoughts, maybe your program should look something like this - running_functions = [] while 1: if some_condition: # start function to store data func =

Move dictionary from instance to class level

2009-08-26 Thread Frank Millman
d_0 MyClass.method_dict[1] = MyClass.method_1 As you can see, I had to add 'self' to the method arguments when calling the method. Any comments? Thanks Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: Move dictionary from instance to class level

2009-08-26 Thread Frank Millman
On Aug 26, 10:54 am, Chris Rebert wrote: > On Wed, Aug 26, 2009 at 1:22 AM, Frank Millman wrote: > > A > > class MyClass(object): > def on_message_received(self, msg): > self.method_dict[msg](self) > > def method_0(self): > print 'in

Re: Move dictionary from instance to class level

2009-08-26 Thread Frank Millman
On Aug 26, 10:54 am, Chris Rebert wrote: > On Wed, Aug 26, 2009 at 1:22 AM, Frank Millman wrote: > > A > > class MyClass(object): > def on_message_received(self, msg): > self.method_dict[msg](self) > > def method_0(self): > print 'in

Re: Move dictionary from instance to class level

2009-08-26 Thread Frank Millman
On Aug 26, 10:54 am, Chris Rebert wrote: > On Wed, Aug 26, 2009 at 1:22 AM, Frank Millman wrote: > > A > > class MyClass(object): > def on_message_received(self, msg): > self.method_dict[msg](self) > > def method_0(self): > print 'in

Re: Move dictionary from instance to class level

2009-08-26 Thread Frank Millman
onLostFocus method_dict[EVT_BUTTONCLICKED] = onButtonClicked method_dict[EVT_CHECKBOX] = onCheckBox You can probably figure out from my method names what I am doing here - the messages are sent by a thin client (wxPython), and processed by a server.I am anticipating some "don'

RE: Move dictionary from instance to class level

2009-08-27 Thread Frank Millman
her words it is hard-coded into the client program. I don't know how that would work if I read in a list of message-types at startup. > DaveA > Thanks for the input - it is always good to have some fresh ideas. Frank -- http://mail.python.org/mailman/listinfo/python-list

[OT] How do I reply to a thread by sending a message to [email protected]

2009-08-27 Thread Frank Millman
to stick to a news reader like Outlook Express? Thanks Frank Millman P.S. I am sending this message via email to [email protected] - let's see what happens. -- http://mail.python.org/mailman/listinfo/python-list

RE: Move dictionary from instance to class level

2009-08-27 Thread Frank Millman
wxPython event types. I have abstracted all the event types I am interested in (the list is fairly stable now). My protocol requires that the client maps a specific gui event type to a message identifier, and the server maps the message identifier to a method that handles the message. Hope tha

RE: Move dictionary from instance to class level

2009-08-27 Thread Frank Millman
Dave Angel wrote: > > Frank Millman wrote: > > > > That is definitely *not* what I want to do. > > > > I want to make the server as generic as possible, so that > it can handle any > > type of client, hopefully even including a browser > eventually. Th

Re: Move dictionary from instance to class level

2009-08-27 Thread Frank Millman
finition it sends to the client. Therefore the server and client can unambiguously reference specific widgets, and there is no real danger of getting out of sync. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: Move dictionary from instance to class level

2009-08-30 Thread Frank Millman
"Frank Millman" wrote: Apologies for the triple-post. I use google-groups for reading c.l.py, but I know that some people reject messages from there due to the volume of spam, so on the odd occasion when I want to send something I fire up Outlook Express and send it from there. It

Re: Move dictionary from instance to class level

2009-08-30 Thread Frank Millman
Anthony Tolle wrote: > To take things one step further, I would recommend using decorators to > allow symbolic association of functions with the message identifiers, > as follows: > [...] That's neat. Thanks. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: scheduler or infinite loop

2010-09-29 Thread Frank Millman
tart() At the end of the program, terminate the loop like this - data_getter.stop() HTH Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: scheduler or infinite loop

2010-09-29 Thread Frank Millman
harryos wrote Here is a technique that allows the loop to run in the background, in its own thread, leaving the main program to do other processing - import threading class DataGetter(threading.Thread): thanks Frank A pleasure. I left out a line that will usually be desirable. At the

wxpython 2.8 -- timing and latency issues when displaying widgets

2010-10-28 Thread Josef Frank
Dear all, in an application window (subwindow of a Notebook-control) I'm trying to do the following: 1. Create a StaticText control kind of "Please wait until processing has finished" 2. Do some processing (e.g. vacuuming an sqlite database) 3. Create a 2nd StaticText control with the messa

asyncio does not always show the full traceback

2017-02-28 Thread Frank Millman
values to unpack (expected 2, got 1) It does not show the line where the ValueError occurs, and I have not managed to narrow down exactly when this happens. Does anyone know what I must change to get the full traceback? Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: asyncio does not always show the full traceback

2017-02-28 Thread Frank Millman
pplied to the asyncio module. I will study the thread you quoted, and report back. Thanks Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: asyncio does not always show the full traceback

2017-03-01 Thread Frank Millman
"Frank Millman" wrote in message news:[email protected]... I use asyncio in my project, so most of my functions start with 'async' and most of my calls are preceded by 'await'. If an exception is raised, I usually get the full traceback, but so

Re: asyncio does not always show the full traceback

2017-03-02 Thread Frank Millman
um async for a, x in aenumerate(g): File "test_db1a.py", line 6, in aenumerate async for x in aiterable: File "test_db1a.py", line 11, in gen 1/0 ZeroDivisionError: division by zero Can anyone else confirm whether they can reproduce my results? Thanks Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: asyncio does not always show the full traceback

2017-03-02 Thread Frank Millman
"Frank Millman" wrote in message news:[email protected]... If I place '1/0' in main(), this is the traceback - Traceback (most recent call last): File "test_db1a.py", line 25, in loop.run_until_complete(main()) File "/usr/local/l

Re: asyncio does not always show the full traceback

2017-03-02 Thread Frank Millman
installing the correct version on both platforms, the problem no longer exists. Sorry for wasting your time. Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: When will os.remove fail?

2017-03-14 Thread Frank Millman
r, it does not. If I type 'alias' at the console, it lists current aliases. 'root' shows exactly what Jon quoted above. 'frank' shows no alias for 'rm'. I had a quick look to see what was setting it, but there is nothing in /etc/profile or in /etc

Re: When will os.remove fail?

2017-03-14 Thread Frank Millman
"Frank Millman" wrote in message news:[email protected]... On Fedora 22 (and for many previous versions) I have noticed that, if I log in as 'root', it does prompt, but if I log in as an ordinary user, it does not. If I type 'alias' at the con

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Frank Millman
ow only works for INSERT statements. For UPDATE, you usually have to say - UPDATE {table} SET col_1 = val_1, col_2 = val_2 WHERE col_3 = val_3 ... Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Multiprocessing queue in py2.7

2017-03-28 Thread Frank Miles
I tried running a bit of example code from the py2.7 docs (16.6.1.2. Exchanging objects between processes) only to have it fail. The code is simply: # from multiprocessing import Process, Queue def f(q): q.put([42, None, 'hello']) if __name__ == '__main__': q = Queue()

Re: Multiprocessing queue in py2.7

2017-03-28 Thread Frank Miles
On Tue, 28 Mar 2017 15:38:38 -0400, Terry Reedy wrote: > On 3/28/2017 2:51 PM, Frank Miles wrote: >> I tried running a bit of example code from the py2.7 docs >> (16.6.1.2. Exchanging objects between processes) >> only to have it fail. The code is simply: >

Re: Data exchange between python script and bash script

2017-04-04 Thread Frank Miles
On Tue, 04 Apr 2017 08:01:42 -0700, venkatachalam.19 wrote: > Hello All, > > I am writing a python code for processing a data obtained from a sensor. The > data from sensor is obtained by executing a python script. The data obtained > should be further given to another python module where the r

Re: closing image automatically in for loop , python

2017-04-12 Thread Frank Miles
On Wed, 12 Apr 2017 04:18:45 -0700, Masoud Afshari wrote: > filename ="Ex_resample" +'_sdf_'+ str(n)+'.dat' > with open(filename, 'rb') as f: #read binary file data = np.fromfile(f, > dtype='float64', count=nx*ny) #float64 for Double precision float numbers > Ex = np.reshape(data, [ny, nx], ord

Re: Python DB API - commit() v. execute("commit transaction")?

2017-06-02 Thread Frank Millman
ys calls conn.commit() or conn.rollback() on exit, and I have not had any more problems. I use exactly the same code for sqlite3 and for Sql Server/pyodbc, and it has not caused any problems there either. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Python DB API - commit() v. execute("commit transaction")?

2017-06-02 Thread Frank Millman
"Frank Millman" wrote in message news:[email protected]... By default, psycopg2 uses 'autocommit', which means that even a SELECT is preceded by a 'BEGIN' statement internally. I never changed the default, so all of the following assumes tha

Generator and return value

2017-06-06 Thread Frank Millman
except StopIteration as e: final_result = e.value Is this the best way to achieve it, or is there a nicer alternative? Thanks Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Generator and return value

2017-06-07 Thread Frank Millman
"Jussi Piitulainen" wrote: Frank Millman writes: > It would be nice to write a generator in such a way that, in addition > to 'yielding' each value, it performs some additional work and then > 'returns' a final result at the end. > > From Python

Re: data structure

2017-06-14 Thread Frank Millman
def __init__(self): a= 'aa' b= 'ab' In your __init__() function, 'a' and 'b' are not bound to anything, so they are simply local variables and will be garbage-collected when the function has completed. Therefore any instance of ClassA() will get its values of 'a' and 'b' from the class definition - an empty string. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Google Sheets API Error

2017-06-17 Thread Frank Pinto
ile_name('client_id.json', scope) client = gspread.authorize(creds) sheet = client.open('RC').sheet1 c_list = sheet.get_all_records() df = pd.DataFrame(c_list) return df I really have no idea why this is happening. Does anybody might have a clue? Thank you, -- Frank Pinto -- https://mail.python.org/mailman/listinfo/python-list

Re: Generator - Provide parameters to url - requests

2017-07-05 Thread Frank Millman
for day, month, year in datesRange(-210, 0): # do something Does this help? Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-25 Thread Frank Bechmann (w)
even if I follow the other answers above - language-wise and management-advise-wise - just for the sake of completeness - I would like to point you to Lua: http://www.lua.org/ 1. portability (interpreter runs quite a bit architectures) => yes, nearly pure ANSI-C should compile 2. good ba

Re: 'isimmutable' and 'ImmutableNester'

2013-11-11 Thread Frank-Rene Schäfer
A tuple is immutable but it may contain mutable objects. In larger hierarchies of objects it may become less obvious whether down the lines, there is some mutable object somewhere in the data tree. One can define a recursive function to check for immutability manually. However first, it may not be

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Frank-Rene Schäfer
(1) hash()-ability != immutability (!) Proof: class X: def __hash__(self): return 0 def pseudo_isimmutable(this): try: hash(this) return True except TypeError: return False shapeshifter = (1, 2, X()) print pseudo_isimmutable(shapeshifter) shapeshifter[2].chan

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Frank-Rene Schäfer
> All you've done is proven that you can subvert things. By fiddling > with __hash__, __eq__, and so on, you can make sets and dicts behave > very oddly. Means nothing. To the contrary, it means everything about what 'isimmutable' could contribute: security against advert or inadvert insertion of

Re: 'isimmutable' and 'ImmutableNester'

2013-11-12 Thread Frank-Rene Schäfer
> So how do you figure out whether something's immutable or not? Are you > going to ask the object itself? If so, stick with __hash__, and just > follow the rule that mutable objects aren't hashable - which is, if > I'm not mistaken, how things already are. And if not, then how? How > will you know

sublime textx 3 and python 35

2015-12-16 Thread Yaocheng Frank Yang
ike from My computer to user to ) Thanks! Frank -- https://mail.python.org/mailman/listinfo/python-list

'isimmutable' and 'ImmutableNester'

2013-11-11 Thread Frank-Rene Schäfer
I prepared a PEP and was wondering what your thoughts are about it: PEP: Title: ``isimmutable(Obj)`` and/or ``ImmutableNester`` Version: Last-Modified: Author: Frank-Rene Schaefer, [email protected] * BDFL-Delegate: * Discussions-To

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Frank Goenninger DG1SBG
y smart enough to work these things out > in the abstract. Or too lazy or something. Probably all three. Nah. It's me asking again and again those silly questions about real Cells usage in some real life apps ;-) Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-26 Thread Frank Goenninger DG1SBG
leamber.com/ > Happy Customers: http://castleamber.com/testimonials.html John Bokma not following netiquette. Killfiled. If I can find out how to report this to the relevant ISP I will do so. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do regular BASH work in Python?

2008-10-09 Thread Frank Malina @ vizualbod.com
hat provide some lively code examples > > and recipes, please pass them on. > > > Thank you > > > Frank Malinahttp://vizualbod.com > > http://examples.oreilly.com/python3/has some good examples, although > they may be a little tough to read through if you don'

Re: Decrease code redundancy without breaking references

2008-10-12 Thread Frank Malina @ vizualbod.com
There is the following source structure: /packages/... /packages/global_settings.py # this is the global settings file imported from each client settings file /clients/... /clients/client1/settings.py # client specific settings file (see code above), each client is running in its own process so th

PythonWin --> drwatson

2008-10-17 Thread Frank L. Thiel
I have installed PythonWin from the distribution. When I try to open it, the message "PyWin32 has encountered a problem ..." appears, and a drwatson error report is generated. Python 2.6 itself, from a cmd window or using IDLE, works without problem. I cannot find any reports of similar beh

Re: PythonWin --> drwatson

2008-10-18 Thread Frank L. Thiel
On 18-Oct-08 01:39, this message was sent by Allan: "Frank L. Thiel" <[EMAIL PROTECTED]> writes: I have installed PythonWin from the distribution. When I try to open it, the message "PyWin32 has encountered a problem ..." appears, and a drwatson error report is gen

Re: PythonWin --> drwatson

2008-10-18 Thread Frank L. Thiel
On 18-Oct-08 16:31, this message was sent by Dennis Lee Bieber: On Sat, 18 Oct 2008 15:00:03 GMT, "Frank L. Thiel" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: Thanks for your reply, Allan. I am not sure what you mean by "the Windows installer pac

Re: PythonWin --> drwatson

2008-10-21 Thread Frank L. Thiel
On 21-Oct-08 03:22, this message was sent by Gabriel Genellina: En Sat, 18 Oct 2008 18:14:46 -0300, Frank L. Thiel <[EMAIL PROTECTED]> escribió: On 18-Oct-08 16:31, this message was sent by Dennis Lee Bieber: Do you have a version of python 2.6 installed? (I'm surprised the

About standard library improvement

2005-02-03 Thread Frank Abel Cancio Bello
Hi! If I make some improvement to xmlrpclib module, where I should send this improvement to form part of next standard library release? Thank -- http://mail.python.org/mailman/listinfo/python-list

Re: get textual content of a Xml element using 4DOM

2005-03-04 Thread Frank Abel Cancio Bello
Hi: PrettyPrint or Print return the value to the console, and i need keep this value in a string variable to work with it, how can i do this? thanks to Uche Frank Abel -Original Message- From: [EMAIL PROTECTED] To: [email protected] Date: 4 Mar 2005 09:23:07 -0800 Subject: Re

subprocess.Popen under windows 7

2011-12-08 Thread Frank van den Boom
Hello, i have something like this under windows 7: print("try command...") arglist = [PATH_TO_7ZIP,"a", "-sfx", archive_name, "*", "-r", "-p",PASSWORD] p = subprocess.Popen(args=arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=srcdir) output, error

Re: subprocess.Popen under windows 7

2011-12-09 Thread Frank van den Boom
I didn't have Windows 7 right now, but that shouldn't happen with the code you've given; when trimming code for posting, you should check that the trimmed code still have the exact same problem. Here is the hole code: #!/usr/bin/env python # little script to backup recursive a folder with 7z

Re: subprocess.Popen under windows 7

2011-12-09 Thread Frank van den Boom
Thank you very much. Now I have written a little c++ programm which produces some ouput. And now it works fine. There is something wrong with 7zip.exe and the arglist with *. Tonight I will go on and hunt the error. It should be Python 2.7 #!/usr/bin/env python PATH_TO_EXE = "C:/Users/yoic

About size of Unicode string

2005-06-06 Thread Frank Abel Cancio Bello
end in HTTP request a string. Then I need know the length of the string to set the header "content-length" independently of its encoding. Any idea? Thanks in advance Frank -- http://mail.python.org/mailman/listinfo/python-list

RE: About size of Unicode string

2005-06-06 Thread Frank Abel Cancio Bello
rue that "the size of the entity-body" is "len(data)" independently of the encoding of "data"? > -Original Message- > From: Laszlo Zsolt Nagy [mailto:[EMAIL PROTECTED] > Sent: Monday, June 06, 2005 1:43 PM > To: Frank Abel Cancio Bello; python-list@p

RE: About size of Unicode string

2005-06-06 Thread Frank Abel Cancio Bello
rg > Subject: Re: About size of Unicode string > > Frank Abel Cancio Bello wrote: > > request.add_header('content-encoding', 'UTF-8') > > The Content-Encoding header is for things like "gzip", not for > specifying the text encoding. Use the

Re: Simple webserver

2023-10-25 Thread Frank Millman via Python-list
github.com/FrankMillman/AccInABox. You are welcome to look at it, but it needs a lot of tidying up before it will be ready for a wider audience. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Type hints - am I doing it right?

2023-12-12 Thread Frank Millman via Python-list
'DbParams']). But I would still like an answer to the original question, as I am sure similar situations will occur without such a simple solution. Thanks Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Question about garbage collection

2024-01-15 Thread Frank Millman via Python-list
ry simple program to illustrate this. Am I missing something? All comments appreciated. Frank Millman == import gc class delwatcher:     # This stores enough information to identify the object being watched.     # It does not store a reference

Re: Question about garbage collection

2024-01-16 Thread Frank Millman via Python-list
On 2024-01-15 3:51 PM, Frank Millman via Python-list wrote: Hi all I have read that one should not have to worry about garbage collection in modern versions of Python - it 'just works'. I don't want to rely on that. My app is a long-running server, with multiple clients lo

Re: Question about garbage collection

2024-01-16 Thread Frank Millman via Python-list
ings. I will start with a fresh approach tomorrow. If you don't hear from me again, you will know that I have solved it! Thanks for the input, it definitely helped. Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about garbage collection

2024-01-16 Thread Frank Millman via Python-list
On 2024-01-17 3:01 AM, Greg Ewing via Python-list wrote: On 17/01/24 1:01 am, Frank Millman wrote: I sometimes need to keep a reference from a transient object to a more permanent structure in my app. To save myself the extra step of removing all these references when the transient object is

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Frank Millman via Python-list
PT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux $ python3 -V Python 3.11.2 $ pip3 freeze asgiref==3.7.2 blinker==1.7.0 click==8.1.7 Flask==3.0.2 itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.5 Werkzeug==3.0.1 ``` Thanks for any help! Cheers, Thomas Hi Thomas I am no exper

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Frank Millman via Python-list
On 2024-03-22 12:09 PM, Frank Millman via Python-list wrote: I am no expert. However, I do have something similar in my app, and it works. I do not use 'await future', I use 'asyncio.wait_for(future)'. I tested it and it did not work. I am not sure, but I think the

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Frank Millman via Python-list
On 2024-03-22 1:23 PM, Frank Millman via Python-list wrote: On 2024-03-22 12:09 PM, Frank Millman via Python-list wrote: I am no expert. However, I do have something similar in my app, and it works. I do not use 'await future', I use 'asyncio.wait_for(future)'. I test

Re: Using a background thread with asyncio/futures with flask

2024-03-23 Thread Frank Millman via Python-list
's ideas, here is a version that works. It is not pretty! call_soon_threadsafe() is a loop function, but the loop is not accessible from a different thread. Therefore I include a reference to the loop in the message passed to in_queue, which in turn passes it to out_queue. Frank ==

Re: Using a background thread with asyncio/futures with flask

2024-03-24 Thread Frank Millman via Python-list
On 2024-03-23 3:25 PM, Frank Millman via Python-list wrote: It is not pretty! call_soon_threadsafe() is a loop function, but the loop is not accessible from a different thread. Therefore I include a reference to the loop in the message passed to in_queue, which in turn passes it to

<    6   7   8   9   10   11