IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Wrote my first python program yesterday :)
It scans its own folder for image files, and then shows corresponding thumbnails for those--a catalog app, in other words. Subfolders are linked automatically. I still have to safety-check the input a bit more; feel free to tell me how to do any part of it better than I did.

I couldn't find a way to include it in this post without numerous errors, so you can read it [link|http://www.semishake.org/catalog.py|here].

And, no, I'm not missing the irony that, for my first python program, I'm explicitly performing local file I/O which the designers have tried to protect me from by not supplying me with the current working directory. Meh.

Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
New Not sure what you mean...
I'm explicitly performing local file I/O which the designers have tried to protect me from by not supplying me with the current working directory.


?
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New The docs I've read say it was intentional
os.getcwd, for example, doesn't return the directory my script is in, but instead returns the directory that the... uh... "compiled" script is running in, which is much closer to the interpreter's location. Doesn't have anything to do with my website dir structure, IOW. Several sites have commented that this is by design: that the "designers of Python" are helping me not shoot myself in the foot.

But the whole point of my app is to be able to drop an image in a folder and have it show up on the web page without modifying any source code.

Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
New Well, for *any* script being run 'automatically'
You can't assume the CWD.

I've always put the directories I'm interested in either in the script or an INI file of some sort.

FWIW, I've never heard the bit about shooting yourself in the foot, unless that's simply an acknowledgement of the dodgyness of cwd as mentioned above. *shrug*
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Was just pondering what to write that in
I've got something I put together in PHP that does about the same thing. Peter is using a Perl script for it. I was about to add a web interface for managing the captions and searchable keywords, and was thinking about doing it in Java, just to have an exercize to teach myself the language.
===

Implicitly condoning stupidity since 2001.
New *snort* Mine is a port of my previous Java version :D

Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
New Re: Wrote my first python program yesterday :)
Take a look at album: [link|http://marginalhacks.com/Hacks/album/|http://marginalhacks.com/Hacks/album/]

I'm not saying rob it wholesale for material, but do take a look at what it produces and how it does it.


Peter
[link|http://www.debian.org|Shill For Hire]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Blog]
New Now that I've sanitized it, you can see it in action
[link|http://www.semishake.org/props/catalog/catalog.py|http://www.semishake...atalog/catalog.py]

Thanks for the album link, Peter. Next project is auto-creation of thumbnails...

Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
     Wrote my first python program yesterday :) - (tseliot) - (7)
         Not sure what you mean... - (admin) - (2)
             The docs I've read say it was intentional - (tseliot) - (1)
                 Well, for *any* script being run 'automatically' - (admin)
         Was just pondering what to write that in - (drewk) - (1)
             *snort* Mine is a port of my previous Java version :D -NT - (tseliot)
         Re: Wrote my first python program yesterday :) - (pwhysall)
         Now that I've sanitized it, you can see it in action - (tseliot)

Ok, on the internet awesomeness scale, this rates roughly a 153 on a scale of 1 to 10.
82 ms