http://tarekziade.wordpress.com/2006/11/01/protecting-a-python-svn-code-base-with-the-pre-commit-hook/
Is it possible to check code in python before committing to svn
using pyflakes, pythontidy
Pyflakes and Subversion
Pyflakes is a
nice little utility that checks your Python code for err
Is it possible to traverse say python lists via http://
say there is a list in the memory
can we traverse the list using list/next list/prev list/first list/last
is there a pythonic library to do that?
thanks
___
Tutor maillist - Tutor@python.org
h
im trying to create a class user
so that
i can do
r=User(1)
r._user.keys()
['rating', 'last_name', 'pageviews', 'ip', 'number_polls', 'site',
'myrand', 'hotmail', 'number_activities', 'skype', 'id', 'city',
'rawpassword', 'number_useraudios', 'zip', 'number_votes',
'last_login', 'number_u
Hi all ,
I got 2 questions for you guys.
The fist question:
I wrote small Tkinter app while laerning about the Radiobutton widget,
and I added a "Quit" button, like this:
bb=Button(root, text="Quit", fg="BLUE", command=root.quit).pack()
When I pressed the button the app crashed and I got an error
On Sat, 04 Dec 2004 14:38:06 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Mark Kels wrote:
>
>
> > Hi all ,
> > I got 2 questions for you guys.
> >
> > The fist question:
> > I wrote small Tkinter app while laerning about the Radiobutton widge
Hi all,
I got 2 questions:
1. How to get input from Tkinter widgets like Text, Entry,
Checkbutton, Scale etc (almost any widget that isn't a button) ?
for some reason its not explained clearly in any tutor I looked in...
2. How to print text using python ( through the printer ) ?
__
Hi all ,
I got some Tkinter related questions for a project that I'm making:
1. How to add an image to a button ?
2. How can I print text using Tkinter (I want it to be cross platform,
so I cant use modules like win32print ) ?
3. How to I make the program to always open in a full window ?
Thanks a
on but the
function i want to call is part of a cpp class in my dll...
ctypes is for C DLLs. You might want to look at www.swig.org instead.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.
rent changes in the same file.
Sounds like the record and crecord extensions come close, anyway:
http://mercurial.selenic.com/wiki/RecordExtension
http://mercurial.selenic.com/wiki/CrecordExtension
TortoiseHg's commit GUI allows this.
-Mark
__
"katrin schmid" wrote in message
news:20100123021522.155...@gmx.net...
hi,
so how about 32 and 64 bit,
do they need separat versions, too?
So a pyd is an "actual" dll?
Regrads,
katrin
Yes, to both questions.
-Mark
___
Tuto
I created a custom vector type, inheriting from object, and defined __mul__,
__add__, etc. Unfortunately, the operators only work if I type "vector *
(int/float/number)", in that exact order. My program produces an error if I
instead type "number * vector". This makes sense to me, because I haven't
Thanks for the help. That's exactly the kind of solution I wanted. I've been
to that page several times already, but just ignored that section
apparently. Thanks alot.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
.getch() returns 255 immediately. Windows applications without a
console usually don't play nice with C I/O calls.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
f something(a,b):
... print a,b
...
something(1,2)
doing prep work...
1 2
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
string. The coding line isn't even used.
The bytes will be exactly what was saved in the file between the quotes.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
winCenterx and charRect['rect'].centerx
< jumpRect.centerx:
charRect['dir'] = DOWN
I've included the whole code as a note pad so the above makes more sense, don't
worry about all the comments, that's just for my convenience.
Thanks guys
Mark
'
.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for
further copyright information.
s = "Sun Jan 23 14:28:32 1965"
from datetime import datetime
d=datetime.strptime(s,'%a %b %d %H:%M:%S %Y')
d.hour
14
d.minute
28
d.second
32
d.time()
da
use my computer no memory left
--
¡Saludos! / Greetings!
Juan José Del Toro M.
jdeltoro1...@gmail.com
Guadalajara, Jalisco MEXICO
___
Tutor maillist - Tutor@python.org
To un
down to 0.47
.485
0.48499 # %.2f will round down to 0.48
round(.475,2)
0.47998 # %.2f will round up to 0.48
round(.485,2)
0.48999 # %.2f will round up to 0.49
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
d some explanations as to what happens, but what are
you trying to achieve? Why don't you forget about arg3 because it is
arg1, which must exist by creating an instance of class c, or you
wouldn't be able to call doSomething in the first place?
HTH.
Mark Lawrence
_
I confess that I don't like top posting :) Please see below.
On 28/05/2010 00:19, Matthew Wood wrote:
#!/usr/bin/env python
Here's my best attempt. I'm not sure if it's "simpler" than yours,
but for me it seems a bit cleaner. Then again, I LOVE the zip
operator, and the '*' operator too. :
)
I think that you're trying to build a Yamoto/Musashi before you've built
a raft from oil drums or whatever :) If I'm wrong, I'll apologise here
and now.
For a really great introduction to Python, I suggest diveintopython,
it's what got me going eight years ago
Hi Alex, thanks for the response, please see below.
On 30/05/2010 02:50, Alex Hall wrote:
On 5/29/10, Mark Lawrence wrote:
On 29/05/2010 20:49, Alex Hall wrote:
Hi all,
In Battleship, I have a weapons.py file, currently with just one
missile type (a Harpoon anti-ship missile). This Harpoon
lem is the call
to plt.axis which sets xmin to 350, compare this to your data values
where the lowest value of x is 233.27.
Note that there is also a matplotlib mailing list.
HTH.
Mark Lawrence.
___
Tutor maillist - Tutor@python.org
To unsubscri
On 07/06/2010 01:44, Alex Hall wrote:
Further to the other comments that you've had, could you please refer to
the following, thanks.
http://www.catb.org/~esr/faqs/smart-questions.html
Kindest regards.
Mark Lawrence
___
Tutor maillist -
,
Malcolm
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
RTFM? :)
Kindest regards.
Mark Lawrence.
___
Tutor maillist - Tutor
On 07/06/2010 17:03, pyt...@bdurham.com wrote:
Hi Mark,
I was surprised to see class Name() work (in Python 2.6.5 at least). Is this
equivalent to class Name( object ) or does this create an old style class?
Going forward into the 2.7/3.x world, is there a preferred style?
RTFM? :)
I am
On 07/06/2010 17:30, pyt...@bdurham.com wrote:
Hi Mark,
I see that Stephen D'Aprano has already replied twice so I won't bother. Apart
from that no offence meant, I hope none taken.
Your RTFM reply actually gave me a good laugh. No (zero) offence taken.
And I appreciate your ma
^
SyntaxError: invalid syntax
The chap03.py file is a simple one that looks like this:
def print_twice(param):
print param param
One of the great advantages of Python is trying things from an
interactive prompt, so let's go.
c:\Users\Mark\python>python
Python 2.6.5 (r26
.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hi Jan,
I guess you're looking for something like the shelve or pickle modules.
http://docs.python.org/library/shelve.html
http://docs.python.org/library/pickle.html
HTH.
Mark Lawrence.
someone, help.
I'll leave you to find out the rests of the lyrics. :)
Mark Lawrence.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 17/06/2010 19:22, Lowell Tackett wrote:
From the virtual desk of Lowell Tackett
--- On Thu, 6/17/10, Mark Lawrence wrote:
From: Mark Lawrence
Subject: Re: [Tutor] help
To: tutor@python.org
Date: Thursday, June 17, 2010, 8:30 AM
On 17/06/2010 08:28, KB SU wrote:
help
Help, I need
,
Python and C++. Obviously I am working on learning python right now, I have
gotten up to Classes(I am studying from Learning Python 3rd and 4th editions
from Mark Lutz on Safari online books), and feel like I have a pretty good idea
of everything before classes. Yea there are still a lot of
h warm regards,
-Payal
You can do this.
>>> re.sub('[lL]','-',a)
'Mary Had a -itt-e -amb'
However it strikes me as overkill to use an re for something that could
be done with the string replace function.
Kindest regards.
Mark Lawrence.
___
Why does this work
>>> a = 6
>>> b = 7
>>> answer = a.__sub__(b.__neg__())
>>> answer
13
but this does not?
>>> answer = 6.__sub__(7.__neg__())
SyntaxError: invalid syntax
I searched the internet, and found someone suggest adding spaces after each
number, which indeed works properly.
>>> answ
Hmm, apparently python doesn't care about whitespace in method calls or
attribute access:
class person:
def __init__(self):
self.name ="jim"
def hi(self):
print("hello")
>>> guy = person()
>>> guy. name
'jim'
>>> guy .hi()
hello
That at least explains that par
On 29/06/2010 17:32, Joel Goldstick wrote:
[big snips]
It might not be completely relevant, but there is nothing to stop
anybody mixing regex and/or string methods. Horses for courses?
Kindest regards.
Mark Lawrence.
___
Tutor maillist - Tutor
r@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Take a look at section 7.1.3 here.
http://docs.python.org/py3k/library/string.html#string-formatting
This is the recommended way to format str
hon.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Drat, drat and double drat, I believe Dick Dastardly from the Wacky
Races cartoons. I meant to mention this, got side-tracked and
completely forgot, sorry.
Kindest regards.
Mark Lawrence.
_
of my code posted up at
http://pastebin.com/k9nMZNMy, I won't edit the code until I get this
worked out, except maybe a few housekeeping things, documentation, etc.*
*I've tried everything I can, and I appreciate your time and help!
~Corey Richardson
___
ation...
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
HTH.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscri
i.e. use 'wb' instead of 'w', and don't bother
converting to strings? Then when reading the file use 'rb' instead of 'r'.
HTH.
Mark Lawrence.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ained within s[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
advance!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
The lazy way.
http://docs.python.org/library/itertools.html
Look for combinations().
HTH.
Mark Lawrenc
s you are trying to print, but it worked on my US Windows
'cp437' console.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
", my_dmg / 2, "damage!"
print
my_hp = my_hp - mo_dmg
print "I was attacked by the lk for ", mo_dmg," damage!"
print "My Hit Points are ", my_hp
print
The keyword 'break' will exit a w
t;> ankur = "this is ankur"
>>> ankur.replace(' ', '\ ')
'this\\ is\\ ankur'
HTH.
Mark Lawrence.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
look at the actual Python test code in the Lib\test\ directory.
Depending on the code that you're wanting to test you might also want to
google for mock+objects, but this can wait until you've got your feet
under the table.
HTH.
Mar
2010/8/11 Corey Richardson
> Yes. It's called the Python API, it comes with Blender ;) bpy and Blender
> are the top modules. There are submodules for everything. The reference is
> here: http://www.blender.org/documentation/249PythonDoc/index.html
>
> HTH,
> ~Corey Richardson
>
> aug dawg wrote:
Not perfect, but you could check for each browser's binary.
import os
os.path.isfile("/usr/bin/firefox")
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
else:
break
Cheers.
Mark Lawrence.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
I think you're looking for this:
http://docs.python.org/library/argparse.html
you'll also want to read up on sys.argv
http://docs.python.org/library/sys.html#sys.argv
On Mon, Sep 6, 2010 at 8:48 AM, aug dawg wrote:
> I've seen Python programs that can be activated from the command line. For
There's also eric. It's geared towards pyqt slightly, but I do a lot of
wxpython development in it as well.
It's got project management and svn plugins, too.
http://eric-ide.python-projects.org/
On Fri, Oct 8, 2010 at 6:01 AM, Sayth Renshaw wrote:
>
> Message: 5
>> Date: Thu, 07 Oct 2010 20:08:10
turn False
To:
return confirmed == 'n'
Also see PEP8 (http://www.python.org/dev/peps/pep-0008/) for Python's
suggested coding standard.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
7;
>>> b=''.join(n for n in a if ord(n) >= 32 and ord(n) <= 126)
>>> b
'
!"#$%&\'()*+,-./0123456789:;<=>?...@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
-Mark
"Dinesh B Vadhia" wrote in message
news
t. Kent is right,
translate is what you want. The join is still nice for making the
translation table:
table = ''.join(' ' if n < 32 or n > 126 else chr(n) for n in
xrange(256))
string.translate('here is\x01my\xffstring',table)
'here is my string'
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Maybe there is a trick
to force python printing ot in due time, but I have no idea, sorry.
stdout is line-buffered. Here's the trick:
import time
import sys
for l in 'the answer':
print(l,end='')
sys.stdout.flush()
time.sleep(0.1)
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
x27;ggg'}]
set(l1)
TypeError: dict objects are unhashable
but,
{'a': 'ddd'} == {'a': 'ddd'}
True
How about:
l1 = [{'a': 'ddd'}, {'a': 'ddd'}, {'b': 'eee'}, {'c': 'ggg
want the window to stay open after executing
the commands, use /k instead of /c. 'cmd /?' gives other switches you might
want. The escaping(^) of the ampersands(&) is required or the commands will
run in the current console not the new one.
import os
os.system(
print 'pKaRes %s %d %s,value= %s' %
(line[:3],int(line[5:9]),line[4],line[10:])
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ing 3.x where it was renamed to "input".
In Python 2.x:
print "Game Over"
raw_input("\n\nPress the enter key to exit.")
In Python 3.x:
print("Game Over")
input("\n\nPress the enter key to exit.")
-Mark
"John J
Python handy? This exposes the implementation as UTF-16.
len(x)
2
x[0]
u'\ud808'
x[1]
u'\udf45'
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"Kent Johnson" wrote in message
news:1c2a2c590903310357m682e16acr9d94b12b60993...@mail.gmail.com...
On Tue, Mar 31, 2009 at 1:52 AM, Mark Tolonen
wrote:
Unicode is simply code points. How the code points are represented
internally is another matter. The below code is from a 16-b
print('Backup Failed')
else:
print('Successful backup to',target)
-Mark
"Benjamin Serrato" wrote in message
news:dde7cc5d0904051354v1c103fb2wf28f182734970...@mail.gmail.com...
Please tell me why this code fails. I am new and I don't understand why my
unless your editor completely supports editing in it (mine doesn't), so I
second the motion to post only plain text.
-Mark
"Wayne Watson" wrote in message
news:49dad279.2000...@sbcglobal.net...
That's strange--tiny image below. I use SeaMonkey, and it seems to be almost
i
>>>> data = "42 sdlfks d f60 sdf sdf
>>>> Title"
[ re attempts stripped]
Your data looks like XML. If it is actually well-formed XML, have you tried
ElementTree?
PythonWin 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on win32.
Portions Copy
---
Here is the content of my utf-8 file:
-
[files]
file3 = ascii.txt
file2 = chinese.txt
file1 = blah.txt
file5 = ÀÈÌÒÙ.txt
file4 = other.txt
[马克]
多少 = 明白
Hope this helps,
Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"Kent Johnson" wrote in message
news:1c2a2c590905050337j1afc177ene64f800dcc3a7...@mail.gmail.com...
On Tue, May 5, 2009 at 1:14 AM, Mark Tolonen
wrote:
> The below works. ConfigParser isn't written to support Unicode
> correctly. I
> was able to get Unicode secti
k awhile to train myself not to
write:
file = open('filename.txt')
and incorrectly shadow the built-in. It's just the most natural name for
the variable :^)
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
It's a bad idea to change the encoding through site.py. Your script won't
work on any other system.
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
t):
File "", line 1, in
TypeError: f() takes exactly 2 arguments (3 given)
But there is a syntax to pass keyword arguments as a dictionary:
f(1,2,**{'c':3})
1 2 {'c': 3}
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
sv.writer(myfile, dialect='excel')
for k,[a,b,c] in dyc.items():
mywriter.writerow([k,a,b,c])
myfile.close()
OUTPUT:
a50,textfield,50,40
k77,othertext,60,10
If you want quoted text fields use:
mywriter = csv.writer(myfile, dialect='excel',quoting=csv.QUOTE_NONNUMERIC)
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"Kent Johnson" wrote in message
news:1c2a2c590906230415q351c7c74kebc591907ce0e...@mail.gmail.com...
On Tue, Jun 23, 2009 at 1:08 AM, Mark Tolonen
wrote:
import csv
dyc = {
'a50' : ['textfield', 50, 40],
'k77' : ['othertext', 60,
or external command,
operable program or batch file.
255
os.system('echo Hello^|World')
Hello|World
0
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
something similar.
Use the random module. There are various types of random number generation
there, such as:
x = random.randint(5,10)
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
; is not defined". Also for the word "canvas"
As you suggest, I probably need to start with a 2.x version.
Python is case-sensitive. Try "tk = Tk()" and "Canvas".
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ascii-only. Try print(ascii(line)).
Another trick is to switch to Lucida Console font and change the console's
code page to 1252 with the command "chcp 1252". This font and code page
supports the EM DASH and will display the text properly with print(line).
"Alan Gauld" wrote in message
news:h407ah$lc...@ger.gmane.org...
"Mark Tolonen" wrote
... I see you are using Python 3.1. ...
You can also use a shell that supports the full Unicode character set
such as Idle or PythonWin instead of the console.
As a matter of int
DIGIT SEVEN
ARABIC-INDIC DIGIT TWO
ARABIC-INDIC DIGIT FIVE
ARABIC-INDIC DIGIT SEVEN
ARABIC-INDIC DIGIT TWO
ARABIC-INDIC DIGIT ZERO
ARABIC-INDIC DIGIT ZERO
ARABIC-INDIC DIGIT EIGHT
-Mark
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi, I was reading a tutorial, and it mentioned the "import this" easter egg.
I was curious, and looked up the contents of the module, and dscovered that
it had attributes c, d, i, and s. I was wondering if anyone had any clue
what these attributes were supposed to mean. I think (this.s) is the zen
Thanks everybody, I didn't know modules ran code when you imported them, I
just thought they defined the functions, etc. in them. Thanks for the info.
I'm going to go look at the module's code now that I know where it's at.
Mark Young
_
n,n) for n in L]
[30, 31, 32, 33, 34, 35, 36, 37, 34, 39, 39]
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
"Douglas Philips" wrote in message
news:9ee00578-6af7-4c6c-9968-af5f25a00...@mac.com...
On 2009 Sep 5, at 12:22 PM, Mark Tolonen wrote:
As a list comp:
L=range(30,41)
[{38:34,40:39}.get(n,n) for n in L]
[30, 31, 32, 33, 34, 35, 36, 37, 34, 39, 39]
True, that is terse, bu
Have you tried running this line by line through the interactive
shell? Given, I'm not doing this on a mac, but your input() call
doesn't fail for me. I'm using Python 2.6.
mark
___
Tutor maillist - Tutor@python.org
To unsubs
e first
comma-delimited thing in record. str(x) is redundant. x will be a string
already. What do you want this function to do?
array = []
for x in bigMethod():
array.append(getMark(x))
array1=[]
for count in array:
array1 = [[count],[x]]
for v in array1:
print v
What
o KeyError. Default on missing is to return None.
help(os.environ.get)
Help on method get in module os:
get(self, key, failobj=None) method of os._Environ instance
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opt
, if it's the
wrong place, I'm sorry.
Mark Young
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
I have no real need to learn anything for a job, it's just a hobby right
now. I mostly just want "a programming language that has a different
philosophy or approach than
Python". However, you guys are right, if I just learn a language without a
reason, it will be worthless.
When I tried to learn
a project with other people before, so it would definitely be helpful, for
both my Python and for whatever language I pick up. I think I may wait a bit
though, so I can actually help someone instead of slowing them down.
Anyway, thanks everyone for the input, you've
2009/10/7 Serdar Tumgoren
> And in case you hadn't heard enough suggestions yet, here's something
> I just stumbled into this morning:
>
> Programming Paradigms for Dummies, by Peter Norvig
> http://lambda-the-ultimate.org/node/3465
>
> Here's a portion of the soundbite from the website (where yo
n last came
up I think we went round that loop and discovered
that it didn't. Happy to be wrong. :)
That still works, but it only ever worked for command.com (the 16-bit
command interpreter that still comes with Windows XP). A 16-bit DOS program
or a batch file explicitly ru
the *same* list object, so modifying one modifies all:
>>> L[2][0]=1
>>> L
[[1, 0], [1, 0], [1, 0], [1, 0]]
Use a list comprehension to create lists of lists, where each list is a
*new* list:
>>> L = [[0,0]
stered program for the
'.py' extension to run the script. It doesn't use the PATH. You can see
the default program for an extension from the command line with the 'assoc'
and 'ftype' commands:
C:\>assoc .py
.p
ding: cp720
u'abc'.encode('cp1256')
'abc'
If you are running on an Arabic version of Windows, you might change the
console code page to 1256 and see if that works. Run 'chcp 1256' before
running 'python'.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
he encoding of the terminal to
decode stdin and encode to stdout. Implementing a cp720 codec would likely
fix the problem.
-Mark
"ALAN GAULD" wrote in message
news:339296.66934...@web86707.mail.ird.yahoo.com...
Forwarding to the tutor list with cut n paste sessions.
It looks to m
ok, all i know is that i have python installed on my computer(mac),
and i know how to open up "IDLE", how do i write my first program,
what do i use , how do i open that, and how to i save it as a prograam?
___
Tutor maillist - Tutor@python.org
To
ectly to a serial port
or file. Each character in the string is a byte of data. If you actually
need to send hexadecimal characters as text, the binascii module has
hexlify:
>>> import binascii
>>> import time
>>
how do
I force split to only evaluate the first two columns? Better yet, can I
tell split to not evaluate commas in the double quoted 3rd column?
Check out the csv, zipfile, and gzip modules in the Python documentation.
-Mark
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
> I find the easiest way is to create an PhotoImage object attach
> the graphic file(jpg,bmp,gif) to that and assign the PhotoImage
> object to the Button.image property. You can "animate" the image
> by simply reassigning the file to the underlying PhotoImage onject.
Thanks, but a practical expla
On Mon, 20 Dec 2004 18:21:13 +1300, Liam Clarke <[EMAIL PROTECTED]> wrote:
> from Tkinter import *
> import Image, ImageTk
> root = Tk()
> img = Image.open('SonicCruiser.gif')
> phi = ImageTk.PhotoImage(img)
> button = Button(root, image=phi)
> button.pack()
> root.mainloop()
Thank you !!
But I d
1 - 100 of 1119 matches
Mail list logo