Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread David Crouse
I use Arch Linux, it has Python 3.0 and 2.6 and 2.4. Below are some common packages and their version numbers. I wouldn't however recommend Arch to a new Linux user, it's not Ubuntu. However once installed and configured, it's very easy to maintain. python3 3.0-3 python 2.6.1-1 python24 2.4.6-1

Re: SSL certificate parsing?

2009-01-05 Thread Python Nutter
If no one answers, the way I do my work with certificates is I just wrap OpenSSL myself by doing a popen call (probably now should be using subprocess for any future scripts I write). I then redirect the output that normally goes to the shell window into a buffer then I search/slice out the fields

Re: why cannot assign to function call

2009-01-05 Thread Terry Reedy
Aaron Brady wrote: Containers are funny in Python in that 'a in a' can be true. It can't in real containers. Guido uses 'container' in the Ref Manual because such 'contain' references (of an undefined nature). Thinking more abstractly, I use 'collection', rather that 'container' and think

Re: About PyOpenGL

2009-01-05 Thread trueli...@gmail.com
On Jan 6, 12:58 am, Rob Williscroft wrote: > trueli...@gmail.com wrote in news:f8099226-a953-4598-bfe2-61ee5772ce26 > @l33g2000pri.googlegroups.com in comp.lang.python: > > > > > > > Traceback (most recent call last): > >   File "test.py", line 36, in > >     main() > >   File "test.py", line 26,

Re: Noob question: Is all this typecasting normal?

2009-01-05 Thread Gabriel Genellina
En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith escribió: The other day, I came upon this gem. It's a bit of perl embedded in a Makefile; this makes it even more gnarly because all the $'s get doubled to hide them from make: define absmondir $(shell perl -e ' \                              

Re: multiprocessing vs thread performance

2009-01-05 Thread Gabriel Genellina
En Sat, 03 Jan 2009 11:31:12 -0200, Nick Craig-Wood escribió: mk wrote: The results I got are very different from the benchmark quoted in PEP 371. On twin Xeon machine the threaded version executed in 5.54 secs, while multiprocessing version took over 222 secs to complete! Am I doing s

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kangkook Jee wrote: > That seems like a good solution for my issue but how can I distinguish > traffics from my application to others? I use nethogs on Ubuntu. If you use Intrepid, you can press 'm' to make it change amongst different displays (eg cu

Re: Is there a better algorithm?

2009-01-05 Thread alex goretoy
> > class entry: > filename = None > > def __init__(self, name, value, filename=None): >self.name = name >self.value = value >if filename is not None: > self.filename = filename > > [entry('name', 'Gabriel'), entry('age', 18), entry('pic', picture_data, > 'path/to/file')] Gabri

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread alex goretoy
You can alot run "lsof -i -T -n" from popen2 to see what applications use what port and addr they are connected to. In order to see all jobs though it needs to be ran as root. This way you can find out what ports and such Then perform tcp dump thru popen2 and filter for port and addr. This is just

Re: Is there a better algorithm?

2009-01-05 Thread Gabriel Genellina
En Sat, 03 Jan 2009 02:55:12 -0200, Kottiyath escribió: tuples = [(1, 2), (3, 4, 5), (6, 7)] It is a code to post some data to HTML server. Even though usually the POST values are of type(name, value), if file transfer is involved, then POST values change to (name, filename, value). My view

Diff Across Multiple Files

2009-01-05 Thread James Pruitt
I am looking for a way to diff across multiple files; on average around 30 to 60 using python and probably the diff library so that we could see what is common between all files and sort of ignore the differences. -- http://mail.python.org/mailman/listinfo/python-list

Re: idle 3.0 unicode

2009-01-05 Thread Gabriel Genellina
En Thu, 01 Jan 2009 06:11:50 -0200, Pavel Kosina escribió: In 3.0 there is an error. The same program, moved to 3.0 syntax, in IDLE editor : # -*- coding: utf-8 -*- print ("ěščřžýáíé") prints: ěščřžýáíé The same program without coding declaration (but saved in utf8) : print ("ěščř

Re: Rich Comparisons Gotcha

2009-01-05 Thread Steven D'Aprano
On Tue, 06 Jan 2009 01:24:58 +, Mark Wooding wrote: > Steven D'Aprano wrote: > >> I've already mentioned NaNs. Sentinel values also sometimes need to >> compare not equal with themselves. Forcing them to compare equal will >> cause breakage. > > There's a conflict between such domain-specif

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Grant Edwards
On 2009-01-05, Kangkook Jee wrote: > I'd like to measure number of bytes sent(or recv'd) from my > python application. Does anyone have any idea how can I > achieve this? Aside from tcpdump/wireshark, you can set up iptables rules to enable accounting for traffic based on IP addresses and ports.

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Grant Edwards
On 2009-01-05, Kangkook Jee wrote: > Jonathan Gardner wrote: >> On Jan 5, 2:26 pm, Kangkook Jee wrote: >>> I'd like to measure number of bytes sent(or recv'd) from my python >>> application. Does anyone have any idea how can I achieve this? >>> >>> I tried to do this by tracing some socket calls

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Grant Edwards
On 2009-01-05, Jonathan Gardner wrote: > On Jan 5, 2:26 pm, Kangkook Jee wrote: >> >> I'd like to measure number of bytes sent(or recv'd) from my >> python application. Does anyone have any idea how can I >> achieve this? >> >> I tried to do this by tracing some socket calls (send, sendto, >> sen

Re: why cannot assign to function call

2009-01-05 Thread Aaron Brady
On Jan 4, 1:28 am, Steven D'Aprano wrote: > I'm answering both John and Aaron's comments in the following. Mostly > John at the start, Aaron toward the end. > > On Sat, 03 Jan 2009 15:42:47 -0800, Aaron Brady wrote: > > On Jan 3, 11:25 am, John O'Hagan wrote: > > [...] > > > > >According to this,

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Steven D'Aprano
On Mon, 05 Jan 2009 18:23:10 -0500, Kangkook Jee wrote: > Jonathan Gardner wrote: >> On Jan 5, 2:26 pm, Kangkook Jee wrote: >>> I'd like to measure number of bytes sent(or recv'd) from my python >>> application. Does anyone have any idea how can I achieve this? >>> >>> I tried to do this by traci

