Sample sqlite databases for use in python

2014-10-26 Thread Nicholas Cannon
Hello I am making a data management program and although i can make my own 
databases I would like a couple sample ones to check out. Of course I searched 
on google for sample db's and I downloaded some but they are not working and I 
keep getting: 
File is not a database or encrypted

The error is not exactly like that but it does say that it may be encrypted or 
not a database. I want the end user to take a database and load it in to my 
program but I dont wont this happening even if the file is a sqlite3 one as 
well. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Syntax Highlighting in a tkinter Text widget

2014-10-07 Thread Nicholas Cannon
Sweet thanks for the help many I am defiantly going to use these. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Syntax Highlighting in a tkinter Text widget

2014-10-06 Thread Nicholas Cannon
Hey guys Im working on an open source text 
editor(https://github.com/nicodasiko/Text-Config-2) and I would like to add 
syntax highlighting(mainly for python code). I have built the editor in python 
and the text input is a Text tkinter widget. I know how to add tags and 
highlight things  but Im not sure on how to constantly update the highlighting.
-- 
https://mail.python.org/mailman/listinfo/python-list


How to not enable a user to close the root tkinter window

2014-09-22 Thread Nicholas Cannon
I have a project I am working on(https://github.com/nicodasiko/Article-Grab) 
which grabs info from the internet then displays it on the screen. It is a 
multithreaded program so as the function that retrieves the data from the 
internet there is also another function running in parallel which updates a ttk 
loading bar. Pretty simple multi threaded stuff. But I found out that the user 
can close the window whilst the threads are running which generates an error 
and is not healthy. Is there a way I can make the root tkinter window not close 
whilst the threads are running. I did this with the search bar and search 
button. Or can I safely stop the running threads and make them drop everything 
error free? Any help will be apreciated!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread Nicholas Cannon
Ok I'm confused. Do I need to do better comments? I know the text is not that 
great but that is my next obstacle I am going to tackle. I mostly need to know 
where I am going wrong such as what is expectable readable code and what is not 
and how to fix this. This is good feedback thanks to all of you guys. All I 
want to do is learn and become better and neater!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread Nicholas Cannon
Also I have just been coding for about and hour and a half and added a lot more 
code to it but it is not fully finished yet so it is not on github yet.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to not enable a user to close the root tkinter window

2014-09-22 Thread Nicholas Cannon

The git hub has not actually been updated yet I am working on somethine else 
then committing the update. How would I stop the threads though. I'am using the 
Thread from threading function. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Love to get some feedback on my first python app!!!

2014-09-21 Thread Nicholas Cannon
On Saturday, September 20, 2014 9:17:27 PM UTC+8, Nicholas Cannon wrote:
 I have created my first python program and I have learnt a lot about python 
 from this group and wanted some feedback. I am still improving it and trying 
 to tackle some performance and GUI stuff so keep that in mind. I don't think 
 it is the best program but is a good product of 3 months of python.
 
 
 
 link: https://github.com/nicodasiko/Article-Grab

I just updated the whole app to include a scroll bar, loading bar and I used 
multi threading to update the scroll bar whilst scraping the data from the web. 
I need to work on performance though but I have defiantly improved it now!
-- 
https://mail.python.org/mailman/listinfo/python-list


Love to get some feedback on my first python app!!!

2014-09-20 Thread Nicholas Cannon
I have created my first python program and I have learnt a lot about python 
from this group and wanted some feedback. I am still improving it and trying to 
tackle some performance and GUI stuff so keep that in mind. I don't think it is 
the best program but is a good product of 3 months of python.

link: https://github.com/nicodasiko/Article-Grab 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Love to get some feedback on my first python app!!!

2014-09-20 Thread Nicholas Cannon
On Saturday, September 20, 2014 9:17:27 PM UTC+8, Nicholas Cannon wrote:
 I have created my first python program and I have learnt a lot about python 
 from this group and wanted some feedback. I am still improving it and trying 
 to tackle some performance and GUI stuff so keep that in mind. I don't think 
 it is the best program but is a good product of 3 months of python.
 
 
 
 link: https://github.com/nicodasiko/Article-Grab

Yeah this is exactly what I was looking for I know the comments are horrible 
and I had no idea about the camelCase stuff. Should I use 
'''
Use this commenting on my functions or not. I think they are called docStrings 
or something
'''
I have a free day today and I am going to fix up some GUI stuff and try and 
slim down the processing and amount of variables because it doesnt really run 
as fast. Thanks for the help Chris Angelico!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Love to get some feedback on my first python app!!!

2014-09-20 Thread Nicholas Cannon
I have just committed a new main.py file on github. I added alot more comments 
and slimmed down the getinfo() function. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python script monitor

2014-09-16 Thread Nicholas Cannon
Nah I mean like there is performance issues. It delivers result that I want 
just mot very conveinetly fast.
-- 
https://mail.python.org/mailman/listinfo/python-list


python script monitor

2014-09-15 Thread Nicholas Cannon
I have made an app that is not fully stable and I would like to monitor the 
performance of the app and try and improve the speed of it. I tried to use the 
activity monitor on the mac but what I want I'm to see how much ram, cup and 
other stats on what resources that app is using. Is there any apps to 
specifically monitor a certain app. I am on Mac is so any suggestions that 
could work with that would be great.
-- 
https://mail.python.org/mailman/listinfo/python-list


Raspberry pi, python and robotics

2014-08-31 Thread Nicholas Cannon
I really enjoy engineering at school and we make like fighting robots and 
stuff(simple stuff of course) and i really enjoy it. I have got a raspberry pi 
and a decent understanding of python and i want to do make stuff like RC cars 
and drones and stuff. Also I like electronics. Is there any good places to 
learn all this stuff like down to the basics of electronics because I have 
looked around and all the books I have seen just throw some electronics 
together and say yep thats done. I would like to work on my own projects after 
I get a grip on the basics. Where could I find some good recourses on this 
stuff.
-- 
https://mail.python.org/mailman/listinfo/python-list


Best place to start of learning the raspberry pi

2014-08-24 Thread Nicholas Cannon
Hey I bought a raspberry pi, a bread board and all this electronics stuff and i 
really enjoy programming stuff in python and i have had a decent of practise 
with python. I really wont to get into making things with electronics(i have 
had a lot of practise with soldering as well) and then program them with 
python. Where is the best place to learn all this starting of from the 
beginning like the basics of electronics?
-- 
https://mail.python.org/mailman/listinfo/python-list


Tkinter frame reset

2014-08-08 Thread Nicholas Cannon
Ok so I am working on a little project and I cant seem to solve something with 
it. I have a label and then a clear button and I want all the numbers in the 
label to clear when I push the button. This button is on a separate frame to 
the buttons. I would like to clear the frame and then set all the widgits back 
to how they were one you first open the app(Label being blank). I have tried to 
destroy it with frame.destry() and then try re create it in a function but it 
never recreates its self. Also when I tried grid_forget() on it, it never came 
back either when I tried to frame it and then grid it back on there. I can 
clear the label by just adding a long blank string to it to overwrite the 
numbers behind because I would like to have the user add more numbers in there 
like starting fresh. This long blank string wont work because the buttons add 
on to the existing string so the label keeps getting updated with the new 
buttons pressed. I tried to remove the label but that never came back
  either. Please help me with trying to clear the label or the whole window 
back to its original blank settings
-- 
https://mail.python.org/mailman/listinfo/python-list


Tkinter menu crash

2014-08-05 Thread Nicholas Cannon
Ok so the first part of the program(until the start of the menu) worked fine. 
It ran and did what I wanted it to do. I wanted to then implement a new 
menu(for practise) and then it crashes. Don't know why but it just crashes. 
(also tips on the code will be appreciated and I gave just started Tkinter 
programming)

Here is the code:


from Tkinter import *
import tkMessageBox as tm

def submit():
#message box with yes no 
tm.askyesno(title='Submit Text', message='Are you sure')

def info():
tm.showinfo(title='About', message='Just a test Tkinter UI sample')


#getting the text from the entrybox and
#packs it into a label
mtext = text.get()
label1 = Label(app, text=mtext)
label1.pack()

#root window setup
root = Tk()
root.geometry('480x480+200+200')
root.title('Basic Tk UI')

#frame set up
app = Frame(root)
app.pack()

#variable and entry box set up
text = StringVar()
entry = Entry(app, textvariable=text)
entry.pack()

#button set up
button1 = Button(app, text='Submit text', command= submit)
button1.pack()

#menu construction
menubar = Menu(root)

filemenu = Menu(menubar)
filemenu.add_command(label='About', command= info)
filemenu.add_command(label='Quit', command= root.destroy)
filemenu.add_cascade(label='TK UI Sample', menu=filemenu)

root.config(menu=menubar)



#loop to listen for events
root.mainloop()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tkinter menu crash

2014-08-05 Thread Nicholas Cannon
Ok so I am on 2.7.8.
 What x.y.z version of Python. How did you run it, exactly?

 Adding filemenu as a submenu of filemenu leads to infinite loop regress. 
 
 On 3.4.1 with tcl/tk 8.6, this does not crash, but it might on an 
 
 earlier version of Python and tcl/tk.
 Since menubar is left empty, it is not displayed.  Fix both problems with
 
menubar.add_cascade(label='TK UI Sample', menu=filemenu)
 
 root.config(menu=menubar)
Yeah this fixed the problem. So the main menu object needs to be cascade 
instead of the filemenu. Will this need to be done every I create a new menu?


and ran -- no crash, no error message, no menu. I entered text into box, 
clicked Submit text, and OK on popup, and nothing happens. 
Im not quite sure what is happening here. Oh I just looked at the code and the 
part that sends the entry box text is in the wrong place or must have been 
unindented I have fixed this now and it works great.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tkinter menu crash

2014-08-05 Thread Nicholas Cannon
I am confused. When I did menu bar.add_cascade why don't I do 
filemenu.add_cascade. Is it because I am adding a cascade to the main menubar?  
-- 
https://mail.python.org/mailman/listinfo/python-list


Tkinter grid autosize help

2014-08-02 Thread Nicholas Cannon
So i have a basic calculator program and i have a label that i want to go 
across the top to show the numbers and stuff like on a normal calculator. The 
only way i can make the buttons look neat and then when i keep pressing one the 
label gets larger and then half the buttons move out of the screen. I cant seem 
to fix this i have tried columnspan, columnconfigure and heaps of other stuff 
and non works it always expands. is there a way i can stop the grid from 
expanding?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tkinter grid autosize help

2014-08-02 Thread Nicholas Cannon
On Saturday, August 2, 2014 10:38:28 PM UTC+8, Nicholas Cannon wrote:
 So i have a basic calculator program and i have a label that i want to go 
 across the top to show the numbers and stuff like on a normal calculator. The 
 only way i can make the buttons look neat and then when i keep pressing one 
 the label gets larger and then half the buttons move out of the screen. I 
 cant seem to fix this i have tried columnspan, columnconfigure and heaps of 
 other stuff and non works it always expands. is there a way i can stop the 
 grid from expanding?



ok here is the code:

#window setup
main = Tk()
main.title('Calculator')
main.geometry('300x350')
main.resizable()

app = Frame(main)
app.grid()
app.columnconfigure(0, weight=500)
app.columnconfigure(1, weight=500)


#number view label
number = ' '
numberView = Label(app, text= number)
numberView.grid(row=0, column=0, columnspan=100)

#Num Pad Buttons below
num1 = '1'
button1 = Button(app, text='1', command= lambda: add(num1), width=5)
button1.grid(row=1, column=0)

num2 = '2'
button1 = Button(app, text='2', command= lambda: add(num2), width=5)
button1.grid(row=1, column=1)

num3 = '3'
button1 = Button(app, text='3', command= lambda: add(num3), width=5)
button1.grid(row=1, column=2)

num4 = '4'
button1 = Button(app, text='4', command= lambda: add(num4), width=5)
button1.grid(row=2, column=0)

num5 = '5'
button1 = Button(app, text='5', command= lambda: add(num5), width=5)
button1.grid(row=2, column=1)

num6 = '6'
button1 = Button(app, text='6', command= lambda: add(num6), width=5)
button1.grid(row=2, column=2)

num7 = '7'
button1 = Button(app, text='7', command= lambda: add(num7), width=5)
button1.grid(row=3, column=0)

num8 = '8'
button1 = Button(app, text='8', command= lambda: add(num8), width=5)
button1.grid(row=3, column=1)

num9 = '9'
button1 = Button(app, text='9', command= lambda: add(num9), width=5)
button1.grid(row=3, column=2)

num0 = '0'
button1 = Button(app, text='0', command= lambda: add(num0), width=5)
button1.grid(row=4, column=1)

main.mainloop()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Tkinter grid autosize help

2014-08-02 Thread Nicholas Cannon
On Saturday, August 2, 2014 10:38:28 PM UTC+8, Nicholas Cannon wrote:
 So i have a basic calculator program and i have a label that i want to go 
 across the top to show the numbers and stuff like on a normal calculator. The 
 only way i can make the buttons look neat and then when i keep pressing one 
 the label gets larger and then half the buttons move out of the screen. I 
 cant seem to fix this i have tried columnspan, columnconfigure and heaps of 
 other stuff and non works it always expands. is there a way i can stop the 
 grid from expanding?

Ok so I have just started out Tkinter and I feel I should study more of it 
because some of the code given is quite intimidating to me right now. Also I 
have only been coding python for 3 months right now. I think I need to learn 
how to write python better haha. I appreciate the help guys.
-- 
https://mail.python.org/mailman/listinfo/python-list


Best place to find sample data

2014-07-26 Thread Nicholas Cannon
Hey I need some sample data to test out and do stuff with. Also I am having 
strange errors with idle when i load a .txt file read it and then print it, 
idle crashes well kind of freezes. Not sure what is wrong here. Also I am 
having troubles with Numpy and its loadtxt function:

ValueError: cannot set an array element with a sequence

So all i need is a good site to download some data from and maybe some fixes 
for these problems.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best place to find sample data

2014-07-26 Thread Nicholas Cannon
On Saturday, July 26, 2014 9:41:11 PM UTC+8, Nicholas Cannon wrote:
 Also I am having troubles with Numpy and its loadtxt function:
 
 
 
 ValueError: cannot set an array element with a sequence

I found out why this has occurred because the csv file i was using didnt have a 
consistent amount of values in each line so when the load text tried to load it 
into a list or whatever some lines had a missing index or something.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best place to find sample data

2014-07-26 Thread Nicholas Cannon
Oh the above is quoted here just the bottom line in added in 
-- 
https://mail.python.org/mailman/listinfo/python-list


I want to do something with data

2014-07-23 Thread Nicholas Cannon
Hey i am interested in using data in my programs. I know every program uses 
data but i want to do like large data processing and pick results out of a data 
like querying database. I dont really know what this is called though. Is it 
data analytics? im not sure but I would like to do this stuff. What would i 
need to learn because i know the basic file opening and stuff and also know how 
to open csv files aswell as grab data from the web. I dont know much else about 
handling data other than regular expressions which is handy when grabbing data 
from the web. I f any one could like guide me on what to learn that would be so 
good.
-- 
https://mail.python.org/mailman/listinfo/python-list


Html Parsing stuff

2014-07-21 Thread Nicholas Cannon
Ok i get the basics of this and i have been doing some successful parsings and 
using regular expressions to find html tags. I have tried to find an img tag 
and write that image to a file. I have had no success. It says it has 
successfully wrote the image to the file with a try... except statement but 
when i try to open this it says that the image has like no been saved correctly 
or is damaged. This was just reading the src attribute of the tag and trying to 
save that link to a .jpg(the extension of the image). Ok so i looked deeper and 
added a forward slash to the url and then added the image src attribute to it. 
I then opened that link with the urllib.urlopen() and then read the contents 
and saved it to the file again. I still got the same result as before. Is there 
a function in beautiful soup or the urllib module that i can use to save and 
image. This is just a problem i am sorting out not a whole application so the 
code is small. Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Html Parsing stuff

2014-07-21 Thread Nicholas Cannon
dont worry it has been solved
-- 
https://mail.python.org/mailman/listinfo/python-list


I am stuck on OOP

2014-07-18 Thread Nicholas Cannon
Just quickly i am quite stuck on OOP and i really need like a good video and i 
cant find any. If anyone knows any please link it i really need it because i 
know OOP is important.
-- 
https://mail.python.org/mailman/listinfo/python-list


I need an idea for practise!

2014-07-17 Thread Nicholas Cannon
Ok I would say I am almost a intermediate python programer. I have made 2 
programs(with GUI). And basically they are quite boring(a text editor and 
calculator). I love programming but i am lost of ideas i actually suck at 
finding good creative ideas. Now i am not looking to use these ideas make them 
and then try get money for it. I am only a kid and would love some like real 
world project ideas to learn more about python. Yeah so if any one would like 
to give me some ideas to train my self on that would be so cool!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Mac python py2app problem

2014-07-17 Thread Nicholas Cannon
On Wednesday, July 16, 2014 9:56:56 AM UTC+8, Nicholas Cannon wrote:
 Hey i have made an app and i have made a .msi for windows with py2exe and i 
 have also exported it with py2app on mac. No problems here they all work 
 fine. I then put the .msi on sourceforge and it works great but when i put 
 the .app on there and download it it says something like i can open this on 
 old architecture or something so i have to put it through google drive and i 
 dont like this like i share the link and folder and people can download it 
 there but it is dodgy. Could someone please help me out like if there is a 
 .msi type thing for mac with py2exe?

Yeah i have zipped it up and put it on sourceforge and then when you download 
the zip it says it is incomplete. I do like the idea of making a .dmg file 
because i have used them downloading other apps and it works great but i dont 
know how to make them! would be great if you guys could give me a link to how 
to do this!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I need an idea for practise!

2014-07-17 Thread Nicholas Cannon
When I say i suck at finding good creative ideas I dont mean like I can think 
of  anything its more like i cant think of anything that is within my scope of 
skill. These ideas are great guys thanks. Also the gui tool kit i used for the 
apps is tkinter because i am reading a book about python and it covers that 
tool kit. Also i like this idea of ssh'ing to a server where i could have a 
python program that allows files to be uploaded to a database and brought down 
from the data base. I am just not so good with the hardware so I dont really 
now how to create one. Also I wouldnt mind putting more functionality into my 
programs and stuff that sounds alright and also re inventing the wheel sounds 
like good practise.
-- 
https://mail.python.org/mailman/listinfo/python-list


Mac python py2app problem

2014-07-15 Thread Nicholas Cannon
Hey i have made an app and i have made a .msi for windows with py2exe and i 
have also exported it with py2app on mac. No problems here they all work fine. 
I then put the .msi on sourceforge and it works great but when i put the .app 
on there and download it it says something like i can open this on old 
architecture or something so i have to put it through google drive and i dont 
like this like i share the link and folder and people can download it there but 
it is dodgy. Could someone please help me out like if there is a .msi type 
thing for mac with py2exe?
-- 
https://mail.python.org/mailman/listinfo/python-list


Standard library Help

2014-07-11 Thread Nicholas Cannon
Hey i would like to know alot more about the standard library and all of its 
functions and so on and i know it is huge and i would basically like to learn 
only the useful stuff that i could use and all of those features. i have been 
looking around and i cant really find anything so i wondering if you guys would 
know any places to learn it.
-- 
https://mail.python.org/mailman/listinfo/python-list


How to distribute python console program

2014-06-21 Thread Nicholas Cannon
I have a simple program that is ran in the console with 2 modules and i was 
wondering how i could like export it so i could give it to someone to use as 
like a utlitie in the console?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to check if a value is a floating point or not

2014-06-20 Thread Nicholas Cannon
Guys i am only a beginner at python most of the stuff you are saying i need to 
do i dont understand.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to check if a value is a floating point or not

2014-06-19 Thread Nicholas Cannon
On Thursday, June 19, 2014 1:53:31 PM UTC+8, Nicholas Cannon wrote:
 I am making a calculator and i need it to support floating point values but i 
 am using the function isnumeric to check if the user has entered an int 
 value. I need the same for floating point types so i could implement an or in 
 the if statement that checks the values the user has entered and allow it to 
 check and use floating points. If you need the source code i am happy to give 
 it to you. Thank you for your help

I am using python 2.7.7 and i have come up with away but there is still 
possible errors for this. What i did was i this

#checks if the user input is an integer value
def checkint(a):
if a.isnumeric():
return True
else:
if a.isalpha():
return False
else:
return True

The parameter a is the users input by the raw_input function. I first test if 
it is normal int with the isnumeric function. Unfortunately this function picks 
up the decimal as false. This means if the user inputs a float it has to be 
false. I then test if this input has any alphabetical characters if it does not 
the user could have only entered  something like 12.5 oppose to abc.d. This 
method works fine and it i have  tested it and it works fine. if incase this 
input did have a letter it would be picked up by the isalpha function. There is 
one annoying error doing it this way and that is if you enter 12.ab or ab.12 it 
will say that it is okay. Still working on this so this should get sorted out 
soon.
-- 
https://mail.python.org/mailman/listinfo/python-list