Go to advanced search

by RoliPi
Tue Jul 30, 2013 9:33 am
Forum: RISCOS
Topic: BBC Basic Manual?
Replies: 12
Views: 9447

Re: BBC Basic Manual?

In the folder Documents.Books you can find a book about BBC BASIC, and the Programmers Reference Manuals.
The link you mentioned is dead for some time now, but i downloaded it when it was available :-)
Drop me a PM if you need it (it's under 2,5MB).
by RoliPi
Fri Jul 12, 2013 12:02 pm
Forum: Python
Topic: Tkinter weird behaviour
Replies: 0
Views: 370

Tkinter weird behaviour

Hello, can anyone tell me, why the value isn't showing up in the new window? from tkinter import * def comman(): entv.set('new value') new=Tk() Label(new,textvariable=entv).pack() Entry(new,textvariable=entv).pack() new.mainloop() testapp=Tk() entv=StringVar() Label(testapp,textvariable=entv).pack()...
by RoliPi
Fri May 31, 2013 11:22 am
Forum: Python
Topic: Speed "problem"
Replies: 3
Views: 873

Re: Speed "problem"

Hello winkleink, thanks for your investigation. I already found the Stackoverflow-link, but i think the after-method should not getting faster: "It only schedules the job to be run after a given amount of time" Thank you for sharing your code. I learned a lot about tkinter and python by reviewing it...
by RoliPi
Mon May 27, 2013 2:11 pm
Forum: Python
Topic: Speed "problem"
Replies: 3
Views: 873

Speed "problem"

Hi, i wrote a _very_ simple game, and it works just fine: from tkinter import * from random import randint from math import radians,sin,cos class Shoot_the_Ball(Canvas): "Gamefield" def __init__(self,root=None,wid=200): Canvas.__init__(self,root) self.root,self.wid,self.rad,self.hit,self.miss=root,w...
by RoliPi
Wed May 15, 2013 11:36 am
Forum: Python
Topic: Tkinter's main loop
Replies: 2
Views: 1914

Re: Tkinter's main loop

Tkinter has a method called after which you can use to schedule a function to run periodically. Have a look on the following link http://stackoverflow.com/questions/2400262/code-a-timer-in-a-python-gui-in-tkinter Thanks scotty, now it works! from tkinter import * from time import localtime class On...
by RoliPi
Mon May 13, 2013 9:03 am
Forum: Python
Topic: Tkinter's main loop
Replies: 2
Views: 1914

Tkinter's main loop

Hi, i have a little trouble with this digital clock: from tkinter import * from time import localtime class OneDigit(Canvas): 'Drawing all the panels' def __init__(self,master=None,wid=80): Canvas.__init__(self,master) self.wid=wid self.configure(width=self.wid,height=self.wid*1.625,bg='black') cw=s...
by RoliPi
Mon Apr 01, 2013 6:00 pm
Forum: RISCOS
Topic: STICKY: New to RISC OS? Read this!
Replies: 83
Views: 188428

Re: New to RISC OS? Read this!

Wow, that were exactly my thoughts too after started using RISC OS.
Even after all i have trouble with accented letters, as RISC OS can't recognize my hungarian keyboard.
by RoliPi
Wed Mar 20, 2013 1:37 pm
Forum: Python
Topic: PyTips
Replies: 2
Views: 605

Re: PyTips

Hello, i find this particularly useful: If you want to cycle through a list's elements over and over again and want not getting out of range, simply MOD (remainder of dividing) an ever increasing counter with the length of the list: counter+=1 index=counter%len(list) #index is always in range list[i...
by RoliPi
Tue Mar 19, 2013 3:18 pm
Forum: Python
Topic: Prime Number Search
Replies: 25
Views: 4020

Re: Prime Number Search

I wrote this function as i learned Python: from math import sqrt def prime(num): primes=[2,3] for i in range(4,num+1): isprime=True if i%2: for j in range(0,(len(primes)-1)): if primes[j]>sqrt(i): break elif not i%primes[j]: isprime=False break if isprime: primes.append(i) return primes Simply call ...
by RoliPi
Wed Feb 27, 2013 11:52 am
Forum: RISCOS
Topic: Very basic guide to BASIC please?
Replies: 28
Views: 4288

Re: Very basic guide to BASIC please?

Hi,
there is a very good introduction to Basic in the Documents.Books.First steps... first.pdf, with detailled example codes and explanations.
by RoliPi
Wed Feb 20, 2013 11:04 am
Forum: RISCOS
Topic: Oh boy... RISC OS on Pi!!!
Replies: 17
Views: 5137

Re: Oh boy... RISC OS on Pi!!!

I recently tried RISC OS on my Pi, of pure curiosity, how does it look and feel. And i fell instantly in love with it :-) Although we never had here the Acorn-RISC-culture as you guys in the UK, but it very much reminds me to the Commodore-era. So i only use RISC OS now, despite the obvious limitati...
by RoliPi
Tue Jan 22, 2013 1:46 pm
Forum: Python
Topic: Banking Program
Replies: 40
Views: 4627

