Perhaps you should do your own work so you'll understand the concept and
learn something?
Also, widely posting your real (unaltered) email address in forums like this
is a sure way to get noticed by spammers.
Good luck.
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm doing a
To all you vi/vim users out there.
I am just getting into python and am trying to learn how to use the
python.vim script. I really like the fact that it autoindents for me while
inserting defs etc, but how do I move my cursor to back to outer block (say
at the end of a def) to continue wit
Thank you!
Python Rocks!
"Tim Chase" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> I am just getting into python and am trying to learn how to use the
>> python.vim script. I really like the fact that it autoindents for me
>> while inserting defs etc, but how do I move my cur
I just got Python 2.4 setup locally (Mac OS X) and am trying to extend
it by installing both the markdown and smartypants plugins. Ultimately
I'd like to be able use both in a custom CMS I'm building with Django.
Installing markdown was a snap by following the instructions at
http://www.freewisdom
python2.4/smtplib.py", line 303, in connect
raise socket.error, msg
socket.error: (61, 'Connection refused')
Python 2.4.1
MacOSX 10.4.3
Is there a better/easier way to send a plain text message?
Thanks in advance!
Scott
--
http://mail.python.org/mailman/listinfo/python-list
nonnumeric port" error upon
instantiation. Instantiating with the port number,
s = smtplib.SMTP("mail..net:@.com",
portNum)
yields the following error:
socket.gaierror: (7, 'No address associated with nodename')
Suggestions?
Thanks again
Scott
Yes, I was doing something wrong: I was connecting to the localhost
after instantiation. All better now.
Thanks for the tips!
Scott
On Feb 8, 2006, at 11:04 AM, Carsten Haese wrote:
>
> Then you're doing something wrong. The line
>
> s = smtplib.SMTP("mail.ispname
I'm a new user of the Python C interface. I would like to know if it
is possible to put items on a standard python Queue object in C, and
pop them from Python. Does the Python/C interface support Queue
objects?
A little background. I made a C dll that sets up a thread for
collecting data from
After being introduced to the concept of MROW locking, I sought a
general implementation of it in Python that implemented reentrant
locks, had a simple interface, and was unit tested.
I found some implementations, but none had all three of these
qualities, so I wrote this recipe:
http://aspn.acti
I often can't remember that to remove spaces from a string whether it's
strip() or trim(), and when finding patterns with the re library
whether it's find() or search() and when iterating over key, values of
a dictionary whether it's items() or entries().
But then I remember that Python is "sexy".
Silly but true. It started with trying to figure how to remember it's
strip() and not trim().
Then it went downhill from there.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I am using an XP box and Python 2.3 (Enthought Edition). I am getting
the same error with both of the .exe's listed on sourceforge:
tables-1.0.win32-py2.3.exe
tables-1.0.LB.win32-py2.3.exe
Note that the installation seems to go fine. Although, when I run the
test_all.py file it seems to
Yes,
but we don't want it to get out of hand, like calling it orgy() instead of join().
Or condom() instead of secure().
Or onClimax() instead of onFinished()
:-)On 5/31/05, Eric Pederson <[EMAIL PROTECTED]> wrote:
> I often can't remember that to remove spaces from a string whether it's> strip()
Oh my God! How did you know?!! You were so smart to post that here!
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> http://freeairconditioners.blogspot.com/
>
--
http://mail.python.org/mailman/listinfo/python-list
e reference won't be
changed, but even that can be subverted by the function's author with
casting.
-Scott.
--
http://mail.python.org/mailman/listinfo/python-list
API?
Thanks,
Scott Huey
--
http://mail.python.org/mailman/listinfo/python-list
uming that I should use storbinary( command, file[, blocksize]) to
transfer the files. the documentation says "command should be an appropriate
"STOR" command: "STOR filename"."
I can't seem to figure out an `appropriate "STOR" command' is???
i.e. URLs of projects and what
you did on them and/or sample code showing _typical_ style of work).
Thanks for any assitance, greatly appreciated.
Scott
--
http://mail.python.org/mailman/listinfo/python-list
cure and I don't understand why user-defined
exception instances should have a different set of attributes than the
built-in exception instances. As well as this is a change from 2.4-
>2.5 that breaks existing code for no apparent reason. This smells
like it was an overlooked mistake and not a
the url's, their index values and counts could be found by:
url_keys= unique_urls.keys()
for url_key in url_keys:
url_idxs= unique_urls[url_key]
url_hits= len(url_idxs)
Depending upon the data you may have associated with your URLs, or whatever
else you're working with, this is a very sweet 'shortcut'.
I hope this helps,
Scott
* To be trully Python-esque, 'habits' would be employed and the value would
have been 'Nun', but I guess the namesake can only be carried so far (^8
--
http://mail.python.org/mailman/listinfo/python-list
On 11/12/07, Scott SA ([EMAIL PROTECTED]) wrote:
Uhm sorry, there is a slightly cleaner way of running the second option I
presented (sorry for the second post).
>If you would find an index and count useful, you could do something like this:
>
>for idx in range
n be a precarious philosophy to live by, so why live on
the edge, when you don't know where the edge is? (let alone how sharp, steep or
deap it is once you get there).
0.02
Scott
--
http://mail.python.org/mailman/listinfo/python-list
On 11/17/07, Duncan Booth ([EMAIL PROTECTED]) wrote:
>Bjoern Schliessmann <[EMAIL PROTECTED]> wrote:
>
>> Benjamin wrote:
>>> Python is has duck typing. "If it quacks like a duke, it's duck."
>>
>> How do dukes quack, exactly? :)
>
>They quack with a North-eastern Scottish accent of course.
>
>Th
exe')
'123'
>>> reg.sub('','123.EXE')
'123'
>>> reg.sub('','123.WenDy')
'123'
... would you like fries with that?
Just imagine what this would look like using the previous non-regex examples,
or maybe not as halloween was _last_ month (scary stuff indeed!).
Here are some links to some great docs 8^):
<http://docs.python.org/lib/module-re.html>
<http://www.amk.ca/python/howto/regex/>
S&R, what you want, is described in more detail here:
<http://www.amk.ca/python/howto/regex/regex.html#SECTION00062>
And more links at:
<http://www.google.com/search?q=python+regex>
HTH
Scott
--
http://mail.python.org/mailman/listinfo/python-list
;)
While the shorthand is cleaner, I'm not always the guy
maintaining the code.
Thanks
Scott
PS. Not all was a loss, I did learn something from one of the other replies...
not that it helps "the rest of the world".
--
http://mail.python.org/mailman/listinfo/python-list
Suppose I have the following python program:
def func():
from sys import stderr, exit
try:
f = open("foo", 'r')
except IOError:
print >> stderr, "Input file foo does not exist"
exit(1)
def main():
import sys
if len(args) != 0:
sys.exit
On 4/28/06, Ted Roche <[EMAIL PROTECTED]> wrote:
> Ten folks attended the monthly Python Special Interest Group meeting,
> held monthly at the Amoskeag Business Incubator in Manchester.
>
> Ben was harassed.
I must say, the level of harrassment was fairly low. I expect a
higher quality of heckl
ot;confusion" stage of Lisp parentheses, so they don't bother me at all.
>
> I need advice from people who have been coding in all three, and who
> can share some views and experiences.
>
> Please, if you don't know ALL three by deep experience, don't respond
the urllib
functions, or do I need to use the httplib functions for this kind of
work. Pointers and/or sample code would be much appreciated.
Thanks!
-scott
--
http://mail.python.org/mailman/listinfo/python-list
HI,
I'm posting this here because it is, I believe, a python config issue (mine)
that is not correct, but frustration and inexperience has left me without
further [visible] options for rectification.
I am trying to configure mod_wsgi to run in daemon mode with Apache. I can
easily get it to ru
On 2/3/08, Brian Smith ([EMAIL PROTECTED]) wrote:
>Scott SA wrote:
>> I am trying to configure mod_wsgi to run in daemon mode with
>> Apache. I can easily get it to run 'normally' under Apache
>> but I obtain permission errors _or_ process-failures i
27;d designate a
different class in some other way?
Hopefully this is enough info for you to see what I'm trying to
accomplish. It's a bit like the DB interfaces, where there is
a generic DB API, and then the different drivers to implement
that API (MySQL, etc).
Thanks for any suggestions!
-scott
--
http://mail.python.org/mailman/listinfo/python-list
310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>>
Whats going on??
Thanks,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
something like that?
Thanks,
Scott
On Sun, Jan 18, 2009 at 12:44 AM, Gabriel Genellina
wrote:
> En Sat, 17 Jan 2009 17:13:00 -0200, Scott MacDonald
> escribió:
>
> I googled a bit this morning search for an answer to this problem but have
>> come up empty so far. Can anyone
Ah yes, with your help I seem to have solved my own problem. I had
PYTHONPATH defined to point to the 2.5 directory.
Thanks!
Scott
On Sun, Jan 18, 2009 at 11:01 AM, Scott MacDonald <
scott.p.macdon...@gmail.com> wrote:
> Yes, I see your point. Not sure how that would happen. It is
I think I set it a long time ago to get the python VTK bindings working...
On Mon, Jan 19, 2009 at 5:58 AM, Gabriel Genellina
wrote:
> En Sun, 18 Jan 2009 16:08:07 -0200, Scott MacDonald <
> scott.p.macdon...@gmail.com> escribió:
>
> Ah yes, with your help I seem to have sol
I'm running into a problem that's rapidly reaching keyboard-smashing
levels. I'm trying to import a module into Python, but it seems like
Python is almost randomly loading the module from an entirely
different directory, one that shouldn't be in the module search path.
When I tell Python to load a
Okay, I'm going out of my mind. I have three directories -- 'act1',
'act2', and 'act3'. Each of these has a module named 'story'.
Through mod_python, I need to load 'story' in the directory 'act1'. I
do it like this:
req.content_type = "text/html"
sys.path.append(os.path.dirname(
Here's another clue: if I'm trying to run the script from the
directory 'act1', but it's loading the module from 'act2', if I rename
the module directory in 'act2' and refresh, the module still reports
that it's running from '/home/www/---/docs/act2/story/game.pyc'...
even though that files no long
And more madness...
Executed from inside 'act1', which contains the directory / module
'story':
directory = os.path.dirname(__file__)
req.write(str(directory))
story = apache.import_module('story', path=[directory])
Results:
File "/home/www/---/docs/act1/play.py", l
Son of a bitch. It gets worse.
> Executed from inside 'act1', which contains the directory / module
> 'story':
>
> directory = os.path.dirname(__file__)
> req.write(str(directory))
> story = apache.import_module('story', path=[directory])
>
> Results:
>
> /home/www/---/do
>
> 'req.write(story.game.Save())' returns '/home/www/--/docs/act2/
> storylab/game.pyc' as the file being accessed.
>
Sorry, that should have read:
> 'req.write(story.game.Save())' returns
> '/home/www/--/docs/act2/story/game.pyc' as the file being accessed.
--
http://mail.python.org/mailman/lis
And finally, an epilogue.
So, the problem lies with how Python cached the modules in memory.
Yes, the modules were in two different locations and yes, the one that
I specified using its direct path should be the one loaded. The
problem is, the module isn't always loaded -- if it's already in
memor
I've been trying to read up on this, but I'm not sure what the
simplest way to do it is.
I have a list of string. I'd like to check to see if any of the
strings in that list matches another string.
Pseudocode:
if "two" in ["one", "two", "three", "four"]:
return True
Is there any built-in i
Damn you, Python, and your loose documentation! It never occurred to
me to actually TRY my pseudocode, since I couldn't find anything on
that type of statement. Anyway, feel free to ignore me from now on.
--
http://mail.python.org/mailman/listinfo/python-list
You might be interested in the "Beautiful Code" book:
http://oreilly.com/catalog/9780596510046/
It has a chapter on Python's dict implementation that is pretty good.
On Tue, Dec 16, 2008 at 10:51 AM, Brigette Hodson
wrote:
> Hello! I am in a beginning algorithms class this semester and I am work
Hi All,
I have a need to determine whether a passed variable is a single string,
or a list of strings. What is the most pythonic way to do this?
Thanks.
-Scott
--
http://mail.python.org/mailman/listinfo/python-list
What size of a project are you looking to work on? I enjoy learning in a
similar way as you it seems. Recently I have been interested in data
visualization problems. Maybe trying to replicate something from a website
like: http://www.visualcomplexity.com/vc/ would interest you?
Scott
On Tue
I have a number of functions that I need to pickle without necessarily
knowing their names in advance. My first thought was to put all the
functions in a class, then pickle the class, but it doesn't really
work like I expected it to.
import cPickle
class PickleClass:
> Pickling the source code is much sturdier. It's very unlikely that
> the same code runs differently in different interpreters. It's much
> more likely that the same code runs the same, or not at all.
Okay, I've run into another problem. I've saved the code to a string,
so I can call it up when
Never mind. Solved the problem by putting the functions in a class and
dumping that into a string. Then, when I need it, I executed the
string to get myself the class, then created an instance of that class
which gave me access to those functions along with the correct scope.
Probably not the smart
> Why not use import ? Simply recreate the source file, if necessary, and
> import it again.
>
Ah, you'd think it would be that easy :P
The problem with just importing a module is that the module is then
cached in memory. Multiple copies of the program are running on a
server, and each of them h
Is there a way to make a Python app running in mod_python with zero
persistence? I have an app that should be resetting its variables
every time you access it, but sometimes -- and only sometimes -- the
variables persist through a couple refreshes. They'll even persist
through multiple browsers, so
Okay, I'm at my wit's end. I have a Python app, running via
mod_python. There are variables in this app that, when changed, save
their changes to a pickled file tied to a session ID. Then, when the
page is accessed again, the variables are loaded from the respective
file.
But, when one user uses t
Huzzah, another post.
I just discovered that even physically deleting the variable doesn't
work.
The module storylab.game has the class InitGame, which contains
"daemons = {}".
A user runs the code, resulting in some values in "daemons":
"{'berry2': , 'berry3': , 'berry1': }". These are pickled.
> are you an experienced python programmer?
>
Yeah, I'd link to think I'm fairly experienced and not making any
stupid mistakes. That said, I'm fairly new to working with mod_python.
All I really want is to have mod_python stop caching variables. This
seems like it should be easy enough to do, bu
> req.write(str(lab.game.settings.daemons))
> del lab.game.settings
> req.write(str(lab.game.settings.daemons))
> lab.game.settings = lab.game.InitGame()
> req.write(str(lab.game.settings.daemons))
>
Sorry, that should have been:
req.write(str(lab.g
> Anyway, this person also posted on mod_python list. One of the things
> I highlighted there was that mod_python for some configurations is
> multithreaded and as such they may not be properly protecting
> variables if they are storing them at global scope. They haven't
> responded to any comments
I'm finally around to playing around with my LCD module. I chose Linux for
OS, pygtk for the GUI, a CF635 Python library written by Thomas Cauley
(found on CF website) for a starting point in sending commands to the LCD,
and gobject.io_add_watch for listening for packets coming from the LCD. It
bec
I think I found the answer to the last question. "A primitive lock is
a synchronization primitive that is not owned by a particular thread
when locked." -17.2.2. Lock Objects
So that's a no.
On Wed, Apr 15, 2009 at 8:55 PM, Scott Flynn wrote:
>
> I'm finally around to
On 22 Apr 2009, at 07:50, Martin v. Löwis wrote:
If the locale's encoding is UTF-8, the file system encoding is set to
a new encoding "utf-8b". The UTF-8b codec decodes non-decodable bytes
(which must be >= 0x80) into half surrogate codes U+DC80..U+DCFF.
Forgive me if this has been covered.
On 30 Apr 2009, at 05:52, Martin v. Löwis wrote:
How do get a printable unicode version of these path strings if they
contain none unicode data?
Define "printable". One way would be to use a regular expression,
replacing all codes in a certain range with a question mark.
What I mean by prin
On 30 Apr 2009, at 21:06, Martin v. Löwis wrote:
How do get a printable unicode version of these path strings if
they
contain none unicode data?
Define "printable". One way would be to use a regular expression,
replacing all codes in a certain range with a question mark.
What I mean by pr
On Mon, 2009-05-04 at 23:50 -0700, CTO wrote:
> You might want to try http://pyinotify.sourceforge.net/. Works well on
> Linux systems. Otherwise, I'd watch the mtime on the file and fork to
> handle the change.
>
pyinotify works really well. If you need to watch a file, simply use the
IN_MODIFY
I was hoping I could update LD_LIBRARY_PATH at runtime and load a library
through ctypes from there, but I haven't been able to.
I've tried all of these.
os.environ['LD_LIBRARY_PATH'] = "./lib"
os.putenv('LD_LIBRARY_PATH', "./lib")
os.system("export LD_LIBRARY_PATH=./lib")
lib = CDLL("libevaluato
I'd like to resize a ctypes array. As you can see, ctypes.resize doesn't
work like it could. I can write a function to resize an array, but I wanted
to know some other solutions to this. Maybe I'm missing some ctypes trick or
maybe I simply used resize wrong. The name c_long_Array_0 seems to tell m
I found an answer to this over on Stackoverflow.
http://stackoverflow.com/questions/919369/resize-ctypes-array
On Thu, May 28, 2009 at 1:25 AM, Scott Sibley wrote:
> I'd like to resize a ctypes array. As you can see, ctypes.resize doesn't
> work like it could. I can write a fu
into the user's
environment, so why not use a richer language where the setup logic is
independent of the user's shell being used.
Thanks for your feedback,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
On May 22, 5:29 pm, brad <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi,
> > Is it worthwhile maintaining a production application setup script in
> > Python as opposed to shell-script?
>
> I do not think so. Perhaps 'in conjunction with', but not 'opposed
> to'... sh is the lowest
Is it possible to change the content of a function after the function
has been created? For instance, say I make a class:
class MyClass:
def ClassFunction(self):
return 1
And I create an object:
MyObject = MyClass()
Is there any way to cha
On Fri, 2008-06-06 at 16:22 +0530, Dinil Karun wrote:
> hi,
>
> I am using the below code but i am getting a error saying pyUno module
> not found.
> can u please help.
I just wrote the same thing!
Take a look at http://cvs2.uwc.ac.za/trac/python_tools/browser/oooconv
It should do what you wan
I've installed mod_python, and everything seems to be working, but it
fails when I try to import another file into the file that's actually
producing the output. I have these lines at the top of index.py:
from mod_python import apache
from storylab import *
... and in the directory where index.py
I'm having some trouble understanding how Python handles variables
across multiple modules. I've dug through the documentation, but I
still find myself at a loss.
When you import a module, are you creating an instance of the
variables within? For instance, if I have one file, "variables.py",
which
> Just wirte test code !
variables.py:
myvar = 5
print myvar
foo.py:
from variables import *
def PrintVar():
print myvar
bar.py:
from variables import *
from foo import *
print myvar
myvar = 2
print myvar
PrintVar()
"python bar.py"
> first read this to learn how objects and variables work in Python:
>
> http://effbot.org/zone/python-objects.htm
>
> and then read this to learn how from-import works, and when you're
> supposed to use it:
>
> http://effbot.org/zone/import-confusion.htm
>
> hope this helps!
>
Awesome.
Here's what I'm struggling with (as best as I can understand it):
I'm writing a program that uses functionality from two different sets of
cdlls which reside in two different directories, call them 'libA.dll' and
'libB.dll'. Although I don't directly use it, both directories contain a
dll with th
I have been tasked to come up with an audio recorder desktop (cross
platform if possible - but linux only is OK) that:
1. records a lecture as an MP3 file (pymedia?)
2. Provides a login form for server credentials
3. Uploads via XMLRPC (pyxmlrpclib) to the server as a podcast
I have been working
On Mon, 2008-03-31 at 06:45 +, Marc 'BlackJack' Rintsch wrote:
> There is an `xmlrpclib` in the standard library, so there is no need for
> an external package here. I even think that pyXMLRPClib is the one that's
> integrated in the standard library, so the external one might be "dead".
>
On Mon, 2008-03-31 at 04:02 -0700, Graham Ashton wrote:
> pyGTK is great. I used it quite heavily a year or so ago. GTK is a
> nice tool kit from the user's perspective too; you can make some
> rather attractive and usable applications with it, and the GUI builder
> is a boon. Obviously it integra
On Mon, 2008-03-31 at 12:39 -0700, [EMAIL PROTECTED] wrote:
> How do I receive input from the command line in Python?
I have used:
sys.argv[ 1 ]
I have been doing Python for around 2 days now, so please do double check that!
--Paul
All Email originating from UWC is covered by disclaimer
http
I have started, and made some progress (OK it works, but needs some
love) on my first real Python application.
http://cvs2.uwc.ac.za/trac/python_tools/browser/podder
I would love some feedback on what I have done. In total this has taken
me 5 nights to do (I am working on it at night as PHP, not
On Mon, 2008-04-07 at 07:05 -0400, Steve Holden wrote:
> The code looks pretty good to someone that doesn't know Gtk graphics.
>
Err, neither do I, so I guess that means its OK? :)
> 184: self.wTree2=gtk.glade.XML(globaldir+"podder.glade","serverdialogue")
>
> could really do with using os.p
On Mon, 2008-04-07 at 09:56 -0700, Lie wrote:
> I don't know if it was just me, but I can't just scan through your
> code briefly to know what it is about (as is with any non-trivial
> codes), only after looking through the website's Roadmap I realized
> it's something to do with audio and recordi
On Mon, 2008-04-07 at 06:20 -0700, [EMAIL PROTECTED] wrote:
> > If anyone on this list is willing/able, please do give me a few
> > pointers, even if it is "This is total crap - RTFM and come back when
> > you are ready" I would really appreciate it!
>
> Ok, since you asked for it:
>
Awesome fe
t is very good (IMO,
FWIW).
I hope this helps others as much as it has for me,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 2008-04-15 at 13:54 +0800, Penny Y. wrote:
> import urllib2,sys
> try:
> r=urllib2.urlopen("http://un-know-n.com/";)
> except URLError,e:
> print str(e)
> sys.exit(1)
>
> print r.info()
>
>
> But got the errors:
>
> Traceback (most recent call last):
> File "t1.py", line
On Wed, 2008-04-16 at 02:35 -0300, Gabriel Genellina wrote:
> I'm unsure if teaching Javascript, VBScript and Python at the same time is
> a good thing, I'd think one would get a language soup and mix all the
> concepts, but if it works for you, go ahead.
> For other resources, see the beginne
On Mon, 2008-04-21 at 02:01 -0400, Brian Vanderburg II wrote:
> I've recently gotten more than too many spam messages and all say
> Sender: [EMAIL PROTECTED] I'm wondering
> if my mail list registration is now being used to spam myself and
> others. If so, sorry, but I'm not the one sending m
...
RecipieClass.get_ingrendients(['cookies','cake','bread'])
8C Flour
2C Sugar
...
Of course any suggestions on how this might be better approached would be
interesting too.
TIA,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
Recipie.get('cookie').ingredients
>print Recipies.get_ingredients_for('cookie', 'cake', 'bread')
Yes, thank you. While my example didn't accurately portray my original
thoughts, this is an educational example of merit.
I'm still crossing the bridge of conceptual understanding into practical
application. Decoration appears very useful, it's practical application
requires a level of thought I'm not fluent. Google is helping.
>My 2 cents...
You're short-changing yourself ;-)
Thanks for your input,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
On 4/23/08, Ivan Illarionov ([EMAIL PROTECTED]) wrote:
>On 24 ???, 07:27, Scott SA <[EMAIL PROTECTED]> wrote:
>> I'm using the @classemethod decorator for some convenience methods and for
>
>It would make sense to separate instance-level and class-level
>behav
ttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/500266>
And another python-based (non PIL) one here:
<http://www.jfroche.be/open-source/python-iptc-parser/iptc.py/view>
While not a direct answer, I hope this is helpful,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
On 5/1/08, Brian Vanderburg II ([EMAIL PROTECTED]) wrote:
>I don't know if any such support is already built in, so I ended up
>making my own simple signals/slots like mechanism. If anyone is
>interested then here it is, along with a simple test. It can connect to
>normal functions as well as
tagging:
<http://code.google.com/p/django-tagging/>
It easily allows configuration of different image sizes and integrates with
generic templates providing gallery and detail view support.
HTH
Scott
--
http://mail.python.org/mailman/listinfo/python-list
Today, I needed to concatenate a bunch of directory paths and files
together based on user input to create file paths. I achieved this
through nested os.path.join()'s which I am unsure if this is a good
thing or not.
example:
if os.path.exists(os.path.join(basedir,picdir)) == True :
blah bla
On Mon, 2008-05-05 at 16:21 +0200, Paul Scott wrote:
> example:
>
> if os.path.exists(os.path.join(basedir,picdir)) == True :
> blah blah
>
Sorry, pasted the wrong example...
Better example:
pics = glob.glob(os.path.join(os.path.join(basedir,picdir),'*'))
On Mon, 2008-05-05 at 10:34 -0400, Jean-Paul Calderone wrote:
> How about not nesting the calls?
>
> >>> from os.path import join
> >>> join(join('x', 'y'), 'z') == join('x', 'y', 'z')
> True
> >>>
>
Great! Thanks. Didn't realise that you could do that... :)
--Paul
All Email o
I have mod_python running on my server, but when I chance a Python
file on the server, Apache needs to be restarted in order to have the
changes take effect. I assume this is so mod_python can run
persistently, but it's becoming quite a headache for development. Is
there a way to turn off the persi
I've been trying to tackle this all morning, and so far I've been
completely unsuccessful. I have a binary file that I have the
structure to, and I'd like to read it into Python. It's not a
particularly complicated file. For instance:
signature char[3] "GDE"
version uint32 2
attr_co
> signature, version, attr_count = struct.unpack('3cII',
> yourfile.read(11))
>
This line is giving me an error:
Traceback (most recent call last):
File "test.py", line 19, in
signature, version, attr_count = struct.unpack('3cII',
file.read(12))
ValueError: too many values to unpack
--
htt
401 - 500 of 2114 matches
Mail list logo