Re: Rich Comparisons Gotcha

2009-01-05 Thread Mark Wooding
Steven D'Aprano wrote: > I've already mentioned NaNs. Sentinel values also sometimes need to > compare not equal with themselves. Forcing them to compare equal will > cause breakage. There's a conflict between such domain-specific considerations (NaNs, strange sentinels, SAGE's equations), and r

Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread Lex Hider
Probably not a big difference in most cases between debian, ubuntu, fedora. The latter two may be more likely to have more recent versions. I'm pretty sure ubuntu is the only one which currently has python 3.0 in it's archives [no, it's not the default version]. On 06/01/2009, member thudfoo wro

Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread James Mills
On Tue, Jan 6, 2009 at 11:11 AM, alex goretoy wrote: > +1 for ubuntu +1 for Ubuntu also (for the novice and ex-windows user(s)) +2 for CRUX (1) cheers James 1. http://crux.nu/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread alex goretoy
+1 for ubuntu -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Tue, Jan 6, 2009 at 12:39 AM, wrote: > Hi, > > I would have to put in a vote for Ubuntu. > > There seems to be a working ubuntu package for most of the things that I > have tried. Instead of having to use a py

Re: Is there a best linux distro for a python hobbyist?

2009-01-05 Thread david.lyon
Hi, I would have to put in a vote for Ubuntu. There seems to be a working ubuntu package for most of the things that I have tried. Instead of having to use a pythonic package - just get one from the os. As for the things you mention.. give it a go On Mon, 5 Jan 2009 15:42:00 -0800, "member thud

Re: Rich Comparisons Gotcha

2009-01-05 Thread Mark Wooding
Steven D'Aprano wrote: > There is nothing to blame them for. This is the correct behaviour. NaNs > should *not* compare equal to themselves, that's mathematically > incoherent. Indeed. The problem is a paucity of equality predicates. This is hardly surprising: Common Lisp has four general-pu

cPickle vs pickle discrepancy

2009-01-05 Thread Zac Burns
Greetings, I have a module that attempts to pickle classes defined in that module. I get an error of the form: PicklingError: Can't pickle : import of module Module.SubModule failed when using cPickle (protocol -1, python version 2.5.1). The module has already been imported and is in sys.modules

Re: socket send help

2009-01-05 Thread James Mills
On Wed, Dec 24, 2008 at 3:59 PM, greyw...@gmail.com wrote: (snip) > If I run testserver.py via the cmd prompt in Windows XP and then the > testclient.py program, I get the following error: > > Traceback (most recent call last): > File "C:\Python30\testclient.py", line 12, in >s.send('Hello

Re: socket send help

2009-01-05 Thread James Mills
On Tue, Jan 6, 2009 at 10:49 AM, Bryan Olson wrote: >> I thought a firewall would block an attempt to bind to any routeable >> address, but not to localhost. So using INADDR_ANY would be rejected. No. > My understanding is that firewalls block network traffic, not system calls. This is correct.

Re: socket send help

2009-01-05 Thread Bryan Olson
Gabriel Genellina wrote: Bryan Olson escribió: Gabriel Genellina wrote: greyw...@gmail.com escribió: [...] A simple server: from socket import * myHost = '' Try with myHost = '127.0.0.1' instead - a firewall might be blocking your server. Just a nit: I'd say the reason to use '127.0.0.1

Re: Regex Generator From Multiple Files

2009-01-05 Thread MRAB
James Pruitt wrote: I am looking for a way given a number of files, say 3, that represent technical support tickets in the same format to generate regular expressions for the different fields automatically. An example from of one line from each file: Date: 12/30/2008 Room: 457 Building: Main D

Re: Extending Python with C or C++

2009-01-05 Thread Ryan
On Jan 5, 2:37 pm, Terry Reedy wrote: > Ryan wrote: > > I've been using Python for many years now. It's a wonderful language > > that I enjoy using everyday. I'm now interested in getting to know > > more about the guts > > The 'guts' of Python the language include the object model, namespaces > (

Regex Generator From Multiple Files

2009-01-05 Thread James Pruitt
I am looking for a way given a number of files, say 3, that represent technical support tickets in the same format to generate regular expressions for the different fields automatically. An example from of one line from each file: Date: 12/30/2008 Room: 457 Building: Main Date: 12/31/2008 Room: A2

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread alex goretoy
Have you looked into scapy? www.secdev.org/projects/*scapy*/ There's another one, it comes with python I think. Can't seem to remember the name. I may be mistaken though. -Alex Goretoy http://www.alexgoretoy.com somebodywhoca...@gmail.com On Mon, Jan 5, 2009 at 11:23 PM, Kangkook Jee wrote:

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread James Mills
On Tue, Jan 6, 2009 at 8:26 AM, Kangkook Jee wrote: > I'd like to measure number of bytes sent(or recv'd) from my python > application. Does anyone have any idea how can I achieve this? > > I tried to do this by tracing some socket calls (send, sendto, sendAll) > using 'metaclass' but I could fin

Is there a best linux distro for a python hobbyist?

2009-01-05 Thread member thudfoo
One with all the major python GUIs: pyQT, pyGtk, pyKde, wxPython, And so on. -- http://mail.python.org/mailman/listinfo/python-list

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Jonathan Gardner
On Jan 5, 3:23 pm, Kangkook Jee wrote: > Jonathan Gardner wrote: > > A good universal tool on the Linux platform is tcpdump. It takes some > > learning, but is very useful for this kind of task. You can use a tool > > like ethereal to visualize the data that tcpdump gathers. > > That seems like a

Re: multiprocessing vs thread performance

2009-01-05 Thread alex goretoy
There doesn't seem to be any good examples on POSH or it's not clear to me. For when using with a for loop like mk is doing who started this thread. How would somethings like this be possible to do with POSH? The example show how to share variables between processes/threads but nothing about How th

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Kangkook Jee
Jonathan Gardner wrote: On Jan 5, 2:26 pm, Kangkook Jee wrote: I'd like to measure number of bytes sent(or recv'd) from my python application. Does anyone have any idea how can I achieve this? I tried to do this by tracing some socket calls (send, sendto, sendAll) using 'metaclass' but I cou

