w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Python tkinter screen width and height secondary display
How I did it: t = Tk() # new window t.update() t.attributes("-alpha", 00) t.state('zoomed') # maximize the window height= t.winfo_height() # ... width= t.winfo_width() But sadly I do not know of the location of the other screen. But I think you can do this create a new window use winfo_screenheight() and winfo_screenwidth() to find out about the original screen use geometry() to move the window around maximize the window (it should always maximize at the screen where it is) get geometry() if geometry is at (0, 0) it is the main screen, proceed with 3. you found another screen

Categories : Python

python, tkinter: Using grid layout, my frame refuses to display its contents
may be you are trying to do something like this. class App: def __init__(self,master): frame = Frame(master,height=20,width=25) frame.grid() #Multiple buttons, over n rows and columns, these are just here to demonstrate my syntax for i in range(n): frame.columnconfigure(i,pad=3) for i in range(n): frame.rowconfigure(i,pad=3) for i in range(0,n): for j in range(0,n): self.action = Button(frame,text="action",command=self.doAction) self.action.grid(row=i,column=j) def doAction(self): print('Action')

Categories : Python

display a variable without changing the code
Just add the echo to your include file. Something like: if(!empty($_SESSION['warning'])) echo $_SESSION['warning']; Presumably you'd also want to clear the value once it's displayed so it doesn't continue getting displayed on every page after that.

Categories : PHP

How do I display the code of a Python function?
You cannot do this in the regular console. iPython keeps a copy of the source in case you want to see it again later on, but the standard Python console does not. Had you imported the function from a file, you could have used inspect.getsource(): >>> import os.path >>> import inspect >>> print inspect.getsource(os.path.join) def join(a, *p): """Join two or more pathname components, inserting '/' as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.""" path = a for b in p: if b.startswith('/'): path = b elif path == '' or path.endswith('/'): path += b else: path += '/

Categories : Python

No X11 Display variable set error only when running through ant
The stack trace suggests that you're trying to get the default screen GraphicsDevice in headless mode. The documentation says that getDefaultScreenDevice throws HeadlessException - if isHeadless() returns true.

Categories : Java

python3.2 tkinter display an image from a URL
You can create a StringIO object instead: from StringIO import StringIO ... im = StringIO(img_file.read()) It behaves like a file, but it's not a file.

Categories : Python

table display in tkinter with scroll bars
You have a couple of problems. First, you can't use grid to place labels in the canvas and expect them to scroll. When you scroll a canvas, only the widgets added with create_window will scroll. However, you can use grid to put the labels in a frame, and then use create_window to add the frame to the canvas. There are several examples of that technique on this site. Second, you need to tell the canvas how much of the data in the canvas should be scrollable. You use this by setting the scrollregion attribute of the canvas. There is a method, bbox which can give you a bounding box of all of the data in the canvas. Usually it's used like this: canvas.configure(scrollregion=canvas.bbox("all"))

Categories : Python

Display checkbox next to each listed item(error in code)
First you need to create a layout like.. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginTop="5dp" android:text="@+id/label" android:textSize="20px" android:textStyle="bold" /> <CheckBox android:id="@+id/check" android:focusable="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="15px" android:layout_marginRigh

Categories : Android

OpenGL Display Error - Incorrect display
glOrtho sets your viewing area. Since your shape fits inside of 1 square unit, but you want to be able to see the whole thing, you can either have your near and far set to enclose the whole shape (which the 2, -2 do) or you can set your glOrtho to something like glOrtho(-1, 1, -1, 1, 0, -5); and translate your shape backwards so that it is then in the viewing field. Another (bad) option is to change the absolute position of your verts so that they fall within the near and far fields but I wouldn't recomend that since that is the point of the translates and transforms in general. Do you mean to have everything in an orthographic view or do you mean to have perspective? The orthographic view is why translating didn't help originally.

Categories : Java

Please help me out, i want to display the linked list, reverse it & display then again display it
The reason your program fails to reverse a list is because when the user chooses menu option 9, all they get is a print statement declaring the code isn't working yet. At a high level, reversing a linked list can be accomplished like this: for each element in the input list, from beginning to end: remove element from input list place element in the beginning of the output list return output list

Categories : C

Changing a variable using python and tkinter
Variables within functions are local to the function so the new value/variable "interface" is garbage collected when the function exits. I would suggest that you spend the time to learn basic classes as it will make keeping track of variables simpler. from Tkinter import * from functools import partial class WLAN(): def __init__(self): master = Tk() master.title('Wireless Warrior') self.interface = "initial value" ## instance object=available through out the class self.label_interface = StringVar() self.label_interface.set(self.interface) w = Label(master, textvariable=self.label_interface, fg="blue", font=("Helvetica", 16)) w.grid(row=0, column=0, columnspan=3) for but in range(1, 8): w = Button(master,

