Thx guys.
now quick question on the usage of thread local storage.
In my case I have the below object model:
class Base(object):'
def __init__(self):
self.__service = None
def _GetService():
if not hasattr(threading.currentThread(), 'service'):
threading.currentThread().service = S
Andreas Kostyrka wrote:
> * Kent Johnson <[EMAIL PROTECTED]> [070414 19:53]:
>> That's a good point. Does anyone know when to prefer threading.local()
>> vs thread attributes?
> It's design question, I guess:
>
> *) if you have thread subclasses, then use thread attributes.
> *) if you have stand
Hi folks,
I want to practice Python programming by developing complete applications.
Where can I get such problems, which can improve my Python programming
skills.
Thanks in anticipation.
Regards,
Asrar
___
Tutor maillist - [EMAIL PROTECTED]
http:
* Kent Johnson <[EMAIL PROTECTED]> [070414 19:53]:
> Andreas Kostyrka wrote:
> > * Kent Johnson <[EMAIL PROTECTED]> [070414 19:30]:
> >> Rather than store your attributes directly in the thread, it would
> >> probably be better to use a threading.local() object as the container.
> >> http://docs.p
Andreas Kostyrka wrote:
> * Kent Johnson <[EMAIL PROTECTED]> [070414 19:30]:
>> Rather than store your attributes directly in the thread, it would
>> probably be better to use a threading.local() object as the container.
>> http://docs.python.org/lib/module-threading.html#l2h-3416
>>
>> I don't re
* Kent Johnson <[EMAIL PROTECTED]> [070414 19:30]:
> Arun Kumar PG wrote:
> > Guys,
> >
> > I have a web application and I want to store an object per request so
> > thta that is available across all classes till end of request.
> >
> > I am planning to write the below code in my entry program
Thanks the encode method really helps.
Alan Gauld <[EMAIL PROTECTED]> wrote: "ammar azif" wrote
> Actually i wanted to write a http client using just he low level
> socket module.
I won;t ask why! But the httplib module probably does what you want
just in case you dodn't realize it existed...
"ammar azif" <[EMAIL PROTECTED]> wrote
> Actually i wanted to write a http client using just he low level
> socket module.
I won;t ask why! But the httplib module probably does what you want
just in case you dodn't realize it existed...
> The program will prompt the user asking for input and th
"linda.s" <[EMAIL PROTECTED]> wrote
>I wonder how to use colors from gray to black to represent a group of
> values from small to large?
Can you explain what you mean? Normally colours are represented
in code as a tuple of three numbers for the RGB values. If its shades
of grey then all three num
ammar azif wrote:
> Hi,
>
> i wanted to get a string from raw_input like this
>
> raw_input('>')
> > \n\nsomestring
>
> but the problem is raw input will return the string
> '\\n\\nsomestring'
This is a bit confusing to talk about because the actual contents of the
string differ from what is
Arun Kumar PG wrote:
> Guys,
>
> I have a web application and I want to store an object per request so
> thta that is available across all classes till end of request.
>
> I am planning to write the below code in my entry program which is
> executed as soon as a request comes:
>
> entry.py
>
Actually i wanted to write a http client using just he low level socket module.
The program will prompt the user asking for input and the use will type http
commands like 'GET /index.html HTTP/1.0\r\nHost: somehost\r\n\r\n'
when i use the raw_input function , the string that i get is
'GET /index.
"ammar azif" <[EMAIL PROTECTED]> wrote
> i wanted to get a string from raw_input like this
>
> raw_input('>')
>> \n\nsomestring
OK, Can you explain precisely what you want the string to contain.
\n is the string representation of a newline. Do you want to enter
something that starts with two ne
"Teresa Stanton" <[EMAIL PROTECTED]> wrote
> No one suggested this. That's great! Wish I had seen it sooner.
> Thanks,
> I'll put that in my notebook for further use later.
Note that Fileinput is used to iterate over a (set of) file line by
line,
it doesn't read the entire file into a string
I wonder how to use colors from gray to black to represent a group of
values from small to large?
Thanks,
Linda
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
Hi,
i wanted to get a string from raw_input like this
raw_input('>')
> \n\nsomestring
but the problem is raw input will return the string
'\\n\\nsomestring'
My question is
Are there any function to convert back those string to '\n\nsomestring' ?
Thanks
--
16 matches
Mail list logo