Re: why cannot assign to function call

2009-01-05 Thread Rhodri James
On Mon, 05 Jan 2009 22:28:59 -, Steven D'Aprano wrote: * That only languages "substantially taught" in undergraduate CS courses matter. As an aside, I use only one of the languages I was taught in my Computer Science course, and that only for poking my EMACS configuration. Every other

Re: replacement for __file__ in compiled exe

2009-01-05 Thread TechieInsights
Yes, that is my exact question. How do you get the file path of your script/program. Normally in python you can use __file__ and it will return the file path of the script you are in, however, when you compile the script to exe py2exe (or whatever util you are using) compresses them into a zip fo

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Jonathan Gardner
On Jan 5, 2:26 pm, Kangkook Jee wrote: > I'd like to measure number of bytes sent(or recv'd) from my python > application. Does anyone have any idea how can I achieve this? > > I tried to do this by tracing some socket calls (send, sendto, sendAll) >   using 'metaclass' but I could find exactly pl

Re: [email/quoprimime.py] AttributeError: 'tuple' object has no attribute 'lstrip'

2009-01-05 Thread Terry Reedy
Gilles Ganault wrote: Hello I successfully use the email package to send e-mail from Python scripts, but this script fails when I fetch addresses from an SQLite database where data is Unicode-encoded: == from email.MIMEText import MIMEText import smtplib,sys import apsw connecti

