@# 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



Comments:

<0> Gfn: it's making a new x,y coordinate pair for canvas space
<0> Gfn: given a p[0],p[1] coordinate which is in "curve space"
<0> Gfn: so when i adjust the zoom or pan, i redraw the curves. ht, end, and start are parameters of the current view
<0> self.winfo_width() is too
<1> i c
<1> just a sec lemme try this
<0> if you write your own transform function like i often do, then you can get reliable drawings and avoid canvas.scale altogther. I sometimes add a canvas.scale back in as an optimization if i'm sure it won't corrupt things
<1> ok i have one more question, where is winfo_width coming from. that's the canvas, right?
<0> yes, although you get get the winfo_width from any widget
<1> i really appreciate the help :)
<0> the reason i used winfo_width instead of canvas.cget('width') is that winfo_width is the actual size of the widget on the screen, not just the size the widget requested to be (which is rarely what it gets)
<2> does python have a builtin for sets that can grow and shrink?
<0> see sets.Set in the standard lib
<2> they are immutable
<0> not sets.ImmutableSet :)
<0> i mean "don't look at sets.ImmutableSet, look at sets.Set"



<1> start,end = canvas.zoom()
<1> ht = canvas.winfo_height()
<1> x = (x-start)/(end-start)*canvas.winfo_width()
<1> y = (ht-5)-y*(ht-10)
<1> er sorry about that
<1> just meant to say thanks :)
<0> Gfn: don't forget __future__.division :)
<2> cool thanks
<1> You need to explain future.division to me, and have pity. I just started using python this past week ;)
<3> thepipe = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
<3> thepipe.read()
<3> i'm a bit confused
<0> Gfn: try "x,start,end = 1,0,3; print (x-start)/(end-start)" to see the problem
<0> Gfn: 1/3 is 0, since old python uses integer division when all the operands are ints. add "from __future__ import division" to the very top of your program to fix that
<3> nevermind, thepipe.stdout.read()
<1> 1/3 = 0??
<1> ahh
<1> very smart :)
<0> after the subtextual discussion earlier, this one made my head explode: http://www.overheardinnewyork.com/archives/004498.html
<1> drewp, AttributeError: Canvas instance has no attribute 'zoom'
<1> hmm
<0> scale
<2> how do you from python find out where /usr/lib/python2.4/site-packages is?
<0> oh i know this one..
<1> "drewp scale", That's confusing :|
<0> well i misplaced it, but distutils can tell you where Python.h is, and probably site-packages too
<0> Gfn: i think you're looking for the method called Canvas.scale
<0> Sonderblade: well, distutils.sysconfig.get_python_inc() is the one i was thinking of. there might be something nearby that has what you want
<1> I see, ok :p
<1> ok now i need to ask a dumb question, because my knowledge here is severely lacking. start,end = canvas.scale() | TclError: wrong # args: should be ".-1210975764.-1210975732 scale tagOrId xOrigin yOrigin xScale yScale"
<0> Gfn: Canvas.scale is clearly not what you think :) see http://www.ayni.com/perldoc/perl5.7.3/lib/Tk/Canvas.html#$canvas-%3Escale(tagOrId,-xOrigin,-yOrigin,-xScale,-yScale)
<1> ok. so Canvas.scale returns an empty string. Where do the values for start and end come from?
<0> in my code, i was using start/end as the times at the left/right sides of my curve drawing
<4> hi
<1> ahhh
<0> so they may have nothing to do with your problem
<1> they definetely do. Thank you that makes it a lot clearer
<4> anyone knows about any problems with python threads, the GIL and system() calls?
<0> Gfn: here's one screenshot of my program: http://bigast.com/post/light9/curvecalc2.png
<4> system() in C
<5> hi
<4> I can update my gui in gtk fine, except when a callback makes a system() call to ldconfig
<5> ahh - there's live :)
<5> just wanted to ask: Is it possible to change the color of the console-output with some out-of-the-box method (means: without something like for instance "curses")
<4> maybe some escape codes
<4> don't know
<4> that's terminal voodoo
<5> problem on esc-sequs is that they are very sys-specific
<5> put for the beginning a good solution
<5> but, not put :)
<6> Hello.
<6> Is there a way to import data structs from a c header file (".h") ?
<4> I think it's not possible
<0> python comes with h2py, but that probably can't do structs. ctypes can deal with the structs, but i don't know if it can parse them from C
<6> I hate c
<7> ?
<8> I used to think c and c++ were great, but Python has really spoiled me...
<4> I bet C hates you back
<7> hahah
<7> ruby and python are the pwnage
<8> coming from c++ and ***embly, I used to think that programming simply *was* hard, and that was that. python has really shown me otherwise...



