spir wrote:
class Out(file):
def __init__(self, filename, toconsole=True, numberlines=True):
file.__init__(self, filename, 'r')
print self
# debug output to console
self.toconsole = toconsole
# line numberi
Richard Hultgren wrote:
a = 0
b = 1
count = 0
max_count = 20
while count < max_count:
count = count + 1
# we need to keep track of a since we change it
old_a = a# especially here
old_b = b
a = old_b
b = old_a + old_b
# Notice that the , at the end of a
spir wrote:
Roy Hinkelman dixit:
I can't find anything on this error I am getting when renaming some files.
I'm pulling info from a csv file and parsing it to build new file names.
Any pointers appreciated
Roy
My code:
# RENAME FILES using META file - new name = [place]_[state]_[sku].tif
Serdar Tumgoren wrote:
Hi Kent and Lie,
First, thanks to you both for the help. I reworked the tests and then
the main code according to your suggestions (I really was muddling
these TDD concepts!).
The reworked code and tests are below. In the tests, I hard-coded the
source data and the expect
Tim Goddard wrote:
I'm still learning, and this may be better served on a pygame mailing
list but I thought I'd try here first.
I'm following the python programming for absolute beginners which uses
livewires and pygame to do some simple games. My difficulty comes
from not using the module vers
Roshan S wrote:
class
Student:
print"We have a new student "
def __init__(self,name='',credit=0,grade=0,quality=0):
self.name=name
self.credit=credit
self.grade=grade
self.quality=quality
def inputstudent(self):
self.name=raw_input("Enter stu
Richard D. Moores wrote:
def float_to_exact_number_stored_in_computer(f):
"""
Given a float, return the exact number stored in computer.
See
http://docs.python.org/3.1/tutorial/floatingpoint.html#representation-error
"""
from decimal import Decimal
return Decimal.from_float(f)
Richard D. Moores wrote:
On Tue, Dec 15, 2009 at 15:05, Dave Angel wrote:
Richard D. Moores wrote:
If I keep the function, renamed to Allan's suggested float2Decimal(),
then that's all I'll have to remember. But I see yours and Hugo's
point.
Just remember, if th
Richard D. Moores wrote:
On Tue, Dec 15, 2009 at 23:30, Hugo Arts wrote:
On Wed, Dec 16, 2009 at 5:12 AM, Richard D. Moores wrote:
Before I can go below I need to know if you are saying that the
relevant doc is wrong. I took the original name for my function almost
directly from it. N
R. Alan Monroe wrote:
I'm wondering whether text.replace has to shove oodles of text to the
right in memory when you replace a shorter word with a longer word.
Someone else on the list may know.
Alan
Since a string is immutable, replace() has to copy the string. So it
doesn't need to
Richard D. Moores wrote:
On Wed, Dec 16, 2009 at 14:48, Richard D. Moores wrote:
I just realized that my question was absurd, in that given real
numbers n and x there is no x such that both x < n and x is greater
than all other numbers less than n.
So after inserting "(in 14 hex digits)" at 2
Richard D. Moores wrote:
On Wed, Dec 16, 2009 at 20:23, Dave Angel wrote:
Richard D. Moores wrote:
There are conceivably better ways to get at the mantissa of the fp number,
but you can simply parse the hex digits as I did manually, and add one and
subtract one from the given
Richard D. Moores wrote:
def prestrings2list(a_str):
word = ""
list_of_strings = []
length_of_a_string = len(a_str)
for i, char in enumerate(a_str):
if i == length_of_a_string - 1:
word += char
word = word.rstrip()
list_of_strings.append
John Filben wrote:
Can someone please let me know how to read a file one record at a time (just
say fixed block for now - see small example below) and assign columns to
fields. Then reference the field names with if-then-else logic.
Sample Fixed Block File:
John98762
John82634
John11234
Tha
MK wrote:
Hi there,
i have some logical problem. I dont get it done to write my for loops in
that way that the ip address range which is given as arguments are
correct processed. Meaning that only the ips are printed which the
user defines as argument. I tried to make an if statement to stop
a
#x27;
for exp in [3,2,1,0]:
octet = octet + str(intip / (256 ** exp)) + "."
intip = intip % ( 256 ** exp)
return (octet.rstrip("."))
Am Dienstag, den 22.12.2009, 06:32 -0500 schrieb Dave Angel:
spir wrote:
Lie Ryan dixit:
class Error(Exception):
def __init__(self, value):
self.value = value
def printer(self, value):
print self.value
You can also use __str__ instead of printer. This will give a standard output
form for your error automatically use
Norman Khine wrote:
hello,
import re
line = "ALSACE 67000 Strasbourg 24 rue de la Division Leclerc 03 88 23 05 66
strasbo...@artisansdumonde.org"
m = re.search('[\w\-][\w\-\...@[\w\-][\w\-\.]+[a-za-z]{1,4}', line)
emailAddress .search(r"(\d+)", line)
phoneNumber = re.compile(r'(\d{2}) (\d{2
Robert Berman wrote:
Hi,
I am trying to build an algorithm or methodology which will let me tell
if a decimal has a repeating sequence of digits and if it does have that
attribute, what is the sequence of digits. For example, 1/3.0 =
0.3..By eyeballing we know it has a repeating sequence
Alan Gauld wrote:
"朱淳" wrote
fileList = []
def openFiles():
for i in range(0,2):
fname = "file%s"%i
f = open(fname,"a")
fileList.append(f)
def closeFiles():
for f in fileList:
f.close()
if __name__=="__main__":
openFiles()
print "fileList
closeFiles()
print fileList
openFiles()
print fileL
Andre Engels wrote:
On Tue, Jan 5, 2010 at 1:46 PM, 朱淳 wrote:
I've token a dictionary to save filenames, and write it into "constant.py".
And I think it's a good method to create a class as Andre wrote. Thank you
all!
By the way, if I close a open file object, will the closed file object st
sudhir prasad wrote:
hi,
iam a beginner.
sample_file = file("/home/ee08m082/Desktop/python/123.txt","w")
sample_file.write("About Pythons\n")
in the above two line code,123.txt is being created but "About Pythons" is
not being written in the file.
my OS is redhat linux and python version is 2
On 01/-10/-28163 02:59 PM, Susana Iraiis Delgado Rodriguez wrote:
Hello Peter!
I added the line you suggested me and found out that I was just searching
for the filenames without pointing to a specific directory, so Python took
its directory (Python26) as default. After that I need to add a '\'
On 11/25/2010 09:20 AM, Susana Iraiis Delgado Rodriguez wrote:
Hi Dave!
Thank you for your suggestion I haven't prevent the problems you're
describing, but I'm newbie in this stuff so, where should I repalce the
code?
Thank you again!
2010/11/24 Dave Angel
On 01/-10/-28163 0
On 01/-10/-28163 02:59 PM, Joel Schwartz wrote:
I meant the Python-Help mailing list
(http://mail.python.org/mailman/listinfo/python-help), which is described on
the Python mailing list page (http://mail.python.org/mailman/listinfo) as
"Expert volunteers answer Python-related questions."
I guess
On 01/-10/-28163 02:59 PM, howit...@archlinux.us wrote:
Hi.
For the past week, I've been following an online Python guide named:
'Learn Python the Hard Way'. I'm very happy with it as it gives a lot of
freedom to explore.
However, due to this I have no idea if I'm thinking the right way. That's
On 01/-10/-28163 02:59 PM, Francesco Loffredo wrote:
On 03/12/2010 1.32, Steven D'Aprano wrote:
mylist = [x for x in mylist if x != "something"]
Up to this point, I share experiences and solution. But the next point
did thrill me:
If you really need to modify the list in place, and not just
On 01/-10/-28163 02:59 PM, Chris Begert wrote:
Bonjour
I have three lists with 65 float items and would like to do the following sum:
L0 = ([sum(L0A[i]*cos(L0B[i]+L0C[i]*JME) for i in range(0,64,1))])
So it just should do a sum across all the items in the list:
L0A[0]*cos(L0B[0]+L0C[0]*JME)+
On 01/-10/-28163 02:59 PM, Modulok wrote:
Does anyone know of an efficient way of doing a weighted random
choice? (I don't even know what algorithms like this would be called.)
Preferably, something that doesn't grow exponentially with the number
of elements in the list, or the size of their resp
On 01/-10/-28163 02:59 PM, Albert-Jan Roskam wrote:
Hi Steven,
Doesn't this qualify as 'monkeying with the loop index'? [*]
import random
weights = [5, 20, 75]
counts = {0:0, 1:0, 2:0}
for i in xrange(100):
... i = weighted_choice(weights) #<--- monkeying right here (?)
... counts
On 01/-10/-28163 02:59 PM, Robert Berman wrote:
I am working on the second part of the 'Bingo' problem defined at the Bingo
Praxis web page, http://programmingpraxis.com/2009/02/19/bingo/.
My notes as how to best define and build the problem:
'In a large game with five hundred cards in play, wh
On 01/-10/-28163 02:59 PM, Tommy Kaas wrote:
Steven D'Aprano wrote:
But in your case, the best way is not to use print at all. You are writing
to a
file -- write to the file directly, don't mess about with print. Untested:
f = open('tabeltest.txt', 'w')
url = 'http://www.kaasogmulvad.dk/unv/
On 01/-10/-28163 02:59 PM, delegb...@dudupay.com wrote:
#§¶Ú%¢Šh½êÚ–+-jwm…éé®)í¢ëZ¢w¬µ«^™éí¶qªë‰ë–[az+^šÈ§¶¥ŠË^ןrœ’)àë)¢{°*'½êí²ËkŠx,¶–Š$–)`·...@Ý"žÚ
Not sure why the quoting of this particular message didn't work. Since
I have no problem with anyone else's message, I suggest i
On 01/-10/-28163 02:59 PM, Patty wrote:
for c in 'abcd':
..
When I first looked at this - I thought that the variable 'c' would
have had to be initialized
first earlier in the program. And I thought that the programmer would
input a single char or a single space. I wasn't thinking counti
On 01/-10/-28163 02:59 PM, Richard D. Moores wrote:
On Tue, Jan 4, 2011 at 11:57, Richard D. Moores wrote:
On Tue, Jan 4, 2011 at 10:41, Richard D. Moores wrote:
Please see http://tutoree7.pastebin.com/z9YeSYRw . I'm actually
searching RTF files, not TXT files.
I want to modify this script t
On 01/-10/-28163 02:59 PM, Wayne Werner wrote:
On Wed, Jan 5, 2011 at 10:43 AM, Steven D'Apranowrote:
Wayne Werner wrote:
The decimal module allows you to get rid of those pesky floating point
errors. See http://docs.python.org/library/decimal.html for more info.
That's a myth. Decimal s
(Don't top-post. You keep putting your responses out of order.)
On 01/-10/-28163 02:59 PM, tee chwee liong wrote:
i modified the code to be:
fname = "sampledata.txt"
pattern = "-1"
failed = False
for line in open(fname):
data=line.split()
if len(data)==4:
port, channel, lane
On 01/-10/-28163 02:59 PM, walter weston wrote:
I generate a random number(supposedly a password, in my case its just a long
floating point lol),I want the user to reinput that number and I want to print
a string if the number entered is correct. so if m==num(num is the number
generated and m
On 01/-10/-28163 02:59 PM, Brett Murch wrote:
Hi everyone,
I'm just starting to learn Python and am starting by creating a text
game but am having trouble with classes and funtions. I want to create a
class or function where someone creates a charater and has a choice of
their name or os. This i
On 01/-10/-28163 02:59 PM, Karim wrote:
Hello,
I implemented Observer DP on a listbox (Tkinter) as follows and I don't
understand why super() is not working and Observable.__init__(self) is
working, cf below:
class ListObservable(Listbox, Observable):
"""Creation de widget Listbox"""
def __in
On 01/-10/-28163 02:59 PM, David Holland wrote:
Hi All,
I hope this makes sense
I am trying to write a GUI where you click on a button and each time
you click on the button it shows in the entry text how many times you
have clicked. However when I changed an earlier version of the code to
pass
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
Hello again:
I have never seen this message before. I am pulling xml from a site's
api and printing it, testing the wrapper I am writing for the api. I
have never seen this error until just now, in the twelfth result of my
search:
UnicodeEncodeError: 'A
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
I tried both of those and got a different error. I have since fixed it
so I no longer have the exact text, but it was something about not
supporting convertion from unicode. I finally ended up doing this:
self.title�ta.find("title").text.encode("utf-8"
On 01/28/2011 08:02 AM, Alex Hall wrote:
On 1/28/11, Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
I tried both of those and got a different error. I have since fixed it
so I no longer have the exact text, but it was something about not
supporting convertion from unicode. I
On 01/-10/-28163 02:59 PM, Nevins Duret wrote:
Hello Python collective,
I am trying to wrap my head around what exactly is causing me not to get
any output or error message in the following code:
#!/usr/bin/env python3.1
import random
def main():
def chosen_letter():
chosen_letter = Conson
(please don't top-post. Insert the ">" symbol in front of whatever
lines you're quoting, and put your response under the quote. Most email
programs can be configured to do this easily, or even automatically.)
On 01/-10/-28163 02:59 PM, Elwin Estle wrote:
I'm not 100% sure, but I think the Ac
On 01/-10/-28163 02:59 PM, Karim wrote:
On 02/03/2011 02:15 PM, Peter Otten wrote:
Karim wrote:
(snip>
*Indeed what's the matter with RE module!?*
You should really fix the problem with your email program first;
Thunderbird issue with bold type (appears as stars) but I don't know how
to fix
On 01/-10/-28163 02:59 PM, John Martinetti wrote:
Hello -
Welcome,
# - create a record from all the fields
linedata = (vendornum, vendorname, ordernum, ordersuffix, orderdate,
buyer, partnum, qty, comment)
# - append the record to the list of records representing the CQ report
On 01/-10/-28163 02:59 PM, David Hutto wrote:
On Sat, Feb 12, 2011 at 4:43 AM, Alan Gauld wrote:
"David Hutto" wrote
and what is sound, electromagnetically transmitted, then turned into
ones and zeroes.
Just to be picky sound is mechanical waves not electromagnetic.
The ear is primarily a
On 01/-10/-28163 02:59 PM, tee chwee liong wrote:
hi,
i'm using Python 2.5 and Win XP.
i want to extract the last column of the attached text file and group 128
characters to each row. want the result to look like:
Row1=X.1XXX (total of 128 char)
Row2=11XX.
On 02/13/2011 07:03 PM, tee chwee liong wrote:
How about some clues as to what you're trying to accomplish? This code
is surprisingly verbose, and probably totally wrong. Anyway, each time
you pop an item from the list, all the following ones change their
index. So presumably there weren't stil
On 01/-10/-28163 02:59 PM, tee chwee liong wrote:
hi Francesco,
couldnt get hex of bin working on IDLE Python 2.5 when i type:
hex(0b1001001001001001001)
SyntaxError: invalid syntax
bin(0x49249)
Traceback (most recent call last):
File "", line 1, in
bin(0x49249)
NameError: name 'bi
On 01/-10/-28163 02:59 PM, Edward Martinez wrote:
On 02/23/11 19:29, Corey Richardson wrote:
On 02/23/2011 10:22 PM, Edward Martinez wrote:
Hi,
I'm new to the list and programming.
i have a question, why when i evaluate strings ie 'a'> '3' it reports
true, how does python come up with that?
W
On 01/-10/-28163 02:59 PM, pyhx0r wrote:
Dear All,
multiple = 1024 if a_kilobyte_is_1024_bytes else 1000
for suffix in SUFFIXES[multiple]:
size /= multiple
if size< multiple:
return '{0:.1f} {1}'.format(size, suffix)
I’ve shorted the code be:
On 02/24/2011 11:55 AM, Walter Prins wrote:
On 24 February 2011 16:22, Dave Angel wrote:
(Is there a reason you double-spaced all that code? It makes it very hard
to read, and quite difficult to quote, since I had to delete every other
line.)
For what it's worth the code cam
On 01/-10/-28163 02:59 PM, Justin Bonnell wrote:
Okay. When I try to run the script from the terminal, it still doesn't work.
Here is a screenshot.
What am I doing wrong?
1) You're top-posting. Put your responses after the quote you're
responding to.
2) You're trying to include graphic
On 01/-10/-28163 02:59 PM, Steve Willoughby wrote:
On 26-Feb-11 01:19, ALAN GAULD wrote:
Bill,
That's the same thing we are talking about.
The problem is those environment variables are
highly variable so you can't talk about a machine's environment.
Two users on the same machine (at the same t
On 02/26/2011 04:10 PM, Justin Bonnell wrote:
On Feb 26, 2011, at 4:49 AM, Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Justin Bonnell wrote:
Okay. When I try to run the script from the terminal, it still doesn't work.
Here is a screenshot.
What am I doing wrong?
1) You
On 02/27/2011 02:50 AM, Justin Bonnell wrote:
On Feb 26, 2011, at 10:51 PM, Dave Angel wrote:
On 02/26/2011 06:03 PM, Justin Bonnell wrote:
On Feb 26, 2011, at 4:05 PM, Dave Angel wrote:
As for cd not working, someone else has pointed out that in the shell, you need
to escape
On 01/-10/-28163 02:59 PM, Alan Gauld wrote:
"Steven D'Aprano" wrote
The right way is to do it like this:
>>> x = 0.0
>>> for i in range(1, 11):
... x = i*0.1
...
>>> x == 1.0
True
But this I don't understand.
Why would you use a loop when the final value is just
the final multiplicati
On 01/-10/-28163 02:59 PM, Steven D'Aprano wrote:
Alan Gauld wrote:
Why would you use a loop when the final value is just
the final multiplication. Since you know the final value
in advance (you need it to create the loop!) why not
just do the final multiplication directly:
x = 10*0.1
I think
On 01/-10/-28163 02:59 PM, jaco erasmus wrote:
Hi there, list
The other day I got bored at work and decided to give this programming thing
a try, since Rick Romero said it's becoming all the rage these days.
Eventually, I want to end up writing a steganography program, but for now I
am still an i
On 01/-10/-28163 02:59 PM, Joel Goldstick wrote:
2011/3/19 Yaşar Arabacı
a=5
b=5
a == b
True
a is b
True
My question is, why "a is b" is true. What I expected it to be is that, a
and b are different things with same value.
___
Tutor maillist -
On 01/-10/-28163 02:59 PM, Ajit Deshpande wrote:
I am trying to figure out where lambda functions can be useful. Has anyone
used them in real world?
From my reading so far, I hear people claim that lambda can be a useful
replacement for small functions. Most examples didn't make much sense to
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
On 3/21/11, David wrote:
Hello list,
I am having trouble understanding the following function. What trips me
up is the "letter = letter.lower()" line.
As I understand, the function takes a letter and assigns True to a
letter if it is upper case.
No
On 01/-10/-28163 02:59 PM, Prasad, Ramit wrote:"
>A more important problem is that it is flattening only one level.
>Multi-level flattening is I think not possible without using some kind
>of recursion."
>
>Not true, just requires more iterations to check each element. Each
>iteration could chec
On 01/-10/-28163 02:59 PM, Matthew Speltz wrote:
I'm trying to teach myself python and have run across a rather
annoying error. I'm not sure exactly where the fault lies, so please
pardon me for posting too much information, I'm not sure what would be
relevant.
I'm running the Python 3.2 Window
On 01/-10/-28163 02:59 PM, Jim Byrnes wrote:
I'm trying to teach myself OOP in python (again). The following code
from Dawson's book runs fine, unaltered [1].
class Critter(object):
""" A virtual pet """
def __init__(self, name):
print "A new critter is born"
self.name = name
def get_name(self)
On 01/-10/-28163 02:59 PM, Rance Hall wrote:
Hey gang:
I need some help trying to pythonize (sp?, if this is even a word?) an idea.
I'd like to define a datavalidation function that returns true if data
is valid, and false if it isn't.
I need a way to store the pass fail values of each of th
On 01/-10/-28163 02:59 PM, Brad Desautels wrote:
Hello, I am working on a problem for my computer science class. This program
is supposed to change the expression of the face when the appropriate button
is clicked. It seems logical that it should work, however, when I click one
of the buttons, I
On 01/-10/-28163 02:59 PM, monkey...@aim.com wrote:
Hello,
I am trying to learn how to use python with Facebook's Open Graph API. I am
getting my feet wet with the following code authored by Matthew A. Russell. I
copied it line for line for learning purposes, but I am getting the following
On 01/-10/-28163 02:59 PM, Clara Mintz wrote:
Sorry I am completely new at python and don't understand why this function is
returning an empty dictionary. I want it to take a list of files open them then
return the number of characters as the value and the file name as the key.
def fileLengths
On 01/-10/-28163 02:59 PM, tax botsis wrote:
I have the following txt file that has 4 fields that are tab separated: the
first is the id and the other three show the results per test.
152 TEST1 valid TEST3 good TEST2 bad
158 TEST2 bad TEST1 bad TEST4 valid
.
.
.
Based on the above txt I need to
On 01/-10/-28163 02:59 PM, Alan Gauld wrote:
"Albert-Jan Roskam" wrote
How can I walk (as in os.walk) or glob a website?
I don't think there is a way to do that via the web.
Of course if you have access to the web servers filesystem you can use
os.walk to do it as for any other filesystem, b
On 01/-10/-28163 02:59 PM, Cindy Lee wrote:
Hi Pyton Tutors thanks for adding me,
I am new to Python and missed one of my classes and am not sure of my homework.
We are currently on sequencing and are being asked to make a function that
receives text as an argument and returns the same text, b
On 01/-10/-28163 02:59 PM, Válas Péter wrote:
2011. június 2. 9:29 Simon Yan írta,:
Yes you can.
I guess the question is how you want the information to be structured.
IMHO, everything in Python can be "string-lized".
What is the syntax then? I have Windows XP. The code is:
f=open("xxx.dat",
On 01/-10/-28163 02:59 PM, Válas Péter wrote:
Hi,
let X be a mutable container, such as dict/set/list=bytearray, and Y=X,
When I change X, Y will follow it, having always the same value, although
id(X)!=id(Y). How is that, what is the explanation? Meanwhile the same for
immutable types results a
On 01/-10/-28163 02:59 PM, Vincent Balmori wrote:
Hello. Right now I am learning the python language through Python Programming
for the Absolute Beginner 3rd Edition. I am having trouble with one question in
Ch. 4 #3, which says "Improve 'WordJumble so that each word is paired with a
hint. The pl
On 01/-10/-28163 02:59 PM, Alex Hall wrote:
On 6/18/11, Steven D'Aprano wrote:
Alex Hall wrote:
Hello all,
I am using the configobj package to handle a ridiculously simple ini
What's configobj?
>>> import configobj
Traceback (most recent call last):
File "", line 1, in
ImportError: N
On 01/-10/-28163 02:59 PM, Kaustubh Pratap chand wrote:
> Hello i made this program which interprets brainf***
>
> But i don't understand why it doesn't endsand also it doesn't
print anything
>
> import sys
>
> cell=[0] * 3
> code_pointer=0
> cell_pointer=0
> close_brace_pos=
On 01/-10/-28163 02:59 PM, David Merrick wrote:
HI. I feel I'm starting to go round in circles solving this problem. I feel
I made significant progress.
Can someone help me iron out the bugs please
# Blackjack
# From 1 to 7 players compete against a dealer
import cards, games
class BJ_Card(car
On 07/11/2011 06:39 PM, Emile van Sebille wrote:
On 7/11/2011 3:16 PM Edgar Almonte said...
hello , i have a file this a structure like this
X | 0.00| 88115.39|
X | 90453.29| 0.00|
X | 0.00| 90443.29|
On 07/12/2011 12:56 AM, Edgar Almonte wrote:
thanks emile i understand exactly what you explain me but i was unable
to accomplish it ( too noob in python ) but i solved the problem with
this code
http://pastebin.com/4A6Jz4wZ
(When you post on this list, your comments should follow the pieces
yo
On 07/12/2011 08:25 AM, Edgar Almonte wrote:
On Tue, Jul 12, 2011 at 7:28 AM, Dave Angel wrote:
On 07/12/2011 12:56 AM, Edgar Almonte wrote:
thanks emile i understand exactly what you explain me but i was unable
to accomplish it ( too noob in python ) but i solved the problem with
this code
On 07/14/2011 05:44 AM, Knacktus wrote:
Hi guys,
I've got the following (not working) code:
class Attribute(object):
def __init__(self, attribute_name, att_type_name):
self._attribute_name = attribute_name
try:
self._attribute_type = globals()[att_type_name]
On 07/15/2011 07:39 PM, Richard D. Moores wrote:
On Fri, Jul 15, 2011 at 16:21, xDog Walker wrote:
I believe on Windows, you can almost always use a forward slash in a path:
C:/somewhere/somewhereelse/
with open("C:/test/test.txt", "a") as file_object:
print("Hello, world!", file=file_o
--- On Sat, 7/16/11, Albert-Jan Roskam wrote:
From: Albert-Jan Roskam
Subject: [Tutor] what is 'doubleword alignment'?
To: "Python Mailing List"
Date: Saturday, July 16, 2011, 8:23 PM
Hello,
What is 'doubleword alignment'? It is used in the following sentence: "Fill up the
buffer with the c
On 07/16/2011 05:32 PM, B G wrote:
Thanks, Emile-- although I'm not sure I was completely clear about my
objective. What I really meant is that is there a way (via machine learning)
to give the computer a list of rules and exceptions, and then have it
predict based on these rules the ionization e
On 07/16/2011 07:21 PM, Christopher King wrote:
Actually maybe not, depending on the complexity of the pattern, but it would
be difficult. You would have to know how much it decreases for every time
you go down or to the right.
If its more complex than that, you may have to program each rule in,
On 07/19/2011 05:43 PM, Alan Gauld wrote:
Albert-Jan Roskam wrote:
> and ctypes to process the data in python. It works now, although I
> still want to read more about this. Where does the distinction
> little/big endian enter this story?
That's to do with which bit in a byte/word is most signif
On 07/21/2011 01:53 PM, Ryan Porter wrote:
Hi there,
In one part of a program I'm writing, I want a list to be printed to
the string. Here's my code:
# Begin snippet
listString = input('Please enter a single item: >').strip();
/print();
itemList.append(listString);
/
/...
/
On 07/22/2011 06:40 PM, dave wrote:
Hello,
I'm trying to work on GNU Radio and having trouble understanding some of the
Python code. I have a C/C++ coding background. I'm looking at the
ieee802.15.4 code found on CGRAN. It's about 4 years old and runs but doesn't
function anymore so I'm tryin
On 07/27/2011 09:58 PM, Pete O'Connell wrote:
Hi I was wondering if there is a way to disable a function.
Hi have a GUI grid snapping function that I use in a program called Nuke
(the film compositing software)
Here is the function (which loads when Nuke loads):
###
def theAu
On 07/28/2011 07:05 PM, Prasad, Ramit wrote:
I have 2 questions.
1. Is there a way to do a reverse and a normal sort at the same time?
I have a list of tuples (there are more than 2 elements in the tuples but I
only want to sort by the first two). I want to sort in reverse for the first
elemen
On 07/28/2011 08:32 PM, Christopher King wrote:
Dear Tutor Dudes,
I have a socket Gui program. The only problem is that socket.recv waits
for a response, which totally screws Tkinter I think. I tried making the
timeout extremely small (it was alright if I didn't receive anything, I
was excep
On 07/28/2011 09:58 PM, Alexander Quest wrote:
I downloaded the google's python exercise files from their website (
http://code.google.com/edu/languages/google-python-class/set-up.html),
unzipped them, and placed them in C.
I then added the following to the PATH variable under system settings so
y, July 28, 2011, Dave Angel wrote:
On 07/28/2011 08:32 PM, Christopher King wrote:
Dear Tutor Dudes,
I have a socket Gui program. The only problem is that socket.recv
waits
for a response, which totally screws Tkinter I think. I tried making the
timeout extremely small (it was alright i
On 07/31/2011 08:42 PM, Christopher King wrote:
Wow wow, way is a ser...@might.co.za person doing a tutor response. And why
can I see it if it isn't to me.. I'm sorry Sergey if this
isn't something malicious, it just seems suspicious.
(You could try reading it, instead of just getting suspicious
On 08/02/2011 10:36 PM, Richard D. Moores wrote:
Puzzled again. Why the error. Line 36 is the line just above "import
os.path". I have many other functions in mycalc.py with examples
formatted exactly the same way.
def convertPath(path):
"""
Given a path with backslashes, return that p
On 08/03/2011 02:07 AM, Richard D. Moores wrote:
On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote:
When I paste that from your email into a file and run Python 2.7 on it, it
behaves fine with no errors. That's in Linux.
I should have said that I'm using Wing IDE Professional 4.
401 - 500 of 1736 matches
Mail list logo