Hello,
I'm developing Flask app, processed by gevent.wsgi.WSGIServer.
If I need to isolate some pieces of code inside request handlers, can I use
threading.Lock?
If I need semaphore, must I use threading.Semaphore or gevent.lock.Semaphore?
What is the difference between them?
Thank you!
--
http
7;t be able to ignore it if you ever
reabase or merge.
> This seems error-prone. Am I missing something?
What exactly is error-prone? Are you afraid to commit to a wrong branch?
Are you afraid to commit the changes you didn't want to commit? Anyway,
if you did a mistake, you should be able to examine situation and fix it
rather easily, provided you didn't yet publish your history.
HTH,
-- Sergey.
--
https://mail.python.org/mailman/listinfo/python-list
e any policy or particular work-flow
on you, so if clones work better for you, using them still follows git
philosophy.
-- Sergey.
--
https://mail.python.org/mailman/listinfo/python-list
Hi All,
I have a web-service that needs to handle a bunch of work requests. Each
job involves IO call (DB, external web-services to fetch some data), so
part of the time is spent on the blocking IO call. On the other side, after
getting the data the job involves computational part (using numpy/pan
_pkg)
pkg = load_package_strict(tmp_pkg, basedir + '/x/' + dir_name)
result = pkg.main.TTT()
What is the risk of this method? What are 3 methods of doing the same?
--
Sergey
--
https://mail.python.org/mailman/listinfo/python-list
work with result of
load_module, used for loading a package.
Regards,
Sergey
--
https://mail.python.org/mailman/listinfo/python-list
return main.TTT()
It is working, but if package code changes on disc at runtime and I call
get_obj again, it returns instance of class, loaded for the first time
previously.
How to replace line "from tmp import main" by getting properties of pkg?
Regards,
Sergey
--
https://mail.python.org/mailman/listinfo/python-list
).
What do you think about it?
--
Best regards,
Valiev Sergey
*skype:* *svaliev*
*jabber:* *sval...@gmail.com*
*phone:* +7 926 233-17-64
--
http://mail.python.org/mailman/listinfo/python-list
Is anybody there to help me out ?
On Thu, Jan 27, 2011 at 4:49 PM, Sergey Lukin wrote:
> Hi all,
>
> I'm migrating code from python 2.4 to python 2.6 and I've got into troubles
> with pickling/unpickling python Exceptions.
> The following code works fine in 2.4 but not
Hi all,
I'm migrating code from python 2.4 to python 2.6 and I've got into troubles
with pickling/unpickling python Exceptions.
The following code works fine in 2.4 but not in 2.6.
See Exception1 example
I have found on python mail list similar problem
http://mail.python.org/pipermail/python-lis
dictionary given below?
{'Device':'MS1','Time':'Time: 19:57:44.71','CP-User
data':{'length':'37','RPDU':{'Message type indicator (MTI)':'(1) RP-DATA'}}}
Any other thoughts about reading that kind of text?
Thanks,
Sergey
--
http://mail.python.org/mailman/listinfo/python-list
this is what it looks like
>
>
> On Thu, Aug 19, 2010 at 7:01 PM, Agida Kerimova wrote:
>
>> Hi, I don't know how to work in a non bash console... I typed python in a
>> terminal window and all but it didn't work...
>>
>>
>>
>>
>>
&g
*when I actually *
*type it I get an error msg*
Did you type python commands in a bash console? In case you did, you should
run python interactive console instead. Just type python in terminal window
and than you'll be able interactively run statements.
If you have your script saved in a file, f
match.
Is there somehow I can improve code in elementsPresent()? I'm not a
very good programmer but I sense that idea of using a variable named
'result' inside elementsPresent() doesn't sound very good. Any ideas
will be highly appreciated.
Thanks,
Oltmans
--
Kind regar
__init__( self, base ):
self.base = base
Something like that... and then I would do this:
foo = MyDerived( MyBase() )
Note I'm using Python 3.1 on Windows. Thanks in advance.
--
Kind regards, Sergey Simonenko.
--
http://mail.python.org/mailman/listinfo/python-list
x27; and 'setdefault' ignore redefined '__setitem__' and use
builtin dict's one so dict looks kinda like a black box.
Another guy have reported me that he experiences similar problems with
subclassing builtin 'list'.
Kind regards, Sergey.
--
Написано в
Hi guys. I have a question regarding runtime definition of the variable
PYTHONPATH. Do you know how without modifying of source code change the
value for this var. Value stores in the system var sys.path, but the first
item of this list, path[0], is the directory containing the script that was
used
On 8 янв, 22:03, "Chris Rebert" wrote:
> On Thu, Jan 8, 2009 at 5:53 AM, Sergey Kishchenko wrote:
> > In Python empty container equals False in 'if' statements:
>
> > # prints "It's ok"
> > if not []:
> > print "It
In Python empty container equals False in 'if' statements:
# prints "It's ok"
if not []:
print "It's ok"
Let's create a simple Foo class:
class Foo:
pass
Now I can use Foo objects in 'if' statements:
#prints "Ouch!"
f=Foo()
if f:
print "Ouch!"
So, default __nonzero__ impl is to re
On Dec 19, 2:16 am, Robert Kern wrote:
> Sergey Shepelev wrote:
> > Hello.
>
> > I'm trying to make almost-Python source to Erlang source translation
> > tool.
>
> > Are there ready ply.lex settings for parsing python source?
>
> Yes! Andrew Dalke
Hello.
I'm trying to make almost-Python source to Erlang source translation
tool.
Are there ready ply.lex settings for parsing python source?
--
http://mail.python.org/mailman/listinfo/python-list
"Peter Otten" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What syntax would you suggest for a lambda enhanced to cover your use
> case?
> I suppose you will end up with roughly the same number of characters, all
> crammed in one line -- or broken into lines at a random positio
"Peter Otten" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Please help, is there way to use sub-expressions in lambda?
For example, if I want to calculate sin(x^2)+cos(x^2) I must code:
lambda x: sin(x*x)+cos(x*x)
How to make x*x to be evaluated once?
>>>
>>
"Peter Otten" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sergey Dorofeev wrote:
>
>> Please help, is there way to use sub-expressions in lambda?
>> For example, if I want to calculate sin(x^2)+cos(x^2) I must code:
>> lambda x: si
Hello all!
Please help, is there way to use sub-expressions in lambda?
For example, if I want to calculate sin(x^2)+cos(x^2) I must code:
lambda x: sin(x*x)+cos(x*x)
How to make x*x to be evaluated once?
--
http://mail.python.org/mailman/listinfo/python-list
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's effectively a tuple with field names. I don't know when the switch
> occurred (it's in 2.2, as far back as my built interpreter versions
> currently go), but back in the day os.stat used to return a plain old
> tuple.
posix.sta
"James Stroud" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>[1]+(1,)
>>
>> Traceback (most recent call last):
>> File "", line 1, in
>> TypeError: can only concatenate list (not "tuple") to list
>>
>>
>> Its ugly and boring.
>
> Agreed. This would be similar to:
>
> py> 1
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> (1,)+[1]
Traceback (most recent call last):
File "", line 1, in
TypeError: can only concatenate tuple (not "list") to tuple
>>> [1]+(1,)
"Rob Wolfe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>> p2=email.message.Message()
>> p2.set_type("message/rfc822")
>> p2.set_payload(m)
>
> Payload is a _list_ of Message objects (is_multipart() == True)
> or a _string_ object (is_multipart() == False) but never just Message
Hello.
Why does not work?
--
import email.message
import smtplib
import time
m=email.message.Message()
m.set_type("multipart/mixed")
m["From"]="Sergey Dorofeev <[EMAIL PROTECTED]>"
m["To"]="Sergey Dorofeev <[EMAIL PROTECTE
Hello all.
Anybody who has idle time, please look at my version of MIME tools at
http://www.fidoman.ru/prog/mime/.
Questions and critical notes are welcome. If somebody will consider that
interesting, I will refine these modules and put to pypi.
--
http://mail.python.org/mailman/listinfo/pyth
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>| >import wmi
>| >c = wmi.WMI (computer="srv", user="[EMAIL PROTECTED]", password="")
>| >pid, retval = c.Win32_Process.Create (CommandLin
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>import wmi
>c = wmi.WMI (computer="srv", user="[EMAIL PROTECTED]", password="")
>pid, retval = c.Win32_Process.Create (CommandLine="notepad.exe"
import win32com.client
loc = win32com.client.Dispatch("WbemScripting.SWbemLocator")
svc = loc.ConnectServer("srv", "root/cimv2", "[EMAIL PROTECTED]", "**")
sys = svc.get("Win32_Process")
sys.create("notepad.exe")
=>
Traceback (most recent call last):
File "remote.py", line 6, in ?
sys.create
There is function
mktime() -- convert local time tuple to seconds since Epoch
in module time.
But how about to convert *GMT time tuple* to seconds since Epoch?
Is there such function?
--
http://mail.python.org/mailman/listinfo/python-list
"Claudio Grondi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Sergey wrote:
> I don't know if and how it apply and can be of any help here, but in my C
> programs in the very past after switching from DOS to
> Windows long names a following tr
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>Have a look at win32file.FindFilesIterator from the pywin32 extensions.
>Maybe that can cope? (I haven't looked at the source).
Yeah, it works!
THANK YOU!
(but now I must have two pi
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>I see from another post that CreateFile cannot open your file.
>That puts it further away from Python, although it doesn't
>explain how some other program can see the files. Can
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>Not to state the obvious, but can you cut-and-paste that long
>string (the one starting with \\?\e:\...) from the Python
>interpreter into the [S]tart [R]un [O]pen field to see what
>
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Are you passing a unicode object to the function?
>
> f = file(u"E:\\files\\...\\something.dat", "r")
I pass variable c into functions:
>>> c
u'.\\e:\\files\\\u041f\u0420\u041e\u0414\u041e \u041c\u0435\u043d\u043
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>Not to state the obvious, but can you cut-and-paste that long
>string (the one starting with \\?\e:\...) from the Python
>interpreter into the [S]tart [R]un [O]pen field to see what
>
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
[Sergey]
>But note that r prefix to the string. Is it possible
>that your string didn't include it? If not, then the
>backslash character which Windows uses as a separator
>can be sto
Hello.
I try to open file with pathname length 282 bytes:
E:\files\..\something.dat
On MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp)
described method to access
files with path length
up to 32000 bytes: just add prefix \\?\ t
Does anybody know python module for sql parsing?
--
http://mail.python.org/mailman/listinfo/python-list
How to send alarm to a thread?
I can set alarm in main thread, but how then send exception to another thread
to wake it if it executes too long?
--
http://mail.python.org/mailman/listinfo/python-list
Problem solved.
"Sergey P. Vazulia" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:[EMAIL PROTECTED]
> this part of my code:
>
> f = file(work_dir + filename,'rb')
^
>
this part of my code:
f = file(work_dir + filename,'r')
n = int(totalSize/recordLenth)
i = 0
while i < n:
buf = f.read(recordLenth);
sometime (when find something like \0A\00\00 in data) returm less bytes then
file have.
Q: how-to read all data from bi
,
Sergey
--
http://mail.python.org/mailman/listinfo/python-list
I can use string.unpack if string in struct uses fixed amount of bytes.
But is there some extension to struct modue, which allows to unpack
zero-terminated string, size of which is unknown?
E.g. such struct: long, long, some bytes (string), zero, short, short,
short.
--
http://mail.python.org/ma
it's line #159 here, but it did work! thanks. so it IS a bug?
--
http://mail.python.org/mailman/listinfo/python-list
Here's the session log:
>>> _re_pair="(?(plus).|-)"
>>> _re1=("(?P\+)"+_re_pair)
>>> _re2=("((?P\+))"+_re_pair)
>>> _re3=("(?:(?P\+))"+_re_pair)
>>> _re4="(%s)"%_re3
>>> import re
>>> print [re.match(_re, "+a") and 'match' for _re in [_re1, _re2,
_re3, _re4]]
['match', None, 'match', None]
this i
Is there an alternative to standard module ConfigParser, which can use
delimitier symbol other than ":" and "=", preferaby just space?
I need to parse such configs:
[Passwords]
2:5020/758
2:5020/794
ConfigParser is not able to work with option names which contain symbol ':'
It is not d
52 matches
Mail list logo