Re: Tkinter - problem closing window

2009-01-05 Thread Collin D
On Jan 5, 9:21 am, Roger wrote: > On Jan 5, 11:52 am, Collin D wrote: > > > > > On Jan 5, 6:25 am, "Djames Suhanko" wrote: > > > > Hello! > > > I'm sorry my terrible english (my native language is portuguese). > > > I has a litle program that open another window. When I close de root > > > windo

Re: Extending Python with C or C++

2009-01-05 Thread Terry Reedy
Ryan wrote: I've been using Python for many years now. It's a wonderful language that I enjoy using everyday. I'm now interested in getting to know more about the guts The 'guts' of Python the language include the object model, namespaces (including modules), and the statement and infix-expres

Re: greenlets and how they can be used

2009-01-05 Thread James Mills
On Tue, Jan 6, 2009 at 4:39 AM, Benjamin Walkenhorst wrote: > James Mills wrote: >> On Sun, Jan 4, 2009 at 4:52 AM, Benjamin Walkenhorst wrote: >>> POE was one of the nicest software frameworks I have ever used, and I've >>> been continuously frustrated by the lack of something like it in other

Re: why cannot assign to function call

2009-01-05 Thread Steven D'Aprano
On Mon, 05 Jan 2009 13:21:09 -0600, Derek Martin wrote: > Some of the comments from people include the idea that the assignment > model is nothing special, if you've encountered any one of a dozen other > languages. I didn't realize programming in any of those languages was a > prerequisite for p

Measuring bytes of packet sent from python application

2009-01-05 Thread Kangkook Jee
Hi, all I'd like to measure number of bytes sent(or recv'd) from my python application. Does anyone have any idea how can I achieve this? I tried to do this by tracing some socket calls (send, sendto, sendAll) using 'metaclass' but I could find exactly place that I can put this in. My appli

Re: My last working day of 2007

2009-01-05 Thread News123
s...@pobox.com wrote: > Jack> It's simple, a small program running on background, logging the > Jack> title of foreground window. A python script parses the log file > Jack> and then generates chart by matplotlib. > > Jack> I just want to get suggestions to improve it, or know the

Re: threading a 10 lines out of a file

2009-01-05 Thread alex goretoy
> > Se we need to know a bit more about your 4.5-hour program before we can > determine whether threads can help. There is light at the end of the > tunnel, however, since even if threads don't work it's possible that the > multiprocessing module will (assuming you have multi-processor hardware > a

Re: threading a 10 lines out of a file

2009-01-05 Thread Steve Holden
alex goretoy wrote: > Steve, > > Are you referring to the endless GIL debate? I googled about what you > said. I'll look into it here shortly. I just know one thing, is that I > need a comparison for regular code and something about how GIL and > threading fit in the picture. It makes it easier fo

Re: threading a 10 lines out of a file

2009-01-05 Thread alex goretoy
Steve, Are you referring to the endless GIL debate? I googled about what you said. I'll look into it here shortly. I just know one thing, is that I need a comparison for regular code and something about how GIL and threading fit in the picture. It makes it easier for me to understand what is going

Re: replacement for __file__ in compiled exe

2009-01-05 Thread John Machin
On Jan 6, 7:03 am, TechieInsights wrote: > __file__ command does not work when compiled to exe.  It makes since > because the file is now in a compressed library.  Is there a > replacement or something else you can do?  The real problem is that > when you create an exe of your program with python

Re: Python training in Colorado, January 27-30

2009-01-05 Thread alex goretoy
> > lutz> Per my web page, my classes may be available in a different >lutz> location later this year (Florida is a strong possibility), but >lutz> not in Tulsa, unfortunately. > > Maybe if Tulsa had more appealing geography or weather??? ;-) > > Skip Yes, that makes sense to me. Thank y

