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
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
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
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
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'
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:
here other techniques to get around the
problem.
Any suggestions will be appreciated.
Thanks
Frank Millman
--
http://mail.python.org/mailman/listinfo/python-list
"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
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
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
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
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
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
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-
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://
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
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.
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
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
erval, plus any other parameters
required, as arguments.
HTH
Frank Millman
--
http://mail.python.org/mailman/listinfo/python-list
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 =
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
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
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
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
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'
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
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
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
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
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
"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
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
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
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
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
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
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
"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
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
"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
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
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
"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
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
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()
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:
>
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
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
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
"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
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
"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
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
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
for day, month, year in datesRange(-210, 0):
# do something
Does this help?
Frank Millman
--
https://mail.python.org/mailman/listinfo/python-list
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
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
(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
> 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
> 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
ike from My computer to user to
)
Thanks!
Frank
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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'
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
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
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
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
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
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
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
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
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
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
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
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
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
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
'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
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
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
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
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
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
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
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
'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
==
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
1001 - 1090 of 1090 matches
Mail list logo