DaniWeb Forum Index
>
Search Forums
Search Results
1
2
>
•
•
•
•
Showing results 1 to 40 of 80
Search took
0.02
seconds.
Search:
Posts Made By:
Ene Uran
Save these search results for 24 hours
Forum:
Python
17 Days Ago
Replies:
3
please help me with crossfade
Views:
152
Posted By
Ene Uran
1
There is some important information missing here....
There is some important information missing here. What module are you using/importing?
Also I have a dislike for people who post two threads on the same subject. That is very rude. Which one of...
Forum:
Geeks' Lounge
26 Days Ago
Replies:
9
What is the most important part of your Xmas celebration?
Views:
465
Posted By
Ene Uran
1
What is the most important part of your Xmas celebration?
Xmas dances and music
Forum:
Python
Sep 29th, 2009
Replies:
22
Solved:
opening an exe from Program Files directory in windows
Views:
1,006
Posted By
Ene Uran
3
Re: opening an exe from Program Files directory in windows
This problem has been around for a long time and not just with Python:
# the "Microsoft kludge", quoting a string within a string fixes the
# space-in-folder-name problem, tells the OS to use the...
Forum:
Python
Sep 27th, 2009
Replies:
20
Solved:
Text Files
Views:
600
Posted By
Ene Uran
1
Re: Text Files
See if something like this will do, but be careful that all the slicing doesn't steal some data:
def extract_number(data_str):
"""
extract the numeric value from a string
(the string...
Forum:
Python
Sep 26th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
There is another Python version called IronPython that uses Python syntax. It runs independent from the normal CPython version and allows access to the large GUI libraries of .NET and Mono. Here is...
Forum:
Python
Sep 7th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
A similar table, this time we use PyQT's QTableView and QAbstractTableModel which allows the items in the table to be sorted by simply clicking on the header titles:
# use PyQT's QTableView and...
Forum:
Python
Sep 7th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
Thanks vegaseat for the newer PyQT style info. Here is a relatively simple way to display tabular data using a function to create an html coded table:
# PyQT's QLabel widget can display html...
Forum:
Python
Sep 5th, 2009
Replies:
2
understanding the self in relation to variables
Views:
335
Posted By
Ene Uran
1
Re: understanding the self in relation to variables
Look over this code sample, it should be very explanatory:
# role of self in Python classes
# self can be named different, but 'self' is convention
class Snake:
def __init__(self, name):
...
Forum:
Python
Sep 3rd, 2009
Replies:
2
Converting csv to xls
Views:
251
Posted By
Ene Uran
1
Re: Converting csv to xls
Take a look at:
http://sourceforge.net/projects/pyexcelerator/
Here is example code:
http://sujitpal.blogspot.com/2007/02/python-script-to-convert-csv-files-to.html
Forum:
Python
Sep 3rd, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
A quick look at Tkinter's radio and check buttons:
# exploring multiple Tkinter radio buttons
# radio buttons only allow one item to be selected/checked
# ene
try:
# Python2
import...
Forum:
Python
Aug 27th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
An enlightening look at Tkinter's grid layout manager:
# looking at the Tkinter grid() layout manager
#
# The size of a grid cell in a given row or column is
# determined by its largest widget....
Forum:
Geeks' Lounge
Jul 12th, 2009
Replies:
83
Windows 7 Hope
Views:
4,232
Posted By
Ene Uran
1
Re: Windows 7 Hope
On a notebook that you take from class to class, Windows Vista is simply unacceptable since it takes at least five minutes to boot up and just about the same to shut down. I hope Windows 7 offers...
Forum:
Python
Jul 8th, 2009
Replies:
4
Solved:
Using List in Python
Views:
297
Posted By
Ene Uran
1
Re: Using List in Python
Simply use list():
list1 = ['a', 'b', 'c', 'd']
# this will create a new list with a different mem ref
temp_list1 = list(list1)
for i in range(len(list1)):
temp_list1[i] = "1"
print list1; ...
Forum:
Python
Jul 7th, 2009
Replies:
6
Solved:
How to create tabs in a file??
Views:
384
Posted By
Ene Uran
1
Re: How to create tabs in a file??
You mean something like this:
# data string read from a file
data = """\
gnl|dbSNP|rs13484118 gi|62750812|ref|NC_005111.2|NC_005111 95 20 1 0 68 87 31017559 31017578 4.4 32.3
gnl|dbSNP|rs13484118...
Forum:
Geeks' Lounge
Jul 7th, 2009
Replies:
5
Solved:
You there, this is the smile police, be happy
Views:
442
Posted By
Ene Uran
1
Re: You there, this is the smile police, be happy
Let's see if the Omron Smile Scan system works on holders of State of California short term debts and bonds. California has started pay off with I.O.U.'s rather than actual money.
Forum:
Geeks' Lounge
Jul 6th, 2009
Replies:
68
Can Barack Obama save America?
Views:
5,018
Posted By
Ene Uran
1
Re: Can Barack Obama save America?
Why did we get into such a mess?
Instant food
Instant credit
Instant war
Instant debt
.. just to mention four reasons.
Forum:
Geeks' Lounge
Jul 6th, 2009
Replies:
61
Poll:
which browser do you use? - poll
Views:
4,123
Posted By
Ene Uran
1
Re: which browser do you use? - poll
The last update of MS IE did me in, after it fooled around with my 'favorite folders'. I am now a very happy Firefox user.
Forum:
Geeks' Lounge
Jul 6th, 2009
Replies:
41
Happy 4th july!!!
Views:
3,902
Posted By
Ene Uran
2
Re: Happy 4th july!!!
The debt per person in the USA is cheap compared to other countries. Let's celebrate with Chinese fireworks! I love the stench of burning sulfur from the fireworks, much better than the normal LA...
Forum:
Python
Jul 6th, 2009
Replies:
1
Writing multiple lines into a file in Python
Views:
801
Posted By
Ene Uran
1
Re: Writing multiple lines into a file in Python
In Python it would look like:
fout = open("test1.txt", "w")
fout.write("save something ...\n")
fout.write("save something more ...\n")
fout.close()
# or C++ style (allowed in Python2)
fout =...
Forum:
Python
Jul 5th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
Here is a general notebook widget class for Tkinter:
# testing a notebook widget class for Tkinter (modified)
# Python 2.5.4 ene
import Tkinter as tk
class Notebook(object):
"""
a...
Forum:
Python
Jun 17th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
PyQT has an interesting widget called a dial (circular slider). Here is a simple applcation:
# use a PyQT QDial knob to select a temperature
# show Celsius and corresponding Fahrenheit values
#...
Forum:
Python
Jun 13th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
Draw a simple bar chart with PyQT:
# use PyQT to draw a simple vertical bar chart
# tested with PyQT4.5 and Python3.0
# ene
import sys
# simplified import, hopefully no namespace conflicts...
Forum:
Python
Jun 13th, 2009
Replies:
130
Read Me:
Starting wxPython (GUI code)
Views:
50,349
Posted By
Ene Uran
2
Re: Starting wxPython (GUI code)
I think we may have talked about this before, but I can't find it. Here is a way to use a sound file inside the Python code and play it. First create a base64 encoded string of the binary sound...
Forum:
Geeks' Lounge
May 24th, 2009
Replies:
6
Solved:
Cycle path?
Views:
617
Posted By
Ene Uran
1
Re: Cycle path?
Did you have a bad day?
Forum:
Python
May 24th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
Tkinter has some nice pop-up dialogs that can also be used for regular console programs. Here is an example to use if you want to get a filename from a pop-up window. It works with Python2x or...
Forum:
Python
May 19th, 2009
Replies:
9
Solved:
Does wxPython do the following well?
Views:
572
Posted By
Ene Uran
1
Re: Does wxPython do the following well?
Here is an example without a titlebar and showing fullscreen:
# wx.Frame with no title bar and showing fullscreen
# modified from vegaseat's example
import wx
def exit(event):
...
Forum:
Python
May 13th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
A small Python/PyQT4 utility program to find out what kind of fonts your computer has:
# bring up a font dialog with PyQT4
# show the selected font using a sample text
import sys
# hopefully no...
Forum:
Python
May 12th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
An example how to use the QPainter to create a wallpaper background:
# a simple window using PyQT
# using a canvas with a texture/wallpaper background
import sys
# pray for minimal namespace...
Forum:
Python
May 12th, 2009
Replies:
80
Read Me:
Python GUI Programming
Views:
18,137
Posted By
Ene Uran
1
Re: Python GUI Programming
I got PyQT4 istalled and working on my Vista computer. Here is an example of my first program:
# display a bunch of random circles using PyQT4
import random
import sys
# pray for minimal...
Forum:
Python
Feb 16th, 2009
Replies:
2
how to use the shutil.copy() statement?
Views:
1,016
Posted By
Ene Uran
1
Re: how to use the shutil.copy() statement?
Expanding on jrcagle post:
import shutil
source_file = r"C:\Python25\Atest\Bull\shutil_test.txt"
destination = r"C:\Python25\Atest\Bull\Test"
# this copies the source file to the destination...
Forum:
Python
Feb 13th, 2009
Replies:
5
Solved:
Is List Equivalent to Arrays?
Views:
637
Posted By
Ene Uran
1
Re: Is List Equivalent to Arrays?
Oh yes, Python has an array type, but you must import module array:
# module array has Python's array type
import array
# Python25 use 'c' as the character typecode
# Python30 uses unicode...
Forum:
Geeks' Lounge
Feb 11th, 2009
Replies:
1,560
Thoughts Of The Day.
Views:
209,269
Posted By
Ene Uran
1
Re: Thoughts Of The Day.
"A person should not be too stupid. Stupid people are screwed first. "
Forum:
Python
Feb 5th, 2009
Replies:
2
Combinging parts of tuples together
Views:
268
Posted By
Ene Uran
1
Re: Combinging parts of tuples together
Two loops will do, or you can use a list comprehension:
rank = ("A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K")
suit = ("c", "h", "s", "d")
card = []
for r in rank:
for s...
Forum:
Geeks' Lounge
Feb 2nd, 2009
Replies:
80
Some funny jokes
Views:
8,565
Posted By
Ene Uran
1
Re: Some funny jokes
Man "I’d like to call you. What’s your number?"
Woman "It’s in the phone book."
Man "But I don’t know your name."
Woman "That’s in the phone book too."
Forum:
Python
Jan 26th, 2009
Replies:
8
Solved:
GUI library for python 3
Views:
3,191
Posted By
Ene Uran
1
Re: GUI library for python 3
For the time being you will have to use good old Tkinter that ships with Python3.0.
Forum:
Python
Jan 24th, 2009
Replies:
2
Solved:
Add directory to import locations
Views:
758
Posted By
Ene Uran
1
Re: Add directory to import locations
You simply append the directory to PYTHONPATH before you import your custom module:
import sys
# appends to PYTHONPATH the location of the example codes
sys.path.append(r'C:\Python25\Examples')
Forum:
Geeks' Lounge
Dec 31st, 2008
Replies:
151
HUMOR
Views:
14,231
Posted By
Ene Uran
1
Re: HUMOR
Accidents happen (explains why I didn't get a Xmas present):
Forum:
Geeks' Lounge
Nov 29th, 2008
Replies:
151
HUMOR
Views:
14,231
Posted By
Ene Uran
1
Re: HUMOR
Resolving to surprise her husband, an executive's wife stopped by his office. When she opened the door, she found him with his secretary sitting in his lap.
Without hesitating, he dictated,...
Forum:
Python
Oct 21st, 2008
Replies:
8
[PYTHON] Help - Memory scanning
Views:
774
Posted By
Ene Uran
1
Re: [PYTHON] Help - Memory scanning
Here is a general example you can adopt, let us know if it works for your case:
# using module subprocess to pass arguments to and from an
# external program
import subprocess
# put in the...
Forum:
Python
Sep 26th, 2008
Replies:
10
Solved:
Replacing list items with other list
Views:
1,630
Posted By
Ene Uran
1
Re: Replacing list items with other list
Why do all the extra work, if Python can do it for you?
result3=[
83,97,109,117,101,108,32,83,109,105,116,104,13,10,13,10,84,
104,97,110,107,32,121,111,117,32,102,111,114,32,108,111,111,...
Showing results 1 to 40 of 80
1
2
>
Latest Posts
Today's Posts
All Forums
Unanswered Threads
All Forums
Related Forum Features
DaniWeb News Stories
DaniWeb Code Snippets
DaniWeb Tutorials
DaniWeb Product Reviews
DaniWeb White Papers
Forum Search
About Us
|
Contact Us
|
Advertise
|
DaniWeb
|
Acceptable Use Policy
|
©2003 - 2009 DaniWeb® LLC