@# 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 15 16 17 18 19



Comments:

<0> No worries.
<1> I started how to think like a computer scientists and it was too easy so i quit ;P
<2> Alterego> i've skimmed through most of these, all look to be well written. All come w/ high marks as far as being recommended by the community as well.
<3> altf2o, just remember 'help (command)' and 'dir (module or package)' are extremely usefull :)
<2> nice. Haven't heard about that, but i'll be sure to write 'em down.
<3> altf2o, also, as you said you're coming from a C background. A lot of the Python API is identical to C. Sockets for instance. PyGtk is also another good example.
<2> ahh, nice.
<4> What is best used to connect to MS SQL Server from Python on Linux? I'm used to using psycopg to hit PostgreSQL but I'm finding I need to be able to hit MS SQL Server as well.
<5> altf2o: pygtk certainly isn't identical to the C api
<3> teratorn, I said it was a good example.
<3> The mapping is pretty damn similar.
<5> *shrug*
<3> It must be one of those days when everyone is trying to be an ***.
<3> I bit a newbies head off earlier for not understanding 'echo "blah" >> file'
<5> maybe, in which case I should probably kick you



<5> but I think I'll just forget about it
<3> Great.
<6> sqobject pisses me off
<7> sqlobject?
<7> yeah
<6> it tries too hard to be "magical"-- and screws me over every time
<7> it's a pain
<7> muhoo: what are you trying to do?
<6> like.. i have column names that are '_cache_some_longtext'
<6> SQLObject loses control of its bladder over that
<6> OperationalError: (1054, "Unknown column 'sometable.cache_some_longtext'
<6> notice it has "magically" decided that the leading _ is unimportant. bastards.
<6> the leading _ is legal in mysql
<6> i notice that SQLObject has decided it is _get_CacheSomeLongtext
<4> I'm used to using psycopg to hit PostgreSQL from Python on Linux, but does anyone know what module I'd use to hit MS SQL Server instead?
<6> so it's ****ing with the capitalisation, which is one of its more annoying qualities
<8> Is anybody aware of any issues with threads and python running in a chroot?
<6> sanka: if you're going to hit MS SQL, i suggest using a hammer.
<6> actually there's a ODBC connector IIRC
<6> ah, steenkin sqlobject. indeed, it mangles the name and changes it to CacheSomeLongtext.
<6> unusable.
<6> poop.
<6> alas, i have to write this in PHP. son of a bitch.
<6> once again, sqlobject makes it impossible for me to do work in python
<3> Well, who'd have known it was that easy ...
<9> hi, i'm getting this error with an install on win32: ImportError: no module named com
<9> where do i find this com module
<10> Did you install ActivePython or the bares-bones Python distribution?
<11> jotham, what code is generating the error?
<9> benji: the python setup.py install for Venster
<11> did you install ctypes first?
<9> yes, i followed the instructions
<11> hmm
<11> you know, I think ctypes recently split off it's com stuff into a seperate install
<9> brb (am at work)
<11> perhaps you could use an older version of ctypes or find and install the COM package too
<12> hello
<6> http://pythonpaste.org/archives/message/20050405.112410.0f646969.en.html
<12> how can I do a "negative range()" in python ??
<11> baring that, you could ask on the venster mailing list
<6> yes, i can confirm this.
<12> eg: [9,8,7,6,5 ...]
<11> range(9, 0, -1)
<10> help(range)
<6> apparently sqlobject in its genius, thinks leading spaces are deprecated sqlmeta functions/vars
<3> [^Zapata^], you can reverse the list.
<12> how Alterego ?
<3> list.reverse () ;)
<12> thanks
<10> Wrong answer.
<11> [^Zapata^], no need to reverse, use a negative step (see above)
<12> yes yes
<12> I read thank :P
<7> muhoo: the steps to getting patches applied to sqlobject svn very quickly are:
<3> Ah, didn't realise you could do that.
<6> http://pythonpaste.org/archives/message/20050906.153143.3dc63c2f.en.html
<7> muhoo: a) write a failing testcase, b) fix the problem, c) post the patch into the sourceforge tracker mentioning it's got tests in the title.
<7> muhoo: it'll get applied within 48 hours
<6> there's way too much magick going on in sqlobject to fix this one, unf
<6> and, i'm on a deadline. if there's no easy fix/workaround-- and nobody here has offered one and none seems forthcoming via google or sqlobject ml archives-- i have to write a ton of ugly, nasty PHP instead.



