You should look into using PyQt or PySide. They are python bindings for
the very popular Qt GUI framework.
On Wed, Oct 5, 2016 at 2:33 PM, Beverly Howard wrote:
> >> if it is a pi controlling the system I would tend towards controlling it
> from a web page via the network. to keep it updating
Define your colors as actual number variables instead of a string
color = (255,0,0)
color2 = (0,0,255)
Then use argument expansion to pass them in as separate arguments to the
function
colorFunction(*color)
Brendan
On Wed, Oct 5, 2016 at 12:17 PM, John McKenzie
wrote:
>
> Hell
> a = 1
if condition:
print(a) # UnboundLocalError: local 'a' referenced before assignment
a += 1
For-loops are no different. Making them their own namespace is a very
strange thing to do, it would mean you couldn't re-bind a value inside a
for-loop:
count = 0
for x in sequence:
cou
Yes, loops don't have their own scope. Indeed, very few flow elements in
python -- if, with, try/except -- create a new scope. In that sense, it's
fairly consistent, but can be unexpected for people that have used
languages with many nested scopes.
The lambda behavior is a common gotcha - there
> Splitting it up would make it slower to load.
It's usually the opposite. When packages are split up, you only have to
load the specific portions you need. Putting it all in a single module
forces you to always load everything.
On Fri, Sep 23, 2016 at 11:59 PM, Lawrence D’Oliveiro <
lawrenced.
Unless you're actually distributing python (as in, the interpreter or it's
source code), you don't need to include the python license or the copyright
notice. You also don't need a Contributor agreement just to distribute a
python library. That is more for people who are contributing to core
Pyth
unction is concerned.)
On Tue, Sep 13, 2016 at 11:31 AM, Chris Angelico wrote:
> On Wed, Sep 14, 2016 at 4:28 AM, Brendan Abel <007bren...@gmail.com>
> wrote:
> > This looks like a decorator function that optionally accepts arguments to
> > change the behavior.
>
&g
This looks like a decorator function that optionally accepts arguments to
change the behavior.
You can safely ignore the warning form PyCharm. the variable won't be
shadowed it's included in the function signature of the inner function.
A lot of times, the outside decorator will just use the *ar
Generally, all your unittests will be inside a "tests" directory that lives
outside your package directory. That directory will be excluded when you
build or install your project using your setup.py script. Take a look at
some popular 3rd party python packages to see how they structure their
proj
You could create your own generator that wraps enumerate
def reverse_enumerate(iterable):
for i, val in enumerate(reversed(iterable)):
yield len(iterable) - 1 - i, val
for i, val in reverse_enumerate(x):
...
On Wed, Jul 20, 2016 at 10:42 AM, Ian Kelly wrote:
> I had occasion to
A lot of these arguments and points have already been made and hashed out
on the python-dev list. There's a very good article that one of the python
core developers wrote about the decision to move to github
http://www.snarky.ca/the-history-behind-the-decision-to-move-python-to-github
Basically,
t least the "from x.y.z import a" forms of imports,
yet they don't work the same as "import x.y.z.a".
//Brendan
--
https://mail.python.org/mailman/listinfo/python-list
Is there a better way of structuring this to ensure I process the
interrupt and not get interrupt overrun?
Is using select only in the mainloop, with multiple file descriptors, a
better way of doing things, so that I can process the file descriptor of
interest first, before any others if set?
I have a relatively large python package that has several cyclical
dependencies. The cyclical dependencies typically aren't a problem so long as
I'm just importing modules, and not named attributes (ie. function, class,
globals), which may not be defined at a given point in the import routine
few improved
things (eg. no "self", no ":", ...)
Possible negatives are:
* Requires either .NET or Mono frameworks.
* lack of 3rd party libraries ??
Cheers, Brendan.
--
http://mail.python.org/mailman/listinfo/python-list
not quite like that. I'd like to upgrade to 2.5.6 (for one particular
mature application), but unfortunately I'm stuck with 2.5.4 as I don't
really want to have to build (and hopefully get it right) on my OS X box.
Cheers, Brendan.
--
http://mail.python.org/mailman/listinfo/python-list
(or
Mono), though the web pages do suggest they are also working on a
version that runs on JVM. Also third party libraries (e.g GUIs like wx)
may not be as good or available (yet) ??
http://cobra-language.com/docs/python/
http://cobra-language.com/docs/why/
-- Brendan.
--
http://mail.python.org/mailman/listinfo/python-list
> On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote:
>>
>> Any other arguments where Python has benefits over Cobra ??
>>
>> Cheers, Brendan.
>>
> Two questions:
> 1. Is Cobra Open Source?
> 2. The blog ended on October, did he run out o
be less significant over time.
I'm not sure about the .NET/Mono framework, whether that is good or
bad. Sounds good in some situations at least.
Any other arguments where Python has benefits over Cobra ??
Cheers, Brendan.
--
http://mail.python.org/mailman/listinfo/python-list
already done).
If I recall correctly, I had to specify the python interpreter to use.
It added a whole lot of paths to the PYTHONPATH variable which caused me
some grief. I ended up removing them all (or most of them) and it
worked fine after that.
Cheers, Brendan.
--
Brendan Simon
Since it seems the python motto is "Batteries included", then it would
seem to me that wxPython is the natural fit as it also has "Batteries
included" (e.g. accessibility, native look-n-feel, mature and evolving,
can produce simple or complex gui programs, etc, etc)
On Oct 25, 12:57 pm, Brendan wrote:
> I am posting here in the hopes the author of java2python will see it.
> Does j2py handle overloading of the __init__ constructor? For me it
> is calling __init__ and not calling the decorator overloaded __init__0.
Never mind. Moronic type mistake.
I am posting here in the hopes the author of java2python will see it.
Does j2py handle overloading of the __init__ constructor? For me it
is calling __init__ and not calling the decorator overloaded __init__0.
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 22, 2:21 pm, Peter Pearson wrote:
> On Fri, 22 Oct 2010 07:49:39 -0700 (PDT), Brendan wrote:
>
> [snip]
>
>
>
>
>
> > x.py
> > class X(object):
> > pass
>
> > y.py
> > import x
> > class Y(x.X):
> > pass
>
>
On Oct 23, 1:03 pm, Sean DiZazzo wrote:
> On Oct 22, 10:48 pm, Steven D'Aprano
> cybersource.com.au> wrote:
> > On Fri, 22 Oct 2010 22:03:38 -0700, Sean DiZazzo wrote:
> > > How can I assure him (and the client) that the transfer completed
> > > successfully like my log shows?
>
> > "It has worke
On Oct 22, 9:16 am, Dave Angel wrote:
> On 2:59 PM, Brendan wrote:> On Oct 21, 3:56 pm, Ethan
> Furman wrote:
> >>
> >> Because y.py has "from x import x" the x class from x.py is added to the
> >> y.py namespace.
>
> >> ~Ethan~- Hid
On Oct 22, 5:02 am, Steven D'Aprano wrote:
> On Thu, 21 Oct 2010 12:12:34 -0700, Brendan wrote:
> >> Because y.py has "from x import x" the x class from x.py is added to
> >> the y.py namespace.
>
> >> ~Ethan~- Hide quoted text -
>
> &g
On Oct 21, 3:56 pm, Ethan Furman wrote:
> Jonas H. wrote:
> > On 10/21/2010 08:09 PM, Brendan wrote:
> >> Two modules:
> >> x.py:
> >> class x(object):
> >> pass
>
> >> y.py:
> >> from x import x
> >> class y(x
On Oct 21, 3:47 pm, Carl Banks wrote:
> On Oct 21, 11:09 am, Brendan wrote:
>
>
>
>
>
> > Two modules:
> > x.py:
> > class x(object):
> > pass
>
> > y.py:
> > from x import x
> > class y(x):
> > pass
>
> > Now
Two modules:
x.py:
class x(object):
pass
y.py:
from x import x
class y(x):
pass
Now from the python command line:
>>> import y
>>> dir(y)
['__builtins__', '__doc__', '__file__', '__name__', '__package__',
'x', 'y']
I do not understand why class 'x' shows up here.
--
http://mail.python.o
On 14/10/10 5:17 PM, python-list-requ...@python.org wrote:
> Subject:
> Whining about "struct"
> From:
> Tim Roberts
> Date:
> Wed, 13 Oct 2010 21:30:38 -0700
>
> To:
> python-list@python.org
>
>
> I have a bad memory. I admit it. Because of that, the Python "help"
> system is invaluable to me.
2010/9/29 Lawrence D'Oliveiro :
> In message , Brendan
> Miller wrote:
>
>> It seems that characters not in the ascii subset of UTF-8 are
>> discarded by c_char_p during the conversion ...
>
> Not a chance.
>
>> ... or at least they don't print out
utton = gtk.Button(label)
or possibly:
label = 'True' if fill else 'False'
button = gtk.Button(label)
or using a dict for label lookup:
label = { True : 'True', False : 'False' }
button = gtk.Button(label[fill])
Cheers, Brendan.
--
http://mail.python.org/mailman/listinfo/python-list
n the ascii subset of UTF-8 are
discarded by c_char_p during the conversion, or at least they don't
print out when I go to print the string.
Does python not support utf-8 strings? Is there some other way I
should be doing the conversion?
Thanks,
Brendan
--
http://mail.python.org/mailman/listi
, then
search for './component', './component/name' and so on. It's a bit
ugly, but heaps better than using minidom :)
Cheers, Brendan.
On 31/08/10 6:57 PM, Nitin Pawar wrote:
> Try using getroot()
>
> I think your root is components so its searching in root
und ok :)
comp = root.find( './/component' )
name = root.find( './/name' )
print 'comps =', comps
print 'comp =', comp
print 'name =', name
Thanks, Brendan.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 7, 3:00 pm, MRAB wrote:
> Brendan Abel wrote:
> >>>> One thing that would be very useful is how to maintain something that
> >>>> works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up
> >>>> versions below 2.6 is out of the ques
> > > One thing that would be very useful is how to maintain something that
> > > works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up
> > > versions below 2.6 is out of the question for most projects with a
> > > significant userbase IMHO. As such, the idea of running the python 3
> >
python -i myscript.py
almost does what I want. The only problem is if I exit with exit(0) it
does *not* enter interactive mode. I have to run off the end of the
script as near as I can tell. Is there another way to exit without
breaking python -i?
On Thu, May 20, 2010 at 4:57 PM, Brendan Miller
I have a python script that sets up some environmental stuff. I would
then like to be able to change back to interactive mode and use that
environment. What's the best way to do that?
--
http://mail.python.org/mailman/listinfo/python-list
While I think most of the disagreement in this long thread results
from different beliefs in what "freedom" means, I wanted to add, that
most of the responses that argue that the MIT license permits the user
more freedom than the GPL, suffer from the broken window fallacy.
This fallacy results from
On Apr 30, 9:04 am, Jabapyth wrote:
> At least a few times a day I wish python had the following shortcut
> syntax:
>
> vbl.=func(args)
>
> this would be equivalent to
>
> vbl = vbl.func(args)
>
> example:
>
> foo = "Hello world"
> foo.=split(" ")
> print foo
> # ['Hello', 'world']
>
> and I guess
On Apr 28, 11:44 am, Richard Lamboj wrote:
> Hello,
>
> is there any way to get the name from the actual called function, so that the
> function knows its own name?
>
> Kind Regards,
>
> Richi
If you want to get the function name from within the function itself,
check out the inspect module.
http
On Apr 27, 7:20 pm, goldtech wrote:
> Hi,
>
> This is undoubtedly a newbie question. How doI assign variables
> multiline strings? If I try this i get what's cited below. Thanks.
>
> >>> d="d
> d"
> >>> d
>
> Traceback (most recent call last):
> File "", line 1, in
> NameError: name 'd'
On Thu, Apr 22, 2010 at 7:49 AM, Zvezdan Petkovic wrote:
>
> On Apr 21, 2010, at 6:29 PM, Brendan Miller wrote:
>
>> Here's the method I was using. Note that tmp_char_ptr is of type
>> c_void_p. This should avoid the memory leak, assuming I am
>> interpreting the
p_val
On Wed, Apr 21, 2010 at 3:15 PM, Brendan Miller wrote:
> I have a function exposed through ctypes that returns a c_char_p.
> Since I need to deallocate that c_char_p, it's inconvenient that
> ctypes copies the c_char_p into a string instead of giving me the raw
> pointe
e the string itself after the copy... which I
doubt.
Is there some way to tell ctypes to return an actual c_char_p, or is
my best bet to return a c_void_p and cast to c_char_p when I'm reading
to convert to a string?
Thanks
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
from errcheck.
Thanks,
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 20, 2010 at 11:38 AM, Robert Kern wrote:
> On 4/20/10 1:09 PM, Brendan Miller wrote:
>>
>> Python provides a GNU readline interface... since readline is a GPLv3
>> library, doesn't that make python subject to the GPL? I'm confused
>> because
Python provides a GNU readline interface... since readline is a GPLv3
library, doesn't that make python subject to the GPL? I'm confused
because I thought python had a more BSD style license.
Also, I presume programs written with the readline interface would
still be subject to GPL... might want t
On Wed, Apr 14, 2010 at 12:12 PM, Mark Dickinson wrote:
> On Apr 14, 7:09 pm, Brendan Miller wrote:
>> I'm using python 2.5.2.
>>
>> I have a ctypes function with argtypes like this:
>>
>> _create_folder.argyptes = [c_void_p, c_int]
>
> Is that
an
integer argument?
I didn't see this behavior documented when I read through
http://docs.python.org/library/ctypes.html, maybe I'm just missing
it... if that's the case a reference would be appreciated.
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
a circular reference, so that the __del__ shouldn't be
an issue.
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
re's any documented order that reference counts
get decremented when a module is released or when a program terminates.
What I would expect is "reverse order of definition" but obviously that's not
the case.
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
Is there any difference whatsoever between a raw string beginning with
the captical R or one with the lower case r e.g. r"string" vs
R"string"?
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Dec 18, 2009 at 2:47 PM, Bearophile wrote:
> Brendan Miller:
>> I agree though, it doesn't matter to everyone and anyone. The reason I
>> was interested was because i was trying to solve some specific
>> problems in an elegant way. I was thinking it would be c
On Fri, Dec 18, 2009 at 10:39 AM, Carl Banks wrote:
> On Dec 17, 10:00 pm, Brendan Miller wrote:
>> On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano
>>
>> wrote:
>> > On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote:
>>
>> >> I was th
On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano
wrote:
> On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote:
>
>> I was thinking it would be cool to make python more usable in
>> programming competitions by giving it its own port of the STL's
>> algori
On Thu, Dec 17, 2009 at 8:41 AM, Anh Hai Trinh wrote:
>> I have a couple of thoughts:
>> 1. Since [:] by convention already creates a copy, it might violate
>> people's expectations if that syntax were used.
>
> Indeed, listagent returns self on __getitem__[:]. What I meant was
> this:
>
> x = [0
On Wed, Dec 16, 2009 at 12:38 PM, Anh Hai Trinh wrote:
> On Dec 16, 2:48 pm, Brendan Miller wrote:
>
>> No, that's what I'm getting at... Most of the existing mutating
>> algorithms in python (sort, reverse) operate over entire collections,
>> not partia
On Wed, Dec 16, 2009 at 4:16 AM, Paul Rudin wrote:
> Steven D'Aprano writes:
>
>
>> I'm sympathetic to your request for list views. I've often wanted some
>> way to cleanly and neatly do this:
>>
>> for item in seq[1:]:
>> process(item)
>>
>> without making an unnecessary copy of almost all o
On Dec 15, 6:17 pm, Jennifer wrote:
> I am writing a program that has a requirement for a timeout of
> retrlines after the connection established. I just wonder if timeout
> of ftplib.FTP('.xxx.com',username,password,timeout) will work for
> retrlines method after the connection established.
On Tue, Dec 15, 2009 at 9:09 PM, Terry Reedy wrote:
> On 12/15/2009 10:39 PM, Brendan Miller wrote:
>> I'm wondering if anyone has done work towards creating more powerful
>> iterators for python, or creating some more pythonic equivalent.
>
> For sequences, integer i
sn't really handle forward and bidirectional iterators...
which I guess would be good for algorithms that operator over disk
base datastructures...
Anyone else had similar thoughts?
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
I was quite happy to see that ftplib in Python 2.6 now has a timeout
parameter. With large file downloads my script would often hang,
presumably from timing out. Now that there is a timeout parameter, how
would I detect when a timeout occurs?
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 23, 12:21 pm, Steve Howell wrote:
> On Nov 23, 7:22 am, Brendan wrote:
>
> > In KirbyBase there is a method that uses string exceptions for
> > control, even though it has a defined exception. Is there any reason
> > the string exceptions below could not be re
In KirbyBase there is a method that uses string exceptions for
control, even though it has a defined exception. Is there any reason
the string exceptions below could not be replaced?
i.e. in code below replace:
raise "No Match"
with:
raise KBError()
and
except 'No Match':
with:
except KBError:
I h
On Jun 17, 1:33 pm, Tim Chase wrote:
> Brendan wrote:
> > What is the difference on exit() and sys.exit() when called in the
> > main body of a script? From the command line they seem to have the
> > same effect.
>
> In Python <=2.4 you had to use sys.exit() becaus
What is the difference on exit() and sys.exit() when called in the
main body of a script? From the command line they seem to have the
same effect.
Aside: Just used a python dictionary in which the keys were compiled
regular expressions. Provided a very elegant solution. Have to love it.
--
http:/
Can someone please explain what is happening in the output below? The
number 3 never gets printed. Does Python make a copy of a list before
it iterates through it?:
>>> e = range(1,5)
>>> for i in e:
print i
if i == 2 :
e.remove(i)
1
2
4
>>> e
[1, 3, 4]
--
http://
On Jun 9, 9:54 am, Brendan wrote:
> I was hoping to use pywin32 to automate some rather tedious filling in
> of Word forms. I thought the process would be analogous to dealing
> with xml documents or DOM but find myself somewhat lost in the word
> object reference
I was hoping to use pywin32 to automate some rather tedious filling in
of Word forms. I thought the process would be analogous to dealing
with xml documents or DOM but find myself somewhat lost in the word
object reference manual (http://msdn.microsoft.com/en-us/library/
bb244515.aspx) . I was hop
I was hoping to use pywin32 to automate some rather tedious filling in
of Word forms. I thought
--
http://mail.python.org/mailman/listinfo/python-list
I was hoping to use pywin32 to automate some rather tedious filling in
of Word forms. I thought
--
http://mail.python.org/mailman/listinfo/python-list
On May 25, 9:42 am, David Lyon wrote:
> On Sun, 24 May 2009 15:34:42 -0700 (PDT), Joana
> wrote:
>
> > I mantain Python on Windows, all installed packages are under c:
> > \Python25\Lib\site-packages. Now I have to build C libraries used by
> > python extensions and I am using cygwin, but I don't
What's the point of PyHeapTypeObject in Include/object.h? Why does the
layout of object types need to be different on the heap vs statically
allocated?
Thanks,
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
So it sounds like the options are PyInstaller, cx_freeze, and
bbfreeze. Has anyone used any of these, and knows which one works best
on linux?
--
http://mail.python.org/mailman/listinfo/python-list
> platform. AFAICT there are RHEL4 rpms for these, and RHEL4 already comes
> with its own version of Python so it seems you are attempting to make
> things much more difficult than need be.
There are no rpm's in our repository for the third party modules I
need... If it was that easy I wouldn't be
esults and
hand them off in a convenient way.
Thanks,
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Feb 18, 2009 at 1:34 AM, Chris Rebert wrote:
> On Wed, Feb 18, 2009 at 1:11 AM, Brendan Miller wrote:
>> I'm just curious whether PyYaml is likely to end up in the standard
>> library at some point?
>
> I don't personally have a direct answer to your quest
I'm just curious whether PyYaml is likely to end up in the standard
library at some point?
--
http://mail.python.org/mailman/listinfo/python-list
Like the title says.
--
http://mail.python.org/mailman/listinfo/python-list
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I have several version of python running side by side on my ubuntu
install (2.5,2.6,3.0).
I'm installing a module with a setup.py script, in this case
logilab-common, so that I can get pylint going. However, I need to
install into python 2.6, but by d
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
If I:
import sys
sys = sys.version
This executes find but:
import sys
def f():
sys = sys.version
This gives an error indicating that the sys on the right hand side of =
is undefined. What gives?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
On Wed, Jan 21, 2009 at 8:19 AM, Scott David Daniels
wrote:
> Brendan Miller wrote:
>>
>> On Tue, Jan 20, 2009 at 10:03 PM, Paul Rubin
>> <"http://phr.cx"@nospam.invalid> wrote:
>>>
>>> Of course I'm aware of the LOCK prefix but
On Tue, Jan 20, 2009 at 10:03 PM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> "Rhodri James" writes:
>> You asked a question about CPUs with atomic update, strongly implying
>> there were none. All I did was supply a counter-example,
>
> Well, more specifically, atomic update without loc
On Tue, Jan 20, 2009 at 6:29 PM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> "Rhodri James" writes:
>> > What cpu's do you know of that can atomically increment and decrement
>> > integers without locking?
>>
>> x86 (and pretty much any 8080 derivative, come to think of it).
>
> It would
On Tue, Jan 20, 2009 at 3:46 AM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> s...@pobox.com writes:
>> Carl, I'm quite unfamiliar with Boost and am not a C++ person, so may have
>> read what you saw but not recognized it in the C++ punctuation soup. I
>> couldn't find what you referred to
Maybe I'm missing something here but a lock free algorithm for
reference counting seems pretty trivial. As long as you can atomically
increment and decrement an integer without locking you are pretty much
done.
For a reference implementation of lock free reference counting on all
common platforms
> Constants would be a nice addition in python, sure enough.
My original question was about PEP-8 and whether it is pythonic to use
all caps to denote a variable that shouldn't be changed. More of a
style question than a language question.
I actually think *enforcing* constantness seems to go aga
Yes, I also recently noticed the bug in python's parser that doesn't
let it handle squigly braces and the bug in the lexer that makes white
space significant. I'm surprised the dev's haven't noticed this yet.
On Sat, Jan 17, 2009 at 2:09 AM, v4vijayakumar
wrote:
> I saw some code where someone is
On Sat, Jan 17, 2009 at 7:57 PM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> alex23 writes:
>> Here's an article by Guido talking about the last attempt to remove
>> the GIL and the performance issues that arose:
>>
>> "I'd welcome a set of patches into Py3k *only if* the performance for
>> The goals of the pypy project seems to be to create a fast python
>> implementation. I may be wrong about this, as the goals seem a little
>> amorphous if you look at their home page.
>
> The home page itself is ambiguous, and does oversell the performance
> aspect. The *actual* goal as outlined
xplained *why* they are doing
the things they are doing.
Anyway, I can tell this is the sort of question that some people will
interpret as rude. Asking hard questions is never polite, but it is
always necessary :)
Thanks,
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
> FOO = 1
>
> def f(x=FOO):
> ...
>
>
> Use this instead:
>
> def f(x=1):
> ...
I tend to use constants as a means of avoiding the proliferation of
magic literals for maintenance reasons... Like say if your example of
FOO would have been used in 10 places. Maybe it is more pythonic to
simply
ythonic code... so I thought I'd see what the consensus is.
Brendan
--
http://mail.python.org/mailman/listinfo/python-list
Okay, found it on my own. ftp.voidresp() is what is needed, and it
does _not_ seem to be in the Python documentation for ftplib.
On Jan 8, 1:58 pm, Brendan wrote:
> I am trying to download a file within a very large zipfile. I need two
> partial downloads of the zipfile. The first to g
I am trying to download a file within a very large zipfile. I need two
partial downloads of the zipfile. The first to get the file byte
offset, the second to get the file itself which I then inflate.
I am implementing the partial downloads as follows:
con = ftp.transfercmd('RETR ' + filename, res
I would like zipfile.is_zipfile(), to operate on a cStringIO.StringIO
string buffer, but is seems only to accept file names as arguments.
Should it not be able to handle string buffers too?
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 12, 11:36 am, Brendan wrote:
> On Dec 12, 10:46 am, Brendan wrote:
>
>
>
>
>
> > On Dec 12, 10:25 am, Brendan wrote:
>
> > > I am fooling around with accessing contents of zip files online. I
> > > download the tail end of the zip and use z
1 - 100 of 146 matches
Mail list logo