Re: What do you use as symbols for Python ?

2005-11-10 Thread Gary Herron
(3) Then you can refer to the values as State.OPENED State.CLOSED State.ERROR The extra clarity (and slight wordiness) of the dotted notation seems, somehow, quite Pythonic to me. Gary Herron -- Gary Herron, PhD. Department of Computer Science DigiPen Institute of Technology (425

Re: weird problem with os.chmod

2005-11-11 Thread Gary Herron
James Colannino wrote: James Colannino wrote: So then I entered the command print 0600, and saw that the actual number being output was 384 (why would it output 384?!) Ok, so further research revealed that 0600 is actually the octal representation for 384 (which makes sense.) So

Re: how to convert between type string and token

2005-11-14 Thread Gary Herron
faster. Good luck, Gary Herron enas khalil wrote: hello all when i run the code : # -*- coding: cp1256 -*- from nltk.tagger import * from nltk.corpus import brown from nltk.tokenizer import WhitespaceTokenizer # Tokenize ten texts from the Brown Corpus

Re: what's wrong with lambda x : print x/60,x%60

2005-12-04 Thread Gary Herron
explicit about the returned tuple would produce what you want. lambda x : (x/60,x%60) Gary Herron [EMAIL PROTECTED] ~ $ python Python 2.4.2 (#1, Nov 18 2005, 19:32:15) [GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2 Type help, copyright, credits or license for more

Re: How to Refresh the Desktop window with python script

2005-12-12 Thread Gary Herron
name, mac address, ip address and OS on that system. The platform module can give lots of such info: http://docs.python.org/lib/module-platform.html Good Luck, Gary Herron Thanks in advance for having given a thought on my questions. Regards Yogi -- http://mail.python.org/mailman/listinfo

Re: IsString

2005-12-13 Thread Gary Herron
... Several types would qualify as numbers: IntType, FloatType, LongType, and ComplexType, and several as strings: StringType and UnicodeType Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Gary Herron
it... What's your complaint, what's your solution, and why should we listen? Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2005-12-23 Thread Gary Herron
it to the wall, and start walking backwards. You will still be able to discern the structure of the code *long* after you can no longer identify the curly-braces. (Provided you properly indented you C++ code -- you *do* indent you C++ code don't you?) Gary Herron Note: No need to follow up with long

Re: Indentation/whitespace

2005-12-23 Thread Gary Herron
. That was an April Fools joke. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: reading files into dicts

2005-12-29 Thread Gary Herron
, to take over complete control of your program. So be carefully. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Global Variables in OOP and Python

2005-12-30 Thread Gary Herron
= os.getcwd() # Get working directory at startup (Even if the import of Parameters in some file occurs before the initialization code has a chance to run.) Gary Herron in all of the files (namespaces) where it is needed. Is there a better way? Are the two ideas presented above acceptable? If so

Re: important for me!!

2006-01-02 Thread Gary Herron
this process until the file runs out of words. (Hint:you can use ramdom.shufflefunction to scramble the letters) Please can you answer this problem? This sounds like a school assignment. We make it a habit here to *not* answer such questions. Sorry, and good luck with your studies. Gary Herron

Re: No newline using printf

2005-09-16 Thread Gary Herron
exactly the characters you want to sys.stdout. Thus: sys.stdout.write('%1d' % i) should do what you want. Dr Gary Herron Digipen Institute of Technology -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Source Code for a HTTP Proxy

2005-09-23 Thread Gary Herron
llothar wrote: Hello, i'm looking for a simple http proxy in python. Does anybody know about something like this ? Here's a list, maintained by Alan Kennedy, of about 20 proxys written in Python: http://xhaus.com/alan/python/proxies.html Enjoy, Gary Herron -- http://mail.python.org

Re: Going crazy...

2005-06-13 Thread Gary Herron
, and they support set differences: from sets import Set Set([1,2,3,4,5,6]) - Set([2,3,6]) Set([1, 4, 5]) Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Slicing every element of a list

2005-07-12 Thread Gary Herron
. Gary Herron Digipen Institute of Technology -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I dynamically create functions without lambda?

2006-01-27 Thread Gary Herron
Russell wrote: I want my code to be Python 3000 compliant, and hear that lambda is being eliminated. The problem is that I want to partially bind an existing function with a value foo that isn't known until run-time: someobject.newfunc = lambda x: f(foo, x) The reason a nested function

Re: Module imports

2006-01-30 Thread Gary Herron
and standard operation procedure.The functions from myFunctions execute in the environment of the module they were define in, no matter how you import/reference them from another procedure. Just try it and you'll be please with the results. Gary Herron Is there a way to make python

Re: python printout format

2006-02-01 Thread Gary Herron
string.ljust(PortlinkbeatInv[row[j][0]],14), ^ SyntaxError: invalid syntax The problem here is that the previous line has unbalanced parentheses. Fix that, and there should be no problem with this line. Gary Herron How should I change to printout row data [1,2,3,4,5] in one row in assigned

Re: Newbie

2006-02-12 Thread Gary Herron
LittlePython wrote: Is this a good place to post python questions from newbie's, or would you suggest another board? Thx This is the correct place. This group has the reputation of being newbie-friendly. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Module question

2006-02-21 Thread Gary Herron
to be performed. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: why this error?

2005-03-15 Thread Gary Herron
spencer wrote: Hi, I'm not sure why I can't concatenate dirname() with basename(). Of course you *can* concatenate them, but you're not getting that far. The piece os.path.dirname(os.getcwd) should be os.path.dirname(os.getcwd()) Then it will work without raising an exception, but

Re: which one is more efficient

2008-02-08 Thread Gary Herron
would be better spent worrying about how to optimize the other portions of you code. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: different key, same value in dictionaries

2008-02-09 Thread Gary Herron
your own dictionary type from the builtin dictionary type, and map an index operation d[(x,y)] to d[ImmutableSet(a,b)]. Then all of d[a,b], d[b,a], d[(a,b)] and d[(b,a)] would index the same element. See http://docs.python.org/lib/module-sets.html for details of the set module. Gary Herron

Re: Better way to negate a boolean list?

2008-02-10 Thread Gary Herron
operator, and find operator.not_ which is a function and does what you want. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivt of __FILE__ and __LINE__

2008-02-11 Thread Gary Herron
for the reader. (Meaning I haven't a clue.) Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access object attributes given a string

2008-02-12 Thread Gary Herron
, 100 ). You want getattr and setattr: setattr(ob, 'blah', 123) and getattr(ob, 'blah') Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy PIL question

2008-02-16 Thread Gary Herron
. Basically I'm trying to make a: if pixel == color: do_this() else: pass And have it do this as fast as my pc can handle (that is why only grabbing 1px would be helpful) Try image.getpixel((x,y)) to retrieve the pixel at (x,y). Gary Herron -- http://mail.python.org/mailman/listinfo

Re: Sys.exit() does not fully exit

2008-02-17 Thread Gary Herron
answer. However, it you *do* want threads, and you don't want the main thread to wait for the threads to quit, you can make the threads daemon threads. See setDaemon method on Thread objects in the threading module. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0

2008-02-18 Thread Gary Herron
is to keep the incompatibilities to a minimum, but subject to the larger goal of producing a cleaner/better language unhindered by the need of absolute compatibility. Gary Herron David Blubaugh -Original Message- From: Bill Hart [mailto:[EMAIL PROTECTED] Sent: Friday, February

Re: Understanding While Loop Execution

2008-02-18 Thread Gary Herron
for one. The easiest way to do that is mylist[:]. (This is a shorthand for copying out any sublist of mylist via the syntax mylist[a:b], with a and b defaulting to whole list.) Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: packing things back to regular expression

2008-02-20 Thread Gary Herron
of a pattern matched by an re can be replaces with a given string. See sub and subn. Perhaps you can make one of those do whatever it is you are trying to do. Gary Herron e.g re.SomeNewFunc(compilexp, mytable) myname mytable = {a : 1} re.SomeNewFunc(compileexp, mytable

Re: simpleparse - what is wrong with my grammar?

2008-02-24 Thread Gary Herron
. Good luck. Gary Herron Thanks, Laszlo from simpleparse.common import numbers, strings, comments from simpleparse.parser import Parser declaration = r''' expr:= paren_expr/unop_expr/binop_expr/word paren_expr := (,expr,) unop_expr := unop,expr binop_expr

Re: Newbie: How can I use a string value for a keyword argument?

2008-02-25 Thread Gary Herron
during the calling process as a dictionary, You can create the dictionary yourself, and slip it into the calling arguments with a ** notation: kw = {somestring:32} x.foo(**kw) Gary Herron or x.MyClass() y = 'trials' x.foo(y = 32) # does the wrong thing Surely there's some way to use

Re: String compare question

2008-02-25 Thread Gary Herron
Robert Dailey wrote: Hi, Currently I have the following code: ignored_dirs = ( r.\boost\include ) You expect this is creating a tuple (or so I see from your in test in the following code), but in fact the parenthesis do *not* make a tuple. If you look at ignored_dirs, you'll find

Re: Question on importing and function defs

2008-03-02 Thread Gary Herron
the default a to call ... And you main program: from mod import * def my_a(): ... b(my_a) Hope that helps Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Short confusing example with unicode, print, and __str__

2008-03-05 Thread Gary Herron
(128) Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: parralel downloads

2008-03-08 Thread Gary Herron
threads. Gary Herron You can have more information here. http://artfulcode.nfshost.com/files/multi-threading-in-python.html On Sat, Mar 8, 2008 at 1:11 PM, John Deas [EMAIL PROTECTED] wrote: Hi, I would like to write a python script that will download a list of files (mainly mp3s

Re: is operator

2008-03-10 Thread Gary Herron
be applied to *any* immutable type. For larger ints, such a thing is not true. x=1000 y=1000 x is y False If either is a surprise, then understand that the is operator should probably *never* be used with immutable types. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: how to pass the workspace ?

2008-03-11 Thread Gary Herron
pass the workspace created in node1, to node 2, etc ? thanks, Stef Mientki RTFM! In particular: http://docs.python.org/lib/built-in-funcs.html#l2h-26 Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Weight Problem

2008-03-16 Thread Gary Herron
of Sets. -- -=Ravi=- This sounds like a homework problem, something you should be solving yourself. If, however, you have any Python questions, then please ask. We'll be glad to answer them. -- Gary Herron, PhD. Department of Computer Science DigiPen Institute of Technology (425) 895-4418

Re: Is this valid ?

2008-03-19 Thread Gary Herron
comparison operators work. The meaning is the same as the AND of each individual test. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError: name 'guess' is not defined

2008-03-22 Thread Gary Herron
'The while loop is over.' print 'Done' Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Time module is not behaving.

2008-03-25 Thread Gary Herron
$ more time.py import time * Right there is the problem. Your program, named time.py, is hiding the Python supplied module. So that import of time is finding and re-importing itself. Rename your script to something that won't shadow a Python library module. Gary Herron *print time.time

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Gary Herron
= subprocess.Popen ([/usr/bin/ls /tmp]) This line fails because of a typo. There needs to be a comma between the two list elements. Without the comma, this becomes proc = subprocess.Popen ([/usr/bin/ls/tmp]) which obviously fails. Gary Herron Traceback (most recent call last): File

Re: Problems wit List Object

2008-03-27 Thread Gary Herron
to look at. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting back an Object

2008-03-27 Thread Gary Herron
object obj do: objMap[str(obj)] = obj and later with the string in hand, do obj = objMap[string] One other word of warning. It is best to not use a variable named string as Python has a builtin type of that name which would become inaccessible if you redefine. Gary Herron -- http

Re: Astronomy Fits format and gif.save(path)

2008-03-28 Thread Gary Herron
W. Watson wrote: In what library would I find gif.save(path), where path is the name and path of a file, and the method would produce a file in a gif format? Is there a fits.save(path) somewhere? fits is commonly used in astronomical work. You may want to install PIL (the Python Image

Re: problem with logic in reading a binary file

2008-03-29 Thread Gary Herron
the struct module: http://docs.python.org/lib/module-struct.html It is meant to solve this kind of problem, and it is quite easy to use. Gary Herron Here is my function that takes in a string. def parseSequence(data, start): group_num = data[start:start+2] element_num = data

Re: [OT] troll poll

2008-03-31 Thread Gary Herron
/it), then castironpi can be declared to be a truly *intelligent* AI. AFAICT, there appears no danger of that happening yet. Gary Herron :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner advice

2008-03-31 Thread Gary Herron
Paul Scott wrote: I have been tasked to come up with an audio recorder desktop (cross platform if possible - but linux only is OK) that: 1. records a lecture as an MP3 file (pymedia?) 2. Provides a login form for server credentials 3. Uploads via XMLRPC (pyxmlrpclib) to the server as a

Re: import multiple modules with same name

2008-03-31 Thread Gary Herron
Christian Bird wrote: Is it possible to import multiple modules with the same name from different locations? I'm using two different pieces of software, both of which have a module named util.py. I know that I can modify sys.path to fix which util gets imported when I do: import util I'd

Re: Recursive function won't compile

2008-04-02 Thread Gary Herron
please: Why are you surprised? Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: expanding a variable to a dict

2008-04-03 Thread Gary Herron
this: for a in [dictFoo, dictBar, dictFrotz]: if 'srcdir' in a: a['srcdir']='/usr/src' Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: expanding a variable to a dict

2008-04-03 Thread Gary Herron
idle wrote: brilliant. Hardly. Any perceived brilliance is in the design of Python, not our simple and hopefully effective use of it. :-) Gary Herron thanks to both of you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird scope error

2008-04-05 Thread Gary Herron
just make ElementTree directly importable by either installing it normally or including .../xml/etree in your PYTHONPATH Gary Herron Can anybody help? THanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with list comprehension

2008-04-09 Thread Gary Herron
) is wrong since range(2) is [0,1]. You want range(3) which gives [0,1,2]. Gary Herron but for some reason the list comprehension is not always returning a list with 2 elements in it (sometimes it will be just 1 element). I've tried changing to a generator as well as using filter() and all

Re: urgent question, about filesystem-files

2008-04-10 Thread Gary Herron
... Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Call a classmethod on a variable class name

2008-04-13 Thread Gary Herron
] parameters.theClass.bar() (Hint: It matters not whether foo is a classmethod, saticmathod or normal method.) Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Preferred method for Assignment by value

2008-04-15 Thread Gary Herron
, I've used these various copy methods perhaps a dozen times or less. If you find you are copying structures often, you are probably not using Python as effectively as you could. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Mailing list question

2008-04-16 Thread Gary Herron
python newbie wrote: Hello, Just curious; can I post a basic programming question to this mailing list? You just did. :-) (Real answer: Yes. We're pretty newbie friendly here.) Gary Herron Thanks in advance. Pete

Re: Can't see variables declared as global in a function

2008-04-16 Thread Gary Herron
all the hundred variables, and define getter/setter methods for them. Gary Herron Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type help, copyright, credits or license for more information. from test_vars import * dir

Re: Image handling - stupid question

2008-04-16 Thread Gary Herron
. It's an awesome combination. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't do a multiline assignment!

2008-04-17 Thread Gary Herron
in the future.) Gary Herron In Python, you usually can use parentheses to split something over several lines. But you can't use parentheses for an assignment of several lines. For that, you can use the line continuation character ('\'): CONSTANT1= \ CONSTANT2= \ CONSTANT3= \ 1

Re: Can't do a multiline assignment!

2008-04-17 Thread Gary Herron
= None Connection = None Date= None Pragma = None ... Gary Herron Etc etc etc. At the end they'll all be assign to None. Then, when initialized, __init__() will the the string of headers, parse them, and use

Re: [Python-Dev] annoying dictionary problem, non-existing keys

2008-04-24 Thread Gary Herron
, i should only use it, if it does not exist, it may return only empty, just as in php i hope you understand my question... See http://docs.python.org/lib/typesmapping.html for a description of the get method of dictionaries. Also look at the key in dict syntax on the same page. Gary

Re: convert xhtml back to html

2008-04-24 Thread Gary Herron
tree structure representation, it should be a relatively easy job to traverse the tree to emit the tags and text you want. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gary Herron
. If you *are* trying to use the name mangling, then you still don't need the super. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is None = 0

2008-04-25 Thread Gary Herron
differently, but on a specific implementation, the result will not change. Python 3 will raise an exception on such comparisons. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Given a string - execute a function by the same name

2008-04-28 Thread Gary Herron
, and probably more. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: list.reverse()

2008-04-28 Thread Gary Herron
it: x = list ... x.reverse() # reorders, but returns nothing ... now use x ... You might look at the builtin reversed(list): http://www.python.org/doc/faq/programming/#how-do-i-iterate-over-a-sequence-in-reverse-order Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Math libraries - How to?

2008-04-28 Thread Gary Herron
import pi, sqrt Then use pi, and sqrt. But other module attributes (like sin, and cos) are not accessible. Method 3: from math import * Then use pi, sqrt, cos, sin, and anything else defined by the module. (This is sometime frowned upon, but there's no reason to do so here.) Gary Herron

Re: computing with characters

2008-04-30 Thread Gary Herron
SL wrote: How can I compute with the integer values of characters in python? Like 'a' + 1 equals 'b' etc -- http://mail.python.org/mailman/listinfo/python-list You can get an integer value from a character with the ord() function. Gary Herron -- http://mail.python.org/mailman/listinfo/python

Re: Is vs Equality Operator

2008-05-01 Thread Gary Herron
Good Z wrote: Hello, I am having problem in using is. Here is what i am doing. Short answer: Use == for equality.Don't use is. Ever! (Especially if you are a newbie.) Longer answer: In a dozen years of programming Python, the only time I use is is when testing for something like

Re: is +=1 thread safe

2008-05-01 Thread Gary Herron
, increment the register write the value into i. If a thread is interrupted anywhere within that sequence, and another thread access i, you have a conflict. (And indeed, hardware interrupts can occur between any two instructions.) Gary Herron -- http://mail.python.org/mailman/listinfo/python

Re: How to use a parameter in a class

2008-05-03 Thread Gary Herron
, and we'll wee if we can help. Gary Herron P.S. Having a class attribute AND an instance attribute, both named value is going to cause trouble. # But the last line does not work. I would like to do a call like: dummy = Dummy(thisValue = 12) And that someFunction gets a default

Re: is +=1 thread safe

2008-05-03 Thread Gary Herron
since each thread has it's own set of register values. Gary Herron 'as -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: is +=1 thread safe

2008-05-04 Thread Gary Herron
Carl Banks wrote: On May 3, 7:44 pm, Gary Herron [EMAIL PROTECTED] wrote: Alexander Schmolck wrote: AlFire [EMAIL PROTECTED] writes: The threading module already has a function to return the number of Thread objects currently alive. I have threads within threads

Re: is +=1 thread safe

2008-05-04 Thread Gary Herron
Alexander Schmolck wrote: Gary Herron [EMAIL PROTECTED] writes: But... It's not! A simple test shows that. I've attached a tiny test program that shows this extremely clearly. Please run it and watch it fail. In [7]: run ~/tmp/t.py final count: 200 should be: 200 (I

Re: is +=1 thread safe

2008-05-04 Thread Gary Herron
Carl Banks wrote: On May 4, 12:03 pm, Gary Herron [EMAIL PROTECTED] wrote: Alexander Schmolck wrote: Gary Herron [EMAIL PROTECTED] writes: But... It's not! A simple test shows that. I've attached a tiny test program that shows this extremely clearly. Please run

Re: open filename with spaces in path

2008-05-06 Thread Gary Herron
with -- tell us what exception you get.(Or just look at it carefully yourself.) Whatever the problem is, I don't believe it has anything to do with the spaces. Gary Herron open('./my\\ test/test.txt') Exception but yet... import os os.chdir('./my test') open('./test') works just

Re: Idea for P3K

2008-05-07 Thread Gary Herron
that (mis)feature because it's so unclear, and easy to abuse. Most of us in the community support that point of view and would fight the introduction of such a feature into Python. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: howto print binary number

2008-05-07 Thread Gary Herron
','1'] for j in b] ... len(b) 256 b[63] '0011' Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Gary Herron
. (Truly, when I found Python, programming became fun again.) Gary Herron Tnx, Raxit www.mykavita.com -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Gary Herron
be useful. However, this *does* do what you asked. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call a file

2008-05-10 Thread Gary Herron
, but you'll get past these trivial problems soon. Then you'll be more likely to find volunteers who will spend time to help *if* you spend the time to provide useful information. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Gary Herron
the skill of reading the error messages *very* carefully. Your error says there is no file named fileName, and if you think about what's on your disk, I'll bet you won't find a file whose name is fileName. Gary Herron where fileName is defined before the line it's used in. It works fine when I

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Gary Herron
bc90021 wrote: ...and the exact error message was? Here is a tip: if you want people to help you, then you have to help them to help you. Personally, I wouldn't respond to anymore of your questions because you seem incapable of posting the information that was requested. So far, the

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Gary Herron
or the purpose of the group. And you've done both and been reprimanded for it. Now, either go away, or change your attitude and join the group. (You would be welcome if the attitude changed.) Either way, this group will be it's usual friendly self. Gary Herron Gary Herron wrote

Re: question about python statements

2008-05-12 Thread Gary Herron
a statement? Do you even have a list of statements from which we are to work? Python is a little unusual in what it considers statements. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: question about python statements

2008-05-13 Thread Gary Herron
. The biggest challenge at the moment is that we have no idea what you mean by statement, but it is certainly not what Python considers statements. Gary Herron Thanks, Ohad Frand -Original Message- From: Gary Herron [mailto:[EMAIL PROTECTED] Sent: Monday, May 12, 2008 10:41 PM

Re: looking for a pdf module

2008-05-13 Thread Gary Herron
/python-list ReportLabs is a quite extensive open-source project for generating PDF files. http://www.reportlab.org/ Enjoy, Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't I import this?

2008-05-13 Thread Gary Herron
this leaves unanswered the question of *how* you are supposed to import that code. I've never used PythonCard so I can't help further, but I suggest looking at the documentation and examples supplied. And perhaps waiting for someone with experience with PythonCard to answer. Gary Herron

Re: variable scope question?

2008-05-13 Thread Gary Herron
a is trying to access the local variable before the assignment gives it a value. You were expecting that the print a pickups it the outer scope a and the assignment later creates a local scope a, but Python explicitly refuses to do that. Gary Herron -- http://mail.python.org/mailman/listinfo

Re: What is self.file = file for?

2008-05-13 Thread Gary Herron
is the name of the object being created, self.file is an attribute named file of that object, and the assignment stores the supplied value there. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't I import this?

2008-05-13 Thread Gary Herron
John Henry wrote: On May 13, 1:49 pm, Gary Herron [EMAIL PROTECTED] wrote: John Henry wrote: Hi list, I can't understand this. The following import statement works fine: from PythonCard.templates.dialogs import runOptionsDialog but this one fails

Re: What is self.file = file for?

2008-05-13 Thread Gary Herron
are dedicated to OOP. Years could be spent learning to apply its concepts. A web search would find a flood of such information. Gary Herron On Wed, May 14, 2008 at 12:25 AM, Gary Herron [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hello! I have trouble understanding something

Re: How do I use the unpack function?

2008-05-15 Thread Gary Herron
= pixelComponent[:4] # first 4 bytes pixelComponent = pixelComponent[4:] # All but first four bytes buffer = unpack(!f, fourbytes) There are probably better ways overall, but this directly answers your question. Gary Herron -M

Re: How do I use the unpack function?

2008-05-15 Thread Gary Herron
of question. Just try it! a = 'abcdefghi' b = a[:4] print a,b abcdefghi abcd Notice that the [:4] index does not change the original array. Gary Herron I'm getting weird results now.. -M Date: Thu, 15 May

Re: How do I use the unpack function?

2008-05-15 Thread Gary Herron
John Machin wrote: On May 16, 2:11 am, Gary Herron [EMAIL PROTECTED] wrote: Marlin Rowley wrote: All: I've got a script that runs really slow because I'm reading from a stream a byte at a time: // TERRIBLE for y in range( height ): for color in range(4

  1   2   3   4   5   6   7   8   >