• Member Avatar for sneekula
    sneekula

    Replied To a Post in writing text from right to left

    There might be a Persian version of Python.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Problem with Tkinter code (button and label)

    Normally you build a house from the bottom up. Try to understand the basics of Python first and put the windows in later.
  • Member Avatar for sneekula
    sneekula

    Gave Reputation to almostbob in Jokes

    I had a power outage at my house this morning and my PC, Laptop, TV, DVD, IPad and my new surround sound music system were all shut down. Then I …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in There is an elephant on the loo!

    Computer languages Worldwide, Jan 2015 Meassured by the number of inquiries on Google (a mixture of "I am interested" and "I am lost") ---------------------------------------------------- Rank Language Share(%) Trend(% vs a …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in PriceLess malware

    Update: PriceLess has so far stayed away from my Chrome Web Browser extensions. However I can still find references to it, for instance if I save a file without extension …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from Tkinter without using button

    Try it this way: ''' favemovies.py with iPython on Windows use: run C:\Python27\Atest27\Bull\favemovies.py view ''' import sys import pickle # for Python3 replace Tkinter with tkinter import tkinter as tk …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Random Facts

    After the Swiss Federal Bank floated the Swiss Franc against the Euro, the Franc shot up so much that many Swiss take the short trip to Germany to literally buy …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from Tkinter without using button

    Then you have to change your code to: def message(): label['text'] = 'Good morning' # for Python3 replace Tkinter with tkinter import Tkinter as tk win = tk.Tk() label = …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from Tkinter without using button

    Try: def message(): print('Good morning') from Tkinter import * tk = Tk() message() tk.mainloop()
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in creating list of lists

    Apply append() this way: i = 0 pack = [] mylist = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] while i < 17: sublist = mylist[i : i + 3] pack.append(sublist) i += 1 print (pack)
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in creating list of lists

    Avoid using Python function names like **list** for variable names. if you use list = [1, 2, 3] and later abc_list = list('abc') it won't work!
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Need a clear help with dump and load in pickle

    I would use **with**, it closes your files properly. Also use a protocol for larger files: import pickle fname = "films.db" with open(fname, "wb") as fout: # default protocol is …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Check if a number is a prime number (Python)

    A simple timing example: import time def print_timing(func): """ a decorator function to time another function time.clock() works on Windows systems only you can use time.time() instead, but it gets …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How can I take the results and auto copy to clipboard?

    To work with the clipboard see: https://www.daniweb.com/software-development/python/code/487653/access-the-clipboard-via-tkinter#post2142575
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How can I take the results and auto copy to clipboard?

    What operating system are you using?
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in do-while loop in python

    The elegant thing about the **while True** loop is that you can break at a given point between statements.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in count of substrings. append method

    Note that overlapping subs won't work with text.count(): text = "assesses" sub = "sses" print(text.count(sub)) # --> 1 ???
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in count of substrings. append method

    I took the liberty to time some of the approaches: ''' str_count_sub_timing_hperf.py timing functions that count the number of sub_strings in a string using high performance time.perf_counter() new in Python …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in how do the uppercase and lowercase?

    You can modernize this a little: // str_toupper.cpp // convert a string to all upper case // compiled with mingw32-g++.exe #include <algorithm> // transform() #include <cctype> // toupper() #include <iostream> …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Isaac Newtons theory about the earth falling to the sun.

    Slowing down the Earth to a speed that would make it fall into the Sun within a few days time, would flatten it like a ripe tomato hitting a wall.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Projects for the Beginner

    If you go to: http://en.wikipedia.org/wiki/List_of_countries_by_inflation_rate you can extract the 10 countries with the highest inflatuion rate. You end up with this tab delimited data string: data = '''\ Uruguay 8.11 …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in There is an elephant on the loo!

    10 countries with with the highest mid 2014 inflation rate: Country Inflation (%) Venezuela 60.9 Sudan 46.8 Belarus 32.8 Argentina 24.2 Iran 14.6 Syria 13.6 Ukraine 13.0 Egypt 10.61 Turkey …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Isaac Newtons theory about the earth falling to the sun.

    What external force could slow down the Earth orbital speed?
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in counting numbers

    You have this execution/evaluation order: 1) if (i%3 == 0 && i%5 == 0) 2) else if (i%3 == 0) 3) else if (i%5 == 0) 4) else Here 2) …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in count of substrings. append method

    Hmm: ''' str_find_sub_index.py explore s.find(sub[ ,start[,end]]) returns index or -1 ''' text = "trans panamanian bananas" sub = "an" start = 0 count = 0 while True: ix = text.find(sub, …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in counting numbers

    @ivel I looked at the code you have written and at NathanOliver's helpful suggestions. I came to the conclusion that you need beginner's help. I took your code and corrected …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in how do the uppercase and lowercase?

    @cambalinho you are mixing char and int types, do the proper casts and your approach will work: // str_Upper.cpp // convert a string to all upper case #include <iostream> #include …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in how do the uppercase and lowercase?

    Something like that: // removes the third bit, simple way to create upper case char char toupper(char ch) { return ch & 0xDF; } Sorry doesn't handle numbers etc.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Projects for the Beginner

    Write a Python program that checks a given directory for any file changes over a given period.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How can i creat e text file to use as a database in python

    Give us a short example of what your project data looks like.
  • Member Avatar for sneekula
    sneekula

    Created Installing Kubuntu

    I have a Toshiba Satellite notebook with Windows7 OS. How would I go about it to replace Windows7 with Kubuntu?
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in PriceLess malware

    Actually, after removing the contaminated MS installed Wildtangent games, the MS "application virtualization client" complains about not being able to reload a program. It doesn't tell which program it is, …
  • Member Avatar for sneekula
    sneekula

    Marked Solved Status for Permission to read a file

    On Windows7 I am trying to read file C:\programdata\microsoft\application virtualization client\SoftGrid Client\sftfs.fsd using a Python program, but I get a PermissionError. How do I get permission? Why does folder programdata …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Permission to read a file

    Thank you! Just a little MS game of hide and seek?
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Who is the better Joker?

    I wish Hollywood could come up something better than endless sequels.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from linux terminal

    Using the LXTerminal --> cd rpi_python python hello_arg2.py sayhi or --> python hello_arg2.py saybye
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from linux terminal

    On my Raspberry Pi computer I came up with this: #!/usr/bin/python2 # -*- coding: utf-8 -*- """ Save this file as hello_arg2.py in folder /home/pi/rpi_python Note: line 1 has been …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from linux terminal

    I thought you want to do it from the Python shell?
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from linux terminal

    Or simpler: `>>> execfile("hello.py")` You might have to give it the full file path.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from linux terminal

    Or simpler: `>>> execfile("hello.py")`
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How to call a function from linux terminal

    If you saved your file as hello.py somewhere Python looks for, do this from the shell: >>> import hello >>> hello.thefunc()
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in How many hours do you spend on computers all day.

    I average about 2 hours a day.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Change the First Character of List word to Upper Case

    Here you go: s = "happy Hello World!" print(s) print(s.capitalize()) print(" ".join(w.capitalize() for w in s.split())) print(s.lower()) print(s.upper()) print(s.swapcase()) ''' my result --> happy Hello World! Happy hello world! Happy …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Condition-controlled loop

    Nicely explained in: http://www.tutorialspoint.com/python/python_for_loop.htm
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in ANY ideas for how to start this program? "ARGENT"

    Assume the individual data has to come from the user via cin.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in sorting string array

    Do you want to sort or random shuffle your array?
  • Member Avatar for sneekula
    sneekula

    Marked Solved Status for PIL and matplotlib for Linux

    On my Raspberry Pi computer I did a search for PIL and matplotlib with apt-cache search python but could not find anything close in the list. Is PIL/Pillow and matplotlib …
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in There is an elephant on the loo!

    If you wait till April, they will most likely print a 100 quatrillion Dollar bill. That's the way hyperinflation goes.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Permission to read a file

    What is folder view? Got into it using help.
  • Member Avatar for sneekula
    sneekula

    Replied To a Post in Permission to read a file

    Tough to do if the folder does not even show up.

The End.