Re: Extending Python with C or C++

2009-01-05 Thread Ralf Schoenian
Ryan wrote: I've been using Python for many years now. It's a wonderful language that I enjoy using everyday. I'm now interested in getting to know more about the guts (C/C++) and extending it. But, extending python still seems like a black art to me. Is there anymore docs or info on extending it

Extending Python with C or C++

2009-01-05 Thread Ryan
I've been using Python for many years now. It's a wonderful language that I enjoy using everyday. I'm now interested in getting to know more about the guts (C/C++) and extending it. But, extending python still seems like a black art to me. Is there anymore docs or info on extending it besides the s

Re: __init__.py and package help

2009-01-05 Thread TechieInsights
Thanks J. Cliff Dyer wrote: > On Mon, 2009-01-05 at 11:49 -0800, TechieInsights wrote: > > Ok I have read all of the tutorials and documents I could find. I am > > running Python 2.6 on windows. The problem I am having with packages > > is that they don't show up! > > > > Simple example of what

replacement for __file__ in compiled exe

2009-01-05 Thread TechieInsights
__file__ command does not work when compiled to exe. It makes since because the file is now in a compressed library. Is there a replacement or something else you can do? The real problem is that when you create an exe of your program with python embedded, you can't always guarantee that your cur

Re: __init__.py and package help

2009-01-05 Thread J. Cliff Dyer
On Mon, 2009-01-05 at 11:49 -0800, TechieInsights wrote: > Ok I have read all of the tutorials and documents I could find. I am > running Python 2.6 on windows. The problem I am having with packages > is that they don't show up! > > Simple example of what isn't working... > Structure- > > pyte

Re: __init__.py and package help

2009-01-05 Thread TechieInsights
Ok... I figured it out... you can only import packages via the __all__ = ['subpackage/folder']... if you include a module such as hello.py, it will fail. Go figures I'd find this right after posting here... Greg TechieInsights wrote: > Ok I have read all of the tutorials and documents I could fi

__init__.py and package help

2009-01-05 Thread TechieInsights
Ok I have read all of the tutorials and documents I could find. I am running Python 2.6 on windows. The problem I am having with packages is that they don't show up! Simple example of what isn't working... Structure- pytest/ Root directory of package __init__.py- code: __all__ = ['folder']

Re: why cannot assign to function call

2009-01-05 Thread Derek Martin
On Mon, Jan 05, 2009 at 01:23:04PM -0500, Steve Holden wrote: > Even if they really are small-minded or stupid I agree this wouldn't be > helpful behavior. But neither would your characterization of Python's > assignment model as "bizarre" (even ignoring that you SHOUTED IT AT US), > and I have yet

Re: Why not Ruby?

2009-01-05 Thread r
On Jan 5, 7:31 am, "Tim Rowe" wrote: > 2009/1/1 r : > > > I am beginning to think > > the perfect high level language would take the best for Ruby and > > Python. The ultimate language with speed in mind, pythons clear > > syntax, but with shortcuts for gurus. > > I spent quite a few evenings look

Re: Python training in Colorado, January 27-30

2009-01-05 Thread skip
lutz> Per my web page, my classes may be available in a different lutz> location later this year (Florida is a strong possibility), but lutz> not in Tulsa, unfortunately. Maybe if Tulsa had more appealing geography or weather??? ;-) Skip -- http://mail.python.org/mailman/listinfo/pyt

Re: Python training in Colorado, January 27-30

2009-01-05 Thread lutz
Yes, my public classes are held only in Colorado today. Most students travel from out-of-town to attend. Per my web page, my classes may be available in a different location later this year (Florida is a strong possibility), but not in Tulsa, unfortunately. Thanks, --Mark Lutz -Original Mes

Re: why cannot assign to function call

