tra-index-url
https://pypi.org/simple ngfp==0.1.5.post3
thank you and cheers,
ant
--
https://mail.python.org/mailman/listinfo/python-list
dieter wrote:
> ant writes:
>> ...
>> yet not quite all the way yet. i run the
>> commands to make the sdist and wheels and upload
>> it using twine to my test account, but when
>> i install it and try to run it the ngfp.py is
>> not found (i'
ant wrote:
...
script was there, but the package was not actually
installed.
after installing again i get:
=
(env) me@ant(26)~/src/test$ ngfp
Traceback (most recent call last):
File "/home/me/src/env/bin/ngfp", line 7, in
from ngfp import main
ImportError: cannot i
ant wrote:
> ant wrote:
>
> ...
>
> script was there, but the package was not actually
> installed.
>
> after installing again i get:
>
>=
>
> (env) me@ant(26)~/src/test$ ngfp
> Traceback (most recent call last):
> File "/home/me/src/env/bin
dieter wrote:
> ant writes:
>> ant wrote:
>> ...
>>> (env) me@ant(26)~/src/test$ ngfp
>>> Traceback (most recent call last):
>>> File "/home/me/src/env/bin/ngfp", line 7, in
>>> from ngfp import main
>>> ImportError:
e to take
the code and use it however you like:
https://salsa.debian.org/ant-guest/gfpoken-in-python
ant
--
https://mail.python.org/mailman/listinfo/python-list
dieter wrote:
> ant writes:
>> ...
>> in order to get this far below i had to edit each
>> file and put a try: except: around each import
>> statment checking if the module could be found
>> like (as an example):
>>
>> try:
>> import config
dieter wrote:
...
thank you for your help. :) i finally worked through
the changes needed at last.
my current package in testing PyPI is at:
https://test.pypi.org/project/ngfp/
which uses my code from:
https://salsa.debian.org/ant-guest/gfpoken-in-python
i ended up needing
cd $NGFP_SRC_HOME
twine upload --repository testpypi dist/*
=
note: it may take a while for what you uploaded to be made
available for download again even if it reflected in your
project page. sometimes it has been as long as a half hour
or more before it comes down. other times it has only been
a few minutes.
hope this helps...
ant
--
https://mail.python.org/mailman/listinfo/python-list
ant wrote:
...
> .pypirc
>=
> [distutils]
> index-servers=
> testpypi
>
> [testpypi]
> repository: https://test.pypi.org/legacy/
> username: UserName
> password: Password
>=
>
>
> and my upload command is:
>
>
>=
> #!/bin
rsions of
setuptools, wheel and twine
$ pip install --upgrade setuptools
$ pip install --upgrade wheel
$ pip install --upgrade twine
i just used it earlier today... worked fine for me.
is your account there and verified?
ant
--
https://mail.python.org/mailman/listinfo/python-list
>> i just used it earlier today... worked fine for me.
>> is your account there and verified?
>
> Yes, I have an account on TestPyPI and is verified.
try the above...
ant
--
https://mail.python.org/mailman/listinfo/python-list
sntshkm...@gmail.com wrote:
>> $ pip install readme_renderer[md]
>
> Thanks a lot for this, I wasn't able to figure it out earlier.
does it work ok now? got the upload to go to pypitest?
ant
--
https://mail.python.org/mailman/listinfo/python-list
:
1. posix/other linux sytems (perhaps Macs fit into this anways)
2. Macs
3. Windows
luckily i do have other examples of python 3 programs which
seem to be multiple platform oriented that i can look at and
see what they've done. so i won't be forever lost in the
wilderness
> You might also look at the docs for HTML::Mason (www.masonhq.com) to
> get a look at a reasonably mature template system, even if you don't
> plan to use it (because it's in Perl and not Python). I'm not sure
if
> CherryPy is directly comparable. I haven't yet used any of the
Python
> template
> Is there a way in python to say, "hey, catch everything but these two"?
>>> try:
... raise AttributeError
... except Exception, ex:
... if isinstance(ex, AttributeError):
... print "Won't catch it!"
... raise ex
...
Won't catch it!
Traceback (most recent call last):
File "", line
sfo wrote:
> how do i create a hash of hash similar to perl using dict in python
> $x{$y}{z}=$z
Haven't done any Perl in a long while (thankfully ;-) ) so I'm not
quite sure on your syntax there, but here's how to do it in Python:
>>> x = {'y': {'z': 'My value'}}
>>> x['y']['z']
'My value'
Much
> > try:
> > # Do some stuff
> > except Exception, err:
> > if err not in (DontCatchMe1, DontCatchMe2):
> > # Handle err
> >
> > HTH,
> > ~Simon
>
> Dang! not only did somebody else beat me to it, but my code is wrong
> and theirs correct.
Ignoring the fact you haven't re-raised
> I'm using a badly documented module and therefore need to find out
> about how to access the elements in a list.
> (I need to do this in Python 1.5.3)
I presume this is the same in 1.5 use dir():
>>> import os
>>> dir(os)
['F_OK', 'O_APPEND', 'O_BINARY', 'O_CREAT', 'O_EXCL', 'O_NOINHERIT',
'O_
> Yes, it is possible to name crappy accessors too (e.g set_tmp/get_tmp).
> But developers tend to pay more attention to given methods/functions
> less crappy names, at least when compared to data attributes. This
In my experience of getters and setters in Java, most developers choose
attribute n
John Henry wrote:
> Hi list,
>
> Is there a more elagant way of doing this?
>
> # logflags is an array of logicals
> test=True
> for x in logflags:
>test = test and x
> print test
There's reduce, but it's not as explicit, and see F's post RE
efficiency:
>>> x = [True, True, True]
>>> y = [Tr
We seem to be flogging a dead horse now. Is the following a fair
summary:
Q. What is the Pythonic way of implementing getters and setters?
A. Use attributes.
Quote: "I put a lot more effort into choosing method and function
names"
Wisdom: Python is a different paradigm from (e.g.) Java w.r.t.
a
> So What should I do to get the exact value(here the value after
> 'href=') in any case even if the
>
> tags are like these? >>
>
>
> -OR-
>
> -OR-
>
The following should do it:
expr = r'http://mail.python.org/mailman/listinfo/python-list
Christophe wrote:
> ... you haven't beed using enouth generator expressions ...
You should get yourself to the doctors about that cold dude. :-)
--
http://mail.python.org/mailman/listinfo/python-list
> fout = open('somefile','w')
> for line in convertedData:
> fout.write("%s\n" % line)
> fout.close()
>
> -- or --
>
> fout = open('somefile','w')
> fout.write("%s" % '\n'.join(convertedData))
> fout.close()
I shouldn't think it matters too much which of these you use - time
them and see what h
Whoops:
> outfile = open(out_f)
outfile = open(out_f, 'w')
may be better ;-)
--
http://mail.python.org/mailman/listinfo/python-list
Ed Jensen wrote:
> > where the compiler prevents you from accessing
> > private variables, but the runtime allows access to these very variables
> > via reflection?
>
> Java does not allow access to private members via reflection.
Yes it does. You can call setAccessible(true) on the Method objec
Came across this article this afternoon - thought it may be of interest
to some of those following this thread...
http://www.devx.com/opensource/Article/31593/0/page/2
--
http://mail.python.org/mailman/listinfo/python-list
> # python 2.5
> >>> a, b = "", 0
> >>> a if False else b
> 0
> >>> a if True else b
> ''
>
> Time to tear out that page. Really.
Not quite - 2.5 hasn't been released in its final version yet, and many
projects I should imagine will take a while to upgrade.
--
http://mail.python.org/mailman/lis
> At work I have a directory of about 50 large text files and i need to
> search thru them for 10 separate words and print how many were found
> in total.
>
> I am new to python so could somebody please show me some sample code
> that would help me get this done and i will work from that.
Assumin
Traveler wrote:
> yes this is great i will work from that but how can i use say a list
> to pass 10 words?
>
> mylist = ['word1','word2','word3','word4']
...
> >for root, dirs, files in os.walk('~/mydir'):
> >for file in [f for f in files if f.endswith(".txt")]:
> >fh = open(file)
> >
Enabling directory recursion:
> from os import listdir, mkdir
> from os.path import join, basename, isfile
> from zipfile import ZipFile
>
> def zip_dir(path, output_path, include_hidden=True):
> try:
> mkdir(output_path)
> except OSError, e:
> if e.errno == 17: # Path exis
> But what if there's not only commas, but also periods and semicolons? I
> want to find words between 2 near by punctuations. I think it would make
> it difficult to use split instead of regular expression.
You could use re.split(r"\W", text) instead of the string split method
to split on all non
GHUM wrote:
> I need to split a text at every ; (Semikolon), but not at semikolons
> which are "escaped" within a pair of $$ or $_$ signs.
Looking at you example SQL code, it probably isn't possible with
regexes. Consider the code:
$$
blah blah
...
$$
blah;
xxx
$$
blah
blah
$$
Regexes aren't c
Harry George wrote:
> [snip stuff about how to set emacs up as your IDE]
Not sure which post you read, but the OP of this thread was asking
about continuous integration, not integrated development environments.
i.e. tools to *automatically* check out code when the repository has
changed, build it
John Machin wrote:
> Lad wrote:
> > Hello,
> > what is the best /easest way how to get number of hours and minutes
> > from a timedelta object?
...
> >>> diff.days
> 0
> >>> diff.seconds
> 52662
> >>> diff.microseconds
> 922000
> >>> minutes = (diff.seconds + diff.microseconds / 100.0) / 60.0
John Machin wrote:
...
> 1. If that's what he wanted, it was a very peculiar way of asking. Do
> you suspect that he needs to be shown how to conver 877.7... minutes
> into hours, minutes and seconds???
Chill dude, It wasn't an attack :-)
The datetime class has hour, minute and second attributes
Martin Höfling wrote:
> Hi there,
>
> is it possible to put the methods of a class in different files? I just
> want to order them and try to keep the files small.
The editor leo (http://webpages.charter.net/edreamleo/front.html) gives
you a way of handling large files in this way without actuall
daniel Van der Borght wrote:
> Programming a screensaver in Python, where and/or how di I start ?
Google for "python screensaver". The first link has a module to use...
--
http://mail.python.org/mailman/listinfo/python-list
daniel Van der Borght wrote:
> are you Chris ? anyway : thank you...
No - I really am Ant. :-)
--
http://mail.python.org/mailman/listinfo/python-list
> getattr(heading, "process")(file_ptr)
...
> Is there an alternatice to getattr() that will solve my problem, or is
> there another way to do it.
How about:
eval("%s.process(%s)" % (heading, file_ptr))
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Yes, I have been ruined for the last 5 years with Java and C#. Perl was
> my only salvation, but now I can't read the programs I wrote.
ROFL! That's got to be a contender for Quote of the week.
--
http://mail.python.org/mailman/listinfo/python-list
a wrote:
> i m building an rss reader and i want you suggestions for datastructure
> for keeping read and unread list for each use
> i m assuming it will be very sparse
A dictionary for each site seems to be the obvious choice, mapping the
article ID to True or False.
--
http://mail.python.org
[EMAIL PROTECTED] wrote:
> I was wondering what the approximate amount of memory needed to load a
> Python interpreter (only, no objects, no scripts, no nothing else) in a
> Linux 2.6 environment. According to ps, it appears to be 3312 bytes,
> which seems absurdly low to me. However, when I che
> > Are you sure ps is reporting in bytes not KB? The bare interpreter in
> > Windows is 3368KB.
>
> Where did you get that from? With Python 2.4.3, on my machine (Win XP
> SP2):
>
> C:\junk>dir \python24\python*
> [snip]
> 29/03/2006 05:35 PM 4,608 python.exe
> 29/03/2006 05:35 PM
Try running the following example - it should help clear up what is
going on:
class Base:
def __init__(self):
print "Initializing base"
def shouldBeImplemented(self):
raise NotImplementedError
def hasDefaultImplementation(self):
print "Wey Hey!"
class A(Base):
John Salerno wrote:
> I'd really like to learn vim, but I spent days just trying to figure out
> how to get the syntax highlighting and indentation working, where these
> settings are and how to edit them, and it still doesn't work for me. It
> just feels so insurmountable that I can't even start
> such as tempname="\"..it says that the line is single qouted.
The others have addressed the escape issue I think. However it looks
like you want the funtionality of the os.path module. For example:
>>> import os.path as path
>>> filename = "/home/ant/te
Look at the following minimal example:
>>> import re
>>> p = re.compile(r"(:?Test) (String)")
>>> m = p.search("This is a Test String OK?")
>>> m.groups()
('Test', 'String')
I would have expected this to produce:
('String')
since (:?...) should be a non-capturing group. From the module
referenc
Ant wrote:
> Look at the following minimal example:
... (snip example that shows non-capturing group capturing)
Note I get the same results from python versions 2.4 and 2.5.
--
http://mail.python.org/mailman/listinfo/python-list
Just wrote:
> Try ?: instead of :?
Duh. Put it down to Friday afternoon!
:-\
Don't know what I was thinking that something as high profile as that
could slip through the net!!
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> Now quick kill your post before the effbot spots it :-)
Too late - the post was 3 minutes ago you know ;-)
--
http://mail.python.org/mailman/listinfo/python-list
> # Get a list which contains 10 values from the user
> # let them predict Head Or Tail in ten times coin thrown
> # and then prdict the list by a fixed rule
>
>
> list = []
>
> print 'Predict Head or Tail in ten times coin thrown\nJust input \'h\'
> or \'t\' please\n'
>
> count = 0
> while True:
The idiomatic way of doing the tree traversal is:
def search(a_dir):
valid_dirs = []
for dirpath, dirnames, filenames in os.walk(a_dir):
if dirtest(filenames):
valid_dirs.append(dirpath)
return valid_dirs
Also since you are given a list of filenames in the directory, th
Donnie Rhodes wrote:
...
>
> Thank you all and I hope I'm not biting off too much at once...
Not if you break it up into pieces. Look at the things you want to do,
and in the first instance, create a function for each. Then you can
start to fill in the blanks, and if neccessary ask back here for
Brian van den Broek wrote:
...
> A quick check with the on-line text of the second edition of the
> Oxford English Dictionary (sadly, a link only available by
> subscription) gives as the first meaning:
If we're going to start using dictionary definitions, then I claim that
the following joke is
Theerasak Photha wrote:
> On 10/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
...
> (La)TeX is the king of document processing, and does PDF.
Except that the OP want's to print Word documents as PDF. LaTeX is
good, granted, but just try converting LaTeX documents to Word or vice
versa...
A
Rob Wolfe wrote:
...
> def filter(adr):# note that "filter" is a builtin function also
> import re
>
> allow = re.compile(r'.*(?|$)') # negative lookbehind
> deny = re.compile(r'.*\.com\.my(>|$)')
> cnt = 0
> if deny.search(adr): cnt += 1
> if allow.search(adr): cnt +=
Fidel wrote:
> Renaming the file doesn't work. I am on windows... There is a specific
> line of code that tells python not to bother even opening a window.
Seriously, renaming the script to .pyw should work from a standard
python install. If it doesn't then the file handler for that extension
mus
Jordan Greenberg wrote:
...
> >>> def printreverse(lst):
> if lst:
> printreverse(lst[1:])
> print lst[:1][0]
Convoluted way of writing "print lst[0]" !
> >>> printreverse([1,2,3,4])
>
> No good reason at all to do it this way. But recursion is fun.
But there's
BartlebyScrivener wrote:
> Hello,
>
> I'm sure this is my fault or some Windows snafu. But using gvim 7.0 on
It's a bug in Windows. Try doing "sort.py < test.txt" from the command
line, and you'll get the same error. Try "python sort.py < test.txt"
and it should work fine. Apparently cmd.exe can'
Ben Sizer wrote:
> > Create a shortcut and drop the file over it.
...
> That is what I meant by 'the usual steps'. :) It doesn't work.
Alter the target of the shortcut to something like:
C:\Python25\python.exe C:\0\sort_test.py
and drag and drop should work, with the filename of the dragged fi
[EMAIL PROTECTED] wrote:
...
> We'd love it if you could have a look at our first issue, and let us
> know what you think!
On the layout of the site:
1) I have to hit two separate Download buttons to get the PDF, and then
the PDF must be viewed in an external reader rather than the browser
plugi
On Nov 2, 3:15 pm, "JohnJSal" <[EMAIL PROTECTED]> wrote:
> It seems like what I want to do is something that programmers deal with
> everyday, but I just can't think of a way to do it. Basically, I am
> writing a DB front-end and I want a new "Researcher" object to be
> created whenever the user
Hi all,
I'm putting together a simple help module for my applications, using
html files stored in the application directory somewhere. Basically it
sets up a basic web server, and then uses the webbrowser module to
display it in the users browser. I have it set up to call sys.exit(0)
if the url qu
Srinivasa wrote:
> Hai friends,
> I wrote a programme to display a window (ui) using Python. I renamed it
> as .pyw to avoid popping-up the dos window while running it. It worked
> fine. But when i converted it to executable file using py2exe; the dos
> window appears. Can anybody tell me what th
Ant wrote:
...
> However, at this point instead of getting back to a command prompt, I
> get an unresponsive console. Hitting CTRL-Break gets me the command
> prompt back, but I would have expected to get back the command prompt
> as soon as the sys.exit(0) had completed.
Ant wrote:
...
> OK, I've narrowed the problem back to the way HTTPServer (actually its
> TCPServer parent) handles exceptions thrown by the process_request
> method by catching them all, and then calling a handle_error method.
> There doesn't seem to be a way of getting a
Steve Holden wrote:
...
> First of all, five hour response time is a high expectation, you must be
> a Platinum customer :-)
I'm in the last week of my current job - start a new one on Monday, and
so I haven't got a great deal to do at the moment. Five hours is a
lifetime when you're staring at a
On Nov 9, 6:52 am, "BillJosephson" <[EMAIL PROTECTED]> wrote:
...
> If anyone knows why i can't connect, in info about it would be
> a big help.
Sounds like the default mirror is down. Go to Utilities -> Global
Options -> Plugin Manager and click on "Update mirror list". Choose a
new mirror and
> Vim, it can handle all the things.http://www.vim.org/
I'm not convinced of that quite yet. jEdit's syntax highlighting seems
more robust (see SocketServer.py in the standard library for an example
- vim gets the highlighting of the first doc-comment wrong). I've also
not found anything like jEdi
On Nov 9, 2:11 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
...
> """ never are. Then I changed the synchronize declarations in
> /syntax/python.vim to the following:
>
> syn sync match pythonSync grouphere NONE '"""$'
> syn sync maxlines=300
>
> The above is no good for random Python code, th
On Nov 9, 6:29 am, Prabhu Gurumurthy <[EMAIL PROTECTED]> wrote:
...
> regex: I presume this is rather a dumb question, anyways here it comes! as you
> can see from my program, pattIp = r\d{1,3}\ etc, is there any other easy
> way
> to group the reptitions, instead of typing the same regex 4
> May I ask another quetion? I don't want to mess with lots of plugins
> at this point. What are the minimum plugins to get a typical looking
> IDE with a code window and output window and that lets me set
> breakpoints and step through code?
The Console plugin is a must (I think it depends on th
On Nov 9, 3:27 pm, John Salerno <[EMAIL PROTECTED]> wrote:
> Ant wrote:
> > I do use vim more than Python these daysWhat does that mean? Are you
> > referring to all the setup involved with vim?
Whoops! I mean I use vim more than jEdit these days!
--
http://mail.python
On 10 Nov, 10:29, Marcus Bajohr <[EMAIL PROTECTED]> wrote:
> donkeyboy wrote:
> > All,
>
> > I'm having issues installing Jython on Windows XP. I've looked on the
...
> > Any help would be of great use!!!
> Try it from cmd, not from the cygwin shell.
> The environments differ !
Looking at the co
hould - from what I have read in Frederik's
Intro to Tkinter guide - select all of the text in the text area. It
doesn't however...
Does anyone have any idea how to get this to work? Or tell me what I am
doing wrong.
Cheers,
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
selection is only shown if
the widget has focus. I just tried adding another component to the
test, and switching from widget to widget does indeed stop the
selection showing!
Cheers,
--
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
> In our field, we don't always get to program in the language we'd like
For sure!
> to program. So... how do you practice Python in this case? Say you're
> doing J2EE right now. How do you practice Python to keep your skills
> sharp?
Well, we have to use J2EE at work. I keep my Python skills go
> That's because many of them have killfiled you.
I actually wonder whether anyone does use killfiles. I just can''t
imagine the sort of person who writes "plonk" or "welcome to my
killfile" etc could bear to miss out on a reply to such a post in case
there's more to get angry about!
And people w
> to use? I could go back to XML, or I could switch to JSON - I have read
I'd favour JSON if the data structures are simple personally. XML is
comparatively speaking a pain to deal with, where with JSON you can
simply eval() the data and you have a Python dictionary at your
disposal.
I recently u
> Yes, evaling JSON, or any other text coming from the web, is definitely
> a bad idea.
>
> But there's no need for eval: there are safe JSON codecs for python,
Fair enough. And I should imagine that the codecs are still much faster
and easier to use than XML for the same purpose.
For my purpose
Hi all,
I have a specific task I want to automate - rotating a video file
through 90 degrees.
I've used the PIL library quite a bit to perform batch processing on
images, and would like to do similar on video. Can anyone see a problem
with the following:
1) Use pymedia to convert the video into
> im = Image.fromstring("RGB", dd.size, dd.data)
>
> instead of doing that pygame.image call (not that the argument order is
> different).
>
> for details, see the pygame tostring/fromstring docs, and the corresponding
> PIL
> methods:
That's starting to look promising, yes - thanks! I'll gi
I have the following code which works fine for running some tests
defined within a module:
def a_test():
print "Test A"
def b_test():
print "Test B"
if __name__ == "__main__":
tests = ["%s()" % x for x in dir() if x.endswith("test")]
for test in tests:
eval(test)
But th
Ant wrote:
...
> But this feels like a hack... Is there a cleaner way for accessing the
> functions of the current module similar to the __dict__ attribute of
> classes? i.e. a way to access the local symbol table?
Sorry - posted too soon. Found the globals() built-in...
> I am a fussy learner. Could someone explain to me why the following
> inconsistency exists between methods? How can it be justified if it is
> considered all right?
It's the standard way of accessing groups from regex matches in pretty
much all languages that support them. In most modern langua
> I've tried a few others, like TextPad and Crimson, and right now I use
> UltraEdit, which I love actually, except for minor issues here and
> there. But it'd be nice to make the move, as much as possible, to free,
> open-source, cross-platform software.
Vim is great if you have a good memory...
Hi all,
I have just moved to a new machine, and so have installed the latest
version of Python (2.4.3 - previously I believe I was running 2.4.2).
Unfortunately this seems to have broken urllib2...
An app I wrote for testing our web application makes heavy use of
urllib2 against the localhost, an
John Salerno wrote:
> Ant wrote:
>
> > jEdit is for me still the best text editor available. Very extensible
> > with macros (which can be written in Jython with the appropriate plugin
> > installed).
>
> I like the idea of being extensible, but of course I can onl
John Salerno wrote:
> Larry Bates wrote:
>
> > Nope, no Java knowledge necessary. Jython just compiles Python code
> > to java bytecode instead of python bytecode. Once it is in java bytecode
> > the JVM doesn't know where it came from.
>
> Well that's good to know. I guess there's not much of a
Fredrik Lundh wrote:
> check your proxy configuration. most likely, your new machine is set up
> to route all requests via a remote proxy.
Here's me looking like a fool :-) The parts of the machine (eg Firefox,
GAIM etc) that I'd set up use a direct connection - it looks like the
guy who'd had
> > Vim is great if you have a good memory... Otherwise you end up trawling
> > through the help to find out how to do stuff that would in another IDE
> > be just a few menu clicks away.
>
> Mental memory (the painful kind of memory) rapidly turns into muscle
> memory (the fun kind of memory) and
> No, I learned it because Perl was too dirty and Java to complicated.
> Now it is part of my daily job.
Ditto. I was fed up of writing, compiling and running a java
application just in order to do a quick script. I'd used perl, but
quite frankly perl's a ridiculous language. Ruby looked promising
> What I first though was if there was possible to make a filter such as:
>
> Apples (apples)
> (ducks) Ducks
> (butter) g butter
Try something like:
import re
text = """> Some text that can span some lines.
Apples 34
56 Ducks
Some more text.
"""
filters = {"apples": re.compile(
Try adapting the other posters example with something like:
import Image, StringIO
zip=zipfile.ZipFile(inURL,mode="r")
picture=zip.read("00.jpg")
image = Image.open(StringIO(picture))
image.thumbnail ((128,128), Image.ANTIALIAS)
image.save (file + '.thumb.png')
I haven't tested it, but some
each hypothetical user will achieve this effect - i.e. sessions will be
separate from each other in the app, since the openers will return
different session cookies back to the server.
Cheers,
Ant...
--
http://mail.python.org/mailman/listinfo/python-list
> class MyClass:
> "A simple example class"
> i = 12345
> def f(self):
> return 'hello world'
Nothing wrong with this.
> From here I run:
> x = MyClass
Here's your problem - x is a class, *not* an instance of a class (i.e.
an object). Methods
operate on objects, not clas
> Thanks, that's awesome! Definitely not something I'd have ever been able
> to work out myself - I think I need to learn more about nested functions
> and introspection.
I've recently found nested functions incredibly useful in many places
in my code, particularly as a way of producing functions
> [('recId', 3), ('parse', {'pos': u'np', 'gen': u'm'})]
> [('recId', 5), ('parse', {'pos': u'np', 'gen': u'm'})]
> # line injected by a malicious user
> "__import__('os').system('echo if I were bad I could do worse')"
> [('recId', 7 ), ('parse', {'pos': u'np', 'gen': u'm'})]
I'm curious, if you
1 - 100 of 302 matches
Mail list logo