[Tutor] Post to wordpress

2009-05-23 Thread Jan Erik Moström
gs/date) <http://www.metaweblogapi.com/2009/01/posting-to-wordpress-with-python-and-metaweblog-api.html> (same as above) Does anyone know if a library exists or some example of how to do this? jem -- Jan Erik Moström, http://mostrom.eu _

Re: [Tutor] sys.argv?

2007-04-17 Thread Jan Erik Moström
Reply to [EMAIL PROTECTED] 07-04-17 07:26: >I've been reading the python tutorial trying to get used to the style >tryna understand it. So I come across this: "sys.argv[0]" in the tutorial >on python.org. What is "sys.argv"? How does it work? Can someone give me >a simple example on how to use

Re: [Tutor] range() help

2007-04-17 Thread Jan Erik Moström
Reply to [EMAIL PROTECTED] 07-04-17 07:42: >How come it prints on -40 or -70. > >Does -70 come from -70 -> -100? > >This is really confusing me. I don't really understand your question, the definition of range range(...) range([start,] stop[, step]) -> list of integers Return a list c

Re: [Tutor] Apache, CGI-BIN, Python

2007-09-10 Thread Jan Erik Moström
ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/" this is from my Mac, on my debian machine it looks like this ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ And you can of course have different catalogs for different virtual domains jem -- Jan E

Re: [Tutor] dictionary

2005-10-24 Thread Jan Erik Moström
Shi Mu <[EMAIL PROTECTED]> 2005-10-24 09:13: > why the order is changed? By definition a dictionary has no order. jem -- Jan Erik Moström, www.mostrom.pp.se ___ Tutor maillist - Tutor@python.org http://mail.python.or

Re: [Tutor] installing python on windows and macs

2006-02-06 Thread Jan Erik Moström
nd make > install. Why it is not as convenient as Windows? Do you mean that you needed to compile Python ... well, you should have downloaded the binary distribution instead. jem -- Jan Erik Moström, www.mostrom.pp.se ___ Tutor mai

[Tutor] Question about ConfigParser

2007-01-06 Thread Jan Erik Moström
I'm trying to use ConfigParser for the first time and I'm missing something. I have this code import ConfigParser import datetime conf = ConfigParser.ConfigParser() conf.add_section('general') conf.set( 'general', 'revision', 0 ) conf.set( 'general', 'date', datetime.datetime.now().strftime("%

Re: [Tutor] Question about ConfigParser

2007-01-07 Thread Jan Erik Moström
Reply to Dave Kuhlman <[EMAIL PROTECTED]> 07-01-06 15:26: >It's sort of hidden, but note the restriction to string values in >the docs on the set method: > >set(section, option, value) >If the given section exists, set the given option to the specified >value; otherwise raise NoSectionError. While

[Tutor] Sound question

2011-04-08 Thread Jan Erik Moström
Hi, A couple of my students need to be able to play sounds, controlling start & stop, play sound from files and if possible generate sinus wave sounds. I looked around and found several packages but they all seem to have some kind platform restrictions. Does anyone have recommendations for what

[Tutor] Scaling photos

2014-10-06 Thread Jan Erik Moström
I want to write a small script that scales photos. I want the scaled photos to keep all meta data available in the originals. I also want to keep this python only and easily installed on linux and OS X machines. What library would you people recommend for doing this? - jem ___

Re: [Tutor] Scaling photos

2014-10-07 Thread Jan Erik Moström
Thanks for the suggestions On Tue, Oct 7, 2014 at 3:10 AM, Alan Gauld wrote: > On 06/10/14 23:08, Jan Erik Moström wrote: >> >> I want to write a small script that scales photos. I want the scaled >> photos to keep all meta data available in the originals. I also want >&g

Re: [Tutor] help with tic-tac-toe program

2014-11-18 Thread Jan Erik Moström
If I understand what you're asking you need to write the current gameboard and the info you get in 'gameBoard' is the current state of the game. There are several ways of doing this (with different degrees of cleverness) but to keep it simple: Start by printing out the current state, different wa

Re: [Tutor] doubt in a program

2018-01-29 Thread Jan Erik Moström
On 29 Jan 2018, at 7:42, vinod bhaskaran wrote: As the new character is adding the char in the new string but how is it getting reversed without any line giving the char number to be traversed in reverse order. You don't need that, think about this example newstring = '' oldstring = "Newton

Re: [Tutor] guess my number game

2018-05-08 Thread Jan Erik Moström
Here is the code with the while loop import random n = (random.randint(0,100)) g = int(input('Guess my number, 0 to 100, you have 10 chances')) c = 0 while (c < 10): g = int(input('Guess my number, 0 to 100, you have 10 chances')) c = c + 1 if (g >= n): print('Lower!') el