tracemalloc module may help you to investigate leaks.
2016/02/14 午後4:05 "Paulo da Silva" :
> I was unable to reproduce the situation using a simple program just
> walking through all files>4K, with or without the seek, and computing
> their shasums.
> Only some fluctuations of about 500MB in memor
I have written a small backup program, that uses ftplib to make
remote backups. However recentely the program starts to regularly
raise IndexErrors, as far as I can see the problem is in socket.py
Can anyone shed some light?
This is the traceback:
Traceback (most recent call last):
File "/usr/l
Hi Antoon,
EINTR, is an error when there is an emited signal to your process.
http://man7.org/linux/man-pages/man2/read.2.html
Look for EINTR in this page
On 02/14, Antoon Pardon wrote:
I have written a small backup program, that uses ftplib to make
remote backups. However recentely the progr
On 02/13/2016 09:45 PM, Gary Herron wrote:
On 02/13/2016 12:27 PM, Tom P wrote:
On 02/13/2016 07:13 PM, Gary Herron wrote:
On 02/13/2016 09:58 AM, Tom P wrote:
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if
dateutil.pars
On 02/13/2016 10:01 PM, Mark Lawrence wrote:
On 13/02/2016 17:58, Tom P wrote:
I am writing a program that has to deal with various date/time formats
and convert these into timestamps. It looks as if dateutil.parser.parse
should be able to handle about any format, but what I get is:
datetimestr
Hi,
Noob at the Python thing so here goes,
I have copied a program to demonstrate control structures in Python but get a
syntax error at line 31, isint = False. I'm using Python 2.7.6 and Linux Mint
based around ubuntu14.04.1. I have pasted all the code below,
#!/usr/bin/env python2
'''
We
Antoon Pardon wrote:
> I have written a small backup program, that uses ftplib to make
> remote backups. However recentely the program starts to regularly
> raise IndexErrors, as far as I can see the problem is in socket.py
> Can anyone shed some light?
>
> This is the traceback:
[...]
> File
Gregory Ewing wrote:
> Something like this should do it:
>
>instance = getattr(module, class_name)(module_name, product)
>
> If the class name is always the same as the module name with the
> first letter capitalized, you could use
>
>instance = getattr(module, module_name.capitalize())
Geoff Munn wrote:
> Noob at the Python thing so here goes,
>
> I have copied a program to demonstrate control structures in Python but
> get a syntax error at line 31, isint = False.
Often the actual syntax error in your code is in one of the lines preceding
the one that Python is complaining
On Mon, Feb 15, 2016 at 12:39 AM, Geoff Munn wrote:
> Hi,
>
> Noob at the Python thing so here goes,
>
> I have copied a program to demonstrate control structures in Python but get a
> syntax error at line 31, isint = False. I'm using Python 2.7.6 and Linux Mint
> based around ubuntu14.04.1. I h
Op 14-02-16 om 14:40 schreef Peter Otten:
> Antoon Pardon wrote:
>
>> I have written a small backup program, that uses ftplib to make
>> remote backups. However recentely the program starts to regularly
>> raise IndexErrors, as far as I can see the problem is in socket.py
>> Can anyone shed some l
Op 14-02-16 om 14:40 schreef Peter Otten:
>
> PS: How did you produce the overview over the local variables? That looks
> nice.
>
I started from this recipe:
http://code.activestate.com/recipes/52215-get-more-information-from-tracebacks/
made it more to my liking and turned it into a module.
Howdy all,
How should a program generate a unique filesystem path and *not* create
the filesystem entry?
The ‘tempfile.mktemp’ function is strongly deprecated, and rightly so
https://docs.python.org/3/library/tempfile.html#tempfile.mktemp>
because it leaves the program vulnerable to insecure file
Ben Finney wrote:
> How should a program generate a unique filesystem path and *not* create
> the filesystem entry?
The Python documentation suggests that it should not.
> The ‘tempfile.mktemp’ function is strongly deprecated, and rightly so
> https://docs.python.org/3/library/tempfile.html#tem
On 14 Feb 2016 21:46, "Ben Finney" wrote:
> What standard library function should I be using to generate
> ‘tempfile.mktemp’-like unique paths, and *not* ever create a real file
> by that path?
Could you use tempfile.TemporaryDirectory and then just use a consistent
name within that directory.
I
On the PSF-Community list, a Python user points out that LIGO uses
Python, with numpy and IPython, extensively. He linked to
https://losc.ligo.org/s/events/GW150914/GW150914_tutorial.html
which explains, with code, how the gravity wave signal was pulled out of
the (publicly available) raw data.
Matt Wheeler writes:
> On 14 Feb 2016 21:46, "Ben Finney" wrote:
> > What standard library function should I be using to generate
> > ‘tempfile.mktemp’-like unique paths, and *not* ever create a real
> > file by that path?
>
> Could you use tempfile.TemporaryDirectory and then just use a
> consi
I want to pass in the key to the default_factory of defaultdict and I found
that defaultdict somehow can intercept my call to dict.__getitem__(self,
key), so my class's __getitem__ have to catch a TypeError instead instead
of KeyError. The following class is my code:
class DefaultDictWithEnhancedF
I'm in an Intro to Python class and have an assignment where I need to
implement a function calculating distance between two points, then create a
loop to find points within a certain distance and create a list from those
points. I was able to create the function, but I cant get my loop to creat
Herman writes:
> I want to pass in the key to the default_factory of defaultdict and I
> found that defaultdict somehow can intercept my call to
> dict.__getitem__(self, key), so my class's __getitem__ have to catch a
> TypeError instead instead of KeyError. The following class is my code:
I don
On Mon, Feb 15, 2016 at 11:23 AM, Kaley Tucker wrote:
> I'm in an Intro to Python class and have an assignment where I need to
> implement a function calculating distance between two points, then create a
> loop to find points within a certain distance and create a list from those
> points. I w
On Mon, Feb 15, 2016 at 11:17 AM, Herman wrote:
> I want to pass in the key to the default_factory of defaultdict and I found
> that defaultdict somehow can intercept my call to dict.__getitem__(self,
> key), so my class's __getitem__ have to catch a TypeError instead instead
> of KeyError. The fo
On Mon, 15 Feb 2016 11:08:52 +1100, Ben Finney wrote:
> I am unconcerned with whether there is a real filesystem entry of that
> name; the goal entails having no filesystem activity for this. I want
> a valid unique filesystem path, without touching the filesystem.
That's an odd use case.
If it'
Dan Sommers writes:
> On Mon, 15 Feb 2016 11:08:52 +1100, Ben Finney wrote:
>
> > I am unconcerned with whether there is a real filesystem entry of
> > that name; the goal entails having no filesystem activity for this.
> > I want a valid unique filesystem path, without touching the
> > filesyste
Às 07:04 de 14-02-2016, Paulo da Silva escreveu:
> I was unable to reproduce the situation using a simple program just
> walking through all files>4K, with or without the seek, and computing
> their shasums.
> Only some fluctuations of about 500MB in memory consumption.
Today I gave another try to
On Monday 15 February 2016 11:17, Herman wrote:
> I want to pass in the key to the default_factory of defaultdict
Just use a regular dict and define __missing__:
class MyDefaultDict(dict):
def __missing__(self, key):
return "We gotcha key %r right here!" % key
If you want a per-in
On Monday 15 February 2016 11:08, Ben Finney wrote:
> I am unconcerned with whether there is a real filesystem entry of that
> name; the goal entails having no filesystem activity for this. I want a
> valid unique filesystem path, without touching the filesystem.
Your phrasing is ambiguous.
If y
Steven D'Aprano writes:
> On Monday 15 February 2016 11:08, Ben Finney wrote:
>
> > I am unconcerned with whether there is a real filesystem entry of
> > that name; the goal entails having no filesystem activity for this.
> > I want a valid unique filesystem path, without touching the
> > filesys
Good evening/morning Ben,
>> > I am unconcerned with whether there is a real filesystem entry of
>> > that name; the goal entails having no filesystem activity for this.
>> > I want a valid unique filesystem path, without touching the
>> > filesystem.
>>
>> Your phrasing is ambiguous.
>
>The exis
On Monday 15 February 2016 12:19, Ben Finney wrote:
> One valid filesystem path each time it's accessed. That is, behaviour
> equivalent to ‘tempfile.mktemp’.
>
> My question is because the standard library clearly has this useful
> functionality implemented, but simultaneously warns strongly aga
Steven D'Aprano writes:
> If you can absolutely guarantee that this string will never actually
> be used on a real filesystem, then go right ahead and use it.
I'm giving advice in examples in documentation. It's not enough to have
some private usage that I know is good, I am looking for a standa
Hi All,
I am retrieving data from Sybase database using Sybase module of Python.
My query is not taking time however fecthall is taking longer time.
Below is the test script :
def run_query(db,query): ## Run query and resturn record result
t1 = datetime.now()
cursorObj = db.cur
Hi all
Using asyncio, there are times when I want to execute a coroutine which is
time-consuming. I do not need the result immediately, and I do not want to
block the current task, so I want to run it in the background.
run_in_executor() can run an arbitrary function in the background, but a
"Frank Millman" :
> Using asyncio, there are times when I want to execute a coroutine which
> is time-consuming. I do not need the result immediately, and I do not
> want to block the current task, so I want to run it in the background.
You can't run code "in the background" using asyncio. Corout
"Marko Rauhamaa" wrote in message news:8737sumpjl@elektro.pacujo.net...
"Frank Millman" :
> Using asyncio, there are times when I want to execute a coroutine which
> is time-consuming. I do not need the result immediately, and I do not
> want to block the current task, so I want to run it
"Frank Millman" :
> The benefit of my class is that it enables me to take the coroutine
> and run it in another thread, without having to re-engineer the whole
> thing.
>
> Hope this makes sense.
Sure.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Às 09:49 de 14-02-2016, INADA Naoki escreveu:
> tracemalloc module may help you to investigate leaks.
> 2016/02/14 午後4:05 "Paulo da Silva" :
>
Thanks. I didn't know it!
Paulo
--
https://mail.python.org/mailman/listinfo/python-list
"Frank Millman" writes:
> The benefit of my class is that it enables me to take the coroutine
> and run it in another thread, without having to re-engineer the whole
> thing.
Threads in Python don't get you parallelism either, of course.
I haven't used async/await yet and it's looking painful.
38 matches
Mail list logo