@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14



Comments:

<0> parse?
<0> from string to date obj
<1> Need a bit more help on the try/except stuff: http://deadbeefbabe.org/paste/2863. Am I doing this right?
<1> mamat, checking. I think you can do that.
<0> i saw in doc that i can go the otherway with isoformat()
<1> mamat, see the time.strptime
<2> mischko: man... it's not e.errno... it;'s e.args[0]
<3> mischko, Yeah. Exactly.
<3> werneck, e.errno exists
<1> thanks!
<2> kbrooks: nice... that's new for me
<1> is there a way to make it so I don't have to repeat the two lines of code that are in each of the except: blocks?
<4> mischko: you should add else: raise if errno isn't what you expect
<5> miolk
<1> I don't want it to re-raise the exception. I want it to do what's in the final except block.
<6> I have a question: Is there a way to create submodules within a module



<6> As you can do with C/C++ using namespaces
<3> Jarrett, modul1es are objects
<3> os does this. see os.py
<1> so I could change the final except to else?
<7> ive got a folder named NC4 with two subfolders, Common and RSS. i have __init__.py files in each directory. suppose i have foo.py in Common and bar.py in RSS. I want to import foo into for use in bar. according to the python docs, I should be able to do this: import NC4.Common.foo or from NC4.Common import foo, but neither of these work. what's wrong?
<4> mischko: http://python.org/doc/ref/try.html
<3> does NC4 have a __init__.py?
<7> ya
<3> no
<3> i mean
<3> do you see __init__.py while in NC4
<3> listing
<7> im not sure if this is what your asking, but if i run ls from the NC4 directory, __init__.py is in the output
<3> yeah
<3> with ls -R do you see __init__.py in Common and RSS?
<8> is there a way to see which DLLs a pyd file depends on?
<9> how do you convert a list into a set without losing the order
<9> ?
<10> fbriggs: does "import NS4" work?
<4> OrgulloKmoore: you can't
<9> deltab-> no fun :(
<9> what do people do then?
<4> OrgulloKmoore: how do you round a number without losing the fractional part?
<9> you don't
<2> OrgulloKmoore: what exactly do you want ? remove duplicates ?
<9> werneck-> precisely
<4> okay, *which* duplicates?
<6> kbrooks, Hmmm... Well, if I have file foo.py, is there a way to refer to a codeblock inside said file as foo.bar if bar is not a cl*** or function?
<9> the pattern is something like this [a, b, a, b, c, b, d, c, e, d]
<9> or something like that
<6> kbrooks, forgive my ignorance, I am a newbie to python as I'm sure you can tell.
<9> that c is way out of place
<3> so
<2> Jarrett: and what bar is ?
<3> you want [a, b, c, d, e]
<3> and thats it?
<9> kbrooks-> yes
<4> result always sorted?
<9> yes
<4> sprted(set(l))
<4> er, sorted
<9> lets try it...
<9> yep!
<9> gracias
<6> werneck: just a group of variables. I'm trying to emulate C-style enumeration by encapsulating a group of readonly constants.
<2> Jarrett: don't try to apply concepts from other languages like this... use a dictionary to hold your constants, ***ign it to bar and use it as foo.bar
<0> so nobody knows how to parse a '2006-02-11T19:32:12Z' to a datetime object?
<6> werneck: Thanks. I didn't realize you could use a dictionary like that
<4> Jarrett: you can use a cl*** for that
<2> btw, is it safe to use globals().update(d) if I have a dictionary d with some constants I want on the global namespace ?
<4> cl*** Color: BLACK = 0; RED = 1
<11> werneck: depends on your definition of 'safe'. it works in all Python versions I know of.
<4> mamat: you could use a regex
<11> werneck: but it's butt-ugleeee.
<0> deltab: i'm sure... just thought there'd be a function for that though... i just need to compare dates so i think i'll just compare strings
<4> mamat: but I'd use strptime
<4> as mischko suggested
<2> Yhg1s: yes, by safe I mean if it works... I know it's ugly, but the code already use a lot of fixed constants, and someone asked me to make it configurable with a simple text file... I don't have time to change all of it
<12> hello
<13> hi



<0> deltab: you mean strftime? this is for formating not parsing
<11> mamat: no, strptime.
<11> in the 'time' module. not in datetime.
<4> p for parse
<11> datetime is for representing date and times, not for parsing them.
<11> (even though it does a half-***ed job at taking various inputs.)
<4> and does formatting
<11> if you want a richer datetime module, one that does do parsing and a lot more formatting and manhandling options, see mxDateTime.
<12> im a beginner at python and i want to write a program. what i want to do is take my long ffmpeg syntax and make the options in the syntax variables that users can change. i also want to run the final ffmpeg syntax within the program if thats possible. anyways, is any of this even possible using python?
<11> By 'syntax', I ***ume you mean 'command line options'?
<12> correctr
<11> then yes, that's quite easy in any useful language ;)
<3> CLucas916, yes
<12> what should i learn to be able to do this
<12> i know i want the interface to be in a list format
<11> Python in general, option parsing using the 'optparse' module, executing external commands with the 'subprocess' module.
<12> great thank you
<6> werneck, thanks again. Dictionary was exactly what I was looking for :)
<12> im going to frys today, can anyone recommend a good python book for me?
<11> depends on your level of programming experience.
<11> there are a number of free books available online that may be of more help to you than what you can find on the bookshelves.
<12> well im a beginner
<12> ya i know
<11> if you're a complete beginner in programming, I can recommend 'thinkcspy'. It tries to lay down a solid foundation for more advanced programs, though, so it may not lead you to a working program as fast as you might want. However, it does make sure you fully understand whatever program you write ;P
<11> %google thinkcspy
<14> thinkcspy: http://www.ibiblio.org/obp/thinkCSpy/
<12> great
<12> ill definantly take a look at this thanks
<15> I know this is a newbie question, but could somebody please look at: http://deadbeefbabe.org/paste/2864 ? I want each object to have it's own distinct data structures...
<4> mk_sj: like the functions, blah_list is shared by all instances of Blah
<11> because it's part of the 'cl***' statement.
<15> deltab: so how can I make each instance have its own private copy?
<4> mk_sj: if you want a separate list for each instance, you must create it in a method
<11> if you want it per-instance, ***ign to 'self.blah_list' in an __init__ method.
<15> ok, got it, thanks
<0> thx all for the datetime help... time package does do a better job
<16> Can anyone help me with mod_python? This is confusing me
<16> What exactly is the PythonHandler in httpd.conf suppose to be and what does it do?
<17> A Python script. It runs.
<16> So if I'm making a website off of mod_python, would be PythonHandler be something like index.py?
<16> Since it's the main page?
<17> It can be any name you choose.
<16> The problem I'm having is that instead of executing my python scripts, apache just displays the source
<16> I'm on FC4
<16> In my ServerRoot, I have:
<16> AddHandler mod_python .psp, PythonHandler mod_python .psp, PythonDebug On, AllowOverride All
<16> I have more, but that' s just what I added to try to get mod_python working
<3> _pure; reestart the damn server
<16> I did
<16> Like 30 times
<3> did you save?
<16> yeah
<3> very strange
<16> That's why I'm confused
<18> How to make things easy to understand?
<1> _pure, see http://mail.python.org/pipermail/python-list/2004-November/250428.html
<17> That question is a bad start.
<18> ignacio, why?
<1> _pure, see this also: http://www.dscpl.com.au/articles/modpython-001.html
<3> is there a gnome mines howto
<3> how do i play minesweeper?
<19> kbrooks: http://en.wikipedia.org/wiki/Minesweeper_(game)
<18> :(
<20> how do I use a memory editor to win at minesweeper? ;-)
<18> ****.
<18> I do not understand your answer.
<1> Cheery, that does not sound very cheery. :(
<21> Hi All.
<21> I'm trying to use thread.start_new_thread, but getting:
<21> TypeError: first arg must be callable
<21> anybody an idea?
<22> Cheery: how do you ask a question that people are able to answer?
<18> urghk.
<22> sivang: you send in a function


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

dereferencing type-punned pointer will break strict-aliasing rules basic_string
#dns
debian raidutils +mkraid
gentoo alsasound' not found; aborting
debian ipforward proc sysctl
#linux
postfix.rpm suse
kde button Malformed URL system:/
#linux
sii 3112a fc4



Home  |  disclaimer  |  contact  |  submit quotes