Code Monkey home page Code Monkey logo

pythonista's Issues

Needing Help new at this!!!

import random

import ui
import sound

label = ui.Label(name='Label')
label2 = ui.Label(name='Label2')
label3 = ui.Label(name='Label3')
label4 = ui.Label(name='Label4')

def button_tapped(sender):
sound.play_effect('ui:switch4')
'@type sender: ui.Button'

global shows_result
shows_result = False

if shows_result or label.text == 'MB':
label.text = title

if label.text == 'MB':'Megabucks\n\n'+str(self.draw (1, 46, 6))
if label.text == 'MB': label2.text = str(self.draw (1, 23, 1))

class self:
def init(self):
draw(a)

def draw(startPosi, endPosi, interateNumber):
    a = random.sample(range(startPosi, endPosi), interateNumber)
    a.sort()
    
    return a

def make_button(title):
button = ui.Button(action=button_tapped,
title=title)
return button

button1 = make_button(title='MB')

view = ui.load_view()
view.add_subview(label)
view.add_subview(label2)
view.add_subview(label3)
view.add_subview(label4)
view.add_subview(button1)
ui.load_view('Testing').present('sheet')

Can’t show result on label 1 & 2 any help

sensor data

Do you have any example of working with sensor (e.g. acelerometer) data for analizying, for example, gait.?

AttributeError: 'MultiScene' object has no attribute 'fixed_time_step'

Hey there,

Ngl I thought this was pretty darn cool, so I tried to copy it across to my phone onto Pythonista. However, when I try to run I get the error listed in the title. I will attach visuals:
E6B62010-9B74-451F-ADF6-E48532E3D5F6
F328CAFC-1D67-4F3E-B74E-0AD0F5DDF473

Not really sure I understand most of this, coding games isn’t something I’ve delved into before. Would really appreciate the help

Need help I’m new at this.

874C8757-C454-454E-88AF-DBD823A7C46D
Need to removed the [ ] and change the font and sizes from every result and change the name on the button. Sorry I’m asking for a lot. Here is my code.
`import random
import ui

def Function():
v = ui.View()
v.background_color = 'white'
v.background_frame = '0, 0, w, h'

for i in range(1,5):
    b = ui.Button()
    b.frame=(-15+i*70,400,60,70)
    b.border_width= 1.5
    b.border_color = 'black'
    b.title = str(i)
    b.background_color='lightgray'
    b.action = b_action
    v.add_subview(b)
    b.tint_color = 'red'
    
l = ui.Label(
alignment=ui.ALIGN_CENTER,
bg_color='white',
border_color='black',
border_width=1.5,
frame=(50, 100, 100, 50),
name='l')

l.text_font='30'
l.text_color='red'
l.number_of_lines = (2)
l.frame = (13,120,350,180)
v.add_subview(l)
v.present('screen')

def b_action(sender):
x = sender.title
l = sender.superview['l']
if x == '1': l.text = 'Megabucks '+str(factory.factoryLogic ( 1, 46, 6 ) )
elif x == '2': l.text = 'Lucky for Life '+str(factory.factoryLogic (1, 48, 5 ))+str(factory.factoryLogic ( 1, 18, 1 ) )
elif x == '3': l.text = 'Powerball '+str(factory.factoryLogic (1, 69, 5 ))+str(factory.factoryLogic ( 1, 26, 1 ) )
elif x == '4': l.text = 'Mega Millions '+str(factory.factoryLogic (1, 70, 5 ))+str(factory.factoryLogic( 1, 25, 1 ) )

class factory:
def init( self ):
self.a = 0

def factoryLogic( startPosi, endPosi, interateNumber ):
    a = random.sample( range( startPosi, endPosi+1 ), interateNumber )
    a.sort()
    return a

if name == 'main':
Function()

 `

Got scraper working

No time to make a separate pull request for this, but I got the scraper working:

import ui
import time

class Scraper (object):
    def __init__(self, url, js = 'document.documentElement.outerHTML'):
        self.wv = ui.WebView()
        self.wv.delegate = self
        self.wv.load_url(url)
        self.js = js
        self.response = None
    
    def webview_did_finish_load(self, webview):
        self.response = webview.eval_js(self.js)
    
    @property
    def value(self):
        while self.response is None:
            time.sleep(0.1)
        return self.response

def main():
    v = Scraper(url, 'document.documentElement.outerHTML;').value

It is a bit of a hack and probably not all that efficient, but it works perfectly

SimplexNoise.py has a broken reference

The script tries to create a subclass of sk.Scene, but the sk.py module doesn’t contain such a class. sk.py does import * from SKExample.py, but that doesn’t contain it either. It does define SKScene, but that won’t work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.