Categories : Python

Add an environment variable using Python
Short answer: Python cannot edit environment variables in a way that sticks. BUT, if all you want to do is run something in a temporarily modified environment, you can do that with the subprocess module: import os from subprocess import Popen myEnv = dict(os.environ) myEnv['newKey'] = 'newVal' shellCmd = Popen(['sh', 'someScript.sh'], env=myEnv) (shellOut, shellErr) = shellCmd.communicate()

Categories : Python

Executing Tkinter Code Successfully (Python 2.7)
It appears that you have some indentation issues. Python isn't free form, so you need to pay attention to indentation: from Tkinter import * class App(Frame): def __init__(self, master): Frame.__init__(self, master) self.grid() self.create_widgets() def create_widgets(self): self.entryLabel = Label(self, text="Please enter a list of numbers (no commas):") self.entryLabel.grid(row=0, column=0, columnspan=2) self.listEntry = Entry(self) self.listEntry.grid(row=0, column=2, sticky=E) self.entryLabel = Label(self, text="Please enter an index value:") self.entryLabel.grid(row=1, column=0, columnspan=2, sticky=E) self.indexEntry = Entry(self) self.indexEntry.grid(row=1, column=2) self.

Categories : Python

I have a nested function in a function but my code won't clear the display correctly. I am not getting an error in console?
I recommend just declaring the functions outside of the $(document).ready(function(){ .. }); The console doesn't recognize that the functions exist because you are basically trying to make local functions. function clearTheDisplayInitial() { $("#Resume, #CodingExamples, #AboutMe").hide(); } function clearTheDisplay() { $("#Resume, #CodingExamples, #AboutMe, #mainMenu").fadeOut(900); } $(document).ready(function() { $("#displayResume").click(function() { clearTheDisplayInitial(); // you could just add $("#Resume, #CodingExamples, #AboutMe").hide(); here $("#Resume").fadeIn(900); }); $("#CodingExamples1").click(function() { clearTheDisplay(); // you could just add $("#Resume, #CodingExamples, #AboutMe, #mainMenu").fadeOut(900); here $("#A

Categories : Javascript

Is it possible to set an environment variable from Python permanently?
I am not sure. You can return the variable and set it that way. To do this print it. (python program) ... print foo (bash) set -- $(python test.py) foo=$1

Categories : Python

How to control process environment variable in Python?
Looking through the source code for the subprocess module, it's because using a list of arguments with shell=True will do the equivalent of... /bin/sh -c 'echo' '$ATESTVARIABLE' ...when what you want is... /bin/sh -c 'echo $ATESTVARIABLE' The following works for me... import os, subprocess os.environ['ATESTVARIABLE'] = 'value' value = subprocess.check_output('echo $ATESTVARIABLE', shell=True) assert 'value' in value Update FWIW, the difference between the two is that the first form... /bin/sh -c 'echo' '$ATESTVARIABLE' ...will just call the shell's built-in echo with no parameters, and set $0 to the literal string '$ATESTVARIABLE', for example... $ /bin/sh -c 'echo $0' /bin/sh $ /bin/sh -c 'echo $0' '$ATESTVARIABLE' $ATESTVARIABLE ...whereas the second form... /bin/sh -

Categories : Python

Python and the PATH environment variable in Windows
No, execfile does not search the PATH. It just takes a normal filename (which can be relative or absolute) and opens it exactly the same as any other file-handling function. On top of that, you very rarely want to use execfile. In this particular case, what you should probably be doing is running the script from the cmd ("DOS box") prompt, not the Python prompt. If you really want to use the Python prompt as your "shell" in place of cmd, you can do that, but you still want to be able to find programs via the PATH, run them in a separate interpreter instance, etc. The way to do that is with subprocess. For example: >>> from subprocess import check_call # you only have to do this once >>> check_call(['train.py']) That's a lot more typing than you need to do from cmd, o

Categories : Python

Change Python environment variable PYTHONUSERBASE
Start -> Computer -> (Right Click) Properties -> Advanced System Settings -> Environment Variables You might need to restart your active PowerShell session for the new environment variables to kick in. To change it from within PowerShell try: $env:PYTHONUSERBASE = "c:mysite"

Categories : Python