<7> python isn't proceedurel
<4> C is a pain sometimes
<8> python *can* be, and python can also be functional, and python can be oop, and it can be...
<4> but it's fast
<7> whats fast?
<4> C
<8> is there any benefit to a python programmer learning ruby?
<7> diethylamine: What is a good example of python being procedural?
<9> of course, there's always a benefit in learning something new
<7> diethylamine:Ruby attacks problems differently
<7> diethylamine:However, very simalar to python. They are both in the same type of family
<10> ruby is probably a bit more OO than python
<10> i think i prefer python
<10> :)
<10> i prefer both over perl.... i have to write some stuff in perl for school :(
<10> on a side note, since #xml is so quiet.... anyone familiar with xsl:key?
<8> does ruby's oo purity make it more verbose than python? Do you have to wade through object heirarchy to access functions in ruby like you do in java? I like that python is oo but is quite terse
<11> i've just started learning python and enjoy it greatly so far, very new to me though
<12> hi there
<12> can anybody suggest a blog written in python?
<11> however, i doubt i will be able to fully enjoy it until i've had more experience with it, wonderful base of language though, pretty new to the OO but getting there.
<10> spike: django is a whole framework, or turbogears
<10> diethylamine: as far as i know visibility isnt a consideration with rubies OO
<10> similar to perl / python
<13> does anyone know if there is a python (or pygtk) object to access the notification area?
<10> trovao: i hope so, nicotine needs to use it :)
<13> triplah: I hope so too, I am making a gnome-applet, but if it is called directly, its good to put it on the notification area
<10> whats the applet for?
<13> guess I've found it /usr/lib/python2.4/site-packages/gtk-2.0/egg/trayicon.so
<10> spike: #python.web
<13> triplah: preloading OOo
<10> trovao: nice
<0> spike: i'm using newsbruiser- it's ok
<10> trovao: on system startup?
<13> triplah: if it is on the panel, yes
<10> trovao: you could do something similar with alltray, alltray ooffice2 would start open office and keep it minimised in the notification area
<14> what would make one get invalid literal for int I wrap a string that is a number in int() and I get that.
<14> my program continues to work
<14> without error.
<14> and it processes the number correctly
<14> but gives me that error.
<13> triplah: interesting
<10> not to rain on your parade :P
<13> lol
<13> Scratch: sorry... :(
<15> factor warning or error?
<14> ValueError
<13> triplah: anyway, I'll keep going since I am learning some new concepts
<14> I am wraping a glade entry widget which can can noramly save and use as a value
<14> mc
<14> I am just trying to get the difference of the oldvalue to the new value
<14> newkeyframedata = int( entry.get_text() )
<14> that gets me
<14> ValueError: invalid literal for int():
<14> but works
<10> trovao: sweet :D
<15> factor how bizarre
<14> the widget is locked to only except numbers as well
<16> os.mkdir() appears to be broken
<16> os.mkdir("somedir", 01777) gives me "somedir" with 0755
<16> but 'mkdir -m 01777 somedir' gives me "somedir" with 01777
<15> agaffney are you root?
<17> agaffney: 01777 is an octal number
<16> pjarks: yes
<15> pavlovsdog nice nick
<16> Sulis: mkdir(path [, mode=0777])...and that isn't?
<15> agaffney prehaps your UMASK is affecting it?
<16> pjarks: then why would it work from the same shell when using `mkdir`?
<15> agaffney hem
<17> agaffney: try using a string
<15> Sulis requires int
<16> TypeError: an integer is required ;)
<17> ah, heh
<15> agaffney


Name:

Comments:

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






Return to #python
or
Go to some related logs:

modprobe hangs ca0106
ncurses package SUSE
Perl Wlanscanner
nick autocompletion + bitchX
vxwindows
#ubuntu
AN-VM CSM Dos
#python
#php
#web



Home  |  disclaimer  |  contact  |  submit quotes