richieking 44 Master Poster

trim always cleans the data. Expecially if its for a password or user data that needs a check.

eg

$user=" Foo"
$pass="pass "

This data input will fail without trim to clean the unwanted spaces.
Mostly they are not seen but alway do trim exp. when data are comming from form inputs.
:)

richieking 44 Master Poster

There are already E-COM ready to go sites out there. Google free shoping/ecommerce builder .

Get that change one or two stuffs and you are ready to go in a day. They are mostly php stuff.
Happy coding ;)

richieking 44 Master Poster

Well i can thing of these modules

1.os
2.threading (there are many flavours in python) Need for
3.socket
4.time
5.Queue
And if you want GUI
6. I recommend wxpython

Thats my take.
btw i know you can do your project with that.
I can any way with what i have listed.

richieking 44 Master Poster

All said Grib !

;)

richieking 44 Master Poster

You are welcome. Please close the thread as solved. PM me anytime.

richieking 44 Master Poster

Hay Job done.

Just had to rush this one for you. I have too much on me but i hope you will be happy with this. Well a litle upvoting will be great
:)

alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
crypalph = []

ROT13 = 13
for x in range(0,52):
  crypalph.append(alphabet[(x + ROT13) % 52])

#----------------------------------------------------------------Ask user input

user_input = raw_input ("Please enter some text: \t").strip() # Clean the input

#-----------------------------------------------------Define blank cryptmessage

encryptmessage =''
sub=len(user_input) # Get the lenght tou use for slice

#------------------------------------------------------------Encrypt user input

for x in user_input:
  if x in alphabet:
    encryptmessage += crypalph[alphabet.index(x)]
  else:
    encryptmessage += x

#------------------------------------------------------------------------------

print "__________________________________________"
print "\nEncrypted message: \t\t" + encryptmessage

print "__________________________________________"
raw_input ("\nPress [Enter] to decode '" + encryptmessage + "'")

#----------------------------------------------------------Define blank message

message =''

#-----------------------------------------------------------Decrypt the message

for x in encryptmessage:
  if x in alphabet:
    user_input += crypalph[alphabet.index(x)]
  else:
    user_input += x

#------------------------------------------------------------------------------
fx=[]            # New list to Help Take the eccess data.
for w in user_input:  # Run Through to get each data
    for z in w:       # This step could be done oneliner But i thought you may want to
     fx.append(z)     # Now how everything works better
user_input=fx[:-sub]  #<-- This is were you slice the excess
user_input="".join(user_input)  #<-- Join stuff for out put
print "__________________________________________"
print "\nDecrypted message: \t\t" + user_input + '\n'

raw_input ("\n\nPress [Enter] to continue")

#OUT PUT
Please enter some text: 	Richie the King
__________________________________________

Encrypted message: 		evpuvr Gur XvAt
__________________________________________

Press [Enter] to decode 'evpuvr Gur XvAt'
__________________________________________

Decrypted message: …
richieking 44 Master Poster

Not bad ;)

richieking 44 Master Poster

You can close the thread as solve ...... :)
happy coding ***

richieking 44 Master Poster

This is very simple.

Extend the Small list with Uppercase letters. A-Z Just a-z
And on line 14. take away

x.lower()

Just put

x

And the job is done. I just tried it and it work fine.
Good job. :)

richieking 44 Master Poster

As list in python
So is array in c,c++

They are all the same stuff with different names. :)

richieking 44 Master Poster

If you want CheckBox in staticbox Try this

import wx

class Frame(wx.Frame):
    def __init__(self,parent):
        wx.Frame.__init__(self,parent,size=(400,300),title="STATIC CHECK BOX ")
        
        self.pan=wx.Panel(self,-1)
        
        wx.StaticBox(self.pan, -1, 'BOXES', (5, 5), size=(100, 250))
        self.dat()
        self.Show()  
    def dat(self):
        for x in range(1,10):
            wx.CheckBox(self.pan,-1,"%s %d"%("BOX",x),(15,20*x))
a=wx.App()
Frame(None)
a.MainLoop()
richieking 44 Master Poster

This is another version.

You take read the zipfile and use the file type you want to create a new zip file. Simple.

import zipfile

if __name__ =="__main__":
    ext=["py","txt","doc"]
    nfile=[]  #to take new file list
    ffile=zipfile.ZipFile("/home/richie/r.zip","w") # New zip
    zfile= zipfile.ZipFile("/home/richie/GUI2Exe.zip","r")# Main zip
    for xfile in zfile.namelist():
        if xfile.split(".")[-1] in ext: #Check extention
            nfile.append(xfile)         #append
            ffile.write("/home/richie/"+xfile)  # write new one
    print "New zip file data: ", nfile      
    ff.close()
    zfile.close()
richieking 44 Master Poster

I included image module but its not active in the code.

That means i am working on image module's version.

richieking 44 Master Poster

This is one of the easiest steps to view and convert dcm image useing the snake(python)

There are 3 modules involved.

1. Search for pydicom and install
2. Search for matplotlib and install
3. Search for pylab and install.

If you are on ubuntu destro, Installing matplotlib via the repo will pull include the pylab. That is as far as i know. Maybe Pylab is included in matplotlib module. I stand for corrections .

Note To convert to .png,.gif,.jpg file ...

Pylab will popup the file and it will come with image as required.
Look at the statusbar and there are buttons with save disket image. Click on it then select your choice of file type to save. Make sure you save it where easy to access.

Thank you. :)

richieking 44 Master Poster

Ha ha .... CTRL+C, CTRL+V

well thats an option.
:)

richieking 44 Master Poster

You will need the API for notepad python bindings.

Its not like the webbrowser.

Or write your own notepad in 1 hour or less. Or a basic GUI to display your data for 10-20 munites.

wxPython baby.... ;)

richieking 44 Master Poster

mmmm great info.
nice one :)

richieking 44 Master Poster

In the end. I think its more prudent to reserve new as a keyword and using new must be avoided due to various reasons. I name a few.

1.Print has been a function in numerous prog. languages(c,c++,php,perl) but python introduced this idea in py3.
2. Python is all object variable types(python's way). Thus py variables are more than C,C++, variables. They are objects. Objects are initialized with new keyword. PYc. Foundermental python written language.
OK. This is my concern.

New stuffs that python started including in python 3 are already up and actived stuff in other languages.. or the above listed, haskell and partly lua.

Print function is something they could have included from the start but they did not see why.

New is on the way... Trust me. I have been carefuly analyzing python and its future and i think. This change is bound to happend.

Besides python is gradually moving to te top. Python could have been in place of java if all these litle flavours of python came under python with single install. eg(ironpy,numpy,pyc,matpy,pyaudio,pymol) you name it.

Java is about 140mb on my system. Due to that, java runs everywhere. what is the point of 20mb and strugle all over.?

Python is not only a prog. language . IT IS THE FUTURE !!!

That is my view. :)

richieking 44 Master Poster

Well you can close the thread as solved.
You are welcome
;)

richieking 44 Master Poster

And what is your problem here?

richieking 44 Master Poster

So the question is Girbouillis

Do you recommend new to be used as a basic variable or reserved?
From python point of view.?

I strongly dont recommend that expecially as python seems still evolving. Changes here and there. Who knows.?

But i need your view Grib.!
:)

richieking 44 Master Poster

If you know everything, then write your programs as properly as possible and use proper English. "i knw u ll" is not proper English.

Waltp

This is not an english classes or forum. i dont like that.! Take things easy will you?

richieking 44 Master Poster

mmmmmm python is strange. its only on python that new has broken loose i think.

Thanks guys ;)

richieking 44 Master Poster

Just format your print like this

print( "netpay %-.2f" %(netpay))
richieking 44 Master Poster

I am still studying the dcm stuff.

PM me tomorrow ok .? going to bed now.
:)

richieking 44 Master Poster

just try Idle or pydev/Aptana or netbeans.

They are all free and learning will be a breeze.

what OS are you on now?
:)
;)

richieking 44 Master Poster

In Python, we work with the .cgi scripts.

richieking 44 Master Poster

what error??

what OS are you?

You cat take away the if statement and just leave the save. it will save in your home.
windows will be my documents i think.

richieking 44 Master Poster

Take this

ad =[[x for x in range(1,10,2)],[w for w in range(2,20,3)]]

print(ad)
## out put
[[1, 3, 5, 7, 9], [2, 5, 8, 11, 14, 17]]
richieking 44 Master Poster

what ide are you using?

it must stay up.
no need for time module.

richieking 44 Master Poster

1. on line 4.... You are missing a coma.

print "Your net wage is", $netpay

2. This is python not php/perl

no need for

$netpay

just

netpay

Unless net pay is a template of which i dont think so. :)

richieking 44 Master Poster

This is my final work

import dicom
import Image


Ima=dicom.ReadFile("/home/richie/d1.dcm") # change the path

ds=Ima.InstitutionName="Any name" # not realy needed
# I just had to print this Ima.pixel_array out to show you the lists
f=Ima.pixel_array
print f # print
sa= Image.fromarray(f) ## Hear is the Image module. It needs the array method as the details from Ima. is array
if sa.show():    
   sa.save("foo.gif") # save the dat converted to gif.
print("Copy converted to file with name...[foo.gif]")

And dont forget to show some love by upvoting me ok? ;)

python_user commented: Thanks for your help +1
richieking 44 Master Poster

Bingo. I got it. It looks like lungs i think.
They are 2. one here one there

richieking 44 Master Poster

I have converted to tiff.

Its not that good. Hold on i will see if i can enhance it with Image module

richieking 44 Master Poster

I dont Think PIL support DICOM images.
;)

richieking 44 Master Poster

I got it. wait a sec
;)

richieking 44 Master Poster

can you provide a dicom image for me to work on? Or i can use other image type.
not sure. ;)

richieking 44 Master Poster

I am now reading about the DICOM.

I need and hour or so. Very informative. ;)

richieking 44 Master Poster

if ctype is not allowed.......
Are you allowed to use other headers at all??

richieking 44 Master Poster

Change log
1b8148505b by darcymason on Oct 10, 2008 Diff

Started dicom.image module, show_PIL()
function which uses PIL to display pixel
data. Works for CT and MR and image_defl
but needs palette adjustments. The
ExplVR_BigEndian image with RGB looks odd,
probably not being interpreted correctly.
Reorganized Dataset code to keep
alphabetical.

This is from your link. Meaning the module is still experimental module.
Thats lower than even alpha standard.

sorry ;)

richieking 44 Master Poster

Dos-killer,

The job is done i think.

Check with this link.
It will be great if you put the server on your notebook. Then you will have more control because you need to convert audio to MIDI because you can control that easily on the notebook to speed the audio transfer. Nokia CPU is a piece of ant brain. You need speed. Once the audio is converted to MIDI, s60 can handel MIDI without any issue.

Then use this S60 python module http://www.mobilenin.com/pys60/ex_sound_recorder_player.htm.

You code like this....

#Demo
import audio
import sockeck

## Like this

con,addr=s.accept()
midi=con.recv(1200)
audio.sound.play(midi)

#To record on the reciever ... Its very tricky. No that record do not have to finish. There must be a while 1: loop to keep sending data to both end.
# Here on the nokia.

audiorec=audio.sound.record()# kind of or you ....
socket.send(audiorec)

Take this link doc. http://www.mobilenin.com/pys60/resources/API_Reference_for_Python.pdf

Hay lil upvote will be nice ;)
Try this.....
;)

richieking 44 Master Poster

I get you.

Yes you can do this but what will be the audio format to put throught the socket???

You can use any of this python format.http://wiki.python.org/moin/Audio
i Find audioop and wav modules very handy to help your case.

You will have 2 Apps in to tatal.
1. One for the s60
2.For the recieving server.

But if i were you... i will write both as recieving and send sending server.
who know?

richieking 44 Master Poster

can you post the code. i am curious...... plz ;)

richieking 44 Master Poster

You cant do this with turtule module my friend.

you need these modules.
1. math
2. PIL
or pygame i think.

You are using the wrong tool for the wrong job brother ;)

richieking 44 Master Poster

what do you mean by torn square? like this?

++++++++++
+        +      
+        +
+        +
++++++++++

more info pls ;)

richieking 44 Master Poster

And dont forget to

dbi.commit()

for action.

richieking 44 Master Poster

Yep ...! python got what is takes.
go here my friend!

http://www.mobilenin.com/pys60/menu.htm

Happy coding ;)

richieking 44 Master Poster

Use file.

richieking 44 Master Poster

Do you know that is a delete you are exec. on the file.??
;)

i think you know ... dont you ?:)

richieking 44 Master Poster

snippsat
1.
Are you carefuly reading my stuff...?

ubuntu has nothing to do with python stabilty,python has been and are stable on all platform.
And bugs are taken serious in python,look at bug report in python.

It was about every software,App etc stability.

2.
If you wrote an application in python 10 yrs ago in python. They are not guarenteed to work today.
12 releases in 11 years http//www.python.org/download/releases/
.. Why cant we have LTS and we keep doing bugfixing till most stuff are controled for a major realese. Simple logic!

I use python myself. I like python but it does not mean that its above critcism.
Face the fact. ;)