How to retrieve the contents of entry and text widget and assign it to a variable in tkinter using python
In your specific case, you don't need to use StringVar. This should be what you want: import smtplib from Tkinter import * import tkMessageBox def Composemail(sender,password,receivers,message): try: server = smtplib.SMTP() server.connect('smtp.gmail.com',587) server.ehlo() server.starttls() server.login(sender, password) server.sendmail(sender, receivers, message) tkMessageBox.showinfo("Sending Mail information","Mail sent.") # Just a tip, "error" isn't defined yet so it will blow up. except smtplib.SMTPException, error: tkMessageBox.showinfo("Sending Mail information","Sending Mail failed.Try again later.") a=Tk() a.title("MailsNow-A new place for sending emails") a.geometry("1000x700") b=Label(a,fg="Purple"

Categories : Python

generate code using form button and then display generated code on page
You can use tag to show HTML entities You need to encode all Your HTML entities like < => < like way. Also you can show a text area in which all those HTML code need to echo, it will not execute your code simply it will print it.

Categories : PHP

Tkinter Python Image error
"ImportError: DLL load failed: %1 is not a valid Win32 application." is from Windows itself, and means that your PIL or Tkinter install doesn't work on your Windows version. One potential cause for this is that you're using a version built with VS 2012 on Windows XP; see: http://blogs.msdn.com/b/vcblog/archive/2012/06/15/10320645.aspx

Categories : Python

Python tkinter error messages
The error message mentions threads. In the stack trace it looks like you are altering the state of a variable. If that is true, and you're trying to alter the state of a widget from a thread other than the one that created the widget, that's the problem. You cannot call widget methods from any thread except the one that created the widget.

Categories : Python

converting code from Tkinter TEXT to Tkinter LABEL
The Tkinter Label widget has a text option to indicate the text that is being displayed. If you want to change all the content that the widget displays, then replace self.text = tk.Text(frameLabel, ...) # ... new = self.queue.get() self.text.delete(1.0, 'end') self.text.insert('end', new) With this: self.label = tk.Label(frameLabel, ...) # ... new = self.queue.get() self.label.config(text=new)

Categories : Python

Unicode Decode Error while trying to use Tkinter (Python)
The only time I don't seem to get this error code is when I try to open a .txt file. But I'm wanting to open .docx files also. A docx file isn't just a text file; it's an Office Open XML file: a zipfile containing an XML document and any other supporting files. Trying to read it as a text file isn't going to work. For example, the first 4 bytes of the file are going to be this: b'PKx03x04` You can't interpret that as UTF-8, ASCII, or anything else without getting a bunch of garbage. You're certainly not going to find your words in this. You can do some processing on your own—use zipfile to access the document.xml inside the archive, then use an XML parser to get the text nodes, and then rejoin them so you can split them on whitespace. For example: import itertools import zip

Categories : Python

Python Tkinter Crashing, every run but program continues? Final polishing of Tkinter
You need RotateNO to be a part of your class. Also zoom doesn't need to take a zoom argument because you've already initialized self.Flag_Zoom. Also change root.destroy() to Exe.destroy(). Try this: # ---------- Imports ------------------------------------- # from Tkinter import * import matplotlib import numpy as np # ---------- Settings ------------------------------------ # matplotlib.use('TkAgg') import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg # ---------- Classes ------------------------------------ # class App(Frame): def __init__(self,master=None): Frame.__init__(self, master) self._job = None self.canvas = None self.Flag_Zoom = False self.pack() self._GU

Categories : Python

i'm trying to display user defined number of checkboxes and display the value of the checked boxes in another textbox
See: http://jsfiddle.net/Xar2d/ I think you were going for something like this: $(document).ready(function () { $("#btn1").click(function () { $v = $("#txt").val(); for (i = 0; i < $v; i++) { var box = $('<input type="checkbox" class="chkbx" name="chkbx" value="Option' + i + '">Option ' + i + '<br/>'); $("#display").append(box); } }); $(document).on("change", ".chkbx", function () { $("#show").val(""); var selected = []; $(".chkbx:checked").each(function () { selected.push($(this).val()); }); $("#show").val(selected.join(", ")); }); });

Categories : Jquery

How to use live() to detect when an element attribute switchs from display block to display none?
Sounds like you want to "watch" the value of style.display on that div. That's not impossible, but unpractical and unstable. The easiest solution is to add a new change event handler on the dropdown itself. For that, you can use .live (for that jQuery version), .delegate, or .change (as long as you do it when the DOM is loaded). And make sure to register that event after the original event handler for the dropdown is added. To deal with the timeout, set a timer from your handler, and make sure it's longer than the maximum time from the other timer. For example: $(function(){ $('#dropdown').change(function() { setTimeout(function() { console.log('checking display property'); if($('#myitem').css('display') == 'none') { console.log('the

Categories : Jquery

Why when I try to display the text inside a textarea on html it display eveything in one line?
The text in the textarea isn't html. It is just text, containing regular line break " ". To display them, you either need to enclose the text in a pre tag, or replace the " " with <br>. I would do the latter, since pre doesn't break at all if there's no break in the text, so you'll have a single long line and a scrollbar.

Categories : Javascript

How to get a finished iPhone 5 app to display AS IF in "compatibility mode" on iPad with retina display?
iPad doesn't work like that. I believe the reason is that the 2x button would not scale properly for the 4 inch screen. Either way, you need to make sure your app works well for the 3.5 inch screen anyway, this may be a good time to rethink some of the design of your app to make sure it works well in a 3.5 inch screen.

Categories : Iphone

How to display multiple RSS feeds but only display the most recent post from each feed in simplepie
They have a parameter for that. $max_items_per_feed = 1; $feed->set_item_limit($max_items_per_feed); This sets how many items to pull from each feed. You can set it to 5, 27, or 1 in your case. You put this code above your $feed->init(); function call.

Categories : PHP

Mozilla does not recognize display:inline-block inside display:table-cell container
Stick vertical-align:top; into #selectedView like this: http://jsfiddle.net/TEy2p/1/ At the moment, Firefox is placing your text along the bottom of the table cell.

Categories : HTML

Embedding matplotlib in python tkinter (runtime error)
I somehow managed to solve the problem. I don't know the exact cause of the problem but after i uninstalled my pythonwin , it seems to work fine without giving me anymore error messages. Thanks A.Rodas for your link for pointing out about pythonwin.

Categories : Python

Google Map does not display in Android -not display map except boxes and zooming button
Go to your manifest file see your package name by use this package name you must create Google Maps API V2 key and use Ex: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.venky.loadgooglemapsdemo" android:versionCode="1" android:versionName="1.0" > My package name is "com.venky.loadgooglemapsdemo" If you want Tutorial and Demo please see this link

Categories : Android

Can style "display: block" overrule "display: none" of media print CSS?
@media rules themselves don't have any specificity and because you're adding CSS rules via inline styles, they will always override any external styles that aren't using an !important rule. So in this case, your only option is: @media print { .price_match_no_print { display:none !important; } }

Categories : HTML

how can i change display format in datawindow rather than display data in vertical
Maybe try the N-Up datawindow style otherwise you could flatten the data in SQL using one of the examples in this stackoverflow question on flattening data the method you would use might depend on if you know how many occurs there are. If you need the data to be update-able then you'll need to write some code to un-flatten on save.

Categories : Misc

Lua: how do I add display objects required from external functions to display groups?
function scene:createScene(event) local group=self.view local shieldDisplay = shieldDisplay.new() group:insert(shieldDisplay) end Try changing it to function scene:createScene(event) local group=self.view local shieldDisplay = shieldDisplay.new group:insert(shieldDisplay) end

Categories : Lua

trying to display:none or display:inline depending on the width of the screen with javasrcript
Do you use, jquery ? Did you linked to your jquery file? If not, you should write: document.getElementById('art1').style.display = 'none'; or maybe try document.getElementById("art1").style.display = 'none';

Categories : Javascript

Why is my attempt to display an image over the background causing a white display?
Subclassing UIImageView is not necessary. Just create a container UIView and add 2 UIImageView subviews. Edit - this should work for your implementation: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIImage *backgroundImage = [UIImage imageNamed:@"Default-568h"]; CGRect containerRect = CGRectZero; containerRect.size = [backgroundImage size]; UIView *containerView = [[UIView alloc] initWithFrame:containerRect]; [[self view] addSubview:containerView]; float scale=.1; UIImageView *backgroundView = [[UIImageView alloc] initWithImage:backgroundImage]; [containerView addSubview:backgroundView]; [backgroundView sizeToFit]; UIImage *noteImage = [UIImage imageNamed:@"note"]

Categories : Iphone

How can I use DrawText() to display a variable?
DrawText only knows how to display character strings. To display anything else, you need to convert to a character string first, then display that. void show_int(int x, /* ... */) { std::stringstream buffer; buffer << x; DrawText(hdcWindow, buffer.str().c_str(), -1, &rc, DT_SINGLELINE); }

Categories : C++

Display exact value of a variable in R
Globally solution during all the session options(digits=16) > x [1] 1.00042589212565 or locally just for x: sprintf("%.16f", x) [1] "1.0004258921256499"

Categories : R



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.