Re: Banking Program

Hi, this is a way to handle multiple accounts: class Account: 'Defining a class for accounts' def __init__(self,name,number,pin,balance): self.name=name self.number=number self.pin=pin self.balance=balance def deposit(self,amount): 'Deposits some money on the account' self.balance+=amount return sel...
by RoliPi
Mon Jan 21, 2013 4:41 pm
Forum: Troubleshooting
Topic: config.txt ignored on Raspberry Rev B 512MB Wheezy-Raspbian
Replies: 6
Views: 3067

Re: config.txt ignored on Raspberry Rev B 512MB Wheezy-Raspb

jojopi, thanks for the info.

BTW adding avoid_safe_mode=1 to the config.txt solved the mystery.
by RoliPi
Mon Jan 21, 2013 9:41 am
Forum: Troubleshooting
Topic: config.txt ignored on Raspberry Rev B 512MB Wheezy-Raspbian
Replies: 6
Views: 3067

Re: config.txt ignored on Raspberry Rev B 512MB Wheezy-Raspb

Hi, i have the same problem: The Raspi (512MB, Wheezy, Philips Full HD LED monitor with HDMI) is booting fine, but cannot change for example the colour-depth or the screen resolution. As if the config.txt file were non-existent. In Preferences-Monitor settings i get "Unable to retrieve monitor infor...
by RoliPi
Fri Jan 11, 2013 8:28 pm
Forum: Python
Topic: Pythonic Code
Replies: 4
Views: 927

Re: Pythonic Code

Here's the above code again: addressbook=[] file=open('Sent') try: line=file.readline() except: line=file.readline() while line!='': try: line=file.readline() except: continue if line.startswith(('To: ','Cc: ','Bcc: ')): line=line.split(' ') for i in line: if '@' in i: i=i.strip(',<>\n') i=i.lower()...
by RoliPi
Thu Jan 10, 2013 8:28 pm
Forum: Python
Topic: Pythonic Code
Replies: 4
Views: 927

Re: Pythonic Code

Thanks, i'll try it too.

As well as using the code-tags :-)
by RoliPi
Thu Jan 10, 2013 8:27 pm
Forum: Python
Topic: A program disaster: becoming inevitable
Replies: 16
Views: 2724

Re: A program disaster: becoming inevitable

Hi, i don't know how you came along, but here's one solution: import RPi.GPIO as GPIO import time def morse(duration): #The dash&dot are only different in the GPIO.output(11, True) #duration, so it'll be the passed argument time.sleep(duration) GPIO.output(11, False) time.sleep(dot) #Duration of the...
by RoliPi
Tue Jan 08, 2013 3:34 pm
Forum: Python
Topic: Pythonic Code
Replies: 4
Views: 927

Pythonic Code

Hello there, i've just came around a little problem. I had to retreive email-addresses from the huge archives that are created by Thunderbird&co, and wrote following script (it has to be executed from where the archives are stored): addressbook=[] file=open('Sent') try: line=file.readline() except: ...

Go to advanced search