2009-01-05 Thread Steve Holden
Steven D'Aprano wrote: > On Sun, 04 Jan 2009 20:03:11 -0600, Derek Martin wrote: [...] And for that matter, it's pretty unintuitive generally. >>> Names and objects are quite "natural" IMHO. There are many real world >>> objects which we attach one or more names to, or refer to in sequences >>

Re: why cannot assign to function call

2009-01-05 Thread Steve Holden
Derek Martin wrote: > On Sun, Jan 04, 2009 at 09:56:33PM -0600, Grant Edwards wrote: >> On 2009-01-05, Derek Martin wrote: >>> On Sat, Jan 03, 2009 at 11:38:46AM -0600, Grant Edwards wrote: One presumes that Mr. Martin finds anything different from his first computer language to be BIZAR

Re: threading a 10 lines out of a file

2009-01-05 Thread Steve Holden
alex goretoy wrote: > I've found a great example on how to do threads. It compares a ping > program in regular for loop and with threaded for loop. The link is > below if anyone is interested. > > http://www.wellho.net/solutions/python-python-threads-a-first-example.html > > I hope my eagerness t

Re: Python callback functions and static methods

2009-01-05 Thread Steve Holden
Joris wrote: > Hello, > > I'm trying to implement callback functionality in a static class. > > I have a feeling that I'm doing something against the Python philosophy > and not some programming error but any help would be appreciated. > > First, a piece of proof-of-concept-code: > * > class Dat

Re: Python callback functions and static methods

2009-01-05 Thread Jean-Paul Calderone
On Mon, 5 Jan 2009 18:00:37 +0100, Joris wrote: Hello, I'm trying to implement callback functionality in a static class. I have a feeling that I'm doing something against the Python philosophy and not some programming error but any help would be appreciated. Others have explained what was w

Re: socket send help

2009-01-05 Thread Gabriel Genellina
En Sat, 03 Jan 2009 21:44:34 -0200, Bryan Olson escribió: Gabriel Genellina wrote: greyw...@gmail.com escribió: [...] A simple server: from socket import * myHost = '' Try with myHost = '127.0.0.1' instead - a firewall might be blocking your server. Just a nit: I'd say the reason to

Re: Python callback functions and static methods

2009-01-05 Thread Chris Rebert
On Mon, Jan 5, 2009 at 9:00 AM, Joris wrote: > Hello, > > I'm trying to implement callback functionality in a static class. > > I have a feeling that I'm doing something against the Python philosophy and > not some programming error but any help would be appreciated. > > First, a piece of proof-of

Re: Python callback functions and static methods

2009-01-05 Thread MRAB
Joris wrote: Hello, I'm trying to implement callback functionality in a static class. I have a feeling that I'm doing something against the Python philosophy and not some programming error but any help would be appreciated. First, a piece of proof-of-concept-code: * class Data: callfunc

Re: Tkinter - problem closing window

2009-01-05 Thread Roger
On Jan 5, 11:52 am, Collin D wrote: > On Jan 5, 6:25 am, "Djames Suhanko" wrote: > > > > > Hello! > > I'm sorry my terrible english (my native language is portuguese). > > I has a litle program that open another window. When I close de root > > window in quit button, I need clicking 2 times to cl

Re: Python return values

2009-01-05 Thread Mel
koranth...@gmail.com wrote: > I have a newbie doubt about Python return values. > > In (say) C/C++, if we try to return a value which is stored inside the > procedure stack, we will get an error when trying to access it outside > of that procedure. > For example: > function foo(): >dcl y int

Re: mod_python: delay in files changing after alteration

2009-01-05 Thread Stephen Chapman
I have never noticed any such delay. After making a change I just hit F5 on my browser and its fine. Maybe its a browser issue On 1/5/09, psaff...@googlemail.com wrote: > Maybe this is an apache question, in which case apologies. > > I am running mod_python 3.3.1-3 on apache 2.2.9-7. It works

Python callback functions and static methods

2009-01-05 Thread Joris
Hello, I'm trying to implement callback functionality in a static class. I have a feeling that I'm doing something against the Python philosophy and not some programming error but any help would be appreciated. First, a piece of proof-of-concept-code: * class Data: callfunc = None @sta

Python return values

2009-01-05 Thread koranthala
I have a newbie doubt about Python return values. In (say) C/C++, if we try to return a value which is stored inside the procedure stack, we will get an error when trying to access it outside of that procedure. For example: function foo(): dcl y int dcl x pointer to int pointing to y retu

