Old 08-07-2012, 02:22 PM   #1
[REQ] Python code's
putsa putsa is offline 08-07-2012, 02:22 PM

Pahinge naman ng code kong pano gawin nyong kada log-in po masasave xia sa notepad or kada type tapos OK ng user ma sasave xia agad

tapos pano din gawin nyong Background ng python ai Black diba ang default nia White


pwd pa-save din sa notepad nyong code tapos pa upload, para kong naka cp ako pwdng ma copy agad pwd din eh post dito pero pa-save din po sa notepad ah upload din


advance thank you

 
putsa's Avatar
putsa
click me
Join Date: Apr 2011
Location: @ Bikini Bottom
Posts: 546




Last edited by putsa; 08-07-2012 at 02:25 PM..
Views: 678
Reply With Quote

 Re: [REQ] Python code's
Old 08-09-2012, 04:33 PM   #2
 
putsa's Avatar

putsa
click me
putsa is offline
Posts: 546
PX Cash: 10,277
putsa has a spectacular aura aboutputsa has a spectacular aura aboutputsa has a spectacular aura about
Rep Power: 132
Default Re: [REQ] Python code's

Pano palan gawin nyong background nia ay black?
  Reply With Quote

 Re: [REQ] Python code's
Old 08-09-2012, 08:07 PM   #3
 
sanora's Avatar

sanora
Elite Member
sanora is offline
Posts: 164
PX Cash: 4,510
sanora will become famous soon enoughsanora will become famous soon enough
Rep Power: 95
Post Re: [REQ] Python code's

# May method na ginagamit ang image as background, meron din gumagamit ng mif images na pinagsama-sama in 1 mif gaya ng python uzzap ni sir frost dati, meron din background canvas na basic lang gaya nito sa example natin sa baba,

# imports here
Code:
import appuifw as a, e32, os
# screen size
Code:
a.app.screen = 'full'
# our function to draw black
Code:
def black_bg():
    def redraw(rect):

        # start black background
        cc.clear(0x0000000)
        # end black background

        # start of text
        cc.text((20, 25), u'Putsa Test Canvas', 0xccccccc, font = 'legend')
        cc.text((20, 50), u'Black', 0xccccccc, font = 'legend')
        cc.text((20, 75), u'Click options', 0xccccccc, font = 'legend')
        # end of text

    # body of our canvas
    cc=a.Canvas(event_callback=None, redraw_callback=redraw)
    a.app.body=cc
Code:
# our function to draw green
def green_bg():
    def redraw(rect):

        # start green background
        cc.clear(34816)
        # end green background

        # start of text
        cc.text((20, 25), u'Putsa Test Canvas', 0xccccccc, font = 'legend')
        cc.text((20, 50), u'Green', 0xccccccc, font = 'legend')
        cc.text((20, 75), u'Click options', 0xccccccc, font = 'legend')
        # end of text

    # body of our canvas
    cc=a.Canvas(event_callback=None, redraw_callback=redraw)
    a.app.body=cc
# declare the define function black as our first function
Code:
black_bg()
# exit here
Code:
def exit():
    os.abort()
# menu here
Code:
a.app.menu=[(u'Turn to green', green_bg), (u'Turn to black', black_bg), (u'exit', exit)]
a.app.exit_key_handler=exit
e32.Ao_lock().wait()



Links last checked by PXK - DLink Checker v2 at 09/24/2012 2:21:36 PM
0/1/0/0/1 4.59077310562

  Reply With Quote
The Following User Says Thank You to sanora For This Useful Post:

 Re: [REQ] Python code's
Old 08-09-2012, 08:17 PM   #4
 
putsa's Avatar

putsa
click me
putsa is offline
Posts: 546
PX Cash: 10,277
putsa has a spectacular aura aboutputsa has a spectacular aura aboutputsa has a spectacular aura about
Rep Power: 132
Default Re: [REQ] Python code's

thank you ng marami pwd pahinge dn ng ibat ibang font color sa python

Ito pa diba pag typeq dun naka deafult xia sa txt pwd no. Nalang d kuna pipindutin nyong no.sign gustoq diretso nalang xia sa no.sapag typeq sana na gets mo

Ty talaga
  Reply With Quote

 Re: [REQ] Python code's
Old 08-09-2012, 10:51 PM   #5
 
sanora's Avatar

sanora
Elite Member
sanora is offline
Posts: 164
PX Cash: 4,510
sanora will become famous soon enoughsanora will become famous soon enough
Rep Power: 95
Post Re: [REQ] Python code's

Colors
Red = 14287876
Green = 1700105
Blue = 1575831
Violet = 10224520
Cyan = 1047920
Orange = 15549191
Pink = 13913795
Brown = 9649411
Gold = 16766720
Yellow = 14676491

Direct number typing
1. Open your script (use ped or notepad or xplore)
2. Find this
Code:
def save_docu2():
    Docu_1=a.query(u'Enter text', 'text')
    Docu_2=codecs.open(u'e:\\document.txt', 'w', 'utf8')
    Docu_2.write(Docu_1)
    Docu_2.close()
    a.note(u'Document saved!', 'conf')
    body.set(u'Saved Document:\n\n'+Docu_1)
    body.focus=False
Sa line ng Docu_1
Code:
    Docu_1=a.query(u'Enter text', 'text')
Replace the word 'text' with 'number' and add in the next line a string to prevent a query error of coercing the typed number into unicode
It would be like this:
Code:
    Docu_1=a.query(u'Enter a number', 'number')
    Docu_1=str(Docu_1)
