Converting Python Regex To VisualBasic?
Jun 7, 2011I'm converting a python application to VB.net
a = 'abcdef'
b = re.compile('[' + a + ']{3,}$', re.I)
Is it possible to convert it to Visual Basic, if so, can you provide any code?
I'm converting a python application to VB.net
a = 'abcdef'
b = re.compile('[' + a + ']{3,}$', re.I)
Is it possible to convert it to Visual Basic, if so, can you provide any code?
I have codes which is written with python. I am not good with python and i want to convert this python codes to VB 2010.This python function searching local network and finding my LG TV's local IP adress. I want to find my TV's local IP with VB 2010.
[Code]...
I hired a coder to code me something in Regex. The issue was that he coded it in Visual Basic and I need it in C#. I tried using a converter but it didnt fix the issue.
string iamtwit = ss("http://www.mailinator.com" + GetBetween(GetBetween(iamtwit1, matches.ToString(), "</a>"), "<a href=", ">"));MessageBox.Show(GetBetween(matches1.ToString(), "<a href="", Strings.Chr(34)));
Here is the original code:
Dim iamtwit As String = ss("http://www.mailinator.com" & GetBetween(GetBetween(iamtwit1, matches.ToString, "</a>"), "<a href=", ">"))
MsgBox(GetBetween(matches1.ToString, "<a href=""", Chr(34)))
The error messages I am getting are:
The name 'GetBetween' does not exist in the current context
The name 'Strings' does not exist in the current context
i have tried various ways to accomplish this, but to no avail. I don't know how to generate the replacement text (mailto link) so I just used a bunch of x's until I can figure it out. Here is what I have (which currently not replacing emails in string): Here is my Code behind:
[Code]...
I am having an issue where I am using regex.Replace to replace part of a string. The basic idea is that I want to capture the beginning of the string then replace the end of the string with a value from code. For an example pretend I have a string that says "Test Number " followed by number and I want to increment that number. I capture the "Test Number " but when I try to concatenate that capture with the new number it treats the capture ($1) as a literal and replaces the entire string with $1[new number].
[code]...
This will output "We are on Test Number 2", as expected. how I can use a variable in the replacement string portion of the Regex.Replace when including a captured group?
I want to take the text and some special characters between the xml tags.. My input file contains:
[Code]...
now i want the Regex to take text and the special characters between the tags <line>,<inline>..
I have a function in vb that is converted to a dll that I want to use in python. However trying to use it, I get an error message this is the VB function
Function DISPLAYNAME(Name)
MsgBox ("Hello " & Name & "!")
End Function
and this is how I call it in python
from ctypes import *
test = windll.TestDLL
print test
print test.DISPLAYNAME("one")
But I get errors so what is the right way of calling the dll
Traceback (most recent call last):
File "C:Test estdll.py", line 4, in <module>
print test.DISPLAYNAME("one")
[code].....
I have been looking around online but no solution so far. Can't use cdll since this is for c progs.
I am coding an application in VB.NET that sends sms.Would you please post PYTHON->VB.NET translation of this code and/or guidelines?
[Code]...
I want to use the python module imaplib, email in vb.net to read the gmail email with attachments. How can i use the python module in vb.net?
View 2 RepliesI have always wondered about this and seen this among lots of programmers. Why is a VB programmer or VB code easily dismissed as too noobish and easy while the same does not apply to Python or Python code? After all, isn't Python as easy as VB is? And it does provide drag-n-drop GUI application building also. So why is it that VB is flamed and yet Python is not?
View 1 RepliesI'm wondering if i can convert vb.net codes to python ?
I have this code"
[code]..............
i guess it's like:
[code].....................
so there any converter ? it would be so nice because i got source code for program in vb.net and as you know it's work on only Windows and i want to make it work in Linux so i need Vb to python converter ..
Is there a way to have multiline strings in VB.NET like python
[Code]...
To programming in Python, I was wondering if there is a way to access VB .net APIs using Python.
View 1 RepliesI have an interesting issue I've run into where I can easily tap into python code from VB in an excel instance, as described here: Calling python script from excel/vba.However, when I mimic the exact same code structure in visual studio in a form, the pyscript.language = "python" line fails. Does anyone know if MSScriptControl.ScriptControl can be used in VB .Net to control python like you can in excel? This would be a lot easier than setting up a com object for my python scripts.
Example code (need to add microsoft script control 1.0 and excel object library):
[code]...
I'm creating a program in VB.NET to output multiple images. Some images will have the same file name. If there is multiple files with the same name I want to add "_1_" to the end of the file name. If the "_1_" file already exists I want to increment the 1 to be "_2_". If this file already exists I want to continue incrementing the number ultil it doesn't exist. So for example "filename", filename_1_", "filename_2_", etc. Here is the code that I have tried
[Code]...
I've been working straight since yesterday trying to get this to work. I'm a noob to RegEx and I've tested out about 5 different RegEx "builders" but each of them require you to navigate through the options to build the Regex...each of them has failed when I try to use them.Is there an application out there free/paid where you select the line you want to grab and the RegEx is auto generated from that highlight rather than having to try to build the line of code? [code]
View 1 RepliesI want to create a (3n*7) Matrix in python through Iteration, I did this in VB.Net and it worked but it gives me some challenge in Python as this a new language to me. n can be the number of Iterations to build up the matrix, i.e. ; if u iterated 3 times, the matrix will be a 9*7 matrix. Here is how I did it in VB.Net. :
[Code].....
I'm writing a python plugin for a geo referencing program called QGIS where I want an Excel sheet to do all my calculations for me. For different data points I need to set certain input values into the spreadsheet (which was already written by someone else). I'm fine setting the int values (using win32com.client) with
sheet.Cells(row, col).Value = value
For radio buttons I would expect it to work like so:
sheet.opt_name.Value = True
But I get the error message:
AttributeError: '<win32com.gen_py.Microsoft Excel 12.0 Object Library._Worksheet instance at 0x232878608>' object has no attribute 'opt_name'
What are the options attributes of? How do I set their values?
I'm working on a school project which need to be done in Visual Basic. For this I'm porting one of my Python project in this programming language, project which (in Python) is scanning a directory for .py files and then imports them (dynamically) with the __import__ statement, at runtime. It is possible to do this in Visual Basic with .DLL classes?
View 1 RepliesI am trying to choose a language, IDE and other tools in order to develop a photo gallery application for a Linux platform. Specifically the Raspberry Pi My background is almost exclusively using Visual basic since the early 90's and most recently VB.NET in VS2008
View 1 RepliesI have gotten this code in python - been going in circles trying to figure out the vb.net equivalent. Will pay somebody for the conversion also.
[Code]...
I never thought I'd say this, but I am getting pissed at how easy it is to just plop down a variable in python without any declaration. I have an existing python script which interfaces with a server, and it builds its own messages to be communicated via sockets. What I am trying to do is take the command line python script and convert it into a VB GUI app that is more user friendly.
[Code]...
I am trying to run a python script inside a vb.net application, which means executing the code inside vb.net instead of runing it external. The problem is:
I am using MsScriptControl and set the language to "python", I tried to run it and get the error "A script engine for the specified language can not be created". My research has told me i need these keys in my registry. The problem is I cant find them so how to I make them. Or even better a full solution to my problem.
Is is possible to include a python library, which does API authentication, in a VB.NET app? If so how would I do this? The site that provided this does not provide much documentation on this; I am attempting to create an application that accesses the google API, and this library has been created to do the authentication for you.
View 1 Replies.net 4.0 can support dynamic now.So I think why not develop VB in to a dynamic language based on VB6 syntax.
View 4 RepliesI have some really nice Python code to do what I need to do.I don't particularly like any of the Python GUI choices though. wxPython is nice, but for what I need, the speed on resizing,refreshing and dynamically adding controls just isn't there. I would like to create the GUI in VB.NET.I imagine I could use IronPython to link the two,but that creates a dependency on a rather large third-party product. I was perusing the MSDN documentation on Windows IPC and got the idea to use sockets. I copied the Python echo server code from the Python documentation and in under 5 minutes was able to create a client in VB.NET without even reading the System.Net.Sockets documentation, so this certainly doesn't seem too hard.
View 2 RepliesI'm trying to consume a python web service in my webservice project.how to do that?
View 1 Replies[code]I suspect the reason the results are different is because vb.net returns a double when you call ^ and I should be "shifting" it but can't seem to work out the syntax (or find it)
View 1 RepliesI've given a VisualBasic Software, written in VB5. Now the whole thing should run under Windows 7, so it needs to be converted to VB8 or VB9. It seems that most of the API of VB changed a lot in these years, so for me it seems quite impossible to run just a few code upgrades and everything is fine...
The biggest Problem are Forms. There are a lot of Forms in this Software, which are declared inside .frm files and begin always like this:
[Code]...
It seems for me that this Stuff was generated with an UI-Layouter, so none self written code is in there.Is it possible to run this code in VB8/9 or even rewrite it that VB8/9 understands it? I'm currently very pesimistic and think that the whole software needs to rewritten...
I want to create an app for Windows that displays a graph. I want to plot points on that graph.
I can't find a Toolbox control for this.software developer