Re: About PyOpenGL

2009-01-05 Thread Rob Williscroft
trueli...@gmail.com wrote in news:f8099226-a953-4598-bfe2-61ee5772ce26 @l33g2000pri.googlegroups.com in comp.lang.python: > > Traceback (most recent call last): > File "test.py", line 36, in > main() > File "test.py", line 26, in main > glutInit(sys.argv) > File "c:\python25\lib\si

Re: Tkinter - problem closing window

2009-01-05 Thread Collin D
On Jan 5, 6:25 am, "Djames Suhanko" wrote: > Hello! > I'm sorry my terrible english (my native language is portuguese). > I has a litle program that open another window. When I close de root > window in quit button, I need clicking 2 times to close. is where the > problem? > > The source: >   1 #!

Re: math module for Decimals

2009-01-05 Thread alex goretoy
> > Hmm. Maybe we shouldn't be using this syntax in from_float, if it's > the only thing that prevents the trunk version of decimal.py from > being used with Python 2.4. On the other hand, from_float isn't > going to work until 2.7 anyway, since it uses a whole bunch of > new stuff: as_integer_r

Re: reflection as in Java: how to create an instance from a classname

2009-01-05 Thread Quentin Gallet-Gilles
On Mon, Jan 5, 2009 at 5:34 PM, Bruno Desthuilliers wrote: > guss a écrit : > >> I cannot find a satisfying answer to this question on the web so let's >> try here. >> >> My problem is the following, I would like to instantiate some object >> from a configuration file that would contain class nam

Re: reflection as in Java: how to create an instance from a classname

2009-01-05 Thread Bruno Desthuilliers
guss a écrit : I cannot find a satisfying answer to this question on the web so let's try here. My problem is the following, I would like to instantiate some object from a configuration file that would contain class names like for example classname=org.common.resource.MyResource. Here my resourc

reflection as in Java: how to create an instance from a classname

2009-01-05 Thread guss
I cannot find a satisfying answer to this question on the web so let's try here. My problem is the following, I would like to instantiate some object from a configuration file that would contain class names like for example classname=org.common.resource.MyResource. Here my resource is the class to

Re: About PyOpenGL

2009-01-05 Thread Cousin Stanley
> > OpenGL.error.NullFunctionError: Attempt to call an undefined function > __glutInitWithExit, check for bool(__glutInitWithExit) before calling > > Can anyone please tell me why? Your opengl program runs exactly as coded without error under Debian 5.0 Linux Lenny Perhaps a req

mod_python: delay in files changing after alteration

2009-01-05 Thread psaff...@googlemail.com
Maybe this is an apache question, in which case apologies. I am running mod_python 3.3.1-3 on apache 2.2.9-7. It works fine, but I find that when I alter a source file during development, it sometimes takes 5 seconds or so for the changes to be seen. This might sound trivial, but when debugging te

Re: My last working day of 2007

2009-01-05 Thread skip
Jack> It's simple, a small program running on background, logging the Jack> title of foreground window. A python script parses the log file Jack> and then generates chart by matplotlib. Jack> I just want to get suggestions to improve it, or know the news Jack> that somebody ha

Re: Tkinter - problem closing window

2009-01-05 Thread Peter Otten
Djames Suhanko wrote: > Hello! > I'm sorry my terrible english (my native language is portuguese). > I has a litle program that open another window. When I close de root > window in quit button, I need clicking 2 times to close. is where the > problem? > > The source: > 1 #!/usr/bin/env python

Re: f.seek() unwanted output

2009-01-05 Thread pruebauno
On Jan 5, 8:52 am, "thomasvang...@gmail.com" wrote: > I'm having trouble with a script that is printing the output of f.seek > () whereas in the documentation it is quoted not to have any output: > > > file.seek(offset[, whence])¶ > >     Set the file’s current position, like stdio‘s fseek. T

Tkinter - problem closing window

2009-01-05 Thread Djames Suhanko
Hello! I'm sorry my terrible english (my native language is portuguese). I has a litle program that open another window. When I close de root window in quit button, I need clicking 2 times to close. is where the problem? The source: 1 #!/usr/bin/env python 2 from Tkinter import * 3 import sy

Re: f.seek() unwanted output