The whole def save_docu2() would be written like this
Code:
def save_docu2():
    Docu_1=a.query(u'Enter a number', 'number')
    Docu_1=str(Docu_1)
    Docu_2=codecs.open(u'e:\\document.txt', 'w', 'utf8')
    Docu_2.write(Docu_1)
    Docu_2.close()
    a.note(u'Document saved!', 'conf')
    body.set(u'Saved Document:\n\n'+Docu_1)
    body.focus=False
Then save.

About sa multi_query, yung dalawang textbox ang pagtatypan mo, hindi ko alam if meron direct type ng number. Yung single query lang ang alam kong meron.

Note:
Do not save a py script in unicode. Just click 'Save'. Not 'Save as unicode'


Additional: try this if you want.
Typing directly from the body of a py script.


Links last checked by PXK - DLink Checker v2 at 09/24/2012 2:40:37 PM
0/1/0/0/1 4.63519096375

  Reply With Quote
The Following User Says Thank You to sanora For This Useful Post:

 Re: [REQ] Python code's
Old 08-09-2012, 11:00 PM   #6
 
putsa's Avatar

putsa
click me
putsa is offline
Posts: 546
PX Cash: 10,277
putsa has a spectacular aura aboutputsa has a spectacular aura aboutputsa has a spectacular aura about
Rep Power: 132
Default Re: [REQ] Python code's

alam mudin qng pano nyong background na image xia?
  Reply With Quote
The Following User Says Thank You to putsa For This Useful Post:

 Re: [REQ] Python code's
Old 08-09-2012, 11:48 PM   #7
 
sanora's Avatar

sanora
Elite Member
sanora is offline
Posts: 164
PX Cash: 4,510
sanora will become famous soon enoughsanora will become famous soon enough
Rep Power: 95
Default Re: [REQ] Python code's

May post ata ako ng image background somewhere dito sa mobile programming.
  Reply With Quote
The Following User Says Thank You to sanora For This Useful Post:

 Re: [REQ] Python code's
Old 08-10-2012, 09:03 AM   #8
 
putsa's Avatar

putsa
click me
putsa is offline
Posts: 546
PX Cash: 10,277
putsa has a spectacular aura aboutputsa has a spectacular aura aboutputsa has a spectacular aura about
Rep Power: 132
Default Re: [REQ] Python code's

Originally Posted by sanora [Only Registered Users Can See LinksClick Here To Register]
May post ata ako ng image background somewhere dito sa mobile programming.
Cge hanapinq muna pero qng alam mopo papost po ah advance thank you
  Reply With Quote

 Re: [REQ] Python code's
Old 08-10-2012, 11:42 AM   #9
 
sanora's Avatar

sanora
Elite Member
sanora is offline
Posts: 164
PX Cash: 4,510
sanora will become famous soon enoughsanora will become famous soon enough
Rep Power: 95
download Re: [REQ] Python code's

# Image background
# this is like the basic black background, its just we're using an image to be our background

# imports
Code:
import appuifw as a, e32, os
# add graphics import in next line
Code:
from graphics import *
# screen size
Code:
a.app.screen='full'
# image path, change the path of your own
# you must have the image according to the screen resolution, mine is 240x320 pixel
Code:
path='e:\\image.jpg'
# two functions in drawing an image with text
Code:
def image_1():
    bg=Image.open(path)
    def redraw(rect):
        cc.blit(bg)
        cc.text((20, 30), u'First image', 6710886, font='title')
    cc=a.Canvas(event_callback=None, redraw_callback=redraw)
    a.app.body=cc

def image_2():
    bg=Image.open(path)
    def redraw(rect):
        cc.blit(bg)
        cc.text((20, 30), u'Second image', 6710886, font='title')
    cc=a.Canvas(event_callback=None, redraw_callback=redraw)
    a.app.body=cc
# call the define funtion that is first to operate
Code:
image_1()
# exit here
Code:
def exit():
    os.abort()
# menu here
Code:
a.app.menu=[(u'First image', image_1), (u'Second image', image_2), (u'exit', exit)]
a.app.exit_key_handler = exit
e32.Ao_lock().wait()
Note:
Your image path must be in a correct path and size


Download Link: [Only Registered Users Can See LinksClick Here To Register]



Links last checked by PXK - DLink Checker v2 at 04/16/2013 7:55:57 PM
0/0/1/0/1 7.04314494133

  Reply With Quote
The Following User Says Thank You to sanora For This Useful Post:

 Re: [REQ] Python code's
Old 08-10-2012, 11:57 AM   #10
 
putsa's Avatar

putsa
click me
putsa is offline
Posts: 546
PX Cash: 10,277
putsa has a spectacular aura aboutputsa has a spectacular aura aboutputsa has a spectacular aura about
Rep Power: 132
Default Re: [REQ] Python code's

idol dq makuha nyong naka number agad xia imbest txt ang eh ttype ng user gustoq kasi naka default xia sa no.

Pwd dn ba mga 20characters lang ang eh type ng user? kung baga nasa 32+characters ata ang pwdng eh type ng user , pwd 20lang? tapos hangang d umaabot sa 20Characters ang nilalagay ng user d xia pwdng eh OK? kong baga walang maglalagay na option na pwd nang eh ok

Sorry kong magulo at demanding kaylangan lang talaga idol
  Reply With Quote
Reply

Bookmarks

Tags
program, python, python application, python apps, request


Facebook Comments

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Your Ad Here


All times are GMT +8. The time now is 08:47 AM.


Powered by: vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Disclaimer: None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site’s users. All references are copyright to their respective owners. Pinoyxtreme.com is not responsible for what its users post, or any other actions of its users. Pinoyxtreme.com is not responsible for the accuracy, compliance, copyright, legality, decency, or any other aspect of the content of other linked sites. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms.