Re: [Tutor] Sleep

2009-10-08 Thread Tim Golden
Hristos Giannopoulos wrote: Is it possible for a python script to make a windows computer sleep or wake from sleep? Preferably in windows? Nothing built in to the language. You'll need in invoke the relevant Windows API[1] either via pywin32[2] or ctypes[3]: [1] http://msdn.microsoft.com/en-us

[Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-08 Thread David Jamieson
Hi All, looking for some advice on using Python with MySQL for test data storage. What builds of Python work well with MySQL and what modules allow the connection to the database and data transfer activities. I'm thinking about using PhPMyAdmin to set-up and administer my database in the first ins

[Tutor] Package for verify validity of any kind of IP

2009-10-08 Thread Ansuman Dash
Hi, Can anybody suggest me a package to verify validity of any kind of IP, i.e. IPv4 or IPv6. Thanks, AD ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-08 Thread David
David Jamieson wrote: Hi All, looking for some advice on using Python with MySQL for test data storage. What builds of Python work well with MySQL and what modules allow the connection to the database and data transfer activities. SQLAlchemy is one option; http://www.rmunn.com/sqlalchemy-tutor

[Tutor] Bounces

2009-10-08 Thread Luke Paireepinart
I keep getting Mail Delivery Subsystem notices from tutor saying my mail is undeliverable. Is that just me or are other people getting this as well? I'm realizing now that a lot of my replies are not getting through. Anyone know why this may be? (even if you don't, someone please reply so I know

Re: [Tutor] Bounces

2009-10-08 Thread Evans Anyokwu
This one seems to have got through though.. On Thu, Oct 8, 2009 at 7:15 AM, Luke Paireepinart wrote: > I keep getting Mail Delivery Subsystem notices from tutor saying my mail is > undeliverable. Is that just me or are other people getting this as well? > I'm realizing now that a lot of my repl

Re: [Tutor] Bounces

2009-10-08 Thread Christian Witts
Luke Paireepinart wrote: I keep getting Mail Delivery Subsystem notices from tutor saying my mail is undeliverable. Is that just me or are other people getting this as well? I'm realizing now that a lot of my replies are not getting through. Anyone know why this may be? (even if you don't,

Re: [Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-08 Thread Serdar Tumgoren
> looking for some advice on using Python with MySQL for test data > storage. What builds of Python work well with MySQL and what modules > allow the connection to the database and data transfer activities. You'll need the MySQLdb module to connect to MySQL from Python. http://sourceforge.net/

Re: [Tutor] Bounces

2009-10-08 Thread Serdar Tumgoren
I got an error bounce too, saying that the bottom portion of a recent message was "ignored" ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Memory usage (Lizhi Yang)

2009-10-08 Thread Lizhi Yang
Below you see my original post. 1: Say I use boost.python. 2: For example, I allocate a big array with integers using C++ function (4 bytes for each int in C++, but 12 bytes in python), and I use boost.python to call those C++ functions. How is the memory allocation for that array then? My last

Re: [Tutor] Package for verify validity of any kind of IP

2009-10-08 Thread Wayne
On Thu, Oct 8, 2009 at 3:38 AM, Ansuman Dash wrote: > Hi, > > Can anybody suggest me a package to verify validity of any kind of IP, i.e. > IPv4 or IPv6. > > You mean to check if the IP is live, or to check if the IP is in the valid range for IP addresses? For the latter, just use a regex (googl

[Tutor] Beginners question

2009-10-08 Thread gary littwin
Hi all - Just started on "Python Programming for Absolute Beginners" and I've got a question: The program called 'Guess my Number' goes like this: # Guess My Number # # The computer picks a random number between 1 and 100 # The player tries to guess it and the computer lets # the player know if t

Re: [Tutor] Beginners question

2009-10-08 Thread Christian Witts
gary littwin wrote: Hi all - Just started on "Python Programming for Absolute Beginners" and I've got a question: The program called 'Guess my Number' goes like this: # Guess My Number # # The computer picks a random number between 1 and 100 # The player tries to guess it and the computer le

Re: [Tutor] Beginners question

2009-10-08 Thread Jeff Johnson
gary littwin wrote: Hi all - Just started on "Python Programming for Absolute Beginners" and I've got a question: The program called 'Guess my Number' goes like this: # Guess My Number # # The computer picks a random number between 1 and 100 # The player tries to guess it and the computer le

Re: [Tutor] Memory usage (Lizhi Yang)

2009-10-08 Thread Adam Bark
2009/10/8 Lizhi Yang > Hi Adam, > > One more question, if I want to implement algorithms and load the huge > amount of data using C++, but using Python as the glue language to > implement other functionality such as Gui and txt processing, you > think Boost.python is better or SWIG is better? Hav

Re: [Tutor] Package for verify validity of any kind of IP

2009-10-08 Thread vince spicer
On Thu, Oct 8, 2009 at 2:38 AM, Ansuman Dash wrote: > Hi, > > Can anybody suggest me a package to verify validity of any kind of IP, i.e. > IPv4 or IPv6. > > Thanks, > AD > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscript

[Tutor] Branch Coverage Tool for Python

2009-10-08 Thread Elisha Rosensweig
Hi All, Is there any Python tool for Branch Coverage (as opposed to Statement Coverage)? Thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Wrapper of C++

2009-10-08 Thread Lizhi Yang
Since the memory usage for saving huge data using python is not efficent at all(12 bytes per int). if I want to implement algorithms and load the huge amount of data using C++, but using Python as the glue language to implement other functionality such as Gui and txt processing, you think Boost.pyt

Re: [Tutor] if n == 0 vs if not n

2009-10-08 Thread Luke Paireepinart
On Tue, Oct 6, 2009 at 2:40 AM, Vern Ceder wrote: > Dave Angel wrote: > > Now in this case where it is only used as boolean checks which would be the most pythonic way if writing these checks? >>> The shorter version may be preferable, but it doesn't generally give the >> same res

Re: [Tutor] Wrapper of C++

2009-10-08 Thread Dave Angel
Lizhi Yang wrote: Since the memory usage for saving huge data using python is not efficent at all(12 bytes per int). if I want to implement algorithms and load the huge amount of data using C++, but using Python as the glue language to implement other functionality such as Gui and txt processing,

Re: [Tutor] if n == 0 vs if not n

2009-10-08 Thread Kent Johnson
On Mon, Oct 5, 2009 at 9:13 PM, Luke Paireepinart wrote: > Actually, I just realized that "not" has higher precedence than "==" so this > is really checking if (not n) is equal to 0, not if (n == 0) is (not) True. No, "not" is lower precedence than "==". See http://docs.python.org/reference/expr

Re: [Tutor] if n == 0 vs if not n

2009-10-08 Thread wesley chun
> Thanks all for the informative discussion. To re-confirm it was mostly > for boolean checks like "if b == True". wow, as the OP, you must have been surprised to see how far we have taken your (seemingly) simple question. we went from boolean checks to interning! commenting on my previous reply,

Re: [Tutor] Bounces

2009-10-08 Thread Robert Lummis
It probably means that you used "reply all" and one of the addresses was not valid, possibly because it got garbled somehow on an earlier "reply all". On Thu, Oct 8, 2009 at 2:15 AM, Luke Paireepinart wrote: > I keep getting Mail Delivery Subsystem notices from tutor saying my mail is > undeliver

[Tutor] Reading individual file from tar file as a file object

2009-10-08 Thread xbmuncher
I have a large tar.bz2 file that I want to extract certain files directly to an FTP path. Since the extract() method doesn't accept ftp paths... I wanted to read the files from the tar file like a file object or file I/O stream. Is there a way to do this? Here's my pseudocode: import tarfile def

Re: [Tutor] if n == 0 vs if not n

2009-10-08 Thread Sander Sweers
On Thu, 2009-10-08 at 12:58 -0700, wesley chun wrote: > wow, as the OP, you must have been surprised to see how far we have > taken your (seemingly) simple question. Pleasently suprised :-) And I am gratefull to see the heavy weights join in. > however, what i did *not* mention is that these (abb

[Tutor] Troubles with lists and control flow

2009-10-08 Thread Eduardo Vieira
Hello I'm developing a script to compare two files, finding duplicate entries and matching which id of one csv file corresponds to the id of another csv file. The first version was working nice, but I wanted to postpone the writing to a file till the end and also make a correct csv file. The code i

Re: [Tutor] Troubles with lists and control flow

2009-10-08 Thread Luke Paireepinart
Oops, accidentally replied off-list. -- Forwarded message -- From: Luke Paireepinart Date: Thu, Oct 8, 2009 at 3:36 PM Subject: Re: [Tutor] Troubles with lists and control flow To: Eduardo Vieira On Thu, Oct 8, 2009 at 2:42 PM, Eduardo Vieira wrote: > Hello I'm developing a

[Tutor] Python 3 and tkinter Radiobuttons

2009-10-08 Thread bob smith
Hi. I’m using Tkinter to create a new Radiobutton in Python 3. However, when I create the button, it starts off looking selected instead of unselected (though it behaves correctly like an unselected Radiobutton). So this means when I create a group of Radiobuttons they all look selected when

Re: [Tutor] Reading individual file from tar file as a file object

2009-10-08 Thread Kent Johnson
On Thu, Oct 8, 2009 at 4:10 PM, xbmuncher wrote: > I have a large tar.bz2 file that I want to extract certain files directly to > an FTP path. > Since the extract() method doesn't accept ftp paths...  I wanted to read the > files from the tar file like a file object or file I/O stream. > Is there

Re: [Tutor] Checking for Python version

2009-10-08 Thread Kent Johnson
On Tue, Oct 6, 2009 at 9:59 AM, Didar Hossain wrote: > Hi, > > I am using the following code to check for the Python version - > > import os > > t = os.sys.version_info[0:2] > if (t[0] + t[1]) < 6: Hmm, what would this give for Python 1.5? How about if t < (2, 4): >    os.sys.exit("Need at least

Re: [Tutor] Python 3 and tkinter Radiobuttons

2009-10-08 Thread Kent Johnson
On Thu, Oct 8, 2009 at 6:04 PM, bob smith wrote: > Hi.  I’m using Tkinter to create a new Radiobutton in Python 3.  However, > when I create the button, it starts off looking selected instead of > unselected (though it behaves correctly like an unselected Radiobutton).  So > this means when I crea

Re: [Tutor] Reading individual file from tar file as a file object

2009-10-08 Thread Xbox Muncher
Works perfectly! Thanks. Yet again, I've learned I need to read better. :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Reading individual file from tar file as a file object

2009-10-08 Thread Kent Johnson
On Thu, Oct 8, 2009 at 8:45 PM, Xbox Muncher wrote: > Works perfectly! Thanks. Yet again, I've learned I need to read better. :) And remember, if the docs are unclear, you can always look at the source, as I did... Kent ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Wrapper of C++

2009-10-08 Thread Chris Fuller
It might also be a good application for numpy (http://www.numpy.org/) Cheers ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] list comprehensions

2009-10-08 Thread Christer Edwards
I've been studying python now for a few weeks and I've recently come into list comprehensions. Some of the examples that I've found make sense, and I find them readable and concise. In particular I'm referring to the python docs on the topic (http://docs.python.org/tutorial/datastructures.html#list

Re: [Tutor] list comprehensions

2009-10-08 Thread Gregor Lingl
Christer Edwards schrieb: I've been studying python now for a few weeks and I've recently come into list comprehensions. Some of the examples that I've found make sense, and I find them readable and concise. In particular I'm referring to the python docs on the topic (http://docs.python.org/tut

Re: [Tutor] list comprehensions

2009-10-08 Thread Oxymoron
Hello, On Wed, Oct 7, 2009 at 6:57 AM, Christer Edwards wrote: > > do something to x for each x in list, with an optional qualifier. > To be more precise: http://docs.python.org/tutorial/datastructures.html#list-comprehensions "Each list comprehension consists of an expression followed by a fo

Re: [Tutor] list comprehensions

2009-10-08 Thread wesley chun
> I've been studying python now for a few weeks and I've recently come > into list comprehensions. [...] > Those make sense to me. The way I understand them is: > do something to x for each x in list, with an optional qualifier. that's pretty much correct. > On the other hand I've seen a few exa