<6> so, rant over, basically.
<6> if time presents itself i'll try to understand the name mangling in sqlobject, and submit a patch that doesn't mangle the goddamned names :-)
<7> muhoo: you can add a kwarg to a Col that will force it to look at an arbitary column
<9> benji: any ideas what i should do? should i just find the com install package?
<11> I looked at it and the com stuff is apparently still included in ctypes
<11> so I have no idea
<9> http://starship.python.net/crew/theller/ctypes/com.html
<9> from ctypes.com import IUnknown, GUID, STDMETHOD, HRESULT
<9> ImportError: No module named com
<9> so it's exactly the right stuff
<11> can you do "import ctypes"?
<9> yes
<11> if you look in the ctypes package do you see a com.pyd or com.py or com directory?
<9> benji: directory listing of site-packages and site-packages/ctypes
<9> http://rafb.net/paste/results/P6eMbd68.txt
<8> has anybody run python in a chroot ?
<11> it doesn't look right, but without installing it and double-checking I couldn't know for sure
<11> I'm out of ideas :(
<11> and I have to go
<13> any gnome/glade gurus here?
<13> havng some wierd pygtk problems with glade
<14> dunno about this place, but irc.gnome.net #pygtk has a bunch (the authors, for example ;-)
<13> TFK: ah...interesting
<13> TFK: irc.gnome.net/6667 right?
<14> erm. irc.gimp.net, sorry :-(
<13> TFK: ah. gotcha
<1> is it possible to create a variable containg a number from another variable? (I want to create a loop with x +=1 then create a newvariable(x) = ***ignment
<1> only that doesn't work, heh
<3> tark, x = int (y)
<15> hi
<15> what does this-> startswith(r"%Page: ")
<14> tark, "nevariable(x) = ***ignment"?
<16> Ruby a = [1,2,3,[4,5,[6]]], a.flatten = [1,2,3,4,5,6]
<16> How would that be done in Python ?
<14> das_netz, it checks whether a string starts with the string in the parentheses.
<7> radsurfer: with a recursive function
<16> function I'd have to write, eh/
<16> ?
<14> radsurfer, there are at least two recipes for this in the ASPN Python cookbook.
<7> yep.
<15> TFK, and the 'r'?
<16> hmmm....
<7> there are probably dozens.
<7> das_netz: 'r' just means, "don't make \n \r \0 \xff etc mean anything"
<16> Python has a smaller footprint on the harddrive, but Ruby has some interesting features, too
<14> das_netz, the r means "raw", i.e. r"\n" is two characters, instead of a linefeed.
<15> TFK, oks... thanks
<17> is there a way to open a file in Python under MS Windows, using Windows' default file handler for that type?
<16> python 2.5 should make some of these useful tasks easier :)
<1> TFk: I wanted to create a variable for an undetermined number of images. I was going to use a while loop until the number of images ran out that iterated x+1 then ***ign that to bitmapimage(x) = wxEmptyBitmap(0,0) for each image, only that doesn't work.. of course.
<1> i'm sure there is a way to do it though ;)
<14> tark, use a list?
<3> tark, x = int (y) ?
<14> if you want to create x empty bitmaps, bitmaps = [wxEmptyBitmap(0, 0) for i in range(x)]
<15> TFK, if i quit the 'r'?... what happens?
<15> hi dec0ding
<14> das_netz, in this particular case? Nothing.
<18> hey
<15> TFK, and the another caes?
<18> can u tell me solution for http://pastebin.com/579325
<1> TFK: how would I access them like that? for loop is weird in python :P
<14> das_netz, as Jerub and I noted before, without the 'r', \n and others will be interpreted as escape sequences: \n = linefeed character, \r = carriage return character, etc.
<14> das_netz, with the 'r', r"\n" is two characters - a backslash and 'n'
<14> tarek, bitmaps[5] for the sixth image, for example
<1> oh, that's nifty. thanks
<14> They may be weird, but lists aren't.
<1> thought lists were only for strings
<18> das_netz: can u help me ?
<14> That's pretty much how you'd access an array in C o_O
<1> ^
<15> TFK, are there other arguments different of ' r '?
<14> dec0ding, make sure the module cup***t, whatever that is, is present in your system.
<18> TFK: how and if it isn't how do I install it ?


Name:

Comments:

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






Return to #python
or
Go to some related logs:

ugandians
fedora iptables missing connbytes
gentoo kwlan portage
#suse
#fedora
disable fsck suse
#perl
xinetd xproftpd 421 Service not available
#css
Xorg 7.1 Matrox G550 Xinerama



Home  |  disclaimer  |  contact  |  submit quotes