As Chris said, if your needs are simple, use SQLite back-end. It's probably
already installed on your computer and Python has a nice interface to it in
its standard library. [1]
If you decide to use MySQL back-end instead, consider using PyMySQL [2].
It's compatible with both Python 2 and Python 3
Hi
Which one is most recommended to use for mutex alike locking to
achieve atomic access to single resource:
- fcntl.lockf
- os.open() with O_SHLOCK and O_EXLOCK
- https://pypi.python.org/pypi/lockfile/0.9.1
- https://pypi.python.org/pypi/zc.lockfile/1.1.0
- any other ?
Thanks
/Asaf
--
htt
Another option is PyMySQL [1]. It's developed in the open at GitHub [2].
It's pure Python, compatible with both Python 2 and Python 3. It's DB-API 2
compliant. It also implements some non-standard bits that are present in
MySQLdb, in order to be compatible with legacy code, notably Django
(personal
Le dimanche 9 février 2014 06:17:03 UTC+1, Skybuck Flying a écrit :
> "
>
>
>
>
> However there is more... Python may lack some technical language elements
>
> like, call by reference, and perhaps other low level codes, like 8 bit, 16
>
> bit, 32 bit integers which play a roll with interfac
On Sun, Feb 9, 2014 at 9:20 PM, Marcel Rodrigues wrote:
> As Chris said, if your needs are simple, use SQLite back-end. It's probably
> already installed on your computer and Python has a nice interface to it in
> its standard library.
Already installed? I thought the point of SQLite3 being in th
> Which one is most recommended to use for mutex alike locking to
> achieve atomic access to single resource:
>
> - fcntl.lockf
> - os.open() with O_SHLOCK and O_EXLOCK
> - https://pypi.python.org/pypi/lockfile/0.9.1
> - https://pypi.python.org/pypi/zc.lockfile/1.1.0
> - any other ?
As the author
Forget to mentioned - CentOS 6.5 Python v3.3.
--
https://mail.python.org/mailman/listinfo/python-list
On Sunday, February 9, 2014 1:00:39 PM UTC+2, Skip Montanaro wrote:
> > Which one is most recommended to use for mutex alike locking to
> > achieve atomic access to single resource:
> >
> > - fcntl.lockf
> > - os.open() with O_SHLOCK and O_EXLOCK
> > - https://pypi.python.org/pypi/lockfile/0.9.1
>
Running Python 2.6 and 2.7 on Windows 7 and Server 2012
Event::wait causes a delay when used with a timeout that is not triggered
because event is set in time. I don't understand why.
Can someone explain?
The following program shows this;
'''Shows that using a timeout in Event::wait (same for
I just checked in the Python sources and apparently you're right about
SQLite3. The Python distribution includes pysqlite which seems to be a
self-contained SQLite engine. No external dependencies. Sorry for the
confusion.
2014-02-09 9:00 GMT-02:00 Chris Angelico :
> On Sun, Feb 9, 2014 at 9:20
On Sun, Feb 9, 2014 at 11:04 PM, Marcel Rodrigues wrote:
> I just checked in the Python sources and apparently you're right about
> SQLite3. The Python distribution includes pysqlite which seems to be a
> self-contained SQLite engine. No external dependencies. Sorry for the
> confusion.
Comes to
Hi guys,
Here is one question related to algorithm.
Details here:
here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always
exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with
time complexity as O(n) and space as O(1).
Any comments will be appreciate
I have studied python(2.7.2) till classes. I have covered most of the the
general topics. But i do not know how to apply this. Can someone help me? I
want to make something that can aid me financially. If you have done something
like this please can you provide me with the resources and the libr
On Sunday, February 9, 2014 2:13:50 PM UTC+2, Wesley wrote:
> Hi guys,
>Here is one question related to algorithm.
> Details here:
>
> here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always
> exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with
> t
On Sun, Feb 9, 2014 at 11:13 PM, Wesley wrote:
> here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always
> exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with
> time complexity as O(n) and space as O(1).
The two halves of the list are already sorted,
On Sun, Feb 9, 2014 at 11:25 PM, Moz wrote:
> I have studied python(2.7.2) till classes. I have covered most of the the
> general topics. But i do not know how to apply this. Can someone help me? I
> want to make something that can aid me financially. If you have done
> something like this plea
On Sunday, February 9, 2014 1:00:58 PM UTC+2, Chris Angelico wrote:
> The biggest downside of SQLite3 is concurrency. I haven't dug into the
> exact details of the pager system and such, but it seems to be fairly
> coarse in its locking. Also, stuff gets a bit complicated when you do
> a single tra
pep 257 -- docstring conventions, as well as a myriad of books and other
resources, recommend documenting a function's or method's effect as a command
("do this", "return that"), not as a description ("does this", "returns that").
what's the logic behind this recommendation?
bagratte
--
https
On Sunday, February 9, 2014 5:42:09 PM UTC+5, Chris Angelico wrote:
> On Sun, Feb 9, 2014 at 11:25 PM, Moz wrote:
>
> > I have studied python(2.7.2) till classes. I have covered most of the the
> > general topics. But i do not know how to apply this. Can someone help me? I
> > want to make some
On Sunday, February 9, 2014 2:25:16 PM UTC+2, Moz wrote:
> I want to make something that can aid me financially. If you have
> done something like this please can you provide me with the resources
> and the libraries so that i may study even further.
>
> Thanks You!
you can try similar to this
On Sun, Feb 9, 2014 at 11:47 PM, Asaf Las wrote:
> i simply tested running 2 independent processes started at same time in
> parallel towards same sqlite database and never get 2 in that row
> though used exclusive lock on DB. might be i did something wrong.
The threading locks aren't doing a
On Sunday, February 9, 2014 3:14:50 PM UTC+2, Chris Angelico wrote:
> On Sun, Feb 9, 2014 at 11:47 PM, Asaf Las wrote:
>
Thanks
>
> Also, you're connecting and disconnecting repeatedly... oh, I see why
> it didn't work when I tried. You're also using two completely
> different database names:
On Mon, Feb 10, 2014 at 12:27 AM, Asaf Las wrote:
> i did it just to test sqlite3 behavior and actually test was related to
> simulation of unique incremental sequence number/counter for
> independently spawned tasks accessing counter in non deterministic manner.
Sure. I would expect that you'd
On 9 February 2014 12:13, Wesley wrote:
> Hi guys,
>Here is one question related to algorithm.
> Details here:
>
> here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always
> exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with
> time complexity as O(
On Sunday, February 9, 2014 5:54:16 PM UTC+5, Asaf Las wrote:
> On Sunday, February 9, 2014 2:25:16 PM UTC+2, Moz wrote:
>
> > I want to make something that can aid me financially. If you have
>
> > done something like this please can you provide me with the resources
>
> > and the libraries s
On 2014-02-09 22:00, Chris Angelico wrote:
> On Sun, Feb 9, 2014 at 9:20 PM, Marcel Rodrigues
> wrote:
> > As Chris said, if your needs are simple, use SQLite back-end.
> > It's probably already installed on your computer and Python has a
> > nice interface to it in its standard library.
>
> Al
Please reply to the list rather than directly to me so that other
people can see the answer to my question and offer you help.
On 9 February 2014 14:04, Ni Wesley wrote:
> 2014年2月9日 下午9:41于 "Oscar Benjamin" 写道:
>
>> On 9 February 2014 12:13, Wesley wrote:
>> > Hi guys,
>> >Here is one questi
Yes, with no new list, otherwise, space won't to be O(1)
Wesley
2014年2月9日 下午10:31于 "Oscar Benjamin" 写道:
> Please reply to the list rather than directly to me so that other
> people can see the answer to my question and offer you help.
>
> On 9 February 2014 14:04, Ni Wesley wrote:
> > 2014年2月9日
In article ,
Skip Montanaro wrote:
> > Which one is most recommended to use for mutex alike locking to
> > achieve atomic access to single resource:
> >
> > - fcntl.lockf
> > - os.open() with O_SHLOCK and O_EXLOCK
> > - https://pypi.python.org/pypi/lockfile/0.9.1
> > - https://pypi.python.org/py
In article ,
Wesley wrote:
> Hi guys,
>Here is one question related to algorithm.
> Details here:
>
> here is input sequence like a1,a2,...,an,b1,b2,...,bn ï¼the ax and bx always
> exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with
> time complexity as O(n) and s
On Sun, Feb 9, 2014 at 8:45 AM, Roy Smith wrote:
> This is true of all mutexes, no?
Hmmm... You might well be right. I thought that use of the O_EXLOCK
flag in the open(2) system call would prevent other processes from
opening the file, but (at least on my Mac) it just blocks until the
first proc
Please don't top-post.
On Feb 9, 2014 2:40 PM, "Ni Wesley" wrote:
>
> Yes, with no new list, otherwise, space won't to be O(1)
Did you read the link I posted:
>> http://en.wikipedia.org/wiki/In-place_matrix_transposition
Oscar
--
https://mail.python.org/mailman/listinfo/python-list
On 09/02/2014 10:47, wxjmfa...@gmail.com wrote:
Le dimanche 9 février 2014 06:17:03 UTC+1, Skybuck Flying a écrit :
"
However there is more... Python may lack some technical language elements
like, call by reference, and perhaps other low level codes, like 8 bit, 16
bit, 32 bit integers wh
On 09/02/2014 13:52, Moz wrote:
On Sunday, February 9, 2014 5:54:16 PM UTC+5, Asaf Las wrote:
On Sunday, February 9, 2014 2:25:16 PM UTC+2, Moz wrote:
I want to make something that can aid me financially. If you have
done something like this please can you provide me with the resources
a
Asaf Las :
> Which one is most recommended to use for mutex alike locking to
> achieve atomic access to single resource:
>
> - fcntl.lockf
I recommend fcntl.flock:
#!/usr/bin/python3
import sys, fcntl, time
with open("te
In article ,
bagrat lazaryan wrote:
> pep 257 -- docstring conventions, as well as a myriad of books and other
> resources, recommend documenting a function's or method's effect as a command
> ("do this", "return that"), not as a description ("does this", "returns
> that"). what's the logic b
On 09/02/2014 12:05, bagrat lazaryan wrote:
pep 257 -- docstring conventions, as well as a myriad of books and other resources, recommend documenting a function's
or method's effect as a command ("do this", "return that"), not as a description ("does
this", "returns that"). what's the logic beh
Mark Lawrence writes:
> On 09/02/2014 12:05, bagrat lazaryan wrote:
>
> > pep 257 -- docstring conventions, as well as a myriad of books and
> > other resources, recommend documenting a function's or method's
> > effect as a command ("do this", "return that"), not as a
> > description ("does this",
Hi
Thanks for replies. It would be good to have blocking implementation.
I have to check fcntl if it works in blocking mdoe on CentOS.
Meanwhile there is Posix Semaphore made for Python:
http://semanchuk.com/philip/posix_ipc/
will try it as well.
/Asaf
--
https://mail.python.org/mailman/li
On Sun, Feb 9, 2014 at 5:52 PM, Roy Smith wrote:
> In article ,
> bagrat lazaryan wrote:
>
>> pep 257 -- docstring conventions, as well as a myriad of books and other
>> resources, recommend documenting a function's or method's effect as a command
>> ("do this", "return that"), not as a descript
On 02/09/2014 08:52 AM, Roy Smith wrote:
In article ,
bagrat lazaryan wrote:
pep 257 -- docstring conventions, as well as a myriad of books and other
resources, recommend documenting a function's or method's effect as a command
("do this", "return that"), not as a description ("does this", "
On 2/9/2014 7:05 AM, bagrat lazaryan wrote:
pep 257 -- docstring conventions, as well as a myriad of books and other resources, recommend documenting a function's
or method's effect as a command ("do this", "return that"), not as a description ("does
this", "returns that"). what's the logic beh
Dear List,
What is the latest "best-practice" for deploying a python wsgi
application into production?
For development, I've been using CherryPyWSGIServer which has been
working very well (and the code is small enough to actually ship with
my application). But I would like some way of deploying
I started Python programming in the last few years and so I started with
version 3 and 99% of my code is in version 3.
Much of Google API Python code seems to be Python 2. I can convert the
occasional file to version 3 with 2to3, but for an entire 3rd-party
library, could it be as simple as using
On Sun, 09 Feb 2014 04:13:50 -0800, Wesley wrote:
> Hi guys,
>Here is one question related to algorithm.
> Details here:
>
> here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx
> always exist in pair. So, now, how to change the sequence to
> a1,b1,...,an,bn, with time complex
On Sunday, February 9, 2014 11:05:58 PM UTC+2, Nicholas wrote:
> Dear List,
>
>
>
> What is the latest "best-practice" for deploying a python wsgi
> application into production?
>
> For development, I've been using CherryPyWSGIServer which has been
> working very well (and the code is small eno
On Mon, Feb 10, 2014 at 2:40 AM, Dennis Lee Bieber
wrote:
> Any opinion on Firebird? Just curiosity given how often the advice
> seems to be "start with SQLite, avoid MySQL, end with PostgreSQL"
No, because I've never used it. Has anyone here? What are its
strengths and weaknesses?
Chris
On Mon, Feb 10, 2014 at 1:45 AM, Roy Smith wrote:
> In article ,
> Skip Montanaro wrote:
>
>> As the author of lockfile, I can tell you it only implements advisory
>> locking. All programs needing to access the locked resources must
>> cooperate.
>
> This is true of all mutexes, no?
>
Not quite
On Mon, Feb 10, 2014 at 4:53 AM, Ethan Furman wrote:
> Shouldn't that be:
>
> class Pig:
> def fly(self):
> "Soar gracefully through the air if a hot place is very cold."
> if hell is frozen:
> self.sprout_wings()
> self.altitude += 10
>
On Sunday, 9 February 2014, Asaf Las
>
wrote:
> On Sunday, February 9, 2014 11:05:58 PM UTC+2, Nicholas wrote:
> > Dear List,
> >
> >
> >
> > What is the latest "best-practice" for deploying a python wsgi
> > application into production?
> >
> > For development, I've been using CherryPyWSGIServer
On Sun, 09 Feb 2014 16:05:59 +0400, bagrat lazaryan wrote:
> pep 257 -- docstring conventions, as well as a myriad of books and other
> resources, recommend documenting a function's or method's effect as a
> command ("do this", "return that"), not as a description ("does this",
> "returns that").
On Sun, 09 Feb 2014 10:05:02 -0500, Roy Smith wrote:
> Is this a homework problem?
and then (paraphrasing):
> working code that solves the problem
/headdesk
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
I am fully ready to invest in the Google Cloud Platform, and bring with me my
very own idea: Glass Solver (Sometimes called GlaSolver). Long story short,
this application for Google Glass will connect to the Cloud to retrieve God's
Algorithm for the cube sitting in front of you by doing a series
In article <52f80bca$0$29972$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Sun, 09 Feb 2014 10:05:02 -0500, Roy Smith wrote:
>
> > Is this a homework problem?
>
> and then (paraphrasing):
>
> > working code that solves the problem
>
> /headdesk
I gave him the benefit of t
PyExt is a set of nifty(and sometimes either overly hackish, overly
dangerous, or overly both) extensions to Python. It has things like a
switch statement, runtime module creation, function overloading(does NOT
work with class methods...yet), and more!
Links:
PyPI: https://pypi.python.org/pypi/pye
在 2014年2月9日星期日UTC+8下午11时48分17秒,Oscar Benjamin写道:
> Please don't top-post.
>
> On Feb 9, 2014 2:40 PM, "Ni Wesley" wrote:
>
> >
>
> > Yes, with no new list, otherwise, space won't to be O(1)
>
> Did you read the link I posted:
>
> >> http://en.wikipedia.org/wiki/In-place_matrix_transposition
>
> > here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always
> > exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with
> > time complexity as O(n) and space as O(1).
>
>
>
> The two halves of the list are already sorted, yes?
[Wesley] No, not sorted
Also I should mention that I will credit whomever writes the scripts. I have
contacted Google on their Compute Engine which would execute these scripts. I
am await a reply!
--
https://mail.python.org/mailman/listinfo/python-list
[Wesley] This is not homework:-)
And actually I am new to algorithm, so you guys can feel free to say anything
you want
--
https://mail.python.org/mailman/listinfo/python-list
eliasbylar...@gmail.com Wrote in message:
> Also I should mention that I will credit whomever writes the scripts. I have
> contacted Google on their Compute Engine which would execute these scripts. I
> am await a reply!
>
It might help if you mention that you're talking about the Rubic
cube,
Wesley Wrote in message:
>
>> > here is input sequence like a1,a2,...,an,b1,b2,...,bn ï¼the ax and bx
>> > always exist in pair. So, now, how to change the sequence to
>> > a1,b1,...,an,bn, with time complexity as O(n) and space as O(1).
>>
>>
>>
>> The two halves of the list are already s
On Feb 8, 2014, at 11:30 PM, Chris Angelico wrote:
I have one more question on this if you don’t mind. I’m a bit confused on how
it works this way without it being in seconds? I’ll answer below each step of
how it seems to work to me.
> How to do it from the small end up:
>
> time = int(ra
On Feb 8, 2014, at 11:30 PM, Chris Angelico wrote:
OH, I think I figured it out.
> time = int(raw_input("Enter number of seconds: “))
100
> seconds = time % 60
Remainder of 40 <- for seconds.
> time /= 60
Here you take 100/60 = 1 (which = time for the next line).
> minutes = time %
On Mon, Feb 10, 2014 at 3:17 PM, Scott W Dunning wrote:
> How to do it from the small end up:
>
> time = int(raw_input("Enter number of seconds: "))
> seconds = time % 60
>
> So here it takes say 100 and divides it by 60 to put in seconds and
> spits out the remainder? 100 / 60 is approxi
On Mon, Feb 10, 2014 at 3:31 PM, Scott W Dunning wrote:
> I guess I answered my own question and it looks like it wouldn’t matter if
> you did it opposite from weeks to seconds.
Yep, you've got it!
Remember, you can always try things out in the interactive interpreter
to see what's happening. H
65 matches
Mail list logo