Re: ImageFont family mojibake

2009-09-13 Thread Lie Ryan
Donn wrote: On Saturday 12 September 2009 17:30:19 garabik- news-2005...@kassiopeia.juls.savba.sk wrote: apt-get install unicode unicode 0100.. Nice tip, thanks. if you see a lot of accented letters (and not squares or question marks), you can be sure I see the accented chars -- so now I am m

Re: Which version of python I should use if I just start programming in python?

2009-09-13 Thread Kegan
I have just started using 2.6 (upgrade from 2.5). All my web applications' code (using Django), work without any changes. -- http://mail.python.org/mailman/listinfo/python-list

run exe on different computer

2009-09-13 Thread daved170
Hi everybody, I'm building a small python program that run a service (exe file) on my servers. I don't want to use remote desktop and it's siblings. I would like to have some information on how to run an exe on a different computer and if there a way to check if that exe is still alive. Thanks Da

Re: run exe on different computer

2009-09-13 Thread rootkit
Il 13/09/09 09.43, daved170 ha scritto: Hi everybody, I'm building a small python program that run a service (exe file) on my servers. I don't want to use remote desktop and it's siblings. I would like to have some information on how to run an exe on a different computer and if there a way to c

Re: Finite state machine in python

2009-09-13 Thread Banibrata Dutta
For simplistic FSMs, if you want to avoid hand-coding all the transitions, actions etc., you could consider something like Libero ( http://www.cs.vu.nl/~eliens/documents/libero/lrintr.htm), although the last I checked Libero didn't generate Python yet (but I believe there might be similar options a

Re: CPU usage while reading a named pipe

2009-09-13 Thread Nick Craig-Wood
Miguel P wrote: > On Sep 12, 2:54 pm, Ned Deily wrote: > > In article > > , > >  Miguel P wrote: > > > I've been working on parsing (tailing) a named pipe which is the > > > syslog output of the traffic for a rather busy haproxy instance. It's > > > a fair bit of traffic (upto 3k hits/s per ser

Re: is there a "strawberry python"?

2009-09-13 Thread Thorsten Kampe
* Daniel Fetchinson (Sat, 12 Sep 2009 12:54:03 -0700) > > > the reason I like strawberry perl is that I don't need to have admin right > > to install it. i can just unzip it and start the game. > > i am wondering if there is something similar in python community. > > > > any insight will be apprec

Re: Finite state machine in python

2009-09-13 Thread Hendrik van Rooyen
On Saturday 12 September 2009 22:39:10 Peng Yu wrote: > Hi, > > I have see some discussion on the implementation of finite state > machine in python. Can somebody point to me the best way in implenting > an FSM in python? > > http://code.activestate.com/recipes/146262/ You can go a long way with a

Re: How to define a function with an empty body?

2009-09-13 Thread Hendrik van Rooyen
On Sunday 13 September 2009 05:37:01 Peng Yu wrote: > Hi, > > I want to define a function without anything in it body. In C++, I can > do something like the following because I can use "{}" to denote an > empty function body. Since python use indentation, I am not sure how > to do it. Can somebody

Re: run exe on different computer

2009-09-13 Thread Dave Angel
daved170 wrote: Hi everybody, I'm building a small python program that run a service (exe file) on my servers. I don't want to use remote desktop and it's siblings. I would like to have some information on how to run an exe on a different computer and if there a way to check if that exe is still

Re: IDE for python similar to visual basic

2009-09-13 Thread Nobody
On Fri, 11 Sep 2009 05:27:59 -0700, r wrote: >> I'm saying that the user understands their workflow and environment better >> than the application's programmers. The user should be able to decide >> which menu items are shown and where, which buttons are shown and where, >> etc. The code doesn't n

Distributing Python environment

2009-09-13 Thread Ecir Hana
Hello, I have an app which I would like to extend with Python. I I saw how to embed the interpreter into C. If I bundle my app with the Python lib (say, python26.dll) I can PyRun_SimpleString() some code. My question is, how do I bundle the rest of the libraries (site, os, elementtree, random, ...)

Re: run exe on different computer

2009-09-13 Thread daved170
On Sep 13, 2:17 pm, Dave Angel wrote: > daved170 wrote: > > Hi everybody, > > I'm building a small python program that run a service (exe file) on > > my servers. > > I don't want to use remote desktop and it's siblings. > > > I would like to have some information on how to run an exe on a > > dif

PyQT child forms

2009-09-13 Thread daved170
Hi everybody, I'm building my GUI app with PyQT and i'm quite new with it. I looked for example for managing a form and a child form. My goal is to run the main form and a certain button will open a child form. Whenever the child form will be open the main form will be disabled until the child form

Python and 3d

2009-09-13 Thread azrael
Has anyone any exipience with python and 3d. I mean, is there a module to deal with popular 3d formats like 3ds, or vrml. is it possible to import into python opengl models and then use it in application for GUI purposes like through WX. I know that WX supports OpenGL but how to import models from

Re: Which version of python I should use if I just start programming in python?

2009-09-13 Thread Steven D'Aprano
On Sat, 12 Sep 2009 20:25:47 -0700, Kee Nethery wrote: > I would prefer to be in 3.x because all the inconsistencies of how you > do things in 2.x make it harder than it needs to be to learn the > language. > > People who have been coding in 2.x for along time don't notice how the > syntax is won

Re: How to define a function with an empty body?

2009-09-13 Thread Christian Heimes
Peng Yu schrieb: > Hi, > > I want to define a function without anything in it body. In C++, I can > do something like the following because I can use "{}" to denote an > empty function body. Since python use indentation, I am not sure how > to do it. Can somebody let me know how to do it in python

Re: How to define a function with an empty body?

2009-09-13 Thread Albert Hopkins
On Sat, 2009-09-12 at 22:37 -0500, Peng Yu wrote: > Hi, > > I want to define a function without anything in it body. In C++, I can > do something like the following because I can use "{}" to denote an > empty function body. Since python use indentation, I am not sure how > to do it. Can somebody l

Array of objects lost in unpickling

2009-09-13 Thread Bahadir
Hi, I have a class: class second: a = None b = None class first: array = [] I populate the array in first class with instances of second, then save by: shelve = shelve.open(), shelve["first"] = myfirst shelve.close() When I reopen the shelve from another script, the first class is

Re: Array of objects lost in unpickling

2009-09-13 Thread Jon Clements
On 13 Sep, 15:19, Bahadir wrote: > Hi, > > I have a class: > > class second: >     a = None >     b = None > > class first: >     array = [] > > I populate the array in first class with instances of second, then > save by: > > shelve = shelve.open(), > shelve["first"] = myfirst > shelve.close() >

Re: Array of objects lost in unpickling

2009-09-13 Thread Christian Heimes
Bahadir wrote: > Also there are no errors printed out. > > Any idea why the array of instances are lost? > The pickle protocol doesn't pickle class attributes by default, only instance variables. You list called 'array' is a class variable -- it's bound to the class not your instance. By the wa

Re: Array of objects lost in unpickling

2009-09-13 Thread Bahadir
On Sep 13, 5:48 pm, Jon Clements wrote: > On 13 Sep, 15:19, Bahadir wrote: > > > > > Hi, > > > I have a class: > > > class second: > >     a = None > >     b = None > > > class first: > >     array = [] > > > I populate the array in first class with instances of second, then > > save by: > > > sh

Re: How to define a function with an empty body?

2009-09-13 Thread David
Il Sat, 12 Sep 2009 22:37:01 -0500, Peng Yu ha scritto: > Hi, > > I want to define a function without anything in it body. [...] I usually define void functions as: def myfunction(): raise NotImplementedError("You forgot to implement me!") so I keep safe from leaving orphaned functio

compiling python 3

2009-09-13 Thread Rustom Mody
Just managed to compile python3 on debian lenny I get (among other things) 7 skips unexpected on linux2: test_dbm_ndbm test_bz2 test_ttk_guionly test_tcl test_tk test_ttk_textonly test_dbm_gnu Any ideas what dev packages I need to add? Also emacs python-mode is not set for python3 it look

Python strict mode?

2009-09-13 Thread Peng Yu
Hi, Is there is a way to make python check the variables just as the strict mode in perl. Would somebody let me know what is the python equivalent to the perl strict mode? Regards, Peng -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and 3d

2009-09-13 Thread TerryP
Importing models from a file, obviously always raises the question, what kind of model formats :-P. You should probably take a look at something like Python-Ogre or Pygame for a starting point. Doing raw OpenGL is a bit more tricky and even more dependent on format. -- http://mail.python.org/ma

Re: Python and 3d

2009-09-13 Thread Mike C. Fletcher
azrael wrote: > Has anyone any exipience with python and 3d. > > I mean, is there a module to deal with popular 3d formats like 3ds, or > vrml. is it possible to import into python opengl models and then use > it in application for GUI purposes like through WX. I know that WX > supports OpenGL but

Re: compiling python 3

2009-09-13 Thread Christian Heimes
Rustom Mody wrote: > Just managed to compile python3 on debian lenny > I get (among other things) > > 7 skips unexpected on linux2: > test_dbm_ndbm test_bz2 test_ttk_guionly test_tcl test_tk > test_ttk_textonly test_dbm_gnu > Any ideas what dev packages I need to add? "apt-get build-dep p

AttributeError: 'NoneType' object has no attribute 'get_text'

2009-09-13 Thread Raji Seetharaman
Hi all, i did a small gui addressbook application using pygtk, python, mysql db. It was successful. I tried the same application with glade. But i ended up with errors. I desgined the code as follows. 1.It has one main window and four child dialogs. 2.In the main window, i have to fill in the text

Re: Python and 3d

2009-09-13 Thread Ian Mallett
On Sun, Sep 13, 2009 at 9:29 AM, Mike C. Fletcher wrote: > There's a few older projects to load 3DS files, but I don't think any of > them is currently PyOpenGL 3.x compatible. I would be interested in making them 3.x compatible. Where are they? I've wanted .3ds support for a while... > OpenG

Re: First release of pyfsevents

2009-09-13 Thread Aahz
In article <04180ce5-4cc0-43a4-b26a-b7a4fe826...@g23g2000yqh.googlegroups.com>, IngoognI wrote: >On Sep 8, 6:19=A0am, a...@pythoncraft.com (Aahz) wrote: >> >> There's no direct equivalent to Linux inotify [...] > >pnotify ? Thanks! I'll look into that. -- Aahz (a...@pythoncraft.com)

Is there a similar mailing list about django?

2009-09-13 Thread Joel Goldstick
I'm learning python and django more or less concurrently. I've googled to find a similar list like this for django. Help? Joel Goldstick -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: 'NoneType' object has no attribute 'get_text'

2009-09-13 Thread MRAB
Raji Seetharaman wrote: Hi all, i did a small gui addressbook application using pygtk, python, mysql db. It was successful. I tried the same application with glade. But i ended up with errors. I desgined the code as follows. 1.It has one main window and four child dialogs. 2.In the main window,

including constants

2009-09-13 Thread Nikola Skoric
Hi there, I have a simple problem and I know how to solve it :-D, but I suspect that there is a standard solution which is more elegant. So, here is my problem: I have django app versioned with svn and I test my trunk on two different machines (one with mysql, another with sqlite3). How do I remo

QTableWidgetItem-list

2009-09-13 Thread Helvin
Hi, Could not find anything on this online, except the documentation, which does not explain how to work with a QTableWidgetItem-list. How do I get out what QWidgetTable.finditems found? I have a string that I want to find in my table. I want to locate the row it's in, then delete the row. My cod

Re: QTableWidgetItem-list

2009-09-13 Thread Helvin
On Sep 14, 7:18 am, Helvin wrote: > Hi, > > Could not find anything on this online, except the documentation, > which does not explain how to work with a QTableWidgetItem-list. How > do I get out what QWidgetTable.finditems found? > > I have a string that I want to find in my table. I want to loca

Python and 3d

2009-09-13 Thread Ryniek90
> > azrael wrote: > >> Has anyone any exipience with python and 3d. >> >> I mean, is there a module to deal with popular 3d formats like 3ds, or >> vrml. is it possible to import into python opengl models and then use >> it in application for GUI purposes like through WX. I know that WX >> supp

Re: including constants

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 18:44:25 + (UTC) Nikola Skoric wrote: > Hi there, > > I have a simple problem and I know how to solve it :-D, but I suspect > that there is a standard solution which is more elegant. > > So, here is my problem: I have django app versioned with svn and I > test my trunk o

Re: Python strict mode?

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 09:25:50 -0700 (PDT) Peng Yu wrote: > Is there is a way to make python check the variables just as the > strict mode in perl. Short answer: No. Long answer: I'm guessing you want Python to complain when assigning to a variable that has not been declared before. Since Python h

Re: Is there a similar mailing list about django?

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 14:17:42 -0400 Joel Goldstick wrote: > I'm learning python and django more or less concurrently. I've > googled to find a similar list like this for django. Help? > Didn't like http://groups-beta.google.com/group/django-users ? (Second hit for "django mailing list", but I

Re: Is there a similar mailing list about django?

2009-09-13 Thread Albert Hopkins
On Sun, 2009-09-13 at 21:27 +0200, Andreas Waldenburger wrote: > Didn't like http://groups-beta.google.com/group/django-users ? > > (Second hit for "django mailing list", but I know Google results vary > from country to country, so you might not have seen it.) Or, better yet, go to Django's web s

IRC bot

2009-09-13 Thread Someone Something
I"m trying to write an IRC bot just for fun (in python of course). Here's my current code: 1 #!/usr/local/bin/python 2 import time 3 import socket 4 5 def message (x, channel,s): 6 y="PRIVMSG"+" "+ channel+" :"+x 7 s.send(y); 8 host="irc.freenode.net"; 9 port=6667; 10 si

Re: Python strict mode?

2009-09-13 Thread Patrick Sabin
> You could write a class with a custom __setattr__() method that checks for valid attribute names for that class (a list of strings given to it's __init__() method). That way you could form several restricted "namespaces" for variables simply as different instances of that class. This can be

numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
Hi folks, I am aware that numpy has its own discussion group, which is hosted at gmane. Unfortunately, I can't seem to get in to gmane today. In any case, I'm not sure whether I have a problem with numpy, or with my understanding of the Python pickle module, so I'm posting here. I am pickling n

Re: IRC bot

2009-09-13 Thread Someone Something
Anyone? On Sun, Sep 13, 2009 at 3:58 PM, Someone Something wrote: > I"m trying to write an IRC bot just for fun (in python of course). Here's > my current code: > > 1 #!/usr/local/bin/python > 2 import time > 3 import socket > 4 > 5 def message (x, channel,s): > 6 y="PRIVMSG"+" "+

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Robert Kern
John Ladasky wrote: Hi folks, I am aware that numpy has its own discussion group, which is hosted at gmane. Unfortunately, I can't seem to get in to gmane today. It is not hosted at GMane. It just has a GMane mirror. http://www.scipy.org/Mailing_Lists In any case, I'm not sure whether I

Re: IRC bot

2009-09-13 Thread MRAB
Someone Something wrote: I"m trying to write an IRC bot just for fun (in python of course). Here's my current code: 1 #!/usr/local/bin/python 2 import time 3 import socket 4 5 def message (x, channel,s): 6 y="PRIVMSG"+" "+ channel+" :"+x 7 s.send(y); 8 host="irc.freenode

Re: IRC bot

2009-09-13 Thread Someone Something
Thanks a lot! On Sun, Sep 13, 2009 at 4:29 PM, MRAB wrote: > Someone Something wrote: > >> I"m trying to write an IRC bot just for fun (in python of course). Here's >> my current code: >> >> 1 #!/usr/local/bin/python >> 2 import time >> 3 import socket >> 4 >> 5 def message (x, channel,s):

Re: Which version of python I should use if I just start programming in python?

2009-09-13 Thread Peng Yu
On Sun, Sep 13, 2009 at 12:27 AM, John Nagle wrote: > Kee Nethery wrote: >> >> I am in 2.x because the IDE I am using does not support stepping through >> my code when in 3.x. As soon as the IDE I use supports debugging in 3.x, I'm >> moving up to 3.x. >> >> I would prefer to be in 3.x because all

Re: Is there a similar mailing list about django?

2009-09-13 Thread Tim Chase
Joel Goldstick wrote: I'm learning python and django more or less concurrently. I've googled to find a similar list like this for django. Help? There's a Django Users mailing list over on Google Groups. http://groups.google.com/group/django-users You want Django *Users* for folks that use

Re: Which version of python I should use if I just start programming in python?

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 15:52:44 -0500 Peng Yu wrote: > On Sun, Sep 13, 2009 at 12:27 AM, John Nagle > wrote: > What are the differences between 2.5 and 2.6? http://docs.python.org/dev/whatsnew/2.6.html /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a similar mailing list about django?

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 15:54:07 -0400 Albert Hopkins wrote: > On Sun, 2009-09-13 at 21:27 +0200, Andreas Waldenburger wrote: > > Didn't like http://groups-beta.google.com/group/django-users ? > > > > (Second hit for "django mailing list", but I know Google results > > vary from country to country,

Re: Python strict mode?

2009-09-13 Thread Terry Reedy
Peng Yu wrote: Hi, Is there is a way to make python check the variables just as the strict mode in perl. Would somebody let me know what is the python equivalent to the perl strict mode? 3rd party code checkers like pylint, pychecker. -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python FTP Server library (pyftpdlib) 0.5.2 released

2009-09-13 Thread Giampaolo Rodola'
Hi, I'm pleased to announce release 0.5.2 of Python FTP Server library (pyftpdlib). http://code.google.com/p/pyftpdlib === About === Python FTP server library provides a high-level portable interface to easily write asynchronous FTP servers with Python. pyftpdlib is currently the most complete RF

Re: Python strict mode?

2009-09-13 Thread Ben Finney
Peng Yu writes: > Is there is a way to make python check the variables just as the > strict mode in perl. Would somebody let me know what is the python > equivalent to the perl strict mode? There isn't one, because Python doesn't have the same concept of “unsafe constructs”; in Python, we think

Odd/Weird errors with FTPLib

2009-09-13 Thread Bakes
I am using a simple python script to download my logfiles. This is on a while loop, the logfile grows rapidly, so it is necessary for python to start downloading the new script as soon as it has finished the old. It works fine (for about 20 minutes), then crashes. I have removed a couple of except

Re: Odd/Weird errors with FTPLib

2009-09-13 Thread Chris Rebert
On Sun, Sep 13, 2009 at 2:34 PM, Bakes wrote: > I am using a simple python script to download my logfiles. This is on > a while loop, the logfile grows rapidly, so it is necessary for python > to start downloading the new script as soon as it has finished the > old. > > It works fine (for about 20

Re: Odd/Weird errors with FTPLib

2009-09-13 Thread Bakes
On 13 Sep, 22:41, Chris Rebert wrote: > On Sun, Sep 13, 2009 at 2:34 PM, Bakes wrote: > > I am using a simple python script to download my logfiles. This is on > > a while loop, the logfile grows rapidly, so it is necessary for python > > to start downloading the new script as soon as it has fini

Re: Which version of python I should use if I just start programming in python?

2009-09-13 Thread Peng Yu
On Sun, Sep 13, 2009 at 4:01 PM, Andreas Waldenburger wrote: > On Sun, 13 Sep 2009 15:52:44 -0500 Peng Yu wrote: > >> On Sun, Sep 13, 2009 at 12:27 AM, John Nagle >> wrote: >> What are the differences between 2.5 and 2.6? > > http://docs.python.org/dev/whatsnew/2.6.html Are all packages availab

Re: Python and 3d

2009-09-13 Thread Carl Banks
On Sep 13, 9:29 am, "Mike C. Fletcher" wrote: > azrael wrote: > > Has anyone any exipience with python and 3d. > > > I mean, is there a module to deal with popular 3d formats like 3ds, or > > vrml. is it possible to import into python opengl models and then use > > it in application for GUI purpos

Why indentation is use to denote block of code?

2009-09-13 Thread Peng Yu
Hi, I want to understand why python use indentation to denote block of code. What are the advantages of it? Is there a style in python to denote a block of code the same as that of C++ (with '{}')? One disadvantage of using indentation to denote a block of code is that the runtime to automaticall

Re: Why indentation is use to denote block of code?

2009-09-13 Thread Chris Rebert
On Sun, Sep 13, 2009 at 3:12 PM, Peng Yu wrote: > Hi, > > I want to understand why python use indentation to denote block of > code. What are the advantages of it? See the FAQ: http://www.python.org/doc/faq/general/#why-does-python-use-indentation-for-grouping-of-statements > Is there a style in

Re: Why indentation is use to denote block of code?

2009-09-13 Thread Sean DiZazzo
On Sep 13, 3:12 pm, Peng Yu wrote: > Hi, > > I want to understand why python use indentation to denote block of > code. What are the advantages of it? Is there a style in python to > denote a block of code the same as that of C++ (with '{}')? > > One disadvantage of using indentation to denote a b

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
Hi Robert, Thanks for the quick reply. On Sep 13, 1:22 pm, Robert Kern wrote: > The problem is that you are trying to use "is" to compare by Python object > identity. Except for dtype=object arrays, the object identities of the > individual elements that you extract from numpy arrays are never

Re: Which version of python I should use if I just start programming in python?

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 17:04:25 -0500 Peng Yu wrote: > On Sun, Sep 13, 2009 at 4:01 PM, Andreas Waldenburger > wrote: > > On Sun, 13 Sep 2009 15:52:44 -0500 Peng Yu > > wrote: > > > >> On Sun, Sep 13, 2009 at 12:27 AM, John Nagle > >> wrote: > >> What are the differences between 2.5 and 2.6? > >

Re: Why indentation is use to denote block of code?

2009-09-13 Thread Sean DiZazzo
On Sep 13, 3:12 pm, Peng Yu wrote: > Hi, > > I want to understand why python use indentation to denote block of > code. What are the advantages of it? Is there a style in python to > denote a block of code the same as that of C++ (with '{}')? > > One disadvantage of using indentation to denote a b

Re: Is there a similar mailing list about django?

2009-09-13 Thread Joel Goldstick
Andreas Waldenburger wrote: On Sun, 13 Sep 2009 15:54:07 -0400 Albert Hopkins wrote: On Sun, 2009-09-13 at 21:27 +0200, Andreas Waldenburger wrote: Didn't like http://groups-beta.google.com/group/django-users ? (Second hit for "django mailing list", but I know Google results vary from countr

Re: Odd/Weird errors with FTPLib

2009-09-13 Thread MRAB
Bakes wrote: On 13 Sep, 22:41, Chris Rebert wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes wrote: I am using a simple python script to download my logfiles. This is on a while loop, the logfile grows rapidly, so it is necessary for python to start downloading the new script as soon as it has f

Re: Why indentation is use to denote block of code?

2009-09-13 Thread Grant Edwards
On 2009-09-13, Peng Yu wrote: > One disadvantage of using indentation to denote a block of code is > that the runtime to automatically indent a python code would be about > a few times more than the runtime to automatically indent a C++ code > of the same length (both are in vim). Talking about

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Christian Heimes
John Ladasky wrote: > OK, so there's a dedicated function in numpy to handle this. Thanks! > > I tried "x is NaN" after noting the obvious, that any equality or > inequality test involving NaN will return False. > > In my leisure time, I would like to dig deeper into the issue of why > object id

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Robert Kern
John Ladasky wrote: In my leisure time, I would like to dig deeper into the issue of why object identities are not guaranteed for elements in numpy arrays... with elements of type "float", at least, I thought this would be trivial. Why do you think that? We would have to keep a reference aroun

Re: Why indentation is use to denote block of code?

2009-09-13 Thread r
On Sep 13, 5:12 pm, Peng Yu wrote: > Hi, > > I want to understand why python use indentation to denote block of > code. What are the advantages of it? Is there a style in python to > denote a block of code the same as that of C++ (with '{}')? Easy! because Python is simplistic programming bliss!

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Carl Banks
On Sep 13, 3:18 pm, John Ladasky wrote: > In my leisure time, I would like to dig deeper into the issue of why > object identities are not guaranteed for elements in numpy arrays... > with elements of type "float", at least, I thought this would be > trivial. Unlike Python lists, numpy arrays don

Re: Why indentation is use to denote block of code?

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 15:15:40 -0700, Chris Rebert wrote: > In fact it's pretty much impossible to automatically indent Python code > that has had its indentation removed; it's impossible to know for sure > where the dedents should occur. Just like most other syntactic elements -- if you remove al

Re: Is there a similar mailing list about django?

2009-09-13 Thread Andreas Waldenburger
On Sun, 13 Sep 2009 18:46:44 -0400 Joel Goldstick wrote: > Thanks.. I saw the google group, but I was hoping for a list that I > can read in my thunderbird client. Thanks all for the good pointers Huh? Django-Users is a mailing list. That's what Google-Groups is (among a Usenet portal): A colle

Re: Is there a similar mailing list about django?

2009-09-13 Thread Andreas Waldenburger
On Mon, 14 Sep 2009 01:24:49 +0200 Andreas Waldenburger wrote: > (among a Usenet portal) Damn those late hours. What I meant was "amongst other things such as a Usenet portal". /W -- INVALID? DE! -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a similar mailing list about django?

2009-09-13 Thread Albert Hopkins
On Sun, 2009-09-13 at 18:46 -0400, Joel Goldstick wrote: > Thanks.. I saw the google group, but I was hoping for a list that I > can > read in my thunderbird client. Thanks all for the good pointers And if you simply go to the Django web site and click on "Community" there is a form where you ca

Re: Python strict mode?

2009-09-13 Thread Carl Banks
On Sep 13, 9:25 am, Peng Yu wrote: > Is there is a way to make python check the variables just as the > strict mode in perl. Would somebody let me know what is the python > equivalent to the perl strict mode? I don't recommend using it, but see this post: http://groups.google.com/group/comp.lan

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 17:58:14 -0500, Robert Kern wrote: > John Ladasky wrote: > >> In my leisure time, I would like to dig deeper into the issue of why >> object identities are not guaranteed for elements in numpy arrays... >> with elements of type "float", at least, I thought this would be >> tri

Re: How to define a function with an empty body?

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 15:30:52 +0200, Christian Heimes wrote: > Peng Yu schrieb: >> Hi, >> >> I want to define a function without anything in it body. In C++, I can >> do something like the following because I can use "{}" to denote an >> empty function body. Since python use indentation, I am not

Re: run exe on different computer

2009-09-13 Thread Dave Angel
daved170 wrote: On Sep 13, 2:17 pm, Dave Angel wrote: daved170 wrote: Hi everybody, I'm building a small python program that run a service (exe file) on my servers. I don't want to use remote desktop and it's siblings. I would like to have some information on how to run an exe o

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-13 Thread John Ladasky
On Sep 13, 4:17 pm, Carl Banks wrote: > On Sep 13, 3:18 pm, John Ladasky wrote: > > > In my leisure time, I would like to dig deeper into the issue of why > > object identities are not guaranteed for elements in numpy arrays... > > with elements of type "float", at least, I thought this would be

Re: Why indentation is use to denote block of code?

2009-09-13 Thread AggieDan04
On Sep 13, 6:27 pm, Steven D'Aprano wrote: > On Sun, 13 Sep 2009 15:15:40 -0700, Chris Rebert wrote: > > In fact it's pretty much impossible to automatically indent Python code > > that has had its indentation removed; it's impossible to know for sure > > where the dedents should occur. > > Just l

Re: run exe on different computer

2009-09-13 Thread Sean DiZazzo
On Sep 13, 4:57 pm, Dave Angel wrote: > daved170 wrote: > > On Sep 13, 2:17 pm, Dave Angel wrote: > > >> daved170 wrote: > > >>> Hi everybody, > >>> I'm building a small python program that run a service (exe file) on > >>> my servers. > >>> I don't want to use remote desktop and it's siblings. >

trouble quitting PyQt4 App

2009-09-13 Thread Soumen banerjee
Hi, Im new to PyQt4 and im having fun using it. but ive run into a bit of a problem. I cant quit the application. The application has 2 modules. The gui module(gui.py) and then the main program(main.py) heres gui.py: from PyQt4 import QtCore, QtGui import sys from subprocess import Popen class Ui_

NameError: name '__main__' is not defined

2009-09-13 Thread Peng Yu
Hi, I try the following code. I don't quite understand why __main__ is not defined. Could somebody let me know what I am wrong about it? Regards, Peng $ cat test.py #!/usr/bin/env python if __main__ == '__main__' : print "Hello World!\n" $ ./test.py Traceback (most recent call last): File "

yet another modifying locals() question

2009-09-13 Thread Ed Anuff
I know that locals() is not supposed to be modifiable under most circumstances, but I'm trying to solve a situation where I'm dynamically generating some class attributes and it seemed to be the best way, so I tried something out that seems to work but I'm not sure that it's kosher: >>> def f(l):

Re: Is there a similar mailing list about django?

2009-09-13 Thread Tim Chase
Thanks.. I saw the google group, but I was hoping for a list that I can read in my thunderbird client. Thanks all for the good pointers You can subscribe to the google group via email (which is what I did previously with TB), or you can subscribe to the mirrored copy of it over at gmane.comp

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Xavier Ho
Try if __name__ == '__main__' :], Xav On Mon, Sep 14, 2009 at 11:43 AM, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python

Re: NameError: name '__main__' is not defined

2009-09-13 Thread André
On Sep 13, 10:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
On Sep 13, 6:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!\

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
On Sep 13, 6:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!\

Re: Problem with the inclusion of new files like lxml, django, numpy, etc.

2009-09-13 Thread alex23
joy99 wrote: > What is the problem I am doing? Following the wrong installation instructions? The ones you _should_ be following state: 1. Download the latest release from our download page. 2. Untar the downloaded file (e.g. tar xzvf Django-NNN.tar.gz, where NNN is the version number of the la

Why use "locals()"

2009-09-13 Thread Sean DiZazzo
I have never used a call to "locals()" in my code. Can you show me a use case where it is valuable and Pythonic? ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another modifying locals() question

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 18:52:47 -0700, Ed Anuff wrote: > I know that locals() is not supposed to be modifiable under most > circumstances, but I'm trying to solve a situation where I'm dynamically > generating some class attributes and it seemed to be the best way, so I > tried something out that see

Re: Why use "locals()"

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 20:06:51 -0700, Sean DiZazzo wrote: > I have never used a call to "locals()" in my code. Can you show me a > use case where it is valuable and Pythonic? grep is your friend: $ grep "locals()" /usr/lib/python2.5/*.py /usr/lib/python2.5/decimal.py:for name, val in lo

Re: Why use "locals()"

2009-09-13 Thread Sean DiZazzo
On Sep 13, 8:18 pm, Steven D'Aprano wrote: > On Sun, 13 Sep 2009 20:06:51 -0700, Sean DiZazzo wrote: > > I have never used a call to "locals()" in my code.  Can you show me a > > use case where it is valuable and Pythonic? > > grep is your friend: > > $ grep "locals()" /usr/lib/python2.5/*.py > /u

Re: Simple Text Processing

2009-09-13 Thread Tim Roberts
Steven D'Aprano wrote: >On Fri, 11 Sep 2009 21:52:36 -0700, Tim Roberts wrote: > >> Basically, when you're good with Perl, you start to think of every task >> in terms of regular expression matches. When you're good with Python, >> you start to think of every task in terms of lists and tuples. >

python audio streams?

2009-09-13 Thread konung.nik...@googlemail.com
Hello! Is there a way to record different audio streams (.asx, .ram, m3u) with Python? Also, is there a way to convert them "on the fly" ? Thank, you -- http://mail.python.org/mailman/listinfo/python-list

Re: Why use "locals()"

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 20:26:06 -0700, Sean DiZazzo wrote: > On Sep 13, 8:18 pm, Steven D'Aprano > wrote: >> On Sun, 13 Sep 2009 20:06:51 -0700, Sean DiZazzo wrote: >> > I have never used a call to "locals()" in my code.  Can you show me a >> > use case where it is valuable and Pythonic? >> >> grep

  1   2   >