| vafada | is there a way to detect if a CD was inserted/ejected using python? |
| ironfroggy | hmm.. maybe pygame has something? |
| vafada | ok thanks.. ill check it out |
| ehc | i am trying to use mod_rewrite to make blog.binarymanipulations.com access the webpage at binarymanipulations.com/blog but not change the url. I have http://deadbeefbabe.org/paste/3967 and it's not working |
| Jerub | that's an apache problem #apache |
| ehc | sorry i meant to post it there actully, :) |
| RiotGeek | Dunno if mod_python questions go here or in #apache, but here goes: I've got my app reading in psp files by doing "t = psp.PSP(req,fn); t.run(vars)" and it's working... except that the html in the psp file isn't being interpreted. All the tags show up as plain text. I'm sure I'm missing something simple... like do I have to explicitly sent content-type at some point? Any help would be appreciated. |
| TFKyle | RiotGeek: I've never used mod_py's psp stuff before, but yeah with normal handlers you have to set the content-type normally |
| RiotGeek | Hmm.. how does one do that with mod_py? In cgi I would just use a print statement, but that doesn't seem to do it. |
| TFKyle | RiotGeek: req.content_type = "whatever" |
| RiotGeek | TFKyle: Thanks a ton. That worked! |
| jsheedy | I am new at python, is there something wrong with this if statement that I am missing? *if stupid == 'y': |
| ivan` | an indented block after it |
| Leeds | no, nothing wrong with that line |
| jsheedy | hmm, how may lines can you paste here? |
| piedoggie | question on logging technique: I've got a program with logging statements scattered all over. I want to be able to promote visibility of certain log statements at different times and submerge others. I would love it if I could make logging statement visibility based on the method in addition to a level specification. Any ideas? |
| jsheedy | 3 ok? |
| piedoggie | 3 is fine |
| jsheedy | stupid = raw_input('Would you like to play the game ') if stupid == 'y': print'Sorry ' |
| Leeds | jsheedy: what's your indentation really like? |
| kosh | jsheedy: print stupid and tell us what python says the value is |
| jsheedy | Leeds: one tab for first if, then two tabs for second print |
| piedoggie | eliminate one level of indentation |
| Leeds | right, too much indentation |
| kosh | you only indent a line if the last line ended with a : |
| jsheedy | yep, that got it thanks I guess it is pretty obvious that I am new, well thx for the help! |
| piedoggie | jsheedy: don't worry, as you learn more your definition of "newbie" question will only get more complicated. :-) |
| jsheedy | lol |
| Leeds | jsheedy: that, on the other hand, is against the rules |
| jsheedy | I guess so |
| piedoggie | Now if they could just break me from using smiley faces, the world would be safer for humanity is there any easy way for a method to know it's calling method name and class? |
| action | kosh breaks piedoggie's fingures to break him of that habit |
| kosh | breaks piedoggie's fingures to break him of that habit piedoggie: there is no good way to find out that information |
| piedoggie | Too late, my hands and fingers already broken... |
| kosh | piedoggie: that kind of code is also a design problem since what the method does not only depends on the args passed in but on some nebulous other stuff |