2009-01-05 Thread Tim Chase
I'm having trouble with a script that is printing the output of f.seek () [snip] I have a file in memory. when i try f.seek(0) #or any other value in f.tell() it gives me 0 as output: the following script illustrates my 'problem' for a in range(10): f.seek(a) 0 1 2 3 4 5 6 7 8 9

f.seek() unwanted output

2009-01-05 Thread thomasvang...@gmail.com
I'm having trouble with a script that is printing the output of f.seek () whereas in the documentation it is quoted not to have any output: file.seek(offset[, whence])¶ Set the file’s current position, like stdio‘s fseek. The whence argument is optional and defaults to os.SEEK_SET or 0 (

Re: My last working day of 2007

2009-01-05 Thread Ant
On Jan 5, 9:47 am, "Jack.Chu" wrote: > Hello guys: > I created a simple tool to count how I wasted my time day by day > ;-)http://www.flickr.com/photos/34017...@n07/3169438647/sizes/o/ Looks interesting - did you have some sort of time machine to be spending that much time in Chrome at the end o

Re: Why not Ruby?

2009-01-05 Thread Tim Rowe
2009/1/1 r : > I am beginning to think > the perfect high level language would take the best for Ruby and > Python. The ultimate language with speed in mind, pythons clear > syntax, but with shortcuts for gurus. I spent quite a few evenings looking at Ruby, and didn't find a single thing I liked (

About PyOpenGL

2009-01-05 Thread trueli...@gmail.com
I follow the , write a small test: #!/usr/bin/env python # encoding=utf-8 import sys from OpenGL.GL import * from OpenGL.GLUT import * def display(): glClear(GL_COLOR_BUFFER_BIT) glColor(1.0, 1.0, 1.0) glBegin(GL_POLYGON) glVertex(0.25, 0.25, 0.0) glVertex(0.75, 0.25, 0.0)

Re: structuring a package?

2009-01-05 Thread Bruno Desthuilliers
Torsten Mohr a écrit : Hi, i have a question on how to structure a package best, would be great if anybody could give me some hint on this: Assuming i have a base class GraphicObject and derived from that some classes like Square, Circle, ... It looks natural to me to write in a code that uses

Re: structuring a package?

2009-01-05 Thread Torsten Mohr
Hello James, >> That way i'd have to structure the code like this: >> >> graphic/ >> __init__,py (GraphicObject) >> square.py (Square) >> circle.py (Circle) >> >> Does that make sense like this? > > This seems perfectly acceptable. Thanks for that hint. Do you see a way that i could write i

Re: fetch image

2009-01-05 Thread Diez B. Roggisch
asit wrote: > import httplib > > class Server: > #server class > def __init__(self, host): > self.host = host > def fetch(self, path): > http = httplib.HTTPConnection(self.host) > http.request("GET", path) > r = http.getresponse() > print str(r.

fetch image

2009-01-05 Thread asit
import httplib class Server: #server class def __init__(self, host): self.host = host def fetch(self, path): http = httplib.HTTPConnection(self.host) http.request("GET", path) r = http.getresponse() print str(r.status) + " : " + r.reason serve

Re: why cannot assign to function call

2009-01-05 Thread Marc 'BlackJack' Rintsch
On Sun, 04 Jan 2009 22:55:09 -0600, Derek Martin wrote: > On Sun, Jan 04, 2009 at 09:30:20PM -0500, Steve Holden wrote: >> > I'm going to go out on a limb and assert that there's NO POSSIBLE WAY >> > a student could intuit Python's variable assignment behavior, having >> > never been exposed to th

Re: How to "kill" orphaned threads at program exit

2009-01-05 Thread BlueBird
On Dec 28 2008, 6:33 pm, "Giampaolo Rodola'" wrote: > Hi, > I know that it's not possible to "kill" threads but I'm wondering if > does exist some workaround for my problem. > I have a test suite which does a massive usage of threads. > Sometimes happens that one test fails, the test suite keeps r

Re: why cannot assign to function call

2009-01-05 Thread Marc 'BlackJack' Rintsch
On Sun, 04 Jan 2009 20:03:11 -0600, Derek Martin wrote: > On Sat, Jan 03, 2009 at 10:15:51AM +, Marc 'BlackJack' Rintsch > wrote: >> On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: >> >> What's the difference between Python and Java or C# here!? Or are they >> also "BIZARRE"!? > > I

  1   2   >