On Saturday, February 6, 2016 at 12:54:41 PM UTC-8, Rick Johnson wrote:
> On Wednesday, February 3, 2016 at 12:02:35 AM UTC-6, John Ladasky wrote:
>
> > Rick, you don't like Python?
>
> If i didn't like Python, then i would happily let it self-
> destruct, yes? The problem is, i *DO* like Pytho
Chris Angelico writes:
> On Thu, Feb 11, 2016 at 6:59 PM, dieter wrote:
>> In my context (web applications), I strongly discourage this use - at least
>> when "conn" does not handle subtransactions properly.
>>
>> In a web application, the main transaction should in general be controlled
>> at t
On Sunday, August 5, 2007 at 1:14:38 PM UTC+3, Franz Steinhäusler wrote:
> Hello NG,
>
> wWhat are the best programs in your opinion, written entirly
> in pyhton, divided into categories like:
> a) Games
> b) Utilities/System
> c) Office
> d) Web/Newsreader/Mail/Browser
> ...
>
> I don't want to
On Feb 12, 2016 6:05 AM, "Paulo da Silva"
wrote:
>
> Hi!
>
> What is the best (shortest memory usage) way to store lots of pathnames
> in memory where:
>
> 1. Path names are pathname=(dirname,filename)
> 2. There many different dirnames but much less than pathnames
> 3. dirnames have in general ma
On Fri, 12 Feb 2016 04:02 pm, Chris Angelico wrote:
> On Fri, Feb 12, 2016 at 3:45 PM, Paulo da Silva
> wrote:
>>> Correct. Two equal strings, passed to sys.intern(), will come back as
>>> identical strings, which means they use the same memory. You can have
>>> a million references to the same s
Às 05:02 de 12-02-2016, Chris Angelico escreveu:
> On Fri, Feb 12, 2016 at 3:45 PM, Paulo da Silva
> wrote:
...
>> I think a dict, as MRAB suggested, is needed.
>> At the end of the store process I may delete the dict.
>
> I'm not 100% sure of what's going on here, but my suspicion is that a
> s
On Tuesday, February 9, 2016 at 5:55:30 AM UTC-8, Anita Goyal wrote:
>
> Start learning Python from basics to advance levels here...
> https://goo.gl/hGzm6o
Python experts please translate the webserver "Ghost" Perlmind into Python.
http://ai.neocities.org/P6AI_FAQ.html
--
https://mail.python.
On Fri, Feb 12, 2016 at 3:45 PM, Paulo da Silva
wrote:
>> Correct. Two equal strings, passed to sys.intern(), will come back as
>> identical strings, which means they use the same memory. You can have
>> a million references to the same string and it takes up no additional
>> memory.
> I have bein
Às 04:23 de 12-02-2016, Chris Angelico escreveu:
> On Fri, Feb 12, 2016 at 3:15 PM, Paulo da Silva
> wrote:
>> Às 03:49 de 12-02-2016, Chris Angelico escreveu:
>>> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote:
Apart from all of the other answers that have been given:
>> ...
>>>
>>> Simpl
On Fri, Feb 12, 2016 at 3:15 PM, Paulo da Silva
wrote:
> Às 03:49 de 12-02-2016, Chris Angelico escreveu:
>> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote:
>>> Apart from all of the other answers that have been given:
>>>
> ...
>>
>> Simpler to let the language do that for you:
>>
> import sys
Às 03:49 de 12-02-2016, Chris Angelico escreveu:
> On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote:
>> Apart from all of the other answers that have been given:
>>
...
>
> Simpler to let the language do that for you:
>
import sys
p1 = sys.intern('foo/bar')
p2 = sys.intern('foo/bar')
>
On Fri, Feb 12, 2016 at 2:13 PM, MRAB wrote:
> Apart from all of the other answers that have been given:
>
p1 = 'foo/bar'
p2 = 'foo/bar'
id(p1), id(p2)
> (982008930176, 982008930120)
d = {}
id(d.setdefault(p1, p1))
> 982008930176
id(d.setdefault(p2, p2))
> 98200893017
On 2016-02-12 00:31, Paulo da Silva wrote:
Hi!
What is the best (shortest memory usage) way to store lots of pathnames
in memory where:
1. Path names are pathname=(dirname,filename)
2. There many different dirnames but much less than pathnames
3. dirnames have in general many chars
The idea is
Tim Chase wrote:
> On 2016-02-12 00:31, Paulo da Silva wrote:
>> What is the best (shortest memory usage) way to store lots of
>> pathnames in memory where:
>>
>> 1. Path names are pathname=(dirname,filename)
>> 2. There many different dirnames but much less than pathnames
>> 3. dirnames have in
On 2016-02-12 00:31, Paulo da Silva wrote:
> What is the best (shortest memory usage) way to store lots of
> pathnames in memory where:
>
> 1. Path names are pathname=(dirname,filename)
> 2. There many different dirnames but much less than pathnames
> 3. dirnames have in general many chars
>
> Th
Paulo da Silva writes:
> What is the best (shortest memory usage) way to store lots of
> pathnames in memory
I challenge the premise. Why is “shortest memory usage” your criterion
for “best”, here?
How have you determined that factors like “easily understandable when
reading”, or “using standar
On Fri, Feb 12, 2016 at 11:31 AM, Paulo da Silva
wrote:
> What is the best (shortest memory usage) way to store lots of pathnames
> in memory where:
>
> 1. Path names are pathname=(dirname,filename)
> 2. There many different dirnames but much less than pathnames
> 3. dirnames have in general many
Hi!
What is the best (shortest memory usage) way to store lots of pathnames
in memory where:
1. Path names are pathname=(dirname,filename)
2. There many different dirnames but much less than pathnames
3. dirnames have in general many chars
The idea is to share the common dirnames.
More realisti
In https://docs.python.org/2/library/tarfile.html there is a warning:
Never extract archives from untrusted sources without prior inspection.
It is possible that files are created outside of path, e.g. members that
have absolute filenames starting with "/" or filenames with two dots
"..".
On Thu, Feb 11, 2016, at 11:41, Ulli Horlacher wrote:
> When I use:
>
> for member in taro.getmembers():
> print('extracting "%s"' % member.name)
> taro.extract(member)
>
> I get the error:
>
> File "/usr/lib/python2.7/tarfile.py", line 556, in seek
> raise StreamError("seeki
On Thursday, February 11, 2016 at 10:18:53 AM UTC-8, Benoit Izac wrote:
> Terry Reedy writes:
>
> >>> Since Python runs natively in Windows, why are you trying to run it
> >>> with Cygwin? I'm not implying that you shouldn't, just offhand I don't
> >>> see a reason for it.
> >>
> >> I do it becau
Greetings,
>I have timestamped log files I need to read through and keep track
>of the most upto date information.
>
>For example lets say we had a log file
>
>timeStamp,name,marblesHeld,timeNow,timeSinceLastEaten
I do not quite understand the distinction between timeStamp and
timeNow.
>I nee
On Thursday, February 11, 2016 at 6:16:35 PM UTC, jmp wrote:
> On 02/11/2016 07:07 PM, ltomassm...@gmail.com wrote:
> > I thought a dictionary would be a good idea because of the key restrictions
> > ensuring no duplicates, so the data would always update - However because
> > they are unordered
On Thursday, February 11, 2016 at 6:16:35 PM UTC, jmp wrote:
> On 02/11/2016 07:07 PM, ltomassm...@gmail.com wrote:
> > I thought a dictionary would be a good idea because of the key restrictions
> > ensuring no duplicates, so the data would always update - However because
> > they are unordered
Terry Reedy writes:
>>> Since Python runs natively in Windows, why are you trying to run it
>>> with Cygwin? I'm not implying that you shouldn't, just offhand I don't
>>> see a reason for it.
>>
>> I do it because it's easier to install third party packages, those that
>> need an external library
Terry Reedy writes:
>>> Since Python runs natively in Windows, why are you trying to run it
>>> with Cygwin? I'm not implying that you shouldn't, just offhand I don't
>>> see a reason for it.
>>
>> I do it because it's easier to install third party packages, those that
>> need an external library
On 02/11/2016 07:07 PM, ltomassm...@gmail.com wrote:
I thought a dictionary would be a good idea because of the key restrictions
ensuring no duplicates, so the data would always update - However because they
are unordered and I need to do some more processing on the data afterwards I'm
having
I have timestamped log files I need to read through and keep track of the most
upto date information.
For example lets say we had a log file
timeStamp,name,marblesHeld,timeNow,timeSinceLastEaten
I need to keep track of every 'name' in this table, I don't want duplicate
values so if values com
Frank Miles wrote:
> On Thu, 11 Feb 2016 14:29:04 +, cl wrote:
>
> > I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu
> > 15.10.
> >
> > I have already written something using wxPython directly so I have the
> > basics (of my Python skills and the environment) OK I think
On Thu, Feb 11, 2016 at 04:41:43PM +, Ulli Horlacher wrote:
> sfo = sock.makefile('r')
> taro = tarfile.open(fileobj=sfo,mode='r|')
> taro.extractall(path=edir)
What about using an iterator?
def myiter(tar):
for t in tar:
print "extracting", t.name
yield t
sfo = soc
Ulli Horlacher wrote:
> Ulli Horlacher wrote:
>
>> With
>>
>> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|')
>>
>> I get no more error.
>
> Of course, this is the writing client.
>
> Now I have a small problem with the reading client.
>
> This code works so far:
>
> sfo
Ulli Horlacher wrote:
> This code works so far:
>
> sfo = sock.makefile('r')
> taro = tarfile.open(fileobj=sfo,mode='r|')
> taro.extractall(path=edir)
>
> But it does not writes anything to the terminal to inform the user.
>
> When I use:
>
> for member in taro.getmembers():
>
On 2016-02-11 16:41, Ulli Horlacher wrote:
Ulli Horlacher wrote:
With
taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|')
I get no more error.
Of course, this is the writing client.
Now I have a small problem with the reading client.
This code works so far:
sfo = sock.ma
On Feb 10, 2016, at 8:06 PM, Frank Millman wrote:
>
> "Israel Brewster" wrote in message
> news:92d3c964-0323-46ee-b770-b89e7e7e6...@ravnalaska.net...
>
>> I am working on implementing a Python DB API module, and am hoping I can get
>> some help with figuring out the workflow of handling tran
On Feb 10, 2016, at 8:14 PM, Chris Angelico wrote:
>
> On Thu, Feb 11, 2016 at 4:06 PM, Frank Millman wrote:
>> A connection has 2 possible states - 'in transaction', or 'not in
>> transaction'. When you create the connection it starts off as 'not'.
>>
>> When you call cur.execute(), it checks
Ulli Horlacher wrote:
> With
>
> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|')
>
> I get no more error.
Of course, this is the writing client.
Now I have a small problem with the reading client.
This code works so far:
sfo = sock.makefile('r')
taro = tarfile.open(fil
On Thu, 11 Feb 2016 14:29:04 +, cl wrote:
> I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu
> 15.10.
>
> I have already written something using wxPython directly so I have the
> basics (of my Python skills and the environment) OK I think.
>
> I am having a lot of troubl
Hello,
I changed
PORT = 27017
to
PORT = 5.
I am not getting the error anymore. But I am still unable to insert the data
into MongoDB.
On Thursday, February 11, 2016 at 4:12:30 PM UTC+1, Arjun Srivatsa wrote:
> Hi guys. I am basically transferring the data from PLC to PC (where
On 2016-02-11 15:12, Arjun Srivatsa wrote:
Hi guys. I am basically transferring the data from PLC to PC (where the Python
API runs) but I'm unable to insert into MongoDB thereafter. When I run the
Python script on IDLE, the output is
Hello World!
Traceback (most recent call last): File "C:\Use
Hi guys. I am basically transferring the data from PLC to PC (where the Python
API runs) but I'm unable to insert into MongoDB thereafter. When I run the
Python script on IDLE, the output is
Hello World!
Traceback (most recent call last): File "C:\Users\SRA2LO\Desktop\API.py", line
32, in s.bi
I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu
15.10.
I have already written something using wxPython directly so I have the
basics (of my Python skills and the environment) OK I think.
I am having a lot of trouble getting beyond the first hurdle of
creating a trivial Pytho
Chris Angelico wrote:
> Sounds like tarfile needs a seekable file. How big is this file you're
> reading?
No limits. It can be many TBs...
The use case is:
http://fex.rus.uni-stuttgart.de:8080/
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mai
Ulli Horlacher wrote:
> I have:
>
> sock = socket.create_connection((server,port))
> bs = kB64
> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w')
>
>
>
> Traceback (most recent call last):
> (...)
> File "./fexit.py", line 1838, in sex_send
> taro = tarf
On 11/02/2016 07:46, blindanag...@nowhere.net wrote:
On 10/02/2016 23:05, Mike S wrote:
On 2/10/2016 5:05 AM, Mark Lawrence wrote:
[snip]
Have you seen this?
http://www.davidbaumgold.com/tutorials/set-up-python-windows/
I have now, but I'm perfectly happy with the free versions of Visual
S
On Thu, Feb 11, 2016 at 11:53 PM, Ulli Horlacher
wrote:
> I have:
>
> sock = socket.create_connection((server,port))
> bs = kB64
> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w')
>
>
>
> Traceback (most recent call last):
> (...)
> File "./fexit.py", line 1838, in sex_send
On 2016-02-11 12:53, Ulli Horlacher wrote:
Antoon Pardon wrote:
> (How) can I read a tar file from a (tcp) socket?
> I do not have a pathname but a socket object from socket.create_connection
# First you construct a file object with makefile.
fo = socket.makefile()
# Then you use the fileob
Antoon Pardon wrote:
> > (How) can I read a tar file from a (tcp) socket?
> > I do not have a pathname but a socket object from socket.create_connection
>
> # First you construct a file object with makefile.
>
> fo = socket.makefile()
>
> # Then you use the fileobj argument with tarfile.open.
Nagy László Zsolt wrote:
> I ran into a problem today where I had to determine the mean point
> between two datetimes. Here is an example:
>
start = datetime.datetime(2016,2,11)
stop = datetime.datetime.now()
mean = start + (stop-start)*0.5
> Traceback (most recent call last):
>
On Feb 10, 2016, at 1:23 PM, "Sven R. Kunze" wrote:
> Hi Cem,
>
> On 08.02.2016 02:37, Cem Karan wrote:
>> My apologies for not writing sooner, but work has been quite busy lately
>> (and likely will be for some time to come).
>
> no problem here. :)
>
>> I read your approach, and it looks p
On Thu, Feb 11, 2016 at 9:39 PM, Nagy László Zsolt wrote:
> I have checked and it does work with Python 3. But it does not work with
> Python 2 - is there a good reason for this?
Mainly that Python 3 has had six years of development since Python
2.7, and Python 2 has been getting only bugfixes an
On 02/11/2016 09:31 AM, Ulli Horlacher wrote:
> https://docs.python.org/2/library/tarfile.html says:
>
> tarfile.open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
>
> Return a TarFile object for the pathname name.
>
>
> (How) can I read a tar file from a (tcp) socket?
> I do not
I ran into a problem today where I had to determine the mean point
between two datetimes. Here is an example:
>>> start = datetime.datetime(2016,2,11)
>>> stop = datetime.datetime.now()
>>> mean = start + (stop-start)*0.5
Traceback (most recent call last):
File "", line 1, in
TypeError: unsuppo
Have you tried socket.makefile() method?
--
https://mail.python.org/mailman/listinfo/python-list
Good Morning,
I welcome feedback and suggestions for libraries or resources in order to
automate the following:
1. Given a directory of CSV files (each containing an address field)
a. Read each CSV file
b. Use address instance in row as part of a query and send request to
external API
On 2/10/2016 11:46 PM, blindanag...@nowhere.net wrote:
On 10/02/2016 23:05, Mike S wrote:
On 2/10/2016 5:05 AM, Mark Lawrence wrote:
[snip]
Have you seen this?
http://www.davidbaumgold.com/tutorials/set-up-python-windows/
I have now, but I'm perfectly happy with the free versions of Visual
"Chris Angelico" wrote in message
news:CAPTjJmor8dMv2TDtq8RHQgWeSAaZgAmxK9gFth=oojhidwh...@mail.gmail.com...
So really, the question is: Is this complexity buying you enough
performance that it's worthwhile?
Indeed, that is the question.
Actually, in my case it is not quite the question.
F
On Thu, Feb 11, 2016 at 6:59 PM, dieter wrote:
> In my context (web applications), I strongly discourage this use - at least
> when "conn" does not handle subtransactions properly.
>
> In a web application, the main transaction should in general be controlled
> at the request level: a request shou
https://docs.python.org/2/library/tarfile.html says:
tarfile.open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
Return a TarFile object for the pathname name.
(How) can I read a tar file from a (tcp) socket?
I do not have a pathname but a socket object from socket.create_conn
Israel Brewster writes:
> I am working on implementing a Python DB API module, and am hoping I can get
> some help with figuring out the workflow of handling transactions. In my
> experience (primarily with psycopg2) the workflow goes like this:
>
> - When you open a connection (or is it when y
Chris Angelico writes:
> ...
> When I advise my students on basic databasing concepts, I recommend
> this structure:
>
> conn = psycopg2.connect(...)
>
> with conn, conn.cursor() as cur:
> cur.execute(...)
>
> The transaction block should always start at the 'with' block and end
> when it exit
